Skip to content

Commit

Permalink
Implement requested changes (owners)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Oct 21, 2024
1 parent 43b5368 commit b1e24b9
Show file tree
Hide file tree
Showing 20 changed files with 351 additions and 229 deletions.
31 changes: 10 additions & 21 deletions pages/reference-smart-account/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,16 @@
"href": "/advanced/smart-account-overview"
},
"overview": "Overview",
"-- Functions": {
"-- Safe Reference": {
"type": "separator",
"title": "Functions"
"title": "Safe Reference"
},
"owner-functions": "Owner Functions",
"module-functions": "Module Functions",
"transaction-functions": "Transaction Functions",
"fallback-functions": "Fallback Functions",
"guard-functions": "Guard Functions",
"signature-functions": "Signature Functions",
"setup-functions": "Setup Functions",
"utility-functions": "Utility Functions",
"-- Events": {
"type": "separator",
"title": "Events"
},
"owner-events": "Owner Events",
"module-events": "Module Events",
"transaction-events": "Transaction Events",
"fallback-events": "Fallback Events",
"guard-events": "Guard Events",
"signature-events": "Signature Events",
"setup-events": "Setup Events"
"setup": "Setup",
"owners": "Owners",
"modules": "Modules",
"transactions": "Transactions",
"fallback": "Fallback Handler",
"guards": "Guards",
"signatures": "Signatures",
"utilities": "Utilities"
}
9 changes: 0 additions & 9 deletions pages/reference-smart-account/owner-events/AddedOwner.mdx

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions pages/reference-smart-account/owner-events/RemovedOwner.mdx

This file was deleted.

5 changes: 0 additions & 5 deletions pages/reference-smart-account/owner-events/_meta.json

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions pages/reference-smart-account/owner-functions/changeThreshold.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions pages/reference-smart-account/owner-functions/getOwners.mdx

This file was deleted.

18 changes: 0 additions & 18 deletions pages/reference-smart-account/owner-functions/getThreshold.mdx

This file was deleted.

24 changes: 0 additions & 24 deletions pages/reference-smart-account/owner-functions/isOwner.mdx

This file was deleted.

32 changes: 0 additions & 32 deletions pages/reference-smart-account/owner-functions/removeOwner.mdx

This file was deleted.

31 changes: 0 additions & 31 deletions pages/reference-smart-account/owner-functions/swapOwner.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"addOwnerWithThreshold": "addOwnerWithThreshold",
"removeOwner": "removeOwner",
"swapOwner": "swapOwner",
"changeThreshold": "changeThreshold",
"isOwner": "isOwner",
"getThreshold": "getThreshold",
"getOwners": "getOwners",
"getThreshold": "getThreshold"
"isOwner": "isOwner",
"removeOwner": "removeOwner",
"swapOwner": "swapOwner"
}
75 changes: 75 additions & 0 deletions pages/reference-smart-account/owners/addOwnerWithThreshold.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import { Tabs, Callout } from "nextra/components"

# `addOwnerWithThreshold`

Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.

<Callout type="warning">
This can only be done via a Safe transaction.
</Callout>

## Usage

{/* <!-- vale off --> */}

<Tabs items={['example.sol']}>
<Tabs.Tab>
```solidity
interface ISafe {
function addOwnerWithThreshold(address owner, uint256 _threshold) external
}
contract Example {
function example() … {
(ISafe safe).addOwnerWithThreshold(
"0x...",
1
)
}
}
```
</Tabs.Tab>
</Tabs>

{/* <!-- vale on --> */}

## Parameters

### `owner`

- **Type:** `address`

New owner address.

```solidity focus=2
addOwnerWithThreshold(
"0x...",
1
)
```

### `_threshold`

- **Type:** `uint256`

New threshold.

```solidity focus=3
addOwnerWithThreshold(
"0x...",
1
)
```

## Events

### `AddedOwner`

```solidity
event AddedOwner(address owner)
```

Emitted when an owner is added to the Safe.

This event is also emitted in the [`swapOwner`](./swapOwner.mdx) function.
51 changes: 51 additions & 0 deletions pages/reference-smart-account/owners/changeThreshold.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { Tabs, Callout } from "nextra/components"

# `changeThreshold`

Changes the threshold of the Safe to `_threshold`.

<Callout type="warning">
This can only be done via a Safe transaction.
</Callout>

## Usage

{/* <!-- vale off --> */}

<Tabs items={['example.sol']}>
<Tabs.Tab>
```solidity
interface ISafe {
function changeThreshold(uint256 _threshold) external
}
```
</Tabs.Tab>
</Tabs>

{/* <!-- vale on --> */}

## Parameters

### `_threshold`
- **Type:** `uint256`

New threshold.

```solidity focus=2
changeThreshold(
1
)
```

## Events

### `ChangedThreshold`

```solidity
event ChangedThreshold(uint256 threshold)
```

Emitted when the threshold for confirmations is changed.

This event is also emitted in the [`addOwnerWithThreshold`](./addOwnerWithThreshold.mdx) and [`removeOwner`](./removeOwner.mdx) functions.
Loading

0 comments on commit b1e24b9

Please sign in to comment.