Skip to content

Commit

Permalink
Add missing parameters in Safe.setup()
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Dec 4, 2024
1 parent d028f98 commit 6f424b6
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 for 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 that should be used for the payment (0 is ETH).

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

### `payment`

- **Type:** `uint256`

Value that should be paid.

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

### `paymentReceiver`

- **Type:** `address`

Address that should receive the payment (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 6f424b6

Please sign in to comment.