Skip to content

Commit

Permalink
Disambiguate 0, 0x, 0x... and address(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
louis-md committed Nov 21, 2024
1 parent be570c9 commit 11336b1
Show file tree
Hide file tree
Showing 19 changed files with 169 additions and 168 deletions.
4 changes: 2 additions & 2 deletions pages/reference-smart-account/fallback/setFallbackHandler.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Set Fallback Handler to `handler` for the Safe.
contract Example {
function example() ... {
(ISafe safe).setFallbackHandler("0x...");
(ISafe safe).setFallbackHandler(0x...);
}
}
```
Expand All @@ -42,7 +42,7 @@ Contract to handle fallback calls.

```solidity focus=2
(ISafe safe).setFallbackHandler(
"0x..."
0x...
);
```

Expand Down
6 changes: 3 additions & 3 deletions pages/reference-smart-account/guards/setGuard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Set Transaction Guard `guard` that checks transactions before execution.
contract Example {
function example() ... {
(ISafe safe).setGuard("0x...");
(ISafe safe).setGuard(0x...);
}
}
```
Expand All @@ -36,11 +36,11 @@ Set Transaction Guard `guard` that checks transactions before execution.

- **Type:** `address`

The address of the guard to be used or the `0x` address to disable the guard.
The address of the guard to be used, or `address(0)` to disable the guard.

```solidity focus=2
(ISafe safe).setGuard(
"0x..."
0x...
);
```

Expand Down
6 changes: 3 additions & 3 deletions pages/reference-smart-account/guards/setModuleGuard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ execution.
contract Example {
function example() ... {
(ISafe safe).setModuleGuard("0x...");
(ISafe safe).setModuleGuard(0x...);
}
}
```
Expand All @@ -39,11 +39,11 @@ execution.

- **Type:** `address`

The address of the Module Guard to be used or the `0x` address to disable the Module Guard.
The address of the Module Guard to be used, or `address(0)` to disable the Module Guard.

```solidity focus=2
(ISafe safe).setModuleGuard(
"0x..."
0x...
);
```

Expand Down
10 changes: 5 additions & 5 deletions pages/reference-smart-account/modules/disableModule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Disables the module `module` for the Safe.
contract Example {
function example() ... {
(ISafe safe).disableModule("0x...", "0x...");
(ISafe safe).disableModule(0x..., 0x...);
}
}
```
Expand All @@ -40,8 +40,8 @@ Previous module in the modules linked list.

```solidity focus=2
(ISafe safe).disableModule(
"0x...",
"0x..."
0x...,
0x...
);
```

Expand All @@ -53,8 +53,8 @@ Module to be removed.

```solidity focus=3
(ISafe safe).disableModule(
"0x...",
"0x..."
0x...,
0x...
);
```

Expand Down
4 changes: 2 additions & 2 deletions pages/reference-smart-account/modules/enableModule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Enables a new Safe Module in a Safe account.
contract Example {
function example() ... {
(ISafe safe).enableModule("0x...");
(ISafe safe).enableModule(0x...);
}
}
```
Expand All @@ -40,7 +40,7 @@ Safe Module to be enabled.

```solidity focus=2
(ISafe safe).enableModule(
"0x..."
0x...
);
```

Expand Down
20 changes: 10 additions & 10 deletions pages/reference-smart-account/modules/execTransactionFromModule.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (native toke
contract Example {
function example() … {
(ISafe safe).execTransactionFromModule(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand Down Expand Up @@ -61,8 +61,8 @@ Destination address of module transaction.

```solidity focus=2
(ISafe safe).execTransactionFromModule(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -76,8 +76,8 @@ The native token value transferred in the Safe Module transaction.

```solidity focus=3
(ISafe safe).execTransactionFromModule(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -91,8 +91,8 @@ Data payload of the module transaction.

```solidity focus=4
(ISafe safe).execTransactionFromModule(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -106,8 +106,8 @@ Operation type of the module transaction.

```solidity focus=5
(ISafe safe).execTransactionFromModule(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ Executes a transaction from an enabled Safe Module and returns the result data.
contract Example {
function example() … {
(ISafe safe).execTransactionFromModuleReturnData(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
}
}
```

</Tabs.Tab>
</Tabs>

Expand Down Expand Up @@ -62,8 +63,8 @@ Destination address of the Safe Module transaction.

```solidity focus=2
(ISafe safe).execTransactionFromModuleReturnData(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -77,8 +78,8 @@ Value of the native token transferred in the module transaction.

```solidity focus=3
(ISafe safe).execTransactionFromModuleReturnData(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -92,8 +93,8 @@ Data payload of the module transaction.

```solidity focus=4
(ISafe safe).execTransactionFromModuleReturnData(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand All @@ -107,8 +108,8 @@ Operation type of the module transaction.

```solidity focus=5
(ISafe safe).execTransactionFromModuleReturnData(
"0x...",
"0x...",
0x...,
0,
"0x...",
Enum.Operation.Call
);
Expand Down
10 changes: 5 additions & 5 deletions pages/reference-smart-account/modules/getModulesPaginated.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Returns an array of modules. If all entries fit into a single page, the next poi
contract Example {
function example() … {
(ISafe safe).getModulesPaginated("0x...", "0x...");
(ISafe safe).getModulesPaginated(0x..., 1);
}
}
```
Expand Down Expand Up @@ -53,8 +53,8 @@ Start of the page. Has to be a module or start pointer (`0x1` address).

```solidity focus=2
(ISafe safe).getModulesPaginated(
"0x...",
"0x..."
0x...,
1
);
```

Expand All @@ -66,7 +66,7 @@ Maximum number of modules that should be returned. Has to be greater than zero.

```solidity focus=3
(ISafe safe).getModulesPaginated(
"0x...",
"0x..."
0x...,
1
);
```
4 changes: 2 additions & 2 deletions pages/reference-smart-account/modules/isModuleEnabled.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Returns if a module is enabled.
contract Example {
function example() … {
(ISafe safe).isModuleEnabled("0x...");
(ISafe safe).isModuleEnabled(0x...);
}
}
```
Expand All @@ -42,6 +42,6 @@ Address of the module.

```solidity focus=2
(ISafe safe).isModuleEnabled(
"0x..."
0x...
);
```
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Adds the owner `owner` to the Safe and updates the threshold to `_threshold`.
contract Example {
function example() ... {
(ISafe safe).addOwnerWithThreshold("0x...", 1);
(ISafe safe).addOwnerWithThreshold(0x..., 1);
}
}
```
Expand All @@ -41,7 +41,7 @@ New owner address.

```solidity focus=2
(ISafe safe).addOwnerWithThreshold(
"0x...",
0x...,
1
);
```
Expand All @@ -54,7 +54,7 @@ New threshold.

```solidity focus=3
(ISafe safe).addOwnerWithThreshold(
"0x...",
0x...,
1
);
```
Expand Down
4 changes: 2 additions & 2 deletions pages/reference-smart-account/owners/isOwner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Returns if `owner` is an owner of the Safe.
contract Example {
function example() … {
(bool isOwner) = (ISafe safe).isOwner("0x...");
(bool isOwner) = (ISafe safe).isOwner(0x...);
}
}
```
Expand All @@ -44,6 +44,6 @@ Owner address.

```solidity focus=2
(ISafe safe).isOwner(
"0x..."
0x...
);
```
16 changes: 8 additions & 8 deletions pages/reference-smart-account/owners/removeOwner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold
contract Example {
function example() … {
(ISafe safe).removeOwner(
"0x...",
"0x...",
0x...,
0x...,
1
);
}
Expand Down Expand Up @@ -58,8 +58,8 @@ Owner address that is pointing to the owner to be removed in the contract [linke

```solidity focus=2
(ISafe safe).removeOwner(
"0x...",
"0x...",
0x...,
0x...,
1
);
```
Expand All @@ -72,8 +72,8 @@ Owner address to be removed.

```solidity focus=3
(ISafe safe).removeOwner(
"0x...",
"0x...",
0x...,
0x...,
1
);
```
Expand All @@ -86,8 +86,8 @@ New threshold.

```solidity focus=4
(ISafe safe).removeOwner(
"0x...",
"0x...",
0x...,
0x...,
1
);
```
Expand Down
Loading

0 comments on commit 11336b1

Please sign in to comment.