Skip to content

Commit

Permalink
fix: Add missing parameters in Safe.setup() (#655)
Browse files Browse the repository at this point in the history
* Add missing parameters in Safe.setup()

* Update setup.mdx

Co-authored-by: Germán Martínez <[email protected]>

* Update setup.mdx

Co-authored-by: Germán Martínez <[email protected]>

* Update setup.mdx

Co-authored-by: Germán Martínez <[email protected]>

* Update setup.mdx

Co-authored-by: Germán Martínez <[email protected]>

---------

Co-authored-by: Germán Martínez <[email protected]>
  • Loading branch information
louis-md and germartinez authored Dec 5, 2024
1 parent 4bfacac commit 1897b02
Showing 1 changed file with 145 additions and 4 deletions.
149 changes: 145 additions & 4 deletions pages/reference-smart-account/setup/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,28 @@ Sets an initial storage of the Safe contract.
interface ISafe {
function setup(
address[] _owners,
uint256 _threshold
uint256 _threshold,
address to,
bytes data,
address fallbackHandler,
address paymentToken,
uint256 payment,
address payable paymentReceiver
) external;
}
contract Example {
function example() ... {
(ISafe safe).setup([0x..., 0x...], 1);
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
}
}
```
Expand All @@ -46,7 +61,13 @@ List of Safe owners.
```solidity focus=2
(ISafe safe).setup(
[0x..., 0x...],
1
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

Expand All @@ -59,7 +80,127 @@ Number of required confirmations for a Safe transaction.
```solidity focus=3
(ISafe safe).setup(
[0x..., 0x...],
1
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `to`

- **Type:** `address`

Contract address used as the destination of an optional delegate call.

```solidity focus=4
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `data`

- **Type:** `bytes`

Data payload for optional delegate call.

```solidity focus=5
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `fallbackHandler`

- **Type:** `address`

Handler for fallback calls to this contract.

```solidity focus=6
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `paymentToken`

- **Type:** `address`

Token contract address used for the payment of the Safe proxy contract deployment fees (`0` is the native token).

```solidity focus=7
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `payment`

- **Type:** `uint256`

Amount of `paymentToken` to be paid for the Safe proxy contract deployment fees.

```solidity focus=8
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

### `paymentReceiver`

- **Type:** `address`

Address that receives the payment for the Safe proxy contract deployment fees (or `0` if `tx.origin`).

```solidity focus=9
(ISafe safe).setup(
[0x..., 0x...],
1,
0x...,
"0x...",
0x...,
0x...,
0,
0x...
);
```

Expand Down

0 comments on commit 1897b02

Please sign in to comment.