From 3eb5d38b58f0480a12b60964c8b5f612a5afcb6a Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 17 Oct 2024 17:51:07 +0200 Subject: [PATCH 01/60] Owner and module functions --- .../config/vocabularies/default/accept.txt | 2 +- pages/_meta.json | 5 ++ pages/advanced/_meta.json | 4 ++ pages/reference-smart-account/_meta.json | 17 ++++++ .../module-functions/_meta.json | 8 +++ .../module-functions/disableModule.mdx | 27 ++++++++++ .../module-functions/enableModule.mdx | 21 ++++++++ .../execTransactionFromModule.mdx | 49 +++++++++++++++++ .../execTransactionFromModuleReturnData.mdx | 52 +++++++++++++++++++ .../module-functions/getModulesPaginated.mdx | 35 +++++++++++++ .../module-functions/isModuleEnabled.mdx | 25 +++++++++ pages/reference-smart-account/overview.mdx | 3 ++ .../owner-functions/_meta.json | 9 ++++ .../owner-functions/addOwnerThreshold.mdx | 27 ++++++++++ .../owner-functions/changeThreshold.mdx | 22 ++++++++ .../owner-functions/getOwners.mdx | 18 +++++++ .../owner-functions/getThreshold.mdx | 18 +++++++ .../owner-functions/isOwner.mdx | 24 +++++++++ .../owner-functions/removeOwner.mdx | 32 ++++++++++++ .../owner-functions/swapOwner.mdx | 31 +++++++++++ 20 files changed, 428 insertions(+), 1 deletion(-) create mode 100644 pages/reference-smart-account/_meta.json create mode 100644 pages/reference-smart-account/module-functions/_meta.json create mode 100644 pages/reference-smart-account/module-functions/disableModule.mdx create mode 100644 pages/reference-smart-account/module-functions/enableModule.mdx create mode 100644 pages/reference-smart-account/module-functions/execTransactionFromModule.mdx create mode 100644 pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx create mode 100644 pages/reference-smart-account/module-functions/getModulesPaginated.mdx create mode 100644 pages/reference-smart-account/module-functions/isModuleEnabled.mdx create mode 100644 pages/reference-smart-account/overview.mdx create mode 100644 pages/reference-smart-account/owner-functions/_meta.json create mode 100644 pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx create mode 100644 pages/reference-smart-account/owner-functions/changeThreshold.mdx create mode 100644 pages/reference-smart-account/owner-functions/getOwners.mdx create mode 100644 pages/reference-smart-account/owner-functions/getThreshold.mdx create mode 100644 pages/reference-smart-account/owner-functions/isOwner.mdx create mode 100644 pages/reference-smart-account/owner-functions/removeOwner.mdx create mode 100644 pages/reference-smart-account/owner-functions/swapOwner.mdx diff --git a/.github/styles/config/vocabularies/default/accept.txt b/.github/styles/config/vocabularies/default/accept.txt index ff5d87f25..94277db3d 100644 --- a/.github/styles/config/vocabularies/default/accept.txt +++ b/.github/styles/config/vocabularies/default/accept.txt @@ -13,6 +13,7 @@ [Bb]inance [Bb]lockchain [Bb]lockchains +[Bb]oolean [Bb]undler [Bb]undlers [Cc]hainlist @@ -251,7 +252,6 @@ Zora address_full_match auditable auth_code -boolean bytestrings checksummed createTransaction diff --git a/pages/_meta.json b/pages/_meta.json index 130ecd0fb..663c8e9c7 100644 --- a/pages/_meta.json +++ b/pages/_meta.json @@ -21,6 +21,11 @@ "type": "page", "display": "hidden" }, + "reference-smart-account": { + "title": "Smart Account Reference", + "type": "page", + "display": "hidden" + }, "advanced": { "title": "Advanced", "type": "page" diff --git a/pages/advanced/_meta.json b/pages/advanced/_meta.json index 9e539c2c3..897bfb75c 100644 --- a/pages/advanced/_meta.json +++ b/pages/advanced/_meta.json @@ -19,6 +19,10 @@ }, "smart-account-audits": "Audits", "smart-account-bug-bounty": "Bug Bounty", + "smart-account-reference": { + "title": "Reference", + "href": "/reference-smart-account/overview" + }, "-- Features": { "type": "separator", "title": "Features" diff --git a/pages/reference-smart-account/_meta.json b/pages/reference-smart-account/_meta.json new file mode 100644 index 000000000..957f0ecc5 --- /dev/null +++ b/pages/reference-smart-account/_meta.json @@ -0,0 +1,17 @@ +{ + "home": { + "title": "← Go Back", + "href": "/advanced/smart-account-overview" + }, + "overview": "Overview", + "-- Functions": { + "type": "separator", + "title": "Functions" + }, + "owner-functions": "Owner Functions", + "module-functions": "Module Functions", + "-- Events": { + "type": "separator", + "title": "Events" + } +} diff --git a/pages/reference-smart-account/module-functions/_meta.json b/pages/reference-smart-account/module-functions/_meta.json new file mode 100644 index 000000000..67d05d57b --- /dev/null +++ b/pages/reference-smart-account/module-functions/_meta.json @@ -0,0 +1,8 @@ +{ + "enableModule": "enableModule", + "disableModule": "disableModule", + "execTransactionFromModule": "execTransactionFromModule", + "execTransactionFromModuleReturnData": "execTransactionFromModuleReturnData", + "isModuleEnabled": "isModuleEnabled", + "getModulesPaginated": "getModulesPaginated" +} diff --git a/pages/reference-smart-account/module-functions/disableModule.mdx b/pages/reference-smart-account/module-functions/disableModule.mdx new file mode 100644 index 000000000..9d502ee99 --- /dev/null +++ b/pages/reference-smart-account/module-functions/disableModule.mdx @@ -0,0 +1,27 @@ +# `disableModule` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function disableModule(address prevModule, address module) external + +``` + +Disables the module `module` for the Safe. + +*This can only be done via a Safe transaction.* + +This function emits the [`DisabledModule`](../module-events/disabledModule.md) event. + +## Parameters + +### `prevModule` +- **Type:** `address` + +Previous module in the modules linked list. + +### `module` +- **Type:** `address` + +Module to be removed. diff --git a/pages/reference-smart-account/module-functions/enableModule.mdx b/pages/reference-smart-account/module-functions/enableModule.mdx new file mode 100644 index 000000000..dd53dd082 --- /dev/null +++ b/pages/reference-smart-account/module-functions/enableModule.mdx @@ -0,0 +1,21 @@ +# `enableModule` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function enableModule(address module) external + +``` + +Enables the module `module` for the Safe. + +*This can only be done via a Safe transaction.* + +This function emits the [`EnabledModule`](../module-events/enabledModule.md) event. + +## Parameters +### `module` +- **Type:** `address` + +Module to be whitelisted. diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx new file mode 100644 index 000000000..13a70556f --- /dev/null +++ b/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx @@ -0,0 +1,49 @@ +# `execTransactionFromModule` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function execTransactionFromModule( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation +) external returns (bool success) + +``` + +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token). + +*Function is virtual to allow overriding for L2 singleton to emit an event for indexing.* + +This function emits the [`ExecutionFromModuleSuccess`](../module-events/executionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/executionFromModuleFailure.md) events based on the transaction outcome. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address of module transaction. + +### `value` +- **Type:** `uint256` + +Ether value of module transaction. + +### `data` +- **Type:** `bytes` + +Data payload of module transaction. + +### `operation` +- **Type:** `enum Enum.Operation` + +Operation type of module transaction. + +## Returns + +### `success` +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx new file mode 100644 index 000000000..94b979437 --- /dev/null +++ b/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx @@ -0,0 +1,52 @@ +# `execTransactionFromModuleReturnData` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function execTransactionFromModuleReturnData( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation +) external returns (bool success, bytes returnData) + +``` + +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return data. + +This function emits the [`ExecutionFromModuleSuccess`](../module-events/executionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/executionFromModuleFailure.md) events based on the transaction outcome. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address of module transaction. + +### `value` +- **Type:** `uint256` + +Ether value of module transaction. + +### `data` +- **Type:** `bytes` + +Data payload of module transaction. + +### `operation` +- **Type:** `enum Enum.Operation` + +Operation type of module transaction. + +## Returns + +### `success` +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. + +### `returnData` +- **Type:** `bytes` + +Data returned by the call. diff --git a/pages/reference-smart-account/module-functions/getModulesPaginated.mdx b/pages/reference-smart-account/module-functions/getModulesPaginated.mdx new file mode 100644 index 000000000..7797f0dec --- /dev/null +++ b/pages/reference-smart-account/module-functions/getModulesPaginated.mdx @@ -0,0 +1,35 @@ +# `getModulesPaginated` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next) + +``` + +Returns an array of modules. If all entries fit into a single page, the next pointer will be 0x1. If another page is present, next will be the last element of the returned array. + +## Returns + +### `array` +- **Type:** `address[]` + +Array of modules. + +### `next` +- **Type:** `address` + +Start of the next page. + +## Parameters + +### `start` +- **Type:** `address` + +Start of the page. Has to be a module or start pointer (0x1 address). + +### `pageSize` +- **Type:** `uint256` + +Maximum number of modules that should be returned. Has to be > 0. diff --git a/pages/reference-smart-account/module-functions/isModuleEnabled.mdx b/pages/reference-smart-account/module-functions/isModuleEnabled.mdx new file mode 100644 index 000000000..7e6b073be --- /dev/null +++ b/pages/reference-smart-account/module-functions/isModuleEnabled.mdx @@ -0,0 +1,25 @@ +# `isModuleEnabled` +Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) + +## Overview + +```solidity +function isModuleEnabled(address module) external view returns (bool) + +``` + +Returns if an module is enabled. + +## Returns + +### `isModuleEnabled` +- **Type:** `bool` + +Boolean flag indicating if the module is enabled. + +## Parameters + +### `module` +- **Type:** `address` + +Address of the module. diff --git a/pages/reference-smart-account/overview.mdx b/pages/reference-smart-account/overview.mdx new file mode 100644 index 000000000..6f0fbb2e9 --- /dev/null +++ b/pages/reference-smart-account/overview.mdx @@ -0,0 +1,3 @@ +# Safe Smart Account Reference + +This reference lists all public functions and events of the [Safe Smart Account](../advanced/smart-account-overview.mdx) contracts, logically clustered. diff --git a/pages/reference-smart-account/owner-functions/_meta.json b/pages/reference-smart-account/owner-functions/_meta.json new file mode 100644 index 000000000..6d6bc294a --- /dev/null +++ b/pages/reference-smart-account/owner-functions/_meta.json @@ -0,0 +1,9 @@ +{ + "addOwnerThreshold": "addOwnerThreshold", + "removeOwner": "removeOwner", + "swapOwner": "swapOwner", + "changeThreshold": "changeThreshold", + "isOwner": "isOwner", + "getOwners": "getOwners", + "getThreshold": "getThreshold" +} diff --git a/pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx b/pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx new file mode 100644 index 000000000..acc917408 --- /dev/null +++ b/pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx @@ -0,0 +1,27 @@ +# `addOwnerWithThreshold` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function addOwnerWithThreshold(address owner, uint256 _threshold) external + +``` + +Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. + +*This can only be done via a Safe transaction.* + +This function emits the [`AddedOwner`](../owner-events/addedOwner.md) and [`ChangedThreshold`](../owner-events/changedThreshold.md) events. + +## Parameters + +### `owner` +- **Type:** `address` + +New owner address. + +### `_threshold` +- **Type:** `uint256` + +New threshold. diff --git a/pages/reference-smart-account/owner-functions/changeThreshold.mdx b/pages/reference-smart-account/owner-functions/changeThreshold.mdx new file mode 100644 index 000000000..0c0243e5a --- /dev/null +++ b/pages/reference-smart-account/owner-functions/changeThreshold.mdx @@ -0,0 +1,22 @@ +# `changeThreshold` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function changeThreshold(uint256 _threshold) external + +``` + +Changes the threshold of the Safe to `_threshold`. + +*This can only be done via a Safe transaction.* + +This function emits the [`ChangedThreshold`](../owner-events/changedThreshold.md) event. + +## Parameters + +### `_threshold` +- **Type:** `uint256` + +New threshold. diff --git a/pages/reference-smart-account/owner-functions/getOwners.mdx b/pages/reference-smart-account/owner-functions/getOwners.mdx new file mode 100644 index 000000000..87552c737 --- /dev/null +++ b/pages/reference-smart-account/owner-functions/getOwners.mdx @@ -0,0 +1,18 @@ +# `getOwners` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function getOwners() external view returns (address[]) + +``` + +Returns a list of Safe owners. + +## Returns + +### `owners` +- **Type:** `address[]` + +Array of Safe owners. diff --git a/pages/reference-smart-account/owner-functions/getThreshold.mdx b/pages/reference-smart-account/owner-functions/getThreshold.mdx new file mode 100644 index 000000000..5ff89e5a8 --- /dev/null +++ b/pages/reference-smart-account/owner-functions/getThreshold.mdx @@ -0,0 +1,18 @@ +# `getThreshold` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function getThreshold() external view returns (uint256) + +``` + +Returns the number of required confirmations for a Safe transaction aka the threshold. + +## Returns + +### `threshold` +- **Type:** `uint256` + +Threshold number. diff --git a/pages/reference-smart-account/owner-functions/isOwner.mdx b/pages/reference-smart-account/owner-functions/isOwner.mdx new file mode 100644 index 000000000..731c7ef9a --- /dev/null +++ b/pages/reference-smart-account/owner-functions/isOwner.mdx @@ -0,0 +1,24 @@ +# `isOwner` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function isOwner(address owner) external view returns (bool) + +``` + +Returns if `owner` is an owner of the Safe. + +## Returns + +### `isOwner` +- **Type:** `bool` + +Boolean flag indicating if `owner` is an owner of the Safe. + +## Parameters +### `owner` +- **Type:** `address` + +Owner address. \ No newline at end of file diff --git a/pages/reference-smart-account/owner-functions/removeOwner.mdx b/pages/reference-smart-account/owner-functions/removeOwner.mdx new file mode 100644 index 000000000..dbe281050 --- /dev/null +++ b/pages/reference-smart-account/owner-functions/removeOwner.mdx @@ -0,0 +1,32 @@ +# `removeOwner` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function removeOwner(address prevOwner, address owner, uint256 _threshold) external + +``` + +Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. + +*This can only be done via a Safe transaction.* + +This function emits the [`RemovedOwner`](../owner-events/removedOwner.md) and [`ChangedThreshold`](../owner-events/changedThreshold.md) events. + +## Parameters +### `prevOwner` +- **Type:** `address` + +Owner that pointed to the owner to be removed in the linked list + +### `owner` +- **Type:** `address` + +Owner address to be removed. + +### `_threshold` +- **Type:** `uint256` + +New threshold. + diff --git a/pages/reference-smart-account/owner-functions/swapOwner.mdx b/pages/reference-smart-account/owner-functions/swapOwner.mdx new file mode 100644 index 000000000..bb1e506c3 --- /dev/null +++ b/pages/reference-smart-account/owner-functions/swapOwner.mdx @@ -0,0 +1,31 @@ +# `swapOwner` +Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) + +## Overview + +```solidity +function swapOwner(address prevOwner, address oldOwner, address newOwner) external + +``` + +Replaces the owner `oldOwner` in the Safe with `newOwner`. + +*This can only be done via a Safe transaction.* + +This function emits the [`RemovedOwner`](../owner-events/removedOwner.md) and [`AddedOwner`](../owner-events/addedOwner.md) events. + +## Parameters +### `prevOwner` +- **Type:** `address` + +Owner that pointed to the owner to be replaced in the linked list + +### `oldOwner` +- **Type:** `address` + +Owner address to be replaced. + +### `newOwner` +- **Type:** `address` + +New owner address. From 17c24813ad96c71e2ac82ed5bee7cab54fdfb8bb Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 18 Oct 2024 16:27:51 +0200 Subject: [PATCH 02/60] Remaining events and functions --- pages/reference-smart-account/_meta.json | 15 +++- .../ChangedFallbackHandler.mdx | 9 ++ .../fallback-events/SafeReceived.mdx | 9 ++ .../fallback-events/_meta.json | 4 + .../fallback-functions/_meta.json | 5 ++ .../fallback-functions/fallback.mdx | 11 +++ .../fallback-functions/receive.mdx | 13 +++ .../fallback-functions/setFallbackHandler.mdx | 22 +++++ .../guard-events/ChangedGuard.mdx | 9 ++ .../guard-events/_meta.json | 3 + .../guard-functions/_meta.json | 3 + .../guard-functions/setGuard.mdx | 22 +++++ .../module-events/ChangedModuleGuard.mdx | 9 ++ .../module-events/DisabledModule.mdx | 9 ++ .../module-events/EnabledModule.mdx | 9 ++ .../ExecutionFromModuleFailed.mdx | 9 ++ .../ExecutionFromModuleSuccess.mdx | 9 ++ .../module-events/_meta.json | 7 ++ .../module-functions/disableModule.mdx | 4 +- .../module-functions/enableModule.mdx | 4 +- .../execTransactionFromModule.mdx | 18 ++-- .../execTransactionFromModuleReturnData.mdx | 30 +++---- .../module-functions/getModulesPaginated.mdx | 2 +- .../module-functions/isModuleEnabled.mdx | 2 +- .../owner-events/AddedOwner.mdx | 9 ++ .../owner-events/ChangedThreshold.mdx | 9 ++ .../owner-events/RemovedOwner.mdx | 9 ++ .../owner-events/_meta.json | 5 ++ .../owner-functions/_meta.json | 2 +- ...hreshold.mdx => addOwnerWithThreshold.mdx} | 4 +- .../owner-functions/changeThreshold.mdx | 4 +- .../owner-functions/getOwners.mdx | 2 +- .../owner-functions/getThreshold.mdx | 2 +- .../owner-functions/isOwner.mdx | 2 +- .../owner-functions/removeOwner.mdx | 4 +- .../owner-functions/swapOwner.mdx | 4 +- .../setup-events/SafeSetup.mdx | 9 ++ .../setup-events/_meta.json | 3 + .../setup-functions/_meta.json | 4 + .../setup-functions/domainSeparator.mdx | 17 ++++ .../setup-functions/setup.mdx | 66 +++++++++++++++ .../signature-events/ApproveHash.mdx | 9 ++ .../signature-events/SignMsg.mdx | 9 ++ .../signature-events/_meta.json | 4 + .../signature-functions/_meta.json | 6 ++ .../signature-functions/approveHash.mdx | 22 +++++ .../signature-functions/checkNSignatures.mdx | 40 +++++++++ .../signature-functions/checkSignatures.mdx | 23 ++++++ .../signature-functions/signedMessages.mdx | 24 ++++++ .../transaction-events/ExecutionFailure.mdx | 9 ++ .../transaction-events/ExecutionSuccess.mdx | 9 ++ .../transaction-events/_meta.json | 4 + .../transaction-functions/_meta.json | 6 ++ .../encodeTransactionData.mdx | 78 ++++++++++++++++++ .../transaction-functions/execTransaction.mdx | 82 +++++++++++++++++++ .../getTransactionHash.mdx | 78 ++++++++++++++++++ .../simulateAndRevert.mdx | 23 ++++++ .../utility-functions/_meta.json | 3 + .../utility-functions/getStorageAt.mdx | 28 +++++++ 59 files changed, 806 insertions(+), 43 deletions(-) create mode 100644 pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx create mode 100644 pages/reference-smart-account/fallback-events/SafeReceived.mdx create mode 100644 pages/reference-smart-account/fallback-events/_meta.json create mode 100644 pages/reference-smart-account/fallback-functions/_meta.json create mode 100644 pages/reference-smart-account/fallback-functions/fallback.mdx create mode 100644 pages/reference-smart-account/fallback-functions/receive.mdx create mode 100644 pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx create mode 100644 pages/reference-smart-account/guard-events/ChangedGuard.mdx create mode 100644 pages/reference-smart-account/guard-events/_meta.json create mode 100644 pages/reference-smart-account/guard-functions/_meta.json create mode 100644 pages/reference-smart-account/guard-functions/setGuard.mdx create mode 100644 pages/reference-smart-account/module-events/ChangedModuleGuard.mdx create mode 100644 pages/reference-smart-account/module-events/DisabledModule.mdx create mode 100644 pages/reference-smart-account/module-events/EnabledModule.mdx create mode 100644 pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx create mode 100644 pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx create mode 100644 pages/reference-smart-account/module-events/_meta.json create mode 100644 pages/reference-smart-account/owner-events/AddedOwner.mdx create mode 100644 pages/reference-smart-account/owner-events/ChangedThreshold.mdx create mode 100644 pages/reference-smart-account/owner-events/RemovedOwner.mdx create mode 100644 pages/reference-smart-account/owner-events/_meta.json rename pages/reference-smart-account/owner-functions/{addOwnerThreshold.mdx => addOwnerWithThreshold.mdx} (60%) create mode 100644 pages/reference-smart-account/setup-events/SafeSetup.mdx create mode 100644 pages/reference-smart-account/setup-events/_meta.json create mode 100644 pages/reference-smart-account/setup-functions/_meta.json create mode 100644 pages/reference-smart-account/setup-functions/domainSeparator.mdx create mode 100644 pages/reference-smart-account/setup-functions/setup.mdx create mode 100644 pages/reference-smart-account/signature-events/ApproveHash.mdx create mode 100644 pages/reference-smart-account/signature-events/SignMsg.mdx create mode 100644 pages/reference-smart-account/signature-events/_meta.json create mode 100644 pages/reference-smart-account/signature-functions/_meta.json create mode 100644 pages/reference-smart-account/signature-functions/approveHash.mdx create mode 100644 pages/reference-smart-account/signature-functions/checkNSignatures.mdx create mode 100644 pages/reference-smart-account/signature-functions/checkSignatures.mdx create mode 100644 pages/reference-smart-account/signature-functions/signedMessages.mdx create mode 100644 pages/reference-smart-account/transaction-events/ExecutionFailure.mdx create mode 100644 pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx create mode 100644 pages/reference-smart-account/transaction-events/_meta.json create mode 100644 pages/reference-smart-account/transaction-functions/_meta.json create mode 100644 pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx create mode 100644 pages/reference-smart-account/transaction-functions/execTransaction.mdx create mode 100644 pages/reference-smart-account/transaction-functions/getTransactionHash.mdx create mode 100644 pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx create mode 100644 pages/reference-smart-account/utility-functions/_meta.json create mode 100644 pages/reference-smart-account/utility-functions/getStorageAt.mdx diff --git a/pages/reference-smart-account/_meta.json b/pages/reference-smart-account/_meta.json index 957f0ecc5..90337c402 100644 --- a/pages/reference-smart-account/_meta.json +++ b/pages/reference-smart-account/_meta.json @@ -10,8 +10,21 @@ }, "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" } diff --git a/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx b/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx new file mode 100644 index 000000000..b924fa3f3 --- /dev/null +++ b/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx @@ -0,0 +1,9 @@ +# `ChangedFallbackHandler` +Defined in [`IFallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IFallbackManager.sol#L9). + +```solidity +event ChangedFallbackHandler(address handler) + +``` + +*Emitted when the fallback handler is changed. This event is emitted in the [`setFallbackHandler`](/reference-smart-account/fallback-functions/setFallbackHandler.mdx) function.* diff --git a/pages/reference-smart-account/fallback-events/SafeReceived.mdx b/pages/reference-smart-account/fallback-events/SafeReceived.mdx new file mode 100644 index 000000000..01006ba48 --- /dev/null +++ b/pages/reference-smart-account/fallback-events/SafeReceived.mdx @@ -0,0 +1,9 @@ +# `SafeReceived` +Defined in [`NativeCurrencyPaymentFallback.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/NativeCurrencyPaymentFallback.sol#L9). + +```solidity +event SafeReceived(address sender, uint256 value) + +``` + +*Emitted when the Safe contract receives a payment. This event is emitted in the [`receive`](../fallback-functions/receive.mdx) function.* diff --git a/pages/reference-smart-account/fallback-events/_meta.json b/pages/reference-smart-account/fallback-events/_meta.json new file mode 100644 index 000000000..cf8d0078e --- /dev/null +++ b/pages/reference-smart-account/fallback-events/_meta.json @@ -0,0 +1,4 @@ +{ + "ChangedFallbackHandler": "ChangedFallbackHandler", + "SafeReceived": "SafeReceived" +} diff --git a/pages/reference-smart-account/fallback-functions/_meta.json b/pages/reference-smart-account/fallback-functions/_meta.json new file mode 100644 index 000000000..d596ec329 --- /dev/null +++ b/pages/reference-smart-account/fallback-functions/_meta.json @@ -0,0 +1,5 @@ +{ + "setFallbackHandler": "setFallbackHandler", + "fallback": "fallback", + "receive": "receive" +} diff --git a/pages/reference-smart-account/fallback-functions/fallback.mdx b/pages/reference-smart-account/fallback-functions/fallback.mdx new file mode 100644 index 000000000..3acb6ad7f --- /dev/null +++ b/pages/reference-smart-account/fallback-functions/fallback.mdx @@ -0,0 +1,11 @@ +# `fallback` +Defined in [`FallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/FallbackManager.sol#L57) + +## Overview + +```solidity +fallback() external + +``` + +This function emits the [`SafeReceived`](../fallback-events/SafeReceived.mdx) event when it receives a payment. diff --git a/pages/reference-smart-account/fallback-functions/receive.mdx b/pages/reference-smart-account/fallback-functions/receive.mdx new file mode 100644 index 000000000..7ca953b6a --- /dev/null +++ b/pages/reference-smart-account/fallback-functions/receive.mdx @@ -0,0 +1,13 @@ +# `receive` +Defined in [`NativeCurrencyPaymentFallback.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/NativeCurrencyPaymentFallback.sol#L15) + +## Overview + +```solidity +receive() external payable + +``` + +Receive function accepts native currency transactions. + +This function emits the [`SafeReceived`](../fallback-events/SafeReceived.mdx) event. diff --git a/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx b/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx new file mode 100644 index 000000000..23a5749f4 --- /dev/null +++ b/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx @@ -0,0 +1,22 @@ +# `setFallbackHandler` +Defined in [`FallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/FallbackManager.sol#L46) + +## Overview + +```solidity +function setFallbackHandler(address handler) external + +``` + +Set Fallback Handler to `handler` for the Safe. + +*Only fallback calls without value and with data will be forwarded. This can only be done via a Safe transaction. Cannot be set to the Safe itself.* + +This function emits the [`ChangedFallbackHandler`](../fallback-events/ChangedFallbackHandler.mdx) event. + +## Parameters + +### `handler` +- **Type:** `address` + +Contract to handle fallback calls. diff --git a/pages/reference-smart-account/guard-events/ChangedGuard.mdx b/pages/reference-smart-account/guard-events/ChangedGuard.mdx new file mode 100644 index 000000000..f0ca450db --- /dev/null +++ b/pages/reference-smart-account/guard-events/ChangedGuard.mdx @@ -0,0 +1,9 @@ +# `ChangedGuard` +Defined in [`IGuardManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IGuardManager.sol#L10). + +```solidity +event ChangedGuard(address guard) + +``` + +*Emitted when a guard is set for the Safe. This event is emitted in the [`setGuard`](/reference-smart-account/guard-functions/setGuard.mdx) function.* diff --git a/pages/reference-smart-account/guard-events/_meta.json b/pages/reference-smart-account/guard-events/_meta.json new file mode 100644 index 000000000..7f67fb4ec --- /dev/null +++ b/pages/reference-smart-account/guard-events/_meta.json @@ -0,0 +1,3 @@ +{ + "ChangedGuard": "ChangedGuard" +} \ No newline at end of file diff --git a/pages/reference-smart-account/guard-functions/_meta.json b/pages/reference-smart-account/guard-functions/_meta.json new file mode 100644 index 000000000..406c0bb96 --- /dev/null +++ b/pages/reference-smart-account/guard-functions/_meta.json @@ -0,0 +1,3 @@ +{ + "setGuard": "setGuard" +} \ No newline at end of file diff --git a/pages/reference-smart-account/guard-functions/setGuard.mdx b/pages/reference-smart-account/guard-functions/setGuard.mdx new file mode 100644 index 000000000..d937321ef --- /dev/null +++ b/pages/reference-smart-account/guard-functions/setGuard.mdx @@ -0,0 +1,22 @@ +# `setGuard` +Defined in [`GuardManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/GuardManager.sol#L71) + +## Overview + +```solidity +function setGuard(address guard) external + +``` + +Set Transaction Guard `guard` for the Safe. Make sure you trust the guard. + +*Set a guard that checks transactions before execution. This can only be done via a Safe transaction. ⚠️ IMPORTANT: Since a guard has full power to block Safe transaction execution, a broken guard can cause a denial of service for the Safe. Make sure to carefully audit the guard code and design recovery mechanisms.* + +This function emits the [`ChangedGuard`](../guard-events/ChangedGuard.mdx) event. + +## Parameters + +### `guard` +- **Type:** `address` + +The address of the guard to be used or the 0 address to disable the guard. diff --git a/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx b/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx new file mode 100644 index 000000000..05d6f6c94 --- /dev/null +++ b/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx @@ -0,0 +1,9 @@ +# `ChangedModuleGuard` +Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L18). + +```solidity +event ChangedModuleGuard(address moduleGuard) + +``` + +*Emitted when a module guard is set for the Safe. This event is emitted in the [`setModuleGuard`](/reference-smart-account/module-functions/setModuleGuard.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/module-events/DisabledModule.mdx b/pages/reference-smart-account/module-events/DisabledModule.mdx new file mode 100644 index 000000000..1da57efa6 --- /dev/null +++ b/pages/reference-smart-account/module-events/DisabledModule.mdx @@ -0,0 +1,9 @@ +# `DisabledModule` +Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L15). + +```solidity +event DisabledModule(address module) + +``` + +*Emitted when a module is disabled for the Safe. This event is emitted in the [`disableModule`](/reference-smart-account/module-functions/disableModule.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/module-events/EnabledModule.mdx b/pages/reference-smart-account/module-events/EnabledModule.mdx new file mode 100644 index 000000000..95347cda2 --- /dev/null +++ b/pages/reference-smart-account/module-events/EnabledModule.mdx @@ -0,0 +1,9 @@ +# `EnabledModule` +Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L14). + +```solidity +event EnabledModule(address module) + +``` + +*Emitted when a module is enabled for the Safe. This event is emitted in the [`enableModule`](/reference-smart-account/module-functions/enableModule.mdx) function.* diff --git a/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx b/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx new file mode 100644 index 000000000..b1a862999 --- /dev/null +++ b/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx @@ -0,0 +1,9 @@ +# `ExecutionFromModuleFailure` +Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L17). + +```solidity +event ExecutionFromModuleFailure(address module) + +``` + +*Emitted when a transaction executed by a module fails. This event is emitted in the [`execTransactionFromModule`](/reference-smart-account/module-functions/execTransactionFromModule.mdx) and [`execTransactionFromModuleReturnData`](/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx) functions.* diff --git a/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx b/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx new file mode 100644 index 000000000..7395cce37 --- /dev/null +++ b/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx @@ -0,0 +1,9 @@ +# `ExecutionFromModuleSuccess` +Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L16). + +```solidity +event ExecutionFromModuleSuccess(address module) + +``` + +*Emitted when a transaction executed by a module succeeds. This event is emitted in the [`execTransactionFromModule`](/reference-smart-account/module-functions/execTransactionFromModule.mdx) and [`execTransactionFromModuleReturnData`](/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx) functions.* diff --git a/pages/reference-smart-account/module-events/_meta.json b/pages/reference-smart-account/module-events/_meta.json new file mode 100644 index 000000000..50fda12ec --- /dev/null +++ b/pages/reference-smart-account/module-events/_meta.json @@ -0,0 +1,7 @@ +{ + "EnabledModule": "EnabledModule", + "DisabledModule": "DisabledModule", + "ExecutionFromModuleSuccess": "ExecutionFromModuleSuccess", + "ExecutionFromModuleFailed": "ExecutionFromModuleFailed", + "ChangedModuleGuard": "ChangedModuleGuard" +} diff --git a/pages/reference-smart-account/module-functions/disableModule.mdx b/pages/reference-smart-account/module-functions/disableModule.mdx index 9d502ee99..1581cd797 100644 --- a/pages/reference-smart-account/module-functions/disableModule.mdx +++ b/pages/reference-smart-account/module-functions/disableModule.mdx @@ -1,5 +1,5 @@ # `disableModule` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L142) ## Overview @@ -12,7 +12,7 @@ Disables the module `module` for the Safe. *This can only be done via a Safe transaction.* -This function emits the [`DisabledModule`](../module-events/disabledModule.md) event. +This function emits the [`DisabledModule`](../module-events/DisabledModule.md) event. ## Parameters diff --git a/pages/reference-smart-account/module-functions/enableModule.mdx b/pages/reference-smart-account/module-functions/enableModule.mdx index dd53dd082..588d5543f 100644 --- a/pages/reference-smart-account/module-functions/enableModule.mdx +++ b/pages/reference-smart-account/module-functions/enableModule.mdx @@ -1,5 +1,5 @@ # `enableModule` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L129) ## Overview @@ -12,7 +12,7 @@ Enables the module `module` for the Safe. *This can only be done via a Safe transaction.* -This function emits the [`EnabledModule`](../module-events/enabledModule.md) event. +This function emits the [`EnabledModule`](../module-events/EnabledModule.md) event. ## Parameters ### `module` diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx index 13a70556f..2c7f710f8 100644 --- a/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx @@ -1,5 +1,5 @@ # `execTransactionFromModule` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L154) ## Overview @@ -17,7 +17,14 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Toke *Function is virtual to allow overriding for L2 singleton to emit an event for indexing.* -This function emits the [`ExecutionFromModuleSuccess`](../module-events/executionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/executionFromModuleFailure.md) events based on the transaction outcome. +This function emits the [`ExecutionFromModuleSuccess`](../module-events/ExecutionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/ExecutionFromModuleFailure.md) events based on the transaction outcome. + +## Returns + +### `success` +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. ## Parameters @@ -40,10 +47,3 @@ Data payload of module transaction. - **Type:** `enum Enum.Operation` Operation type of module transaction. - -## Returns - -### `success` -- **Type:** `bool` - -Boolean flag indicating if the call succeeded. diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx index 94b979437..50ff8492c 100644 --- a/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx @@ -1,5 +1,5 @@ # `execTransactionFromModuleReturnData` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L168) ## Overview @@ -13,9 +13,21 @@ function execTransactionFromModuleReturnData( ``` -Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return data. +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return `data`. -This function emits the [`ExecutionFromModuleSuccess`](../module-events/executionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/executionFromModuleFailure.md) events based on the transaction outcome. +This function emits the [`ExecutionFromModuleSuccess`](../module-events/ExecutionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/ExecutionFromModuleFailure.md) events based on the transaction outcome. + +## Returns + +### `success` +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. + +### `returnData` +- **Type:** `bytes` + +Data returned by the call. ## Parameters @@ -38,15 +50,3 @@ Data payload of module transaction. - **Type:** `enum Enum.Operation` Operation type of module transaction. - -## Returns - -### `success` -- **Type:** `bool` - -Boolean flag indicating if the call succeeded. - -### `returnData` -- **Type:** `bytes` - -Data returned by the call. diff --git a/pages/reference-smart-account/module-functions/getModulesPaginated.mdx b/pages/reference-smart-account/module-functions/getModulesPaginated.mdx index 7797f0dec..4d27f7ab5 100644 --- a/pages/reference-smart-account/module-functions/getModulesPaginated.mdx +++ b/pages/reference-smart-account/module-functions/getModulesPaginated.mdx @@ -1,5 +1,5 @@ # `getModulesPaginated` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L203) ## Overview diff --git a/pages/reference-smart-account/module-functions/isModuleEnabled.mdx b/pages/reference-smart-account/module-functions/isModuleEnabled.mdx index 7e6b073be..1480c0fbc 100644 --- a/pages/reference-smart-account/module-functions/isModuleEnabled.mdx +++ b/pages/reference-smart-account/module-functions/isModuleEnabled.mdx @@ -1,5 +1,5 @@ # `isModuleEnabled` -Defined in [ModuleManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol) +Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L196) ## Overview diff --git a/pages/reference-smart-account/owner-events/AddedOwner.mdx b/pages/reference-smart-account/owner-events/AddedOwner.mdx new file mode 100644 index 000000000..3adec7876 --- /dev/null +++ b/pages/reference-smart-account/owner-events/AddedOwner.mdx @@ -0,0 +1,9 @@ +# `AddedOwner` +Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L9). + +```solidity +event AddedOwner(address owner) + +``` + +*Emitted when an owner is added to the Safe. This event is emitted in the [`addOwnerWithThreshold`](/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx) and [`swapOwner`](/reference-smart-account/owner-functions/swapOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/ChangedThreshold.mdx b/pages/reference-smart-account/owner-events/ChangedThreshold.mdx new file mode 100644 index 000000000..8c480d243 --- /dev/null +++ b/pages/reference-smart-account/owner-events/ChangedThreshold.mdx @@ -0,0 +1,9 @@ +# `ChangedThreshold` +Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L11). + +```solidity +event ChangedThreshold(uint256 threshold) + +``` + +*Emitted when the threshold for confirmations is changed. This event is emitted in the [`changeThreshold`](/reference-smart-account/owner-functions/changeThreshold.mdx), [`addOwnerWithThreshold`](/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx) and [`removeOwner`](/reference-smart-account/owner-functions/removeOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/RemovedOwner.mdx b/pages/reference-smart-account/owner-events/RemovedOwner.mdx new file mode 100644 index 000000000..6cbb77b3f --- /dev/null +++ b/pages/reference-smart-account/owner-events/RemovedOwner.mdx @@ -0,0 +1,9 @@ +# `RemovedOwner` +Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L10). + +```solidity +event RemovedOwner(address owner) + +``` + +*Emitted when an owner is removed from the Safe. This event is emitted in the [`removeOwner`](/reference-smart-account/owner-functions/removeOwner.mdx) and [`swapOwner`](/reference-smart-account/owner-functions/swapOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/_meta.json b/pages/reference-smart-account/owner-events/_meta.json new file mode 100644 index 000000000..f826a51fe --- /dev/null +++ b/pages/reference-smart-account/owner-events/_meta.json @@ -0,0 +1,5 @@ +{ + "AddedOwner": "AddedOwner", + "RemovedOwner": "RemovedOwner", + "ChangedThreshold": "ChangedThreshold" +} diff --git a/pages/reference-smart-account/owner-functions/_meta.json b/pages/reference-smart-account/owner-functions/_meta.json index 6d6bc294a..4bcae7781 100644 --- a/pages/reference-smart-account/owner-functions/_meta.json +++ b/pages/reference-smart-account/owner-functions/_meta.json @@ -1,5 +1,5 @@ { - "addOwnerThreshold": "addOwnerThreshold", + "addOwnerWithThreshold": "addOwnerWithThreshold", "removeOwner": "removeOwner", "swapOwner": "swapOwner", "changeThreshold": "changeThreshold", diff --git a/pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx b/pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx similarity index 60% rename from pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx rename to pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx index acc917408..58ca36a9d 100644 --- a/pages/reference-smart-account/owner-functions/addOwnerThreshold.mdx +++ b/pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx @@ -1,5 +1,5 @@ # `addOwnerWithThreshold` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L56) ## Overview @@ -12,7 +12,7 @@ Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. *This can only be done via a Safe transaction.* -This function emits the [`AddedOwner`](../owner-events/addedOwner.md) and [`ChangedThreshold`](../owner-events/changedThreshold.md) events. +This function emits the [`AddedOwner`](../owner-events/AddedOwner.md) and [`ChangedThreshold`](../owner-events/ChangedThreshold.md) events. ## Parameters diff --git a/pages/reference-smart-account/owner-functions/changeThreshold.mdx b/pages/reference-smart-account/owner-functions/changeThreshold.mdx index 0c0243e5a..778131805 100644 --- a/pages/reference-smart-account/owner-functions/changeThreshold.mdx +++ b/pages/reference-smart-account/owner-functions/changeThreshold.mdx @@ -1,5 +1,5 @@ # `changeThreshold` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L107) ## Overview @@ -12,7 +12,7 @@ Changes the threshold of the Safe to `_threshold`. *This can only be done via a Safe transaction.* -This function emits the [`ChangedThreshold`](../owner-events/changedThreshold.md) event. +This function emits the [`ChangedThreshold`](../owner-events/ChangedThreshold.md) event. ## Parameters diff --git a/pages/reference-smart-account/owner-functions/getOwners.mdx b/pages/reference-smart-account/owner-functions/getOwners.mdx index 87552c737..610ad8af4 100644 --- a/pages/reference-smart-account/owner-functions/getOwners.mdx +++ b/pages/reference-smart-account/owner-functions/getOwners.mdx @@ -1,5 +1,5 @@ # `getOwners` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L133) ## Overview diff --git a/pages/reference-smart-account/owner-functions/getThreshold.mdx b/pages/reference-smart-account/owner-functions/getThreshold.mdx index 5ff89e5a8..07aab6705 100644 --- a/pages/reference-smart-account/owner-functions/getThreshold.mdx +++ b/pages/reference-smart-account/owner-functions/getThreshold.mdx @@ -1,5 +1,5 @@ # `getThreshold` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L119) ## Overview diff --git a/pages/reference-smart-account/owner-functions/isOwner.mdx b/pages/reference-smart-account/owner-functions/isOwner.mdx index 731c7ef9a..ec8792b39 100644 --- a/pages/reference-smart-account/owner-functions/isOwner.mdx +++ b/pages/reference-smart-account/owner-functions/isOwner.mdx @@ -1,5 +1,5 @@ # `isOwner` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L126) ## Overview diff --git a/pages/reference-smart-account/owner-functions/removeOwner.mdx b/pages/reference-smart-account/owner-functions/removeOwner.mdx index dbe281050..26a6c00ff 100644 --- a/pages/reference-smart-account/owner-functions/removeOwner.mdx +++ b/pages/reference-smart-account/owner-functions/removeOwner.mdx @@ -1,5 +1,5 @@ # `removeOwner` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L72) ## Overview @@ -12,7 +12,7 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold *This can only be done via a Safe transaction.* -This function emits the [`RemovedOwner`](../owner-events/removedOwner.md) and [`ChangedThreshold`](../owner-events/changedThreshold.md) events. +This function emits the [`RemovedOwner`](../owner-events/RemovedOwner.md) and [`ChangedThreshold`](../owner-events/ChangedThreshold.md) events. ## Parameters ### `prevOwner` diff --git a/pages/reference-smart-account/owner-functions/swapOwner.mdx b/pages/reference-smart-account/owner-functions/swapOwner.mdx index bb1e506c3..29180e38f 100644 --- a/pages/reference-smart-account/owner-functions/swapOwner.mdx +++ b/pages/reference-smart-account/owner-functions/swapOwner.mdx @@ -1,5 +1,5 @@ # `swapOwner` -Defined in [OwnerManager.sol](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol) +Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L89) ## Overview @@ -12,7 +12,7 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. *This can only be done via a Safe transaction.* -This function emits the [`RemovedOwner`](../owner-events/removedOwner.md) and [`AddedOwner`](../owner-events/addedOwner.md) events. +This function emits the [`RemovedOwner`](../owner-events/RemovedOwner.md) and [`AddedOwner`](../owner-events/AddedOwner.md) events. ## Parameters ### `prevOwner` diff --git a/pages/reference-smart-account/setup-events/SafeSetup.mdx b/pages/reference-smart-account/setup-events/SafeSetup.mdx new file mode 100644 index 000000000..94ccfe040 --- /dev/null +++ b/pages/reference-smart-account/setup-events/SafeSetup.mdx @@ -0,0 +1,9 @@ +# `SafeSetup` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L15). + +```solidity +event SafeSetup(address initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) + +``` + +*Emitted when the Safe is set up. This event is emitted in the [`setup`](/reference-smart-account/setup-functions/setup.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/setup-events/_meta.json b/pages/reference-smart-account/setup-events/_meta.json new file mode 100644 index 000000000..b89ca478e --- /dev/null +++ b/pages/reference-smart-account/setup-events/_meta.json @@ -0,0 +1,3 @@ +{ + "SafeSetup": "SafeSetup" +} \ No newline at end of file diff --git a/pages/reference-smart-account/setup-functions/_meta.json b/pages/reference-smart-account/setup-functions/_meta.json new file mode 100644 index 000000000..d4dc3eb63 --- /dev/null +++ b/pages/reference-smart-account/setup-functions/_meta.json @@ -0,0 +1,4 @@ +{ + "setup": "setup", + "domainSeparator": "domainSeparator" +} \ No newline at end of file diff --git a/pages/reference-smart-account/setup-functions/domainSeparator.mdx b/pages/reference-smart-account/setup-functions/domainSeparator.mdx new file mode 100644 index 000000000..c07e45e0d --- /dev/null +++ b/pages/reference-smart-account/setup-functions/domainSeparator.mdx @@ -0,0 +1,17 @@ +# `domainSeparator` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L377) + +## Overview + +```solidity +function domainSeparator() external view returns (bytes32) + +``` + +Returns the domain separator for this contract, as defined in the EIP-712 standard. + +## Return Values + +- **Type:** `bytes32` + +The domain separator hash. diff --git a/pages/reference-smart-account/setup-functions/setup.mdx b/pages/reference-smart-account/setup-functions/setup.mdx new file mode 100644 index 000000000..3c9876a63 --- /dev/null +++ b/pages/reference-smart-account/setup-functions/setup.mdx @@ -0,0 +1,66 @@ +# `setup` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L84) + +## Overview + +```solidity +function setup( + address[] _owners, + uint256 _threshold, + address to, + bytes data, + address fallbackHandler, + address paymentToken, + uint256 payment, + address payable paymentReceiver +) external + +``` + +Sets an initial storage of the Safe contract. + +*This method can only be called once. If a proxy was created without setting up, anyone can call setup and claim the proxy.* + +This function emits the [`SafeSetup`](../setup-events/SafeSetup.mdx) event. + +## Parameters + +### `_owners` +- **Type:** `address[]` + +List of Safe owners. + +### `_threshold` +- **Type:** `uint256` + +Number of required confirmations for a Safe transaction. + +### `to` +- **Type:** `address` + +Contract address for optional delegate call. + +### `data` +- **Type:** `bytes` + +Data payload for optional delegate call. + +### `fallbackHandler` +- **Type:** `address` + +Handler for fallback calls to this contract. + +### `paymentToken` +- **Type:** `address` + +Token that should be used for the payment (0 is ETH). + +### `payment` +- **Type:** `uint256` + +Value that should be paid. + +### `paymentReceiver` +- **Type:** `address payable` + +Address that should receive the payment (or 0 if tx.origin). diff --git a/pages/reference-smart-account/signature-events/ApproveHash.mdx b/pages/reference-smart-account/signature-events/ApproveHash.mdx new file mode 100644 index 000000000..568c57d6d --- /dev/null +++ b/pages/reference-smart-account/signature-events/ApproveHash.mdx @@ -0,0 +1,9 @@ +# `ApproveHash` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L16). + +```solidity +event ApproveHash(bytes32 approvedHash, address owner) + +``` + +*Emitted when a hash is approved by an owner. This event is emitted in the [`approveHash`](/reference-smart-account/signature-functions/approveHash.mdx) function.* diff --git a/pages/reference-smart-account/signature-events/SignMsg.mdx b/pages/reference-smart-account/signature-events/SignMsg.mdx new file mode 100644 index 000000000..bacb3a0e4 --- /dev/null +++ b/pages/reference-smart-account/signature-events/SignMsg.mdx @@ -0,0 +1,9 @@ +# `SignMsg` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L17). + +```solidity +event SignMsg(bytes32 msgHash) + +``` + +*Emitted when a message is signed by an owner. This event is emitted when the [`signMsg`](/reference-smart-account/signature-functions/signMsg.mdx) function is called.* diff --git a/pages/reference-smart-account/signature-events/_meta.json b/pages/reference-smart-account/signature-events/_meta.json new file mode 100644 index 000000000..fcd60328d --- /dev/null +++ b/pages/reference-smart-account/signature-events/_meta.json @@ -0,0 +1,4 @@ +{ + "ApproveHash": "ApproveHash", + "SignMsg": "SignMsg" +} diff --git a/pages/reference-smart-account/signature-functions/_meta.json b/pages/reference-smart-account/signature-functions/_meta.json new file mode 100644 index 000000000..a84e66d55 --- /dev/null +++ b/pages/reference-smart-account/signature-functions/_meta.json @@ -0,0 +1,6 @@ +{ + "approveHash": "approveHash", + "checkSignatures": "checkSignatures", + "checkNSignatures": "checkNSignatures", + "signedMessages": "signedMessages" +} diff --git a/pages/reference-smart-account/signature-functions/approveHash.mdx b/pages/reference-smart-account/signature-functions/approveHash.mdx new file mode 100644 index 000000000..3a4e77d42 --- /dev/null +++ b/pages/reference-smart-account/signature-functions/approveHash.mdx @@ -0,0 +1,22 @@ +# `approveHash` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L368) + +## Overview + +```solidity +function approveHash(bytes32 hashToApprove) external + +``` + +Marks hash `hashToApprove` as approved. + +*This can be used with a pre-approved hash transaction signature. IMPORTANT: The approved hash stays approved forever. There's no revocation mechanism, so it behaves similarly to ECDSA signatures.* + +This function emits the [`ApproveHash`](../signature-events/ApproveHash.mdx) event. + +## Parameters + +### `hashToApprove` +- **Type:** `bytes32` + +The hash to mark as approved for signatures that are verified by this contract. diff --git a/pages/reference-smart-account/signature-functions/checkNSignatures.mdx b/pages/reference-smart-account/signature-functions/checkNSignatures.mdx new file mode 100644 index 000000000..7a916a177 --- /dev/null +++ b/pages/reference-smart-account/signature-functions/checkNSignatures.mdx @@ -0,0 +1,40 @@ +# `checkNSignatures` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L281) + +## Overview + +```solidity +function checkNSignatures( + address executor, + bytes32 dataHash, + bytes signatures, + uint256 requiredSignatures +) public view + +``` + +Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. + +*Since the EIP-1271 does an external call, be mindful of reentrancy attacks.* + +## Parameters + +### `executor` +- **Type:** `address` + +Address that executing the transaction. ⚠️⚠️⚠️ Make sure that the executor address is a legitimate executor. Incorrectly passed the executor might reduce the threshold by 1 signature. ⚠️⚠️⚠️ + +### `dataHash` +- **Type:** `bytes32` + +Hash of the data (could be either a message hash or transaction hash). + +### `signatures` +- **Type:** `bytes` + +Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. + +### `requiredSignatures` +- **Type:** `uint256` + +Amount of required valid signatures. diff --git a/pages/reference-smart-account/signature-functions/checkSignatures.mdx b/pages/reference-smart-account/signature-functions/checkSignatures.mdx new file mode 100644 index 000000000..7a4e6c35e --- /dev/null +++ b/pages/reference-smart-account/signature-functions/checkSignatures.mdx @@ -0,0 +1,23 @@ +# `checkSignatures` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L270) + +## Overview + +```solidity +function checkSignatures(bytes32 dataHash, bytes signatures) public view + +``` + +Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. + +## Parameters + +### `dataHash` +- **Type:** `bytes32` + +Hash of the data (could be either a message hash or transaction hash). + +### `signatures` +- **Type:** `bytes` + +Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. diff --git a/pages/reference-smart-account/signature-functions/signedMessages.mdx b/pages/reference-smart-account/signature-functions/signedMessages.mdx new file mode 100644 index 000000000..2272f64f1 --- /dev/null +++ b/pages/reference-smart-account/signature-functions/signedMessages.mdx @@ -0,0 +1,24 @@ +# `signedMessages` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L162) +{/* Where is this implemented as a function? Looks like this is only an interface definition, while the actual data is just a state variable (a mapping) in Safe.sol.*/} + +## Overview + +```solidity +function signedMessages(bytes32 messageHash) external view returns (uint256) + +``` + +Returns a `uint256` if the `messageHash` is signed by the owner. + +## Parameters + +### `messageHash` +- **Type:** `bytes32` + +Hash of message that should be checked. + +## Return Values +- **Type:** `uint256` + +Number denoting if an owner signed the hash. \ No newline at end of file diff --git a/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx b/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx new file mode 100644 index 000000000..e083152a5 --- /dev/null +++ b/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx @@ -0,0 +1,9 @@ +# `ExecutionFailure` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L18). + +```solidity +event ExecutionFailure(bytes32 txHash, uint256 payment) + +``` + +*Emitted when a transaction fails. This event is emitted in the [`execTransaction`](/reference-smart-account/transaction-functions/execTransaction.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx b/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx new file mode 100644 index 000000000..d803cbe7c --- /dev/null +++ b/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx @@ -0,0 +1,9 @@ +# `ExecutionSuccess` +Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L19). + +```solidity +event ExecutionSuccess(bytes32 txHash, uint256 payment) + +``` + +*Emitted when a transaction is executed successfully. This event is emitted in the [`execTransaction`](/reference-smart-account/transaction-functions/execTransaction.mdx) function.* diff --git a/pages/reference-smart-account/transaction-events/_meta.json b/pages/reference-smart-account/transaction-events/_meta.json new file mode 100644 index 000000000..b0365e546 --- /dev/null +++ b/pages/reference-smart-account/transaction-events/_meta.json @@ -0,0 +1,4 @@ +{ + "ExecutionSuccess": "ExecutionSuccess", + "ExecutionFailure": "ExecutionFailure" +} diff --git a/pages/reference-smart-account/transaction-functions/_meta.json b/pages/reference-smart-account/transaction-functions/_meta.json new file mode 100644 index 000000000..a2a2bac52 --- /dev/null +++ b/pages/reference-smart-account/transaction-functions/_meta.json @@ -0,0 +1,6 @@ +{ + "execTransaction": "execTransaction", + "getTransactionHash": "getTransactionHash", + "simulateAndRevert": "simulateAndRevert", + "encodeTransactionData": "encodeTransactionData" +} diff --git a/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx b/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx new file mode 100644 index 000000000..0f43326fa --- /dev/null +++ b/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx @@ -0,0 +1,78 @@ +# `encodeTransactionData` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L403) + +## Overview + +```solidity +function encodeTransactionData( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address refundReceiver, uint256 _nonce) external view returns (bytes) + +``` + +Encodes the transaction data for `execTransaction`. + +## Return value + +- **Type:** `bytes` + +Encoded transaction data. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address. + +### `value` +- **Type:** `uint256` + +Ether value. + +### `data` +- **Type:** `bytes` + +Data payload. + +### `operation` +- **Type:** `enum Enum.Operation` + +Operation type. + +### `safeTxGas` +- **Type:** `uint256` + +Gas that should be used for the Safe transaction. + +### `baseGas` +- **Type:** `uint256` + +Gas costs for data used to trigger the Safe transaction. + +### `gasPrice` +- **Type:** `uint256` + +Maximum gas price that should be used for this transaction. + +### `gasToken` +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +### `refundReceiver` +- **Type:** `address` + +Address of receiver of gas payment (or 0 if tx.origin). + +### `_nonce` +- **Type:** `uint256` + +Transaction nonce. diff --git a/pages/reference-smart-account/transaction-functions/execTransaction.mdx b/pages/reference-smart-account/transaction-functions/execTransaction.mdx new file mode 100644 index 000000000..719ba55a5 --- /dev/null +++ b/pages/reference-smart-account/transaction-functions/execTransaction.mdx @@ -0,0 +1,82 @@ +# `execTransaction` +Defined in [`Executor.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L111) + +## Overview + +```solidity +function execTransaction( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address payable refundReceiver, bytes signatures) external payable returns (bool success) + +``` + +Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `value` (Native Currency) and pays `gasPrice` * `gasLimit` in `gasToken` token to `refundReceiver`. + +*The fees are always transferred, even if the user transaction fails. This method doesn't perform any sanity check of the transaction, such as if the contract at `to` address has code or not. It is the responsibility of the caller to perform such checks.* + +This function emits the [`ExecutionSuccess`](../transaction-events/ExecutionSuccess.mdx) or [`ExecutionFailure`](../transaction-events/ExecutionFailure.mdx) events based on the transaction outcome. + +## Returns + +- **Type:** `bool` + +Boolean indicating transaction's success. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address of Safe transaction. + +### `value` +- **Type:** `uint256` + +Ether value of Safe transaction. + +### `data` +- **Type:** `bytes` + +Data payload of Safe transaction. + +### `operation` +- **Type:** `Enum.Operation` + +Operation type of Safe transaction. + +### `safeTxGas` +- **Type:** `uint256` + +Gas that should be used for the Safe transaction. + +### `baseGas` +- **Type:** `uint256` + +Gas costs that are independent of the transaction execution (e.g. base transaction fee, signature check, payment of the refund). + +### `gasPrice` +- **Type:** `uint256` + +Gas price that should be used for the payment calculation. + +### `gasToken` +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +### `refundReceiver` +- **Type:** `address payable` + +Address of receiver of gas payment (or 0 if tx.origin). + +### `signatures` +- **Type:** `bytes` + +Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. diff --git a/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx b/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx new file mode 100644 index 000000000..72a71b39e --- /dev/null +++ b/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx @@ -0,0 +1,78 @@ +# `getTransactionHash` +Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L436) + +## Overview + +```solidity +function getTransactionHash( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address refundReceiver, uint256 _nonce) external view returns (bytes32) + +``` + +Returns transaction hash to be signed by owners. + +## Return value + +- **Type:** `bytes32` + +Transaction hash. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address. + +### `value` +- **Type:** `uint256` + +Ether value. + +### `data` +- **Type:** `bytes` + +Data payload. + +### `operation` +- **Type:** `Enum.Operation` + +Operation type. + +### `safeTxGas` +- **Type:** `uint256` + +Gas that should be used for the safe transaction. + +### `baseGas` +- **Type:** `uint256` + +Gas costs for data used to trigger the safe transaction. + +### `gasPrice` +- **Type:** `uint256` + +Maximum gas price that should be used for this transaction. + +### `gasToken` +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +### `refundReceiver` +- **Type:** `address` + +Address of receiver of gas payment (or 0 if tx.origin). + +### `_nonce` +- **Type:** `uint256` + +Transaction nonce. diff --git a/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx b/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx new file mode 100644 index 000000000..027b88c9b --- /dev/null +++ b/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx @@ -0,0 +1,23 @@ +# `simulateAndRevert` +Defined in [`StorageAccessible.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/StorageAccessible.sol#L42) + +## Overview + +```solidity +function simulateAndRevert(address targetContract, bytes calldataPayload) external + +``` + +*Performs a delegatecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static).* + +This method reverts with data equal to `abi.encode(bool(success), bytes(response))`. Specifically, the `returndata` after a call to this method will be: `success:bool || response.length:uint256 || response:bytes`. + +## Parameters + +### `targetContract` +- **Type:** `address` + +Address of the contract containing the code to execute. + +### `calldataPayload` +- **Type:** `bytes` diff --git a/pages/reference-smart-account/utility-functions/_meta.json b/pages/reference-smart-account/utility-functions/_meta.json new file mode 100644 index 000000000..6dc7b4771 --- /dev/null +++ b/pages/reference-smart-account/utility-functions/_meta.json @@ -0,0 +1,3 @@ +{ + "getStorageAt": "getStorageAt" +} \ No newline at end of file diff --git a/pages/reference-smart-account/utility-functions/getStorageAt.mdx b/pages/reference-smart-account/utility-functions/getStorageAt.mdx new file mode 100644 index 000000000..6fc2e663d --- /dev/null +++ b/pages/reference-smart-account/utility-functions/getStorageAt.mdx @@ -0,0 +1,28 @@ +# `getStorageAt` +Defined in [`StorageAccessible.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/StorageAccessible.sol#L17) + +## Overview + +```solidity +function getStorageAt(uint256 offset, uint256 length) public view returns (bytes) + +``` + +Reads `length` bytes of storage in the currents contract. + +## Parameters + +### `offset` +- **Type:** `uint256` + +The offset in the current contract's storage in words to start reading from. + +### `length` +- **Type:** `uint256` + +The number of words (32 bytes) of data to read. + +## Return Values +- **Type:** `bytes` + +The bytes that were read. From 1584b264ded8b9580350eb380bdc4197cd9a01db Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 18 Oct 2024 16:35:11 +0200 Subject: [PATCH 03/60] Add redirections for root folders --- redirects.json | 52 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/redirects.json b/redirects.json index 1f9061779..99c25cd9d 100644 --- a/redirects.json +++ b/redirects.json @@ -843,5 +843,55 @@ "source": "/advanced/passkeys/supported-networks", "destination": "/advanced/smart-account-supported-networks?module=Safe+Passkey+Module", "permanent": true + }, + { + "source": "/reference-smart-account", + "destination": "/reference-smart-account/overview", + "permanent": true + }, + { + "source": "/reference-smart-account/owner-functions", + "destination": "/reference-smart-account/owner-functions/addOwnerWithThreshold", + "permanent": true + }, + { + "source": "/reference-smart-account/owner-events", + "destination": "/reference-smart-account/owner-events/AddedOwner", + "permanent": true + }, + { + "source": "/reference-smart-account/module-functions", + "destination": "/reference-smart-account/module-functions/enableModule", + "permanent": true + }, + { + "source": "/reference-smart-account/module-events", + "destination": "/reference-smart-account/module-events/ModuleEnabled", + "permanent": true + }, + { + "source": "/reference-smart-account/signature-functions", + "destination": "/reference-smart-account/signature-functions/checkSignatures", + "permanent": true + }, + { + "source": "/reference-smart-account/signature-events", + "destination": "/reference-smart-account/signature-events/ApproveHash", + "permanent": true + }, + { + "source": "/reference-smart-account/transaction-functions", + "destination": "/reference-smart-account/transaction-functions/execTransaction", + "permanent": true + }, + { + "source": "/reference-smart-account/transaction-events", + "destination": "/reference-smart-account/transaction-events/ExecutionSuccess", + "permanent": true + }, + { + "source": "/reference-smart-account/utility-functions", + "destination": "/reference-smart-account/utility-functions/getStorageAt", + "permanent": true } -] +] \ No newline at end of file From 43b5368120cf2bc4d168f3e59d030f7cd215fb68 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 18 Oct 2024 16:38:16 +0200 Subject: [PATCH 04/60] Fix vale errors --- .../signature-functions/checkNSignatures.mdx | 2 +- .../transaction-functions/execTransaction.mdx | 2 +- .../transaction-functions/simulateAndRevert.mdx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/reference-smart-account/signature-functions/checkNSignatures.mdx b/pages/reference-smart-account/signature-functions/checkNSignatures.mdx index 7a916a177..4b89ca32a 100644 --- a/pages/reference-smart-account/signature-functions/checkNSignatures.mdx +++ b/pages/reference-smart-account/signature-functions/checkNSignatures.mdx @@ -15,7 +15,7 @@ function checkNSignatures( Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. -*Since the EIP-1271 does an external call, be mindful of reentrancy attacks.* +*Since the EIP-1271 does an external call, be mindful of re-entrancy attacks.* ## Parameters diff --git a/pages/reference-smart-account/transaction-functions/execTransaction.mdx b/pages/reference-smart-account/transaction-functions/execTransaction.mdx index 719ba55a5..d4a55a398 100644 --- a/pages/reference-smart-account/transaction-functions/execTransaction.mdx +++ b/pages/reference-smart-account/transaction-functions/execTransaction.mdx @@ -59,7 +59,7 @@ Gas that should be used for the Safe transaction. ### `baseGas` - **Type:** `uint256` -Gas costs that are independent of the transaction execution (e.g. base transaction fee, signature check, payment of the refund). +Gas costs that are independent of the transaction execution (for example base transaction fee, signature check, payment of the refund). ### `gasPrice` - **Type:** `uint256` diff --git a/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx b/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx index 027b88c9b..b3f141a6f 100644 --- a/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx +++ b/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx @@ -8,7 +8,7 @@ function simulateAndRevert(address targetContract, bytes calldataPayload) extern ``` -*Performs a delegatecall on a targetContract in the context of self. Internally reverts execution to avoid side effects (making it static).* +*Performs a `delegatecall` on a `targetContract` in the context of `self`. Internally reverts execution to avoid side effects (making it static).* This method reverts with data equal to `abi.encode(bool(success), bytes(response))`. Specifically, the `returndata` after a call to this method will be: `success:bool || response.length:uint256 || response:bytes`. From b1e24b98e57898e35289ea8bbcfb4d25bf085019 Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 17:01:24 +0200 Subject: [PATCH 05/60] Implement requested changes (owners) --- pages/reference-smart-account/_meta.json | 31 +++----- .../owner-events/AddedOwner.mdx | 9 --- .../owner-events/ChangedThreshold.mdx | 9 --- .../owner-events/RemovedOwner.mdx | 9 --- .../owner-events/_meta.json | 5 -- .../owner-functions/addOwnerWithThreshold.mdx | 27 ------- .../owner-functions/changeThreshold.mdx | 22 ------ .../owner-functions/getOwners.mdx | 18 ----- .../owner-functions/getThreshold.mdx | 18 ----- .../owner-functions/isOwner.mdx | 24 ------ .../owner-functions/removeOwner.mdx | 32 -------- .../owner-functions/swapOwner.mdx | 31 -------- .../{owner-functions => owners}/_meta.json | 8 +- .../owners/addOwnerWithThreshold.mdx | 75 +++++++++++++++++++ .../owners/changeThreshold.mdx | 51 +++++++++++++ .../owners/getOwners.mdx | 26 +++++++ .../owners/getThreshold.mdx | 33 ++++++++ .../owners/isOwner.mdx | 32 ++++++++ .../owners/removeOwner.mdx | 71 ++++++++++++++++++ .../owners/swapOwner.mdx | 49 ++++++++++++ 20 files changed, 351 insertions(+), 229 deletions(-) delete mode 100644 pages/reference-smart-account/owner-events/AddedOwner.mdx delete mode 100644 pages/reference-smart-account/owner-events/ChangedThreshold.mdx delete mode 100644 pages/reference-smart-account/owner-events/RemovedOwner.mdx delete mode 100644 pages/reference-smart-account/owner-events/_meta.json delete mode 100644 pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx delete mode 100644 pages/reference-smart-account/owner-functions/changeThreshold.mdx delete mode 100644 pages/reference-smart-account/owner-functions/getOwners.mdx delete mode 100644 pages/reference-smart-account/owner-functions/getThreshold.mdx delete mode 100644 pages/reference-smart-account/owner-functions/isOwner.mdx delete mode 100644 pages/reference-smart-account/owner-functions/removeOwner.mdx delete mode 100644 pages/reference-smart-account/owner-functions/swapOwner.mdx rename pages/reference-smart-account/{owner-functions => owners}/_meta.json (74%) create mode 100644 pages/reference-smart-account/owners/addOwnerWithThreshold.mdx create mode 100644 pages/reference-smart-account/owners/changeThreshold.mdx create mode 100644 pages/reference-smart-account/owners/getOwners.mdx create mode 100644 pages/reference-smart-account/owners/getThreshold.mdx create mode 100644 pages/reference-smart-account/owners/isOwner.mdx create mode 100644 pages/reference-smart-account/owners/removeOwner.mdx create mode 100644 pages/reference-smart-account/owners/swapOwner.mdx diff --git a/pages/reference-smart-account/_meta.json b/pages/reference-smart-account/_meta.json index 90337c402..a8ba8d3bc 100644 --- a/pages/reference-smart-account/_meta.json +++ b/pages/reference-smart-account/_meta.json @@ -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" } diff --git a/pages/reference-smart-account/owner-events/AddedOwner.mdx b/pages/reference-smart-account/owner-events/AddedOwner.mdx deleted file mode 100644 index 3adec7876..000000000 --- a/pages/reference-smart-account/owner-events/AddedOwner.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `AddedOwner` -Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L9). - -```solidity -event AddedOwner(address owner) - -``` - -*Emitted when an owner is added to the Safe. This event is emitted in the [`addOwnerWithThreshold`](/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx) and [`swapOwner`](/reference-smart-account/owner-functions/swapOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/ChangedThreshold.mdx b/pages/reference-smart-account/owner-events/ChangedThreshold.mdx deleted file mode 100644 index 8c480d243..000000000 --- a/pages/reference-smart-account/owner-events/ChangedThreshold.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ChangedThreshold` -Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L11). - -```solidity -event ChangedThreshold(uint256 threshold) - -``` - -*Emitted when the threshold for confirmations is changed. This event is emitted in the [`changeThreshold`](/reference-smart-account/owner-functions/changeThreshold.mdx), [`addOwnerWithThreshold`](/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx) and [`removeOwner`](/reference-smart-account/owner-functions/removeOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/RemovedOwner.mdx b/pages/reference-smart-account/owner-events/RemovedOwner.mdx deleted file mode 100644 index 6cbb77b3f..000000000 --- a/pages/reference-smart-account/owner-events/RemovedOwner.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `RemovedOwner` -Defined in [`IOwnerManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IOwnerManager.sol#L10). - -```solidity -event RemovedOwner(address owner) - -``` - -*Emitted when an owner is removed from the Safe. This event is emitted in the [`removeOwner`](/reference-smart-account/owner-functions/removeOwner.mdx) and [`swapOwner`](/reference-smart-account/owner-functions/swapOwner.mdx) functions.* diff --git a/pages/reference-smart-account/owner-events/_meta.json b/pages/reference-smart-account/owner-events/_meta.json deleted file mode 100644 index f826a51fe..000000000 --- a/pages/reference-smart-account/owner-events/_meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "AddedOwner": "AddedOwner", - "RemovedOwner": "RemovedOwner", - "ChangedThreshold": "ChangedThreshold" -} diff --git a/pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx deleted file mode 100644 index 58ca36a9d..000000000 --- a/pages/reference-smart-account/owner-functions/addOwnerWithThreshold.mdx +++ /dev/null @@ -1,27 +0,0 @@ -# `addOwnerWithThreshold` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L56) - -## Overview - -```solidity -function addOwnerWithThreshold(address owner, uint256 _threshold) external - -``` - -Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. - -*This can only be done via a Safe transaction.* - -This function emits the [`AddedOwner`](../owner-events/AddedOwner.md) and [`ChangedThreshold`](../owner-events/ChangedThreshold.md) events. - -## Parameters - -### `owner` -- **Type:** `address` - -New owner address. - -### `_threshold` -- **Type:** `uint256` - -New threshold. diff --git a/pages/reference-smart-account/owner-functions/changeThreshold.mdx b/pages/reference-smart-account/owner-functions/changeThreshold.mdx deleted file mode 100644 index 778131805..000000000 --- a/pages/reference-smart-account/owner-functions/changeThreshold.mdx +++ /dev/null @@ -1,22 +0,0 @@ -# `changeThreshold` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L107) - -## Overview - -```solidity -function changeThreshold(uint256 _threshold) external - -``` - -Changes the threshold of the Safe to `_threshold`. - -*This can only be done via a Safe transaction.* - -This function emits the [`ChangedThreshold`](../owner-events/ChangedThreshold.md) event. - -## Parameters - -### `_threshold` -- **Type:** `uint256` - -New threshold. diff --git a/pages/reference-smart-account/owner-functions/getOwners.mdx b/pages/reference-smart-account/owner-functions/getOwners.mdx deleted file mode 100644 index 610ad8af4..000000000 --- a/pages/reference-smart-account/owner-functions/getOwners.mdx +++ /dev/null @@ -1,18 +0,0 @@ -# `getOwners` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L133) - -## Overview - -```solidity -function getOwners() external view returns (address[]) - -``` - -Returns a list of Safe owners. - -## Returns - -### `owners` -- **Type:** `address[]` - -Array of Safe owners. diff --git a/pages/reference-smart-account/owner-functions/getThreshold.mdx b/pages/reference-smart-account/owner-functions/getThreshold.mdx deleted file mode 100644 index 07aab6705..000000000 --- a/pages/reference-smart-account/owner-functions/getThreshold.mdx +++ /dev/null @@ -1,18 +0,0 @@ -# `getThreshold` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L119) - -## Overview - -```solidity -function getThreshold() external view returns (uint256) - -``` - -Returns the number of required confirmations for a Safe transaction aka the threshold. - -## Returns - -### `threshold` -- **Type:** `uint256` - -Threshold number. diff --git a/pages/reference-smart-account/owner-functions/isOwner.mdx b/pages/reference-smart-account/owner-functions/isOwner.mdx deleted file mode 100644 index ec8792b39..000000000 --- a/pages/reference-smart-account/owner-functions/isOwner.mdx +++ /dev/null @@ -1,24 +0,0 @@ -# `isOwner` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L126) - -## Overview - -```solidity -function isOwner(address owner) external view returns (bool) - -``` - -Returns if `owner` is an owner of the Safe. - -## Returns - -### `isOwner` -- **Type:** `bool` - -Boolean flag indicating if `owner` is an owner of the Safe. - -## Parameters -### `owner` -- **Type:** `address` - -Owner address. \ No newline at end of file diff --git a/pages/reference-smart-account/owner-functions/removeOwner.mdx b/pages/reference-smart-account/owner-functions/removeOwner.mdx deleted file mode 100644 index 26a6c00ff..000000000 --- a/pages/reference-smart-account/owner-functions/removeOwner.mdx +++ /dev/null @@ -1,32 +0,0 @@ -# `removeOwner` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L72) - -## Overview - -```solidity -function removeOwner(address prevOwner, address owner, uint256 _threshold) external - -``` - -Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. - -*This can only be done via a Safe transaction.* - -This function emits the [`RemovedOwner`](../owner-events/RemovedOwner.md) and [`ChangedThreshold`](../owner-events/ChangedThreshold.md) events. - -## Parameters -### `prevOwner` -- **Type:** `address` - -Owner that pointed to the owner to be removed in the linked list - -### `owner` -- **Type:** `address` - -Owner address to be removed. - -### `_threshold` -- **Type:** `uint256` - -New threshold. - diff --git a/pages/reference-smart-account/owner-functions/swapOwner.mdx b/pages/reference-smart-account/owner-functions/swapOwner.mdx deleted file mode 100644 index 29180e38f..000000000 --- a/pages/reference-smart-account/owner-functions/swapOwner.mdx +++ /dev/null @@ -1,31 +0,0 @@ -# `swapOwner` -Defined in [`OwnerManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/OwnerManager.sol#L89) - -## Overview - -```solidity -function swapOwner(address prevOwner, address oldOwner, address newOwner) external - -``` - -Replaces the owner `oldOwner` in the Safe with `newOwner`. - -*This can only be done via a Safe transaction.* - -This function emits the [`RemovedOwner`](../owner-events/RemovedOwner.md) and [`AddedOwner`](../owner-events/AddedOwner.md) events. - -## Parameters -### `prevOwner` -- **Type:** `address` - -Owner that pointed to the owner to be replaced in the linked list - -### `oldOwner` -- **Type:** `address` - -Owner address to be replaced. - -### `newOwner` -- **Type:** `address` - -New owner address. diff --git a/pages/reference-smart-account/owner-functions/_meta.json b/pages/reference-smart-account/owners/_meta.json similarity index 74% rename from pages/reference-smart-account/owner-functions/_meta.json rename to pages/reference-smart-account/owners/_meta.json index 4bcae7781..f9d5353c2 100644 --- a/pages/reference-smart-account/owner-functions/_meta.json +++ b/pages/reference-smart-account/owners/_meta.json @@ -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" } diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx new file mode 100644 index 000000000..a51916158 --- /dev/null +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -0,0 +1,75 @@ +import { Tabs, Callout } from "nextra/components" + +# `addOwnerWithThreshold` + +Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. + + +This can only be done via a Safe transaction. + + +## Usage + +{/* */} + + + +```solidity + interface ISafe { + function addOwnerWithThreshold(address owner, uint256 _threshold) external + } + + contract Example { + function example() … { + (ISafe safe).addOwnerWithThreshold( + "0x...", + 1 + ) + } + } +``` + + + +{/* */} + +## 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. diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx new file mode 100644 index 000000000..3ea881eb9 --- /dev/null +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -0,0 +1,51 @@ +import { Tabs, Callout } from "nextra/components" + +# `changeThreshold` + +Changes the threshold of the Safe to `_threshold`. + + +This can only be done via a Safe transaction. + + +## Usage + +{/* */} + + + +```solidity + interface ISafe { + function changeThreshold(uint256 _threshold) external + } +``` + + + +{/* */} + +## 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. diff --git a/pages/reference-smart-account/owners/getOwners.mdx b/pages/reference-smart-account/owners/getOwners.mdx new file mode 100644 index 000000000..639ee258c --- /dev/null +++ b/pages/reference-smart-account/owners/getOwners.mdx @@ -0,0 +1,26 @@ +# `getOwners` + +Returns a list of Safe owners. + +## Usage + +{/* */} + + + +```solidity + interface ISafe { + function getOwners() external view returns (address[]) + } +``` + + + +{/* */} + +## Returns + +### `owners` +- **Type:** `address[]` + +Array of Safe owners. diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx new file mode 100644 index 000000000..4e33cc981 --- /dev/null +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -0,0 +1,33 @@ +import { Tabs } from "nextra/components" + +# `getThreshold` + +## Overview + +```solidity +function getThreshold() external view returns (uint256) + +``` + +Returns the number of required confirmations for a Safe transaction aka the threshold. + +## Usage + + + + ```solidity + contract Example { + function example() … { + (uint256 threshold) = (ISafe safe).getThreshold(); // 1 + } + } + ``` + + + +## Returns + +### `threshold` +- **Type:** `uint256` + +Threshold number. diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx new file mode 100644 index 000000000..a0c62b914 --- /dev/null +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -0,0 +1,32 @@ +import { Tabs } from "nextra/components" + +# `isOwner` + +Returns if `owner` is an owner of the Safe. + +## Usage + + + + ```solidity + contract Example { + function example() … { + (bool isOwner) = (ISafe safe).isOwner("0x..."); // true + } + } + ``` + + + +## Returns + +### `isOwner` +- **Type:** `bool` + +Boolean flag indicating if `owner` is an owner of the Safe. + +## Parameters +### `owner` +- **Type:** `address` + +Owner address. \ No newline at end of file diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx new file mode 100644 index 000000000..8901cffef --- /dev/null +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -0,0 +1,71 @@ +import { Tabs, Callout } from "nextra/components" + +# `removeOwner` + +## Overview + +Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. + + +This can only be done via a Safe transaction. + + +## Usage + +{/* */} + + + +```solidity + interface ISafe { + function removeOwner(address prevOwner, address owner, uint256 _threshold) external + } + + contract Example { + function example() … { + (ISafe safe).removeOwner( + "0x...", + "0x...", + 1 + ) + } + } +``` + + + +{/* */} + +## Parameters + +### `prevOwner` +- **Type:** `address` + +Owner that pointed to the owner to be removed in the linked list + +### `owner` + +- **Type:** `address` + +Owner address to be removed. + +### `_threshold` + +- **Type:** `uint256` + +New threshold. + +## Events + +### `RemovedOwner` + +```solidity +event RemovedOwner(address owner) + +``` + +Emitted when an owner is removed from the Safe. + +This event is also emitted in the [`swapOwner`](/reference-smart-account/owner/swapOwner.mdx) functions. + +### [`ChangedThreshold`](../owner/changeThreshold#changedthreshold.mdx) diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx new file mode 100644 index 000000000..aca3659fa --- /dev/null +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -0,0 +1,49 @@ +import { Tabs, Callout } from "nextra/components" + +# `swapOwner` + +```solidity +function swapOwner(address prevOwner, address oldOwner, address newOwner) external + +``` + +Replaces the owner `oldOwner` in the Safe with `newOwner`. + + +This can only be done via a Safe transaction. + + +## Usage + + + + ```solidity + contract Example { + function example() … { + (ISafe safe).swapOwner("0x...", "0x...", "0x..."); + } + } + ``` + + + +## Parameters +### `prevOwner` +- **Type:** `address` + +Owner that pointed to the owner to be replaced in the linked list + +### `oldOwner` +- **Type:** `address` + +Owner address to be replaced. + +### `newOwner` +- **Type:** `address` + +New owner address. + +## Events + +### [`AddedOwner`](./addedOwner#addedowner.md) +### [`RemovedOwner`](./removedOwner#removedowner.md) From d086426872f5ef0880b31f8edcf49c271775e2e0 Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 17:10:14 +0200 Subject: [PATCH 06/60] Fix links --- pages/reference-smart-account/owners/getThreshold.mdx | 3 +++ pages/reference-smart-account/owners/isOwner.mdx | 3 +++ pages/reference-smart-account/owners/removeOwner.mdx | 2 +- pages/reference-smart-account/owners/swapOwner.mdx | 8 ++++++-- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx index 4e33cc981..1ad2c4b67 100644 --- a/pages/reference-smart-account/owners/getThreshold.mdx +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -13,6 +13,7 @@ Returns the number of required confirmations for a Safe transaction aka the thre ## Usage +{/* */} ```solidity @@ -25,6 +26,8 @@ Returns the number of required confirmations for a Safe transaction aka the thre +{/* */} + ## Returns ### `threshold` diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index a0c62b914..3f2afca46 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -6,6 +6,8 @@ Returns if `owner` is an owner of the Safe. ## Usage +{/* */} + ```solidity @@ -18,6 +20,7 @@ Returns if `owner` is an owner of the Safe. +{/* */} ## Returns ### `isOwner` diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 8901cffef..df7cc9ca4 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -68,4 +68,4 @@ Emitted when an owner is removed from the Safe. This event is also emitted in the [`swapOwner`](/reference-smart-account/owner/swapOwner.mdx) functions. -### [`ChangedThreshold`](../owner/changeThreshold#changedthreshold.mdx) +### [`ChangedThreshold`](./changeThreshold.mdx#changedthreshold) diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index aca3659fa..300d8ceab 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -15,6 +15,8 @@ This can only be done via a Safe transaction. ## Usage +{/* */} + ```solidity @@ -27,6 +29,8 @@ This can only be done via a Safe transaction. +{/* */} + ## Parameters ### `prevOwner` - **Type:** `address` @@ -45,5 +49,5 @@ New owner address. ## Events -### [`AddedOwner`](./addedOwner#addedowner.md) -### [`RemovedOwner`](./removedOwner#removedowner.md) +### [`AddedOwner`](./addOwnerWithThreshold.mdx#addedowner) +### [`RemovedOwner`](./removeOwner.mdx#removedowner) From a81b9215ff48aef162bc6171adae082e5dd4f3da Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 17:20:10 +0200 Subject: [PATCH 07/60] Various fixes --- .../reference-smart-account/owners/_meta.json | 2 +- .../owners/addOwnerWithThreshold.mdx | 2 +- .../owners/changeThreshold.mdx | 8 +++++ .../owners/getThreshold.mdx | 13 +++----- .../owners/isOwner.mdx | 4 +++ .../owners/removeOwner.mdx | 28 ++++++++++++++-- .../owners/swapOwner.mdx | 33 ++++++++++++++++--- 7 files changed, 73 insertions(+), 17 deletions(-) diff --git a/pages/reference-smart-account/owners/_meta.json b/pages/reference-smart-account/owners/_meta.json index f9d5353c2..10e5bc35e 100644 --- a/pages/reference-smart-account/owners/_meta.json +++ b/pages/reference-smart-account/owners/_meta.json @@ -1,8 +1,8 @@ { "addOwnerWithThreshold": "addOwnerWithThreshold", "changeThreshold": "changeThreshold", - "getThreshold": "getThreshold", "getOwners": "getOwners", + "getThreshold": "getThreshold", "isOwner": "isOwner", "removeOwner": "removeOwner", "swapOwner": "swapOwner" diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index a51916158..01fbc5315 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -20,7 +20,7 @@ This can only be done via a Safe transaction. } contract Example { - function example() … { + function example() ... { (ISafe safe).addOwnerWithThreshold( "0x...", 1 diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index 3ea881eb9..252b2ae81 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -18,6 +18,14 @@ This can only be done via a Safe transaction. interface ISafe { function changeThreshold(uint256 _threshold) external } + + contract Example { + function example() ... { + (ISafe safe).changeThreshold( + 1 + ) + } + } ``` diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx index 1ad2c4b67..afb6cbcd4 100644 --- a/pages/reference-smart-account/owners/getThreshold.mdx +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -2,13 +2,6 @@ import { Tabs } from "nextra/components" # `getThreshold` -## Overview - -```solidity -function getThreshold() external view returns (uint256) - -``` - Returns the number of required confirmations for a Safe transaction aka the threshold. ## Usage @@ -17,8 +10,12 @@ Returns the number of required confirmations for a Safe transaction aka the thre ```solidity + interface ISafe { + function getThreshold() external view returns (uint256) + } + contract Example { - function example() … { + function example() ... { (uint256 threshold) = (ISafe safe).getThreshold(); // 1 } } diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index 3f2afca46..d941301a4 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -11,6 +11,10 @@ Returns if `owner` is an owner of the Safe. ```solidity + interface ISafe { + function isOwner(address owner) external view returns (bool) + } + contract Example { function example() … { (bool isOwner) = (ISafe safe).isOwner("0x..."); // true diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index df7cc9ca4..6a398db85 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -16,7 +16,7 @@ This can only be done via a Safe transaction. -```solidity + ```solidity interface ISafe { function removeOwner(address prevOwner, address owner, uint256 _threshold) external } @@ -30,7 +30,7 @@ This can only be done via a Safe transaction. ) } } -``` + ``` @@ -43,18 +43,42 @@ This can only be done via a Safe transaction. Owner that pointed to the owner to be removed in the linked list +```solidity focus=2 +removeOwner( + "0x...", + "0x...", + 1 +) +``` + ### `owner` - **Type:** `address` Owner address to be removed. +```solidity focus=3 +removeOwner( + "0x...", + "0x...", + 1 +) +``` + ### `_threshold` - **Type:** `uint256` New threshold. +```solidity focus=4 +removeOwner( + "0x...", + "0x...", + 1 +) +``` + ## Events ### `RemovedOwner` diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index 300d8ceab..bfab7ace0 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -2,11 +2,6 @@ import { Tabs, Callout } from "nextra/components" # `swapOwner` -```solidity -function swapOwner(address prevOwner, address oldOwner, address newOwner) external - -``` - Replaces the owner `oldOwner` in the Safe with `newOwner`. @@ -20,6 +15,10 @@ This can only be done via a Safe transaction. ```solidity + interface ISafe { + function swapOwner(address prevOwner, address oldOwner, address newOwner) external + } + contract Example { function example() … { (ISafe safe).swapOwner("0x...", "0x...", "0x..."); @@ -37,16 +36,40 @@ This can only be done via a Safe transaction. Owner that pointed to the owner to be replaced in the linked list +```solidity focus=2 +swapOwner( + "0x...", + "0x...", + "0x..." +) +``` + ### `oldOwner` - **Type:** `address` Owner address to be replaced. +```solidity focus=3 +swapOwner( + "0x...", + "0x...", + "0x..." +) +``` + ### `newOwner` - **Type:** `address` New owner address. +```solidity focus=4 +swapOwner( + "0x...", + "0x...", + "0x..." +) +``` + ## Events ### [`AddedOwner`](./addOwnerWithThreshold.mdx#addedowner) From 28163f20c551d7586075337eb29028c46a91c50b Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 17:31:45 +0200 Subject: [PATCH 08/60] Format files --- pages/reference-smart-account/_meta.json | 4 ++-- .../owners/addOwnerWithThreshold.mdx | 15 +++++++-------- .../owners/changeThreshold.mdx | 11 +++++------ .../reference-smart-account/owners/getOwners.mdx | 5 ++++- .../owners/getThreshold.mdx | 5 ++++- pages/reference-smart-account/owners/isOwner.mdx | 9 +++++++-- .../owners/removeOwner.mdx | 8 ++++---- .../reference-smart-account/owners/swapOwner.mdx | 12 ++++++++---- 8 files changed, 41 insertions(+), 28 deletions(-) diff --git a/pages/reference-smart-account/_meta.json b/pages/reference-smart-account/_meta.json index a8ba8d3bc..5df3e5ec9 100644 --- a/pages/reference-smart-account/_meta.json +++ b/pages/reference-smart-account/_meta.json @@ -10,10 +10,10 @@ }, "setup": "Setup", "owners": "Owners", - "modules": "Modules", "transactions": "Transactions", - "fallback": "Fallback Handler", + "modules": "Modules", "guards": "Guards", + "fallback": "Fallback Handler", "signatures": "Signatures", "utilities": "Utilities" } diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index 01fbc5315..8452bb282 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -1,12 +1,10 @@ -import { Tabs, Callout } from "nextra/components" +import { Tabs, Callout } from 'nextra/components' # `addOwnerWithThreshold` Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. - -This can only be done via a Safe transaction. - +This can only be done via a Safe transaction. ## Usage @@ -27,7 +25,8 @@ This can only be done via a Safe transaction. ) } } -``` + +```` @@ -37,7 +36,7 @@ This can only be done via a Safe transaction. ### `owner` -- **Type:** `address` +- **Type:** `address` New owner address. @@ -46,7 +45,7 @@ addOwnerWithThreshold( "0x...", 1 ) -``` +```` ### `_threshold` @@ -70,6 +69,6 @@ event AddedOwner(address owner) ``` -Emitted when an owner is added to the Safe. +Emitted when an owner is added to the Safe. This event is also emitted in the [`swapOwner`](./swapOwner.mdx) function. diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index 252b2ae81..92fe3e0bc 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -1,12 +1,10 @@ -import { Tabs, Callout } from "nextra/components" +import { Tabs, Callout } from 'nextra/components' # `changeThreshold` Changes the threshold of the Safe to `_threshold`. - -This can only be done via a Safe transaction. - +This can only be done via a Safe transaction. ## Usage @@ -26,7 +24,8 @@ This can only be done via a Safe transaction. ) } } -``` + +```` @@ -43,7 +42,7 @@ New threshold. changeThreshold( 1 ) -``` +```` ## Events diff --git a/pages/reference-smart-account/owners/getOwners.mdx b/pages/reference-smart-account/owners/getOwners.mdx index 639ee258c..61ddf6a5b 100644 --- a/pages/reference-smart-account/owners/getOwners.mdx +++ b/pages/reference-smart-account/owners/getOwners.mdx @@ -1,8 +1,10 @@ +import { Tabs } from 'nextra/components' + # `getOwners` Returns a list of Safe owners. -## Usage +## Usage {/* */} @@ -21,6 +23,7 @@ Returns a list of Safe owners. ## Returns ### `owners` + - **Type:** `address[]` Array of Safe owners. diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx index afb6cbcd4..d2d72a2fa 100644 --- a/pages/reference-smart-account/owners/getThreshold.mdx +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -1,4 +1,4 @@ -import { Tabs } from "nextra/components" +import { Tabs } from 'nextra/components' # `getThreshold` @@ -7,6 +7,7 @@ Returns the number of required confirmations for a Safe transaction aka the thre ## Usage {/* */} + ```solidity @@ -20,6 +21,7 @@ Returns the number of required confirmations for a Safe transaction aka the thre } } ``` + @@ -28,6 +30,7 @@ Returns the number of required confirmations for a Safe transaction aka the thre ## Returns ### `threshold` + - **Type:** `uint256` Threshold number. diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index d941301a4..b5b52826b 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -1,4 +1,4 @@ -import { Tabs } from "nextra/components" +import { Tabs } from 'nextra/components' # `isOwner` @@ -21,19 +21,24 @@ Returns if `owner` is an owner of the Safe. } } ``` + {/* */} + ## Returns ### `isOwner` + - **Type:** `bool` Boolean flag indicating if `owner` is an owner of the Safe. ## Parameters + ### `owner` + - **Type:** `address` -Owner address. \ No newline at end of file +Owner address. diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 6a398db85..ea8edf04f 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -1,4 +1,4 @@ -import { Tabs, Callout } from "nextra/components" +import { Tabs, Callout } from 'nextra/components' # `removeOwner` @@ -6,9 +6,7 @@ import { Tabs, Callout } from "nextra/components" Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. - -This can only be done via a Safe transaction. - +This can only be done via a Safe transaction. ## Usage @@ -31,6 +29,7 @@ This can only be done via a Safe transaction. } } ``` + @@ -39,6 +38,7 @@ This can only be done via a Safe transaction. ## Parameters ### `prevOwner` + - **Type:** `address` Owner that pointed to the owner to be removed in the linked list diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index bfab7ace0..b8976082d 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -1,12 +1,10 @@ -import { Tabs, Callout } from "nextra/components" +import { Tabs, Callout } from 'nextra/components' # `swapOwner` Replaces the owner `oldOwner` in the Safe with `newOwner`. - -This can only be done via a Safe transaction. - +This can only be done via a Safe transaction. ## Usage @@ -25,13 +23,16 @@ This can only be done via a Safe transaction. } } ``` + {/* */} ## Parameters + ### `prevOwner` + - **Type:** `address` Owner that pointed to the owner to be replaced in the linked list @@ -45,6 +46,7 @@ swapOwner( ``` ### `oldOwner` + - **Type:** `address` Owner address to be replaced. @@ -58,6 +60,7 @@ swapOwner( ``` ### `newOwner` + - **Type:** `address` New owner address. @@ -73,4 +76,5 @@ swapOwner( ## Events ### [`AddedOwner`](./addOwnerWithThreshold.mdx#addedowner) + ### [`RemovedOwner`](./removeOwner.mdx#removedowner) From dfb354225f0afbede2a82667f18500eeb7ec4e62 Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 17:33:43 +0200 Subject: [PATCH 09/60] Minor fix --- pages/reference-smart-account/owners/isOwner.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index b5b52826b..bf0ff7d5e 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -42,3 +42,9 @@ Boolean flag indicating if `owner` is an owner of the Safe. - **Type:** `address` Owner address. + +```solidity focus=2 +isOwner( + "0x..." +) +``` From ce903ebdf2fe742e5b8d9cb598e88e4ac3fb41ef Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 18:18:55 +0200 Subject: [PATCH 10/60] Implement requested changes (utilities) --- .../_meta.json | 0 .../utilities/getStorageAt.mdx | 60 +++++++++++++++++++ .../utility-functions/getStorageAt.mdx | 28 --------- 3 files changed, 60 insertions(+), 28 deletions(-) rename pages/reference-smart-account/{utility-functions => utilities}/_meta.json (100%) create mode 100644 pages/reference-smart-account/utilities/getStorageAt.mdx delete mode 100644 pages/reference-smart-account/utility-functions/getStorageAt.mdx diff --git a/pages/reference-smart-account/utility-functions/_meta.json b/pages/reference-smart-account/utilities/_meta.json similarity index 100% rename from pages/reference-smart-account/utility-functions/_meta.json rename to pages/reference-smart-account/utilities/_meta.json diff --git a/pages/reference-smart-account/utilities/getStorageAt.mdx b/pages/reference-smart-account/utilities/getStorageAt.mdx new file mode 100644 index 000000000..9481dfc47 --- /dev/null +++ b/pages/reference-smart-account/utilities/getStorageAt.mdx @@ -0,0 +1,60 @@ +import { Tabs } from 'nextra/components' + +# `getStorageAt` + +Reads `length` bytes of storage in the currents contract. + +## Usage + +{/* */} + + + +```solidity + interface ISafe { + function getStorageAt(uint256 offset, uint256 length) external view returns (bytes) + } + + contract Example { + function example() ... { + (ISafe safe).getStorageAt(0, 1) + } + } + +``` + + + +## Parameters + +### `offset` +- **Type:** `uint256` + +The offset in the current contract's storage in words to start reading from. + +```solidity focus=2 +getStorageAt( + 0, + 1 +) +``` + +### `length` + +- **Type:** `uint256` + +The number of words (32 bytes) of data to read. + +```solidity focus=3 +getStorageAt( + 0, + 1 +) +``` + +## Return Values + +- **Type:** `bytes` + +The bytes that were read. +```` diff --git a/pages/reference-smart-account/utility-functions/getStorageAt.mdx b/pages/reference-smart-account/utility-functions/getStorageAt.mdx deleted file mode 100644 index 6fc2e663d..000000000 --- a/pages/reference-smart-account/utility-functions/getStorageAt.mdx +++ /dev/null @@ -1,28 +0,0 @@ -# `getStorageAt` -Defined in [`StorageAccessible.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/StorageAccessible.sol#L17) - -## Overview - -```solidity -function getStorageAt(uint256 offset, uint256 length) public view returns (bytes) - -``` - -Reads `length` bytes of storage in the currents contract. - -## Parameters - -### `offset` -- **Type:** `uint256` - -The offset in the current contract's storage in words to start reading from. - -### `length` -- **Type:** `uint256` - -The number of words (32 bytes) of data to read. - -## Return Values -- **Type:** `bytes` - -The bytes that were read. From 516c3447bb87daa6c10fc2bdec8c94ebccffe25c Mon Sep 17 00:00:00 2001 From: louis-md Date: Mon, 21 Oct 2024 18:19:18 +0200 Subject: [PATCH 11/60] Implement requested changes (fallback) --- .../ChangedFallbackHandler.mdx | 9 ---- .../fallback-events/SafeReceived.mdx | 9 ---- .../fallback-events/_meta.json | 4 -- .../fallback-functions/_meta.json | 5 -- .../fallback-functions/fallback.mdx | 11 ---- .../fallback-functions/receive.mdx | 13 ----- .../fallback-functions/setFallbackHandler.mdx | 22 -------- .../fallback/_meta.json | 5 ++ .../fallback/fallback.mdx | 31 ++++++++++++ .../fallback/receive.mdx | 36 +++++++++++++ .../fallback/setFallbackHandler.mdx | 50 +++++++++++++++++++ 11 files changed, 122 insertions(+), 73 deletions(-) delete mode 100644 pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx delete mode 100644 pages/reference-smart-account/fallback-events/SafeReceived.mdx delete mode 100644 pages/reference-smart-account/fallback-events/_meta.json delete mode 100644 pages/reference-smart-account/fallback-functions/_meta.json delete mode 100644 pages/reference-smart-account/fallback-functions/fallback.mdx delete mode 100644 pages/reference-smart-account/fallback-functions/receive.mdx delete mode 100644 pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx create mode 100644 pages/reference-smart-account/fallback/_meta.json create mode 100644 pages/reference-smart-account/fallback/fallback.mdx create mode 100644 pages/reference-smart-account/fallback/receive.mdx create mode 100644 pages/reference-smart-account/fallback/setFallbackHandler.mdx diff --git a/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx b/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx deleted file mode 100644 index b924fa3f3..000000000 --- a/pages/reference-smart-account/fallback-events/ChangedFallbackHandler.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ChangedFallbackHandler` -Defined in [`IFallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IFallbackManager.sol#L9). - -```solidity -event ChangedFallbackHandler(address handler) - -``` - -*Emitted when the fallback handler is changed. This event is emitted in the [`setFallbackHandler`](/reference-smart-account/fallback-functions/setFallbackHandler.mdx) function.* diff --git a/pages/reference-smart-account/fallback-events/SafeReceived.mdx b/pages/reference-smart-account/fallback-events/SafeReceived.mdx deleted file mode 100644 index 01006ba48..000000000 --- a/pages/reference-smart-account/fallback-events/SafeReceived.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `SafeReceived` -Defined in [`NativeCurrencyPaymentFallback.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/NativeCurrencyPaymentFallback.sol#L9). - -```solidity -event SafeReceived(address sender, uint256 value) - -``` - -*Emitted when the Safe contract receives a payment. This event is emitted in the [`receive`](../fallback-functions/receive.mdx) function.* diff --git a/pages/reference-smart-account/fallback-events/_meta.json b/pages/reference-smart-account/fallback-events/_meta.json deleted file mode 100644 index cf8d0078e..000000000 --- a/pages/reference-smart-account/fallback-events/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "ChangedFallbackHandler": "ChangedFallbackHandler", - "SafeReceived": "SafeReceived" -} diff --git a/pages/reference-smart-account/fallback-functions/_meta.json b/pages/reference-smart-account/fallback-functions/_meta.json deleted file mode 100644 index d596ec329..000000000 --- a/pages/reference-smart-account/fallback-functions/_meta.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "setFallbackHandler": "setFallbackHandler", - "fallback": "fallback", - "receive": "receive" -} diff --git a/pages/reference-smart-account/fallback-functions/fallback.mdx b/pages/reference-smart-account/fallback-functions/fallback.mdx deleted file mode 100644 index 3acb6ad7f..000000000 --- a/pages/reference-smart-account/fallback-functions/fallback.mdx +++ /dev/null @@ -1,11 +0,0 @@ -# `fallback` -Defined in [`FallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/FallbackManager.sol#L57) - -## Overview - -```solidity -fallback() external - -``` - -This function emits the [`SafeReceived`](../fallback-events/SafeReceived.mdx) event when it receives a payment. diff --git a/pages/reference-smart-account/fallback-functions/receive.mdx b/pages/reference-smart-account/fallback-functions/receive.mdx deleted file mode 100644 index 7ca953b6a..000000000 --- a/pages/reference-smart-account/fallback-functions/receive.mdx +++ /dev/null @@ -1,13 +0,0 @@ -# `receive` -Defined in [`NativeCurrencyPaymentFallback.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/NativeCurrencyPaymentFallback.sol#L15) - -## Overview - -```solidity -receive() external payable - -``` - -Receive function accepts native currency transactions. - -This function emits the [`SafeReceived`](../fallback-events/SafeReceived.mdx) event. diff --git a/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx b/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx deleted file mode 100644 index 23a5749f4..000000000 --- a/pages/reference-smart-account/fallback-functions/setFallbackHandler.mdx +++ /dev/null @@ -1,22 +0,0 @@ -# `setFallbackHandler` -Defined in [`FallbackManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/FallbackManager.sol#L46) - -## Overview - -```solidity -function setFallbackHandler(address handler) external - -``` - -Set Fallback Handler to `handler` for the Safe. - -*Only fallback calls without value and with data will be forwarded. This can only be done via a Safe transaction. Cannot be set to the Safe itself.* - -This function emits the [`ChangedFallbackHandler`](../fallback-events/ChangedFallbackHandler.mdx) event. - -## Parameters - -### `handler` -- **Type:** `address` - -Contract to handle fallback calls. diff --git a/pages/reference-smart-account/fallback/_meta.json b/pages/reference-smart-account/fallback/_meta.json new file mode 100644 index 000000000..7e5000246 --- /dev/null +++ b/pages/reference-smart-account/fallback/_meta.json @@ -0,0 +1,5 @@ +{ + "fallback": "fallback", + "receive": "receive", + "setFallbackHandler": "setFallbackHandler" +} diff --git a/pages/reference-smart-account/fallback/fallback.mdx b/pages/reference-smart-account/fallback/fallback.mdx new file mode 100644 index 000000000..1f9386c19 --- /dev/null +++ b/pages/reference-smart-account/fallback/fallback.mdx @@ -0,0 +1,31 @@ +import { Tabs } from 'nextra/components' + +# `fallback` + +This function emits the [`SafeReceived`](./fallback/receive.mdx#safereceived) event when it receives a payment. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + fallback() external + } + + contract Example { + function example() ... { + (ISafe safe).fallback() + } + } + ``` + + + +{/* */} + +## Events + +### [`SafeReceived`](./receive.mdx#safereceived) \ No newline at end of file diff --git a/pages/reference-smart-account/fallback/receive.mdx b/pages/reference-smart-account/fallback/receive.mdx new file mode 100644 index 000000000..9fa27aa53 --- /dev/null +++ b/pages/reference-smart-account/fallback/receive.mdx @@ -0,0 +1,36 @@ +import { Tabs } from 'nextra/components' + +# `receive` + +Receive function accepts native currency transactions. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + receive() external payable + } + + contract Example { + function example() ... { + (ISafe safe).receive() + } + } + ``` + + + +## Events + +### `SafeReceived` + +```solidity +event SafeReceived(address sender, uint256 value) + +``` + +Emitted when the Safe contract receives a payment. \ No newline at end of file diff --git a/pages/reference-smart-account/fallback/setFallbackHandler.mdx b/pages/reference-smart-account/fallback/setFallbackHandler.mdx new file mode 100644 index 000000000..4381a8575 --- /dev/null +++ b/pages/reference-smart-account/fallback/setFallbackHandler.mdx @@ -0,0 +1,50 @@ +import { Tabs, Callout } from 'nextra/components' + +# `setFallbackHandler` + +Set Fallback Handler to `handler` for the Safe. + + + Only fallback calls without value and with data will be forwarded. This can + only be done via a Safe transaction. Cannot be set to the Safe itself. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function setFallbackHandler(address handler) external + } + ``` + + + +{/* */} + +## Parameters + +### `handler` + +- **Type:** `address` + +Contract to handle fallback calls. + +```solidity focus=2 +setFallbackHandler( + "0x..." +) +``` + +## Events + +### `ChangedFallbackHandler` + +```solidity +event ChangedFallbackHandler(address handler) +``` + +Emitted when the fallback handler is changed. \ No newline at end of file From d4840c4222e788efcfe4af027d3566d450900e98 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:21:58 +0200 Subject: [PATCH 12/60] Implement requested changes (guards) --- .../guard-events/ChangedGuard.mdx | 9 --- .../guard-events/_meta.json | 3 - .../guard-functions/_meta.json | 3 - .../guard-functions/setGuard.mdx | 22 ------- .../reference-smart-account/guards/_meta.json | 4 ++ .../guards/setGuard.mdx | 58 +++++++++++++++++ .../guards/setModuleGuard.mdx | 64 +++++++++++++++++++ 7 files changed, 126 insertions(+), 37 deletions(-) delete mode 100644 pages/reference-smart-account/guard-events/ChangedGuard.mdx delete mode 100644 pages/reference-smart-account/guard-events/_meta.json delete mode 100644 pages/reference-smart-account/guard-functions/_meta.json delete mode 100644 pages/reference-smart-account/guard-functions/setGuard.mdx create mode 100644 pages/reference-smart-account/guards/_meta.json create mode 100644 pages/reference-smart-account/guards/setGuard.mdx create mode 100644 pages/reference-smart-account/guards/setModuleGuard.mdx diff --git a/pages/reference-smart-account/guard-events/ChangedGuard.mdx b/pages/reference-smart-account/guard-events/ChangedGuard.mdx deleted file mode 100644 index f0ca450db..000000000 --- a/pages/reference-smart-account/guard-events/ChangedGuard.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ChangedGuard` -Defined in [`IGuardManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IGuardManager.sol#L10). - -```solidity -event ChangedGuard(address guard) - -``` - -*Emitted when a guard is set for the Safe. This event is emitted in the [`setGuard`](/reference-smart-account/guard-functions/setGuard.mdx) function.* diff --git a/pages/reference-smart-account/guard-events/_meta.json b/pages/reference-smart-account/guard-events/_meta.json deleted file mode 100644 index 7f67fb4ec..000000000 --- a/pages/reference-smart-account/guard-events/_meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "ChangedGuard": "ChangedGuard" -} \ No newline at end of file diff --git a/pages/reference-smart-account/guard-functions/_meta.json b/pages/reference-smart-account/guard-functions/_meta.json deleted file mode 100644 index 406c0bb96..000000000 --- a/pages/reference-smart-account/guard-functions/_meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "setGuard": "setGuard" -} \ No newline at end of file diff --git a/pages/reference-smart-account/guard-functions/setGuard.mdx b/pages/reference-smart-account/guard-functions/setGuard.mdx deleted file mode 100644 index d937321ef..000000000 --- a/pages/reference-smart-account/guard-functions/setGuard.mdx +++ /dev/null @@ -1,22 +0,0 @@ -# `setGuard` -Defined in [`GuardManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/base/GuardManager.sol#L71) - -## Overview - -```solidity -function setGuard(address guard) external - -``` - -Set Transaction Guard `guard` for the Safe. Make sure you trust the guard. - -*Set a guard that checks transactions before execution. This can only be done via a Safe transaction. ⚠️ IMPORTANT: Since a guard has full power to block Safe transaction execution, a broken guard can cause a denial of service for the Safe. Make sure to carefully audit the guard code and design recovery mechanisms.* - -This function emits the [`ChangedGuard`](../guard-events/ChangedGuard.mdx) event. - -## Parameters - -### `guard` -- **Type:** `address` - -The address of the guard to be used or the 0 address to disable the guard. diff --git a/pages/reference-smart-account/guards/_meta.json b/pages/reference-smart-account/guards/_meta.json new file mode 100644 index 000000000..dc05975a4 --- /dev/null +++ b/pages/reference-smart-account/guards/_meta.json @@ -0,0 +1,4 @@ +{ + "setGuard": "setGuard", + "setModuleGuard": "setModuleGuard" +} diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx new file mode 100644 index 000000000..38471c1fa --- /dev/null +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -0,0 +1,58 @@ +import { Tabs, Callout } from 'nextra/components' + +# `setGuard` + +Set Transaction Guard `guard` that checks transactions before execution. + +This can only be done via a Safe transaction. + + Since a guard has full power to block Safe transaction execution, a broken + guard can cause a denial of service for the Safe. Make sure to carefully audit + the guard code and design recovery mechanisms. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function setGuard(address guard) external + } + + contract Example { + function example() ... { + (ISafe safe).setGuard("0x...") + } + } + ``` + + + + +## Parameters + +### `guard` + +- **Type:** `address` + +The address of the guard to be used or the 0 address to disable the guard. + +```solidity focus=2 +setGuard( + "0x..." +) +``` + +## Events + +### `ChangedGuard` + +```solidity +event ChangedGuard(address guard) + +``` + +Emitted when a guard is set for the Safe. diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx new file mode 100644 index 000000000..39c03692e --- /dev/null +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -0,0 +1,64 @@ +import { Tabs, Callout } from 'nextra/components' + +# `setModuleGuard` + +Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module guard. + + + Set a module guard that checks transactions initiated by the module before + execution This can only be done via a Safe transaction. + + + + Since a module guard has full power to block Safe transaction execution + initiatied via a module, a broken module guard can cause a denial of service + for the Safe modules. Make sure to carefully audit the module guard code and + design recovery mechanisms. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function setModuleGuard(address moduleGuard) external + } + + contract Example { + function example() ... { + (ISafe safe).setModuleGuard("0x...") + } + } + ``` + + + +{/* */} + +## Parameters + +### `moduleGuard` + +- **Type:** `address` + +The address of the module guard to be used or the zero address to disable the module guard. + +```solidity focus=2 +setModuleGuard( + "0x..." +) +``` + +## Events + +### `ChangedModuleGuard` + +```solidity +event ChangedModuleGuard(address moduleGuard) + +``` + +Emitted when a module guard is set for the Safe. From 817c6596abf6d50b86d55126d80a60cdaf76dc30 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:22:17 +0200 Subject: [PATCH 13/60] Implement requested changes (modules) --- .../module-events/ChangedModuleGuard.mdx | 9 -- .../module-events/DisabledModule.mdx | 9 -- .../module-events/EnabledModule.mdx | 9 -- .../ExecutionFromModuleFailed.mdx | 9 -- .../ExecutionFromModuleSuccess.mdx | 9 -- .../module-events/_meta.json | 7 - .../module-functions/disableModule.mdx | 27 ---- .../module-functions/enableModule.mdx | 21 --- .../execTransactionFromModule.mdx | 49 ------- .../execTransactionFromModuleReturnData.mdx | 52 ------- .../module-functions/getModulesPaginated.mdx | 35 ----- .../module-functions/isModuleEnabled.mdx | 25 ---- .../{module-functions => modules}/_meta.json | 4 +- .../modules/disableModule.mdx | 68 +++++++++ .../modules/enableModule.mdx | 54 +++++++ .../modules/execTransactionFromModule.mdx | 132 ++++++++++++++++++ .../execTransactionFromModuleReturnData.mdx | 120 ++++++++++++++++ .../modules/getModulesPaginated.mdx | 73 ++++++++++ .../modules/isModuleEnabled.mdx | 45 ++++++ 19 files changed, 494 insertions(+), 263 deletions(-) delete mode 100644 pages/reference-smart-account/module-events/ChangedModuleGuard.mdx delete mode 100644 pages/reference-smart-account/module-events/DisabledModule.mdx delete mode 100644 pages/reference-smart-account/module-events/EnabledModule.mdx delete mode 100644 pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx delete mode 100644 pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx delete mode 100644 pages/reference-smart-account/module-events/_meta.json delete mode 100644 pages/reference-smart-account/module-functions/disableModule.mdx delete mode 100644 pages/reference-smart-account/module-functions/enableModule.mdx delete mode 100644 pages/reference-smart-account/module-functions/execTransactionFromModule.mdx delete mode 100644 pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx delete mode 100644 pages/reference-smart-account/module-functions/getModulesPaginated.mdx delete mode 100644 pages/reference-smart-account/module-functions/isModuleEnabled.mdx rename pages/reference-smart-account/{module-functions => modules}/_meta.json (71%) create mode 100644 pages/reference-smart-account/modules/disableModule.mdx create mode 100644 pages/reference-smart-account/modules/enableModule.mdx create mode 100644 pages/reference-smart-account/modules/execTransactionFromModule.mdx create mode 100644 pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx create mode 100644 pages/reference-smart-account/modules/getModulesPaginated.mdx create mode 100644 pages/reference-smart-account/modules/isModuleEnabled.mdx diff --git a/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx b/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx deleted file mode 100644 index 05d6f6c94..000000000 --- a/pages/reference-smart-account/module-events/ChangedModuleGuard.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ChangedModuleGuard` -Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L18). - -```solidity -event ChangedModuleGuard(address moduleGuard) - -``` - -*Emitted when a module guard is set for the Safe. This event is emitted in the [`setModuleGuard`](/reference-smart-account/module-functions/setModuleGuard.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/module-events/DisabledModule.mdx b/pages/reference-smart-account/module-events/DisabledModule.mdx deleted file mode 100644 index 1da57efa6..000000000 --- a/pages/reference-smart-account/module-events/DisabledModule.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `DisabledModule` -Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L15). - -```solidity -event DisabledModule(address module) - -``` - -*Emitted when a module is disabled for the Safe. This event is emitted in the [`disableModule`](/reference-smart-account/module-functions/disableModule.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/module-events/EnabledModule.mdx b/pages/reference-smart-account/module-events/EnabledModule.mdx deleted file mode 100644 index 95347cda2..000000000 --- a/pages/reference-smart-account/module-events/EnabledModule.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `EnabledModule` -Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L14). - -```solidity -event EnabledModule(address module) - -``` - -*Emitted when a module is enabled for the Safe. This event is emitted in the [`enableModule`](/reference-smart-account/module-functions/enableModule.mdx) function.* diff --git a/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx b/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx deleted file mode 100644 index b1a862999..000000000 --- a/pages/reference-smart-account/module-events/ExecutionFromModuleFailed.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ExecutionFromModuleFailure` -Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L17). - -```solidity -event ExecutionFromModuleFailure(address module) - -``` - -*Emitted when a transaction executed by a module fails. This event is emitted in the [`execTransactionFromModule`](/reference-smart-account/module-functions/execTransactionFromModule.mdx) and [`execTransactionFromModuleReturnData`](/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx) functions.* diff --git a/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx b/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx deleted file mode 100644 index 7395cce37..000000000 --- a/pages/reference-smart-account/module-events/ExecutionFromModuleSuccess.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ExecutionFromModuleSuccess` -Defined in [`IModuleManager.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/IModuleManager.sol#L16). - -```solidity -event ExecutionFromModuleSuccess(address module) - -``` - -*Emitted when a transaction executed by a module succeeds. This event is emitted in the [`execTransactionFromModule`](/reference-smart-account/module-functions/execTransactionFromModule.mdx) and [`execTransactionFromModuleReturnData`](/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx) functions.* diff --git a/pages/reference-smart-account/module-events/_meta.json b/pages/reference-smart-account/module-events/_meta.json deleted file mode 100644 index 50fda12ec..000000000 --- a/pages/reference-smart-account/module-events/_meta.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "EnabledModule": "EnabledModule", - "DisabledModule": "DisabledModule", - "ExecutionFromModuleSuccess": "ExecutionFromModuleSuccess", - "ExecutionFromModuleFailed": "ExecutionFromModuleFailed", - "ChangedModuleGuard": "ChangedModuleGuard" -} diff --git a/pages/reference-smart-account/module-functions/disableModule.mdx b/pages/reference-smart-account/module-functions/disableModule.mdx deleted file mode 100644 index 1581cd797..000000000 --- a/pages/reference-smart-account/module-functions/disableModule.mdx +++ /dev/null @@ -1,27 +0,0 @@ -# `disableModule` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L142) - -## Overview - -```solidity -function disableModule(address prevModule, address module) external - -``` - -Disables the module `module` for the Safe. - -*This can only be done via a Safe transaction.* - -This function emits the [`DisabledModule`](../module-events/DisabledModule.md) event. - -## Parameters - -### `prevModule` -- **Type:** `address` - -Previous module in the modules linked list. - -### `module` -- **Type:** `address` - -Module to be removed. diff --git a/pages/reference-smart-account/module-functions/enableModule.mdx b/pages/reference-smart-account/module-functions/enableModule.mdx deleted file mode 100644 index 588d5543f..000000000 --- a/pages/reference-smart-account/module-functions/enableModule.mdx +++ /dev/null @@ -1,21 +0,0 @@ -# `enableModule` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L129) - -## Overview - -```solidity -function enableModule(address module) external - -``` - -Enables the module `module` for the Safe. - -*This can only be done via a Safe transaction.* - -This function emits the [`EnabledModule`](../module-events/EnabledModule.md) event. - -## Parameters -### `module` -- **Type:** `address` - -Module to be whitelisted. diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx deleted file mode 100644 index 2c7f710f8..000000000 --- a/pages/reference-smart-account/module-functions/execTransactionFromModule.mdx +++ /dev/null @@ -1,49 +0,0 @@ -# `execTransactionFromModule` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L154) - -## Overview - -```solidity -function execTransactionFromModule( - address to, - uint256 value, - bytes data, - enum Enum.Operation operation -) external returns (bool success) - -``` - -Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token). - -*Function is virtual to allow overriding for L2 singleton to emit an event for indexing.* - -This function emits the [`ExecutionFromModuleSuccess`](../module-events/ExecutionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/ExecutionFromModuleFailure.md) events based on the transaction outcome. - -## Returns - -### `success` -- **Type:** `bool` - -Boolean flag indicating if the call succeeded. - -## Parameters - -### `to` -- **Type:** `address` - -Destination address of module transaction. - -### `value` -- **Type:** `uint256` - -Ether value of module transaction. - -### `data` -- **Type:** `bytes` - -Data payload of module transaction. - -### `operation` -- **Type:** `enum Enum.Operation` - -Operation type of module transaction. diff --git a/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx deleted file mode 100644 index 50ff8492c..000000000 --- a/pages/reference-smart-account/module-functions/execTransactionFromModuleReturnData.mdx +++ /dev/null @@ -1,52 +0,0 @@ -# `execTransactionFromModuleReturnData` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L168) - -## Overview - -```solidity -function execTransactionFromModuleReturnData( - address to, - uint256 value, - bytes data, - enum Enum.Operation operation -) external returns (bool success, bytes returnData) - -``` - -Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return `data`. - -This function emits the [`ExecutionFromModuleSuccess`](../module-events/ExecutionFromModuleSuccess.md) or [`ExecutionFromModuleFailure`](../module-events/ExecutionFromModuleFailure.md) events based on the transaction outcome. - -## Returns - -### `success` -- **Type:** `bool` - -Boolean flag indicating if the call succeeded. - -### `returnData` -- **Type:** `bytes` - -Data returned by the call. - -## Parameters - -### `to` -- **Type:** `address` - -Destination address of module transaction. - -### `value` -- **Type:** `uint256` - -Ether value of module transaction. - -### `data` -- **Type:** `bytes` - -Data payload of module transaction. - -### `operation` -- **Type:** `enum Enum.Operation` - -Operation type of module transaction. diff --git a/pages/reference-smart-account/module-functions/getModulesPaginated.mdx b/pages/reference-smart-account/module-functions/getModulesPaginated.mdx deleted file mode 100644 index 4d27f7ab5..000000000 --- a/pages/reference-smart-account/module-functions/getModulesPaginated.mdx +++ /dev/null @@ -1,35 +0,0 @@ -# `getModulesPaginated` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L203) - -## Overview - -```solidity -function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next) - -``` - -Returns an array of modules. If all entries fit into a single page, the next pointer will be 0x1. If another page is present, next will be the last element of the returned array. - -## Returns - -### `array` -- **Type:** `address[]` - -Array of modules. - -### `next` -- **Type:** `address` - -Start of the next page. - -## Parameters - -### `start` -- **Type:** `address` - -Start of the page. Has to be a module or start pointer (0x1 address). - -### `pageSize` -- **Type:** `uint256` - -Maximum number of modules that should be returned. Has to be > 0. diff --git a/pages/reference-smart-account/module-functions/isModuleEnabled.mdx b/pages/reference-smart-account/module-functions/isModuleEnabled.mdx deleted file mode 100644 index 1480c0fbc..000000000 --- a/pages/reference-smart-account/module-functions/isModuleEnabled.mdx +++ /dev/null @@ -1,25 +0,0 @@ -# `isModuleEnabled` -Defined in [`ModuleManager.sol`](https://github.com/safe-global/safe-smart-account/blob/main/contracts/base/ModuleManager.sol#L196) - -## Overview - -```solidity -function isModuleEnabled(address module) external view returns (bool) - -``` - -Returns if an module is enabled. - -## Returns - -### `isModuleEnabled` -- **Type:** `bool` - -Boolean flag indicating if the module is enabled. - -## Parameters - -### `module` -- **Type:** `address` - -Address of the module. diff --git a/pages/reference-smart-account/module-functions/_meta.json b/pages/reference-smart-account/modules/_meta.json similarity index 71% rename from pages/reference-smart-account/module-functions/_meta.json rename to pages/reference-smart-account/modules/_meta.json index 67d05d57b..763a82d7e 100644 --- a/pages/reference-smart-account/module-functions/_meta.json +++ b/pages/reference-smart-account/modules/_meta.json @@ -3,6 +3,6 @@ "disableModule": "disableModule", "execTransactionFromModule": "execTransactionFromModule", "execTransactionFromModuleReturnData": "execTransactionFromModuleReturnData", - "isModuleEnabled": "isModuleEnabled", - "getModulesPaginated": "getModulesPaginated" + "getModulesPaginated": "getModulesPaginated", + "isModuleEnabled": "isModuleEnabled" } diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx new file mode 100644 index 000000000..a833ad4da --- /dev/null +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -0,0 +1,68 @@ +import { Tabs, Callout } from 'nextra/components' + +# `disableModule` + +Disables the module `module` for the Safe. + +This can only be done via a Safe transaction. + +## Usage + +{/* */} + + + + ```solidity + interface IModuleManager { + function disableModule(address prevModule, address module) external + } + + contract Example { + function example() ... { + (IModuleManager moduleManager).disableModule("0x...", "0x...") + } + } + ``` + + + +{/* */} + +## Parameters + +### `prevModule` + +- **Type:** `address` + +Previous module in the modules linked list. + +```solidity focus=2 +disableModule( + "0x...", + "0x..." +) +``` + +### `module` + +- **Type:** `address` + +Module to be removed. + +```solidity focus=3 +disableModule( + "0x...", + "0x..." +) +``` + +## Events + +### `DisabledModule` + +```solidity +event DisabledModule(address module) + +``` + +Emitted when a module is disabled for the Safe. diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx new file mode 100644 index 000000000..f1514b536 --- /dev/null +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -0,0 +1,54 @@ +import { Tabs, Callout } from 'nextra/components' + +# `enableModule` + +Enables the module `module` for the Safe. + +This can only be done via a Safe transaction. + +## Usage + +{/* */} + + + + ```solidity + interface IModuleManager { + function enableModule(address module) external + } + + contract Example { + function example() ... { + (IModuleManager moduleManager).enableModule("0x...") + } + } + ``` + + + +{/* */} + +## Parameters + +### `module` + +- **Type:** `address` + +Module to be whitelisted. + +```solidity focus=2 +enableModule( + "0x..." +) +``` + +## Events + +### `EnabledModule` + +```solidity +event EnabledModule(address module) + +``` + +Emitted when a module is enabled for the Safe. diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx new file mode 100644 index 000000000..664752539 --- /dev/null +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -0,0 +1,132 @@ +import { Tabs, Callout } from 'nextra/components' + +# `execTransactionFromModule` + +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token). + + + Function is virtual to allow overriding for L2 singleton to emit an event for + indexing. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function execTransactionFromModule( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation + ) external returns (bool success) + } + + contract Example { + function example() … { + (ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call + ) + } + } + + ``` + + + + +{/* */} + +## Returns + +### `success` + +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. + +## Parameters + +### `to` + +- **Type:** `address` + +Destination address of module transaction. + +```solidity focus=2 +execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `value` + +- **Type:** `uint256` + +Ether value of module transaction. + +```solidity focus=3 +execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `data` + +- **Type:** `bytes` + +Data payload of module transaction. + +```solidity focus=4 +execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `operation` + +- **Type:** `enum Enum.Operation` + +Operation type of module transaction. + +```solidity focus=5 +execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +## Events + +### `ExecutionFromModuleSuccess` + +```solidity +event ExecutionFromModuleSuccess(address to, uint256 value, bytes data) +``` + +Emitted when a transaction executed by a module succeeds. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulesuccess) function. +### `ExecutionFromModuleFailure` + +```solidity +event ExecutionFromModuleFailure(address module) + +``` + +Emitted when a transaction executed by a module fails. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulefailure) function. diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx new file mode 100644 index 000000000..8937eeebc --- /dev/null +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -0,0 +1,120 @@ +import { Tabs } from 'nextra/components' + +# `execTransactionFromModuleReturnData` + +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return `data`. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function execTransactionFromModuleReturnData( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation + ) external returns (bool success, bytes returnData) + } + + contract Example { + function example() … { + (ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call + ) + } + } + ``` + + + + +{/* */} + +## Returns + +### `success` + +- **Type:** `bool` + +Boolean flag indicating if the call succeeded. + +### `returnData` + +- **Type:** `bytes` + +Data returned by the call. + +## Parameters + +### `to` + +- **Type:** `address` + +Destination address of module transaction. + +```solidity focus=2 +execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `value` + +- **Type:** `uint256` + +Ether value of module transaction. + +```solidity focus=3 +execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `data` + +- **Type:** `bytes` + +Data payload of module transaction. + +```solidity focus=4 +execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +### `operation` + +- **Type:** `enum Enum.Operation` + +Operation type of module transaction. + +```solidity focus=5 +execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +) +``` + +## Events + +### [`ExecutionFromModuleSuccess`](./execTransactionFromModule.mdx#executionfrommodulesuccess) + +### [`ExecutionFromModuleFailure`](./execTransactionFromModule.mdx#executionfrommodulefailure) \ No newline at end of file diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx new file mode 100644 index 000000000..decd9d259 --- /dev/null +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -0,0 +1,73 @@ +import { Tabs } from 'nextra/components' + +# `getModulesPaginated` + +Returns an array of modules. If all entries fit into a single page, the next pointer will be 0x1. If another page is present, next will be the last element of the returned array. + +## Usage + +{/* */} + + + + ```solidity + interface IModuleManager { + function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next) + } + + contract Example { + function example() … { + (IModuleManager moduleManager).getModulesPaginated( + "0x...", + "0x..." + ) + } + } + ``` + + + + +{/* */} + +## Returns + +### `array` + +- **Type:** `address[]` + +Array of modules. + +### `next` + +- **Type:** `address` + +Start of the next page. + +## Parameters + +### `start` + +- **Type:** `address` + +Start of the page. Has to be a module or start pointer (0x1 address). + +```solidity focus=2 +getModulesPaginated( + "0x...", + "0x..." +) +``` + +### `pageSize` + +- **Type:** `uint256` + +Maximum number of modules that should be returned. Has to be > 0. + +```solidity focus=3 +getModulesPaginated( + "0x...", + "0x..." +) +``` diff --git a/pages/reference-smart-account/modules/isModuleEnabled.mdx b/pages/reference-smart-account/modules/isModuleEnabled.mdx new file mode 100644 index 000000000..6a49a9c24 --- /dev/null +++ b/pages/reference-smart-account/modules/isModuleEnabled.mdx @@ -0,0 +1,45 @@ +import { Tabs } from 'nextra/components' + +# `isModuleEnabled` + +Returns if an module is enabled. + +## Usage + +{/* */} + + + + ```solidity + interface IModuleManager { + function isModuleEnabled(address module) external view returns (bool) + } + + contract Example { + function example() … { + (IModuleManager moduleManager).isModuleEnabled("0x...") + } + } + ``` + + + +## Returns + +### `isModuleEnabled` +- **Type:** `bool` + +Boolean flag indicating if the module is enabled. + +## Parameters + +### `module` +- **Type:** `address` + +Address of the module. + +```solidity focus=2 +isModuleEnabled( + "0x..." +) +``` From 4df0f432a33334027dd68174a4d1b380c14a27a4 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:22:36 +0200 Subject: [PATCH 14/60] Implement requested changes (signatures) --- .../signature-events/ApproveHash.mdx | 9 -- .../signature-events/SignMsg.mdx | 9 -- .../signature-events/_meta.json | 4 - .../signature-functions/approveHash.mdx | 22 ---- .../signature-functions/checkNSignatures.mdx | 40 ------- .../signature-functions/signedMessages.mdx | 24 ---- .../_meta.json | 2 +- .../signatures/approveHash.mdx | 58 ++++++++++ .../signatures/checkNSignatures.mdx | 107 ++++++++++++++++++ .../checkSignatures.mdx | 44 +++++++ .../signatures/signedMessages.mdx | 49 ++++++++ 11 files changed, 259 insertions(+), 109 deletions(-) delete mode 100644 pages/reference-smart-account/signature-events/ApproveHash.mdx delete mode 100644 pages/reference-smart-account/signature-events/SignMsg.mdx delete mode 100644 pages/reference-smart-account/signature-events/_meta.json delete mode 100644 pages/reference-smart-account/signature-functions/approveHash.mdx delete mode 100644 pages/reference-smart-account/signature-functions/checkNSignatures.mdx delete mode 100644 pages/reference-smart-account/signature-functions/signedMessages.mdx rename pages/reference-smart-account/{signature-functions => signatures}/_meta.json (100%) create mode 100644 pages/reference-smart-account/signatures/approveHash.mdx create mode 100644 pages/reference-smart-account/signatures/checkNSignatures.mdx rename pages/reference-smart-account/{signature-functions => signatures}/checkSignatures.mdx (53%) create mode 100644 pages/reference-smart-account/signatures/signedMessages.mdx diff --git a/pages/reference-smart-account/signature-events/ApproveHash.mdx b/pages/reference-smart-account/signature-events/ApproveHash.mdx deleted file mode 100644 index 568c57d6d..000000000 --- a/pages/reference-smart-account/signature-events/ApproveHash.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ApproveHash` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L16). - -```solidity -event ApproveHash(bytes32 approvedHash, address owner) - -``` - -*Emitted when a hash is approved by an owner. This event is emitted in the [`approveHash`](/reference-smart-account/signature-functions/approveHash.mdx) function.* diff --git a/pages/reference-smart-account/signature-events/SignMsg.mdx b/pages/reference-smart-account/signature-events/SignMsg.mdx deleted file mode 100644 index bacb3a0e4..000000000 --- a/pages/reference-smart-account/signature-events/SignMsg.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `SignMsg` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L17). - -```solidity -event SignMsg(bytes32 msgHash) - -``` - -*Emitted when a message is signed by an owner. This event is emitted when the [`signMsg`](/reference-smart-account/signature-functions/signMsg.mdx) function is called.* diff --git a/pages/reference-smart-account/signature-events/_meta.json b/pages/reference-smart-account/signature-events/_meta.json deleted file mode 100644 index fcd60328d..000000000 --- a/pages/reference-smart-account/signature-events/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "ApproveHash": "ApproveHash", - "SignMsg": "SignMsg" -} diff --git a/pages/reference-smart-account/signature-functions/approveHash.mdx b/pages/reference-smart-account/signature-functions/approveHash.mdx deleted file mode 100644 index 3a4e77d42..000000000 --- a/pages/reference-smart-account/signature-functions/approveHash.mdx +++ /dev/null @@ -1,22 +0,0 @@ -# `approveHash` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L368) - -## Overview - -```solidity -function approveHash(bytes32 hashToApprove) external - -``` - -Marks hash `hashToApprove` as approved. - -*This can be used with a pre-approved hash transaction signature. IMPORTANT: The approved hash stays approved forever. There's no revocation mechanism, so it behaves similarly to ECDSA signatures.* - -This function emits the [`ApproveHash`](../signature-events/ApproveHash.mdx) event. - -## Parameters - -### `hashToApprove` -- **Type:** `bytes32` - -The hash to mark as approved for signatures that are verified by this contract. diff --git a/pages/reference-smart-account/signature-functions/checkNSignatures.mdx b/pages/reference-smart-account/signature-functions/checkNSignatures.mdx deleted file mode 100644 index 4b89ca32a..000000000 --- a/pages/reference-smart-account/signature-functions/checkNSignatures.mdx +++ /dev/null @@ -1,40 +0,0 @@ -# `checkNSignatures` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L281) - -## Overview - -```solidity -function checkNSignatures( - address executor, - bytes32 dataHash, - bytes signatures, - uint256 requiredSignatures -) public view - -``` - -Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. - -*Since the EIP-1271 does an external call, be mindful of re-entrancy attacks.* - -## Parameters - -### `executor` -- **Type:** `address` - -Address that executing the transaction. ⚠️⚠️⚠️ Make sure that the executor address is a legitimate executor. Incorrectly passed the executor might reduce the threshold by 1 signature. ⚠️⚠️⚠️ - -### `dataHash` -- **Type:** `bytes32` - -Hash of the data (could be either a message hash or transaction hash). - -### `signatures` -- **Type:** `bytes` - -Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. - -### `requiredSignatures` -- **Type:** `uint256` - -Amount of required valid signatures. diff --git a/pages/reference-smart-account/signature-functions/signedMessages.mdx b/pages/reference-smart-account/signature-functions/signedMessages.mdx deleted file mode 100644 index 2272f64f1..000000000 --- a/pages/reference-smart-account/signature-functions/signedMessages.mdx +++ /dev/null @@ -1,24 +0,0 @@ -# `signedMessages` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L162) -{/* Where is this implemented as a function? Looks like this is only an interface definition, while the actual data is just a state variable (a mapping) in Safe.sol.*/} - -## Overview - -```solidity -function signedMessages(bytes32 messageHash) external view returns (uint256) - -``` - -Returns a `uint256` if the `messageHash` is signed by the owner. - -## Parameters - -### `messageHash` -- **Type:** `bytes32` - -Hash of message that should be checked. - -## Return Values -- **Type:** `uint256` - -Number denoting if an owner signed the hash. \ No newline at end of file diff --git a/pages/reference-smart-account/signature-functions/_meta.json b/pages/reference-smart-account/signatures/_meta.json similarity index 100% rename from pages/reference-smart-account/signature-functions/_meta.json rename to pages/reference-smart-account/signatures/_meta.json index a84e66d55..6d1df9f54 100644 --- a/pages/reference-smart-account/signature-functions/_meta.json +++ b/pages/reference-smart-account/signatures/_meta.json @@ -1,6 +1,6 @@ { "approveHash": "approveHash", - "checkSignatures": "checkSignatures", "checkNSignatures": "checkNSignatures", + "checkSignatures": "checkSignatures", "signedMessages": "signedMessages" } diff --git a/pages/reference-smart-account/signatures/approveHash.mdx b/pages/reference-smart-account/signatures/approveHash.mdx new file mode 100644 index 000000000..11b1d4a5b --- /dev/null +++ b/pages/reference-smart-account/signatures/approveHash.mdx @@ -0,0 +1,58 @@ +import { Tabs, Callout } from 'nextra/components' + +# `approveHash` + +Marks hash `hashToApprove` as approved. + + + This can be used with a pre-approved hash transaction signature. IMPORTANT: + The approved hash stays approved forever. There's no revocation mechanism, so + it behaves similarly to ECDSA signatures. + + +## Usage + +{/* */} + + + + + ```solidity + interface ISafe { + function approveHash(bytes32 hashToApprove) external + } + + function example() ... { + (ISafe safe).approveHash("0x...") + } + ``` + + + + +{/* */} + +## Parameters + +### `hashToApprove` + +- **Type:** `bytes32` + +The hash to mark as approved for signatures that are verified by this contract. + +```solidity focus=2 +approveHash( + "0x..." +) +``` + +## Events + +### `ApproveHash` + +```solidity +event ApproveHash(bytes32 approvedHash, address owner) + +``` + +Emitted when a hash is approved by an owner. diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx new file mode 100644 index 000000000..5584d372b --- /dev/null +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -0,0 +1,107 @@ +import { Tabs, Callout } from 'nextra/components' + +# `checkNSignatures` + +Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. + + + Since the EIP-1271 does an external call, be mindful of re-entrancy attacks. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function checkNSignatures( + address executor, + bytes32 dataHash, + bytes signatures, + uint256 requiredSignatures + ) external view + } + + function example() ... { + (ISafe safe).checkNSignatures( + "0x...", + "0x...", + "0x...", + 1 + ) + } + ``` + + + + +{/* */} + +## Parameters + +### `executor` + +- **Type:** `address` + +Address that executing the transaction. + + + Make sure that the executor address is a legitimate executor. Incorrectly + passed the executor might reduce the threshold by 1 signature. + + +```solidity focus=2 +checkNSignatures( + "0x...", + "0x...", + "0x...", + 1 +) +``` + +### `dataHash` + +- **Type:** `bytes32` + +Hash of the data (could be either a message hash or transaction hash). + +```solidity focus=3 +checkNSignatures( + "0x...", + "0x...", + "0x...", + 1 +) +``` + +### `signatures` + +- **Type:** `bytes` + +Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. + +```solidity focus=4 +checkNSignatures( + "0x...", + "0x...", + "0x...", + 1 +) +``` + +### `requiredSignatures` + +- **Type:** `uint256` + +Amount of required valid signatures. + +```solidity focus=5 +checkNSignatures( + "0x...", + "0x...", + "0x...", + 1 +) +``` diff --git a/pages/reference-smart-account/signature-functions/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx similarity index 53% rename from pages/reference-smart-account/signature-functions/checkSignatures.mdx rename to pages/reference-smart-account/signatures/checkSignatures.mdx index 7a4e6c35e..3793c4f9e 100644 --- a/pages/reference-smart-account/signature-functions/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -1,4 +1,5 @@ # `checkSignatures` + Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L270) ## Overview @@ -10,14 +11,57 @@ function checkSignatures(bytes32 dataHash, bytes signatures) public view Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function checkSignatures( + bytes32 dataHash, + bytes signatures + ) external view + } + + function example() ... { + (ISafe safe).checkSignatures( + "0x...", + "0x..." + ) + } + ``` + + + + +{/* */} + ## Parameters ### `dataHash` + - **Type:** `bytes32` Hash of the data (could be either a message hash or transaction hash). +```solidity focus=2 +checkSignatures( + "0x...", + "0x..." +) +``` + ### `signatures` + - **Type:** `bytes` Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. + +```solidity focus=3 +checkSignatures( + "0x...", + "0x..." +) +``` diff --git a/pages/reference-smart-account/signatures/signedMessages.mdx b/pages/reference-smart-account/signatures/signedMessages.mdx new file mode 100644 index 000000000..741b6da7b --- /dev/null +++ b/pages/reference-smart-account/signatures/signedMessages.mdx @@ -0,0 +1,49 @@ +import { Tabs, Callout } from 'nextra/components' + +# `signedMessages` + +Returns a `uint256` if the `messageHash` is signed by the owner. + +## Usage + + + +```solidity +interface ISafe { + function signedMessages(bytes32 messageHash) external view returns (uint256) +} + +contract Example { + function example() ... { + (ISafe safe).signedMessages("0x...") + } +} +``` + + + + +## Parameters + +### `messageHash` + +- **Type:** `bytes32` + +Hash of message that should be checked. + +## Returns + +- **Type:** `uint256` + +Number denoting if an owner signed the hash. + +## Events + +### `SignMsg` + +```solidity +event SignMsg(bytes32 msgHash) + +``` + +Emitted when a message is signed by an owner. From 483f38e06cd5f2737e627bddceabde9a549b5031 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:22:55 +0200 Subject: [PATCH 15/60] Implement requested changes (setup) --- .../setup-events/SafeSetup.mdx | 9 --- .../setup-events/_meta.json | 3 - .../setup-functions/_meta.json | 4 - .../setup-functions/domainSeparator.mdx | 17 ---- .../setup-functions/setup.mdx | 66 ---------------- .../reference-smart-account/setup/_meta.json | 4 + .../setup/domainSeparator.mdx | 34 ++++++++ pages/reference-smart-account/setup/setup.mdx | 79 +++++++++++++++++++ 8 files changed, 117 insertions(+), 99 deletions(-) delete mode 100644 pages/reference-smart-account/setup-events/SafeSetup.mdx delete mode 100644 pages/reference-smart-account/setup-events/_meta.json delete mode 100644 pages/reference-smart-account/setup-functions/_meta.json delete mode 100644 pages/reference-smart-account/setup-functions/domainSeparator.mdx delete mode 100644 pages/reference-smart-account/setup-functions/setup.mdx create mode 100644 pages/reference-smart-account/setup/_meta.json create mode 100644 pages/reference-smart-account/setup/domainSeparator.mdx create mode 100644 pages/reference-smart-account/setup/setup.mdx diff --git a/pages/reference-smart-account/setup-events/SafeSetup.mdx b/pages/reference-smart-account/setup-events/SafeSetup.mdx deleted file mode 100644 index 94ccfe040..000000000 --- a/pages/reference-smart-account/setup-events/SafeSetup.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `SafeSetup` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L15). - -```solidity -event SafeSetup(address initiator, address[] owners, uint256 threshold, address initializer, address fallbackHandler) - -``` - -*Emitted when the Safe is set up. This event is emitted in the [`setup`](/reference-smart-account/setup-functions/setup.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/setup-events/_meta.json b/pages/reference-smart-account/setup-events/_meta.json deleted file mode 100644 index b89ca478e..000000000 --- a/pages/reference-smart-account/setup-events/_meta.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "SafeSetup": "SafeSetup" -} \ No newline at end of file diff --git a/pages/reference-smart-account/setup-functions/_meta.json b/pages/reference-smart-account/setup-functions/_meta.json deleted file mode 100644 index d4dc3eb63..000000000 --- a/pages/reference-smart-account/setup-functions/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "setup": "setup", - "domainSeparator": "domainSeparator" -} \ No newline at end of file diff --git a/pages/reference-smart-account/setup-functions/domainSeparator.mdx b/pages/reference-smart-account/setup-functions/domainSeparator.mdx deleted file mode 100644 index c07e45e0d..000000000 --- a/pages/reference-smart-account/setup-functions/domainSeparator.mdx +++ /dev/null @@ -1,17 +0,0 @@ -# `domainSeparator` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L377) - -## Overview - -```solidity -function domainSeparator() external view returns (bytes32) - -``` - -Returns the domain separator for this contract, as defined in the EIP-712 standard. - -## Return Values - -- **Type:** `bytes32` - -The domain separator hash. diff --git a/pages/reference-smart-account/setup-functions/setup.mdx b/pages/reference-smart-account/setup-functions/setup.mdx deleted file mode 100644 index 3c9876a63..000000000 --- a/pages/reference-smart-account/setup-functions/setup.mdx +++ /dev/null @@ -1,66 +0,0 @@ -# `setup` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L84) - -## Overview - -```solidity -function setup( - address[] _owners, - uint256 _threshold, - address to, - bytes data, - address fallbackHandler, - address paymentToken, - uint256 payment, - address payable paymentReceiver -) external - -``` - -Sets an initial storage of the Safe contract. - -*This method can only be called once. If a proxy was created without setting up, anyone can call setup and claim the proxy.* - -This function emits the [`SafeSetup`](../setup-events/SafeSetup.mdx) event. - -## Parameters - -### `_owners` -- **Type:** `address[]` - -List of Safe owners. - -### `_threshold` -- **Type:** `uint256` - -Number of required confirmations for a Safe transaction. - -### `to` -- **Type:** `address` - -Contract address for optional delegate call. - -### `data` -- **Type:** `bytes` - -Data payload for optional delegate call. - -### `fallbackHandler` -- **Type:** `address` - -Handler for fallback calls to this contract. - -### `paymentToken` -- **Type:** `address` - -Token that should be used for the payment (0 is ETH). - -### `payment` -- **Type:** `uint256` - -Value that should be paid. - -### `paymentReceiver` -- **Type:** `address payable` - -Address that should receive the payment (or 0 if tx.origin). diff --git a/pages/reference-smart-account/setup/_meta.json b/pages/reference-smart-account/setup/_meta.json new file mode 100644 index 000000000..6dbd6ca47 --- /dev/null +++ b/pages/reference-smart-account/setup/_meta.json @@ -0,0 +1,4 @@ +{ + "domainSeparator": "domainSeparator", + "setup": "setup" +} \ No newline at end of file diff --git a/pages/reference-smart-account/setup/domainSeparator.mdx b/pages/reference-smart-account/setup/domainSeparator.mdx new file mode 100644 index 000000000..f823457b9 --- /dev/null +++ b/pages/reference-smart-account/setup/domainSeparator.mdx @@ -0,0 +1,34 @@ +import { Tabs } from 'nextra/components' + +# `domainSeparator` + +Returns the domain separator for this contract, as defined in the EIP-712 standard. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function domainSeparator() external view returns (bytes32) + } + + contract Example { + function example() … { + (ISafe safe).domainSeparator() + } + } + ``` + + + + +{/* */} + +## Returns + +- **Type:** `bytes32` + +The domain separator hash. diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx new file mode 100644 index 000000000..036888240 --- /dev/null +++ b/pages/reference-smart-account/setup/setup.mdx @@ -0,0 +1,79 @@ +import { Tabs, Callout } from 'nextra/components' + +# `setup` + +Sets an initial storage of the Safe contract. + + + This method can only be called once. If a proxy was created without setting + up, anyone can call setup and claim the proxy. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function setup( + address[] _owners, + uint256 _threshold, + ) external + } + + function example() ... { + (ISafe safe).setup([owner1, owner2], 1) + } + + ``` + + + + +{/* */} + +## Parameters + +### `_owners` + +- **Type:** `address[]` + +List of Safe owners. + +```solidity focus=2 +setup( + [owner1, owner2], + 1 +) +``` + +### `_threshold` + +- **Type:** `uint256` + +Number of required confirmations for a Safe transaction. + +```solidity focus=3 +setup( + [owner1, owner2], + 1 +) +``` + +## Events + +### `SafeSetup` + +```solidity +event SafeSetup( + address initiator, + address[] owners, + uint256 threshold, + address initializer, + address fallbackHandler +) +``` + +Emitted when the Safe is set up. From 75e92a9ef68198756f38f6565a8f758ab0762173 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:23:30 +0200 Subject: [PATCH 16/60] Implement requested changes (transactions) --- .../transaction-events/ExecutionFailure.mdx | 9 - .../transaction-events/ExecutionSuccess.mdx | 9 - .../transaction-events/_meta.json | 4 - .../transaction-functions/_meta.json | 6 - .../encodeTransactionData.mdx | 78 ----- .../transaction-functions/execTransaction.mdx | 82 ----- .../getTransactionHash.mdx | 78 ----- .../simulateAndRevert.mdx | 23 -- .../transactions/_meta.json | 6 + .../transactions/encodeTransactionData.mdx | 255 +++++++++++++++ .../transactions/execTransaction.mdx | 296 ++++++++++++++++++ .../transactions/getTransactionHash.mdx | 253 +++++++++++++++ .../transactions/simulateAndRevert.mdx | 59 ++++ 13 files changed, 869 insertions(+), 289 deletions(-) delete mode 100644 pages/reference-smart-account/transaction-events/ExecutionFailure.mdx delete mode 100644 pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx delete mode 100644 pages/reference-smart-account/transaction-events/_meta.json delete mode 100644 pages/reference-smart-account/transaction-functions/_meta.json delete mode 100644 pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx delete mode 100644 pages/reference-smart-account/transaction-functions/execTransaction.mdx delete mode 100644 pages/reference-smart-account/transaction-functions/getTransactionHash.mdx delete mode 100644 pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx create mode 100644 pages/reference-smart-account/transactions/_meta.json create mode 100644 pages/reference-smart-account/transactions/encodeTransactionData.mdx create mode 100644 pages/reference-smart-account/transactions/execTransaction.mdx create mode 100644 pages/reference-smart-account/transactions/getTransactionHash.mdx create mode 100644 pages/reference-smart-account/transactions/simulateAndRevert.mdx diff --git a/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx b/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx deleted file mode 100644 index e083152a5..000000000 --- a/pages/reference-smart-account/transaction-events/ExecutionFailure.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ExecutionFailure` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L18). - -```solidity -event ExecutionFailure(bytes32 txHash, uint256 payment) - -``` - -*Emitted when a transaction fails. This event is emitted in the [`execTransaction`](/reference-smart-account/transaction-functions/execTransaction.mdx) function.* \ No newline at end of file diff --git a/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx b/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx deleted file mode 100644 index d803cbe7c..000000000 --- a/pages/reference-smart-account/transaction-events/ExecutionSuccess.mdx +++ /dev/null @@ -1,9 +0,0 @@ -# `ExecutionSuccess` -Defined in [`ISafe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/interfaces/ISafe.sol#L19). - -```solidity -event ExecutionSuccess(bytes32 txHash, uint256 payment) - -``` - -*Emitted when a transaction is executed successfully. This event is emitted in the [`execTransaction`](/reference-smart-account/transaction-functions/execTransaction.mdx) function.* diff --git a/pages/reference-smart-account/transaction-events/_meta.json b/pages/reference-smart-account/transaction-events/_meta.json deleted file mode 100644 index b0365e546..000000000 --- a/pages/reference-smart-account/transaction-events/_meta.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "ExecutionSuccess": "ExecutionSuccess", - "ExecutionFailure": "ExecutionFailure" -} diff --git a/pages/reference-smart-account/transaction-functions/_meta.json b/pages/reference-smart-account/transaction-functions/_meta.json deleted file mode 100644 index a2a2bac52..000000000 --- a/pages/reference-smart-account/transaction-functions/_meta.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "execTransaction": "execTransaction", - "getTransactionHash": "getTransactionHash", - "simulateAndRevert": "simulateAndRevert", - "encodeTransactionData": "encodeTransactionData" -} diff --git a/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx b/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx deleted file mode 100644 index 0f43326fa..000000000 --- a/pages/reference-smart-account/transaction-functions/encodeTransactionData.mdx +++ /dev/null @@ -1,78 +0,0 @@ -# `encodeTransactionData` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L403) - -## Overview - -```solidity -function encodeTransactionData( - address to, - uint256 value, - bytes data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address refundReceiver, uint256 _nonce) external view returns (bytes) - -``` - -Encodes the transaction data for `execTransaction`. - -## Return value - -- **Type:** `bytes` - -Encoded transaction data. - -## Parameters - -### `to` -- **Type:** `address` - -Destination address. - -### `value` -- **Type:** `uint256` - -Ether value. - -### `data` -- **Type:** `bytes` - -Data payload. - -### `operation` -- **Type:** `enum Enum.Operation` - -Operation type. - -### `safeTxGas` -- **Type:** `uint256` - -Gas that should be used for the Safe transaction. - -### `baseGas` -- **Type:** `uint256` - -Gas costs for data used to trigger the Safe transaction. - -### `gasPrice` -- **Type:** `uint256` - -Maximum gas price that should be used for this transaction. - -### `gasToken` -- **Type:** `address` - -Token address (or 0 if ETH) that is used for the payment. - -### `refundReceiver` -- **Type:** `address` - -Address of receiver of gas payment (or 0 if tx.origin). - -### `_nonce` -- **Type:** `uint256` - -Transaction nonce. diff --git a/pages/reference-smart-account/transaction-functions/execTransaction.mdx b/pages/reference-smart-account/transaction-functions/execTransaction.mdx deleted file mode 100644 index d4a55a398..000000000 --- a/pages/reference-smart-account/transaction-functions/execTransaction.mdx +++ /dev/null @@ -1,82 +0,0 @@ -# `execTransaction` -Defined in [`Executor.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L111) - -## Overview - -```solidity -function execTransaction( - address to, - uint256 value, - bytes data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address payable refundReceiver, bytes signatures) external payable returns (bool success) - -``` - -Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `value` (Native Currency) and pays `gasPrice` * `gasLimit` in `gasToken` token to `refundReceiver`. - -*The fees are always transferred, even if the user transaction fails. This method doesn't perform any sanity check of the transaction, such as if the contract at `to` address has code or not. It is the responsibility of the caller to perform such checks.* - -This function emits the [`ExecutionSuccess`](../transaction-events/ExecutionSuccess.mdx) or [`ExecutionFailure`](../transaction-events/ExecutionFailure.mdx) events based on the transaction outcome. - -## Returns - -- **Type:** `bool` - -Boolean indicating transaction's success. - -## Parameters - -### `to` -- **Type:** `address` - -Destination address of Safe transaction. - -### `value` -- **Type:** `uint256` - -Ether value of Safe transaction. - -### `data` -- **Type:** `bytes` - -Data payload of Safe transaction. - -### `operation` -- **Type:** `Enum.Operation` - -Operation type of Safe transaction. - -### `safeTxGas` -- **Type:** `uint256` - -Gas that should be used for the Safe transaction. - -### `baseGas` -- **Type:** `uint256` - -Gas costs that are independent of the transaction execution (for example base transaction fee, signature check, payment of the refund). - -### `gasPrice` -- **Type:** `uint256` - -Gas price that should be used for the payment calculation. - -### `gasToken` -- **Type:** `address` - -Token address (or 0 if ETH) that is used for the payment. - -### `refundReceiver` -- **Type:** `address payable` - -Address of receiver of gas payment (or 0 if tx.origin). - -### `signatures` -- **Type:** `bytes` - -Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. diff --git a/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx b/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx deleted file mode 100644 index 72a71b39e..000000000 --- a/pages/reference-smart-account/transaction-functions/getTransactionHash.mdx +++ /dev/null @@ -1,78 +0,0 @@ -# `getTransactionHash` -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L436) - -## Overview - -```solidity -function getTransactionHash( - address to, - uint256 value, - bytes data, - Enum.Operation operation, - uint256 safeTxGas, - uint256 baseGas, - uint256 gasPrice, - address gasToken, - address refundReceiver, uint256 _nonce) external view returns (bytes32) - -``` - -Returns transaction hash to be signed by owners. - -## Return value - -- **Type:** `bytes32` - -Transaction hash. - -## Parameters - -### `to` -- **Type:** `address` - -Destination address. - -### `value` -- **Type:** `uint256` - -Ether value. - -### `data` -- **Type:** `bytes` - -Data payload. - -### `operation` -- **Type:** `Enum.Operation` - -Operation type. - -### `safeTxGas` -- **Type:** `uint256` - -Gas that should be used for the safe transaction. - -### `baseGas` -- **Type:** `uint256` - -Gas costs for data used to trigger the safe transaction. - -### `gasPrice` -- **Type:** `uint256` - -Maximum gas price that should be used for this transaction. - -### `gasToken` -- **Type:** `address` - -Token address (or 0 if ETH) that is used for the payment. - -### `refundReceiver` -- **Type:** `address` - -Address of receiver of gas payment (or 0 if tx.origin). - -### `_nonce` -- **Type:** `uint256` - -Transaction nonce. diff --git a/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx b/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx deleted file mode 100644 index b3f141a6f..000000000 --- a/pages/reference-smart-account/transaction-functions/simulateAndRevert.mdx +++ /dev/null @@ -1,23 +0,0 @@ -# `simulateAndRevert` -Defined in [`StorageAccessible.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/common/StorageAccessible.sol#L42) - -## Overview - -```solidity -function simulateAndRevert(address targetContract, bytes calldataPayload) external - -``` - -*Performs a `delegatecall` on a `targetContract` in the context of `self`. Internally reverts execution to avoid side effects (making it static).* - -This method reverts with data equal to `abi.encode(bool(success), bytes(response))`. Specifically, the `returndata` after a call to this method will be: `success:bool || response.length:uint256 || response:bytes`. - -## Parameters - -### `targetContract` -- **Type:** `address` - -Address of the contract containing the code to execute. - -### `calldataPayload` -- **Type:** `bytes` diff --git a/pages/reference-smart-account/transactions/_meta.json b/pages/reference-smart-account/transactions/_meta.json new file mode 100644 index 000000000..924a03b70 --- /dev/null +++ b/pages/reference-smart-account/transactions/_meta.json @@ -0,0 +1,6 @@ +{ + "encodeTransactionData": "encodeTransactionData", + "execTransaction": "execTransaction", + "getTransactionHash": "getTransactionHash", + "simulateAndRevert": "simulateAndRevert" +} diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx new file mode 100644 index 000000000..c2923a994 --- /dev/null +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -0,0 +1,255 @@ +import { Tabs } from 'nextra/components' + +# `encodeTransactionData` + +Encodes the transaction data for `execTransaction`. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function encodeTransactionData( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address refundReceiver, + uint256 _nonce + ) external view returns (bytes) + } + + function example() ... { + (ISafe safe).encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 + ) + } + ``` + + + +{/* */} + +## Returns + +- **Type:** `bytes` + +Encoded transaction data. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address. + +```solidity focus=2 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `value` +- **Type:** `uint256` + +Ether value. + +```solidity focus=3 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `data` +- **Type:** `bytes` + +Data payload. + +```solidity focus=4 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `operation` +- **Type:** `enum Enum.Operation` + +Operation type. + +```solidity focus=5 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `safeTxGas` +- **Type:** `uint256` + +Gas that should be used for the Safe transaction. + +```solidity focus=6 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `baseGas` +- **Type:** `uint256` + +Gas costs for data used to trigger the Safe transaction. + +```solidity focus=7 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `gasPrice` +- **Type:** `uint256` + +Maximum gas price that should be used for this transaction. + +```solidity focus=8 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `gasToken` +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +```solidity focus=9 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `refundReceiver` +- **Type:** `address` + +Address of receiver of gas payment (or 0 if tx.origin). + +```solidity focus=10 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` + +### `_nonce` +- **Type:** `uint256` + +Transaction nonce. + +```solidity focus=11 +encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 +) +``` diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx new file mode 100644 index 000000000..335cd238f --- /dev/null +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -0,0 +1,296 @@ +import { Tabs, Callout } from 'nextra/components' + +# `execTransaction` + +Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `value` (Native Currency) and pays `gasPrice` \* `gasLimit` in `gasToken` token to `refundReceiver`. + + + The fees are always transferred, even if the user transaction fails. This + method doesn't perform any sanity check of the transaction, such as if the + contract at `to` address has code or not. It is the responsibility of the + caller to perform such checks. + + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function execTransaction( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address payable refundReceiver, + bytes signatures + ) external payable returns (bool success) + } + + contract Example { + function example() ... { + (ISafe safe).execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." + ) + } + } + + ``` + + + + +{/* */} + +## Returns + +- **Type:** `bool` + +Boolean indicating transaction's success. + +## Parameters + +### `to` + +- **Type:** `address` + +Destination address of Safe transaction. + +```solidity focus=2 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `value` + +- **Type:** `uint256` + +Ether value of Safe transaction. + +```solidity focus=3 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `data` + +- **Type:** `bytes` + +Data payload of Safe transaction. + +```solidity focus=4 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `operation` + +- **Type:** `Enum.Operation` + +Operation type of Safe transaction. + +```solidity focus=5 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `safeTxGas` + +- **Type:** `uint256` + +Gas that should be used for the Safe transaction. + +```solidity focus=6 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `baseGas` + +- **Type:** `uint256` + +Gas costs that are independent of the transaction execution (for example base transaction fee, signature check, payment of the refund). + +```solidity focus=7 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `gasPrice` + +- **Type:** `uint256` + +Gas price that should be used for the payment calculation. + +```solidity focus=8 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `gasToken` + +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +```solidity focus=9 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `refundReceiver` + +- **Type:** `address payable` + +Address of receiver of gas payment (or 0 if tx.origin). + +```solidity focus=10 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +### `signatures` + +- **Type:** `bytes` + +Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. + +```solidity focus=11 +execTransaction( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + "0x..." +) +``` + +## Events + +### `ExecutionSuccess` + +```solidity +event ExecutionSuccess(bytes32 txHash, uint256 payment) + +``` + +Emitted when a transaction is executed successfully. + +### `ExecutionFailure` + +```solidity +event ExecutionFailure(bytes32 txHash, uint256 payment) + +``` + +Emitted when a transaction fails. diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx new file mode 100644 index 000000000..a53bf5a49 --- /dev/null +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -0,0 +1,253 @@ +# `getTransactionHash` + +Returns transaction hash to be signed by owners. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function getTransactionHash( + address to, + uint256 value, + bytes data, + Enum.Operation operation, + uint256 safeTxGas, + uint256 baseGas, + uint256 gasPrice, + address gasToken, + address refundReceiver, + uint256 _nonce + ) external view returns (bytes32) + } + + contract Example { + function example() ... { + (ISafe safe).getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 + ) + } + } + ``` + + + +## Return value + +- **Type:** `bytes32` + +Transaction hash. + +## Parameters + +### `to` +- **Type:** `address` + +Destination address. + +```solidity focus=2 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `value` +- **Type:** `uint256` + +Ether value. + +```solidity focus=3 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `data` +- **Type:** `bytes` + +Data payload. + +```solidity focus=4 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `operation` +- **Type:** `Enum.Operation` + +Operation type. + +```solidity focus=5 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `safeTxGas` +- **Type:** `uint256` + +Gas that should be used for the safe transaction. + +```solidity focus=6 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `baseGas` +- **Type:** `uint256` + +Gas costs for data used to trigger the safe transaction. + +```solidity focus=7 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `gasPrice` +- **Type:** `uint256` + +Maximum gas price that should be used for this transaction. + +```solidity focus=8 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `gasToken` +- **Type:** `address` + +Token address (or 0 if ETH) that is used for the payment. + +```solidity focus=9 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `refundReceiver` +- **Type:** `address` + +Address of receiver of gas payment (or 0 if tx.origin). + +```solidity focus=10 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` + +### `_nonce` +- **Type:** `uint256` + +Transaction nonce. + +```solidity focus=11 +getTransactionHash( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 0, + 0, + 0, + address(0), + payable(0), + 1 +) +``` diff --git a/pages/reference-smart-account/transactions/simulateAndRevert.mdx b/pages/reference-smart-account/transactions/simulateAndRevert.mdx new file mode 100644 index 000000000..a0933be49 --- /dev/null +++ b/pages/reference-smart-account/transactions/simulateAndRevert.mdx @@ -0,0 +1,59 @@ +import { Tabs } from 'nextra/components' + +# `simulateAndRevert` + +Performs a `delegatecall` on a `targetContract` in the context of `self`. Internally reverts execution to avoid side effects (making it static). + +This method reverts with data equal to `abi.encode(bool(success), bytes(response))`. Specifically, the `returndata` after a call to this method will be: `success:bool || response.length:uint256 || response:bytes`. + +## Usage + +{/* */} + + + + ```solidity + interface ISafe { + function simulateAndRevert( + address targetContract, + bytes calldata payload + ) external + } + + contract Example { + function example() ... { + (ISafe safe).simulateAndRevert("0x...", "0x...") + } + } + ``` + + + + +## Parameters + +### `targetContract` + +- **Type:** `address` + +Address of the contract containing the code to execute. + +```solidity focus=2 +simulateAndRevert( + "0x...", + "0x..." +) +``` + +### `calldataPayload` + +- **Type:** `bytes` + +Payload to be executed. + +```solidity focus=3 +simulateAndRevert( + "0x...", + "0x..." +) +``` From 13dd49796ca26f18ef650b67b295e09eccf94ce1 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:23:56 +0200 Subject: [PATCH 17/60] Various fixes --- .../fallback/fallback.mdx | 2 +- .../fallback/receive.mdx | 2 +- .../fallback/setFallbackHandler.mdx | 8 ++++++- .../owners/addOwnerWithThreshold.mdx | 24 ++++++++++--------- .../owners/getOwners.mdx | 14 ++++++++--- .../owners/removeOwner.mdx | 6 ++++- .../owners/swapOwner.mdx | 12 ++++++++-- .../utilities/getStorageAt.mdx | 3 +-- 8 files changed, 49 insertions(+), 22 deletions(-) diff --git a/pages/reference-smart-account/fallback/fallback.mdx b/pages/reference-smart-account/fallback/fallback.mdx index 1f9386c19..4d6c11e35 100644 --- a/pages/reference-smart-account/fallback/fallback.mdx +++ b/pages/reference-smart-account/fallback/fallback.mdx @@ -28,4 +28,4 @@ This function emits the [`SafeReceived`](./fallback/receive.mdx#safereceived) ev ## Events -### [`SafeReceived`](./receive.mdx#safereceived) \ No newline at end of file +### [`SafeReceived`](./receive.mdx#safereceived) diff --git a/pages/reference-smart-account/fallback/receive.mdx b/pages/reference-smart-account/fallback/receive.mdx index 9fa27aa53..894b69622 100644 --- a/pages/reference-smart-account/fallback/receive.mdx +++ b/pages/reference-smart-account/fallback/receive.mdx @@ -33,4 +33,4 @@ event SafeReceived(address sender, uint256 value) ``` -Emitted when the Safe contract receives a payment. \ No newline at end of file +Emitted when the Safe contract receives a payment. diff --git a/pages/reference-smart-account/fallback/setFallbackHandler.mdx b/pages/reference-smart-account/fallback/setFallbackHandler.mdx index 4381a8575..4af1d30d6 100644 --- a/pages/reference-smart-account/fallback/setFallbackHandler.mdx +++ b/pages/reference-smart-account/fallback/setFallbackHandler.mdx @@ -19,6 +19,12 @@ Set Fallback Handler to `handler` for the Safe. interface ISafe { function setFallbackHandler(address handler) external } + + contract Example { + function example() ... { + (ISafe safe).setFallbackHandler("0x...") + } + } ``` @@ -47,4 +53,4 @@ setFallbackHandler( event ChangedFallbackHandler(address handler) ``` -Emitted when the fallback handler is changed. \ No newline at end of file +Emitted when the fallback handler is changed. diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index 8452bb282..d958f7c7e 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -13,18 +13,18 @@ Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. ```solidity - interface ISafe { - function addOwnerWithThreshold(address owner, uint256 _threshold) external - } - - contract Example { - function example() ... { - (ISafe safe).addOwnerWithThreshold( - "0x...", - 1 - ) - } +interface ISafe { + function addOwnerWithThreshold(address owner, uint256 _threshold) external +} + +contract Example { + function example() ... { + (ISafe safe).addOwnerWithThreshold( + "0x...", + 1 + ) } +} ```` @@ -72,3 +72,5 @@ event AddedOwner(address owner) Emitted when an owner is added to the Safe. This event is also emitted in the [`swapOwner`](./swapOwner.mdx) function. + +### [`ChangedThreshold`](./changeThreshold.mdx#changedthreshold) diff --git a/pages/reference-smart-account/owners/getOwners.mdx b/pages/reference-smart-account/owners/getOwners.mdx index 61ddf6a5b..853d21448 100644 --- a/pages/reference-smart-account/owners/getOwners.mdx +++ b/pages/reference-smart-account/owners/getOwners.mdx @@ -10,12 +10,20 @@ Returns a list of Safe owners. -```solidity + ```solidity interface ISafe { function getOwners() external view returns (address[]) } -``` - + + contract Example { + function example() ... { + (ISafe safe).getOwners() + } + } + + ``` + + {/* */} diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index ea8edf04f..93a9919c3 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -16,7 +16,11 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold ```solidity interface ISafe { - function removeOwner(address prevOwner, address owner, uint256 _threshold) external + function removeOwner( + address prevOwner, + address owner, + uint256 _threshold + ) external } contract Example { diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index b8976082d..615c74b80 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -14,12 +14,20 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. ```solidity interface ISafe { - function swapOwner(address prevOwner, address oldOwner, address newOwner) external + function swapOwner( + address prevOwner, + address oldOwner, + address newOwner + ) external } contract Example { function example() … { - (ISafe safe).swapOwner("0x...", "0x...", "0x..."); + (ISafe safe).swapOwner( + "0x...", + "0x...", + "0x..." + ) } } ``` diff --git a/pages/reference-smart-account/utilities/getStorageAt.mdx b/pages/reference-smart-account/utilities/getStorageAt.mdx index 9481dfc47..d347257e6 100644 --- a/pages/reference-smart-account/utilities/getStorageAt.mdx +++ b/pages/reference-smart-account/utilities/getStorageAt.mdx @@ -52,9 +52,8 @@ getStorageAt( ) ``` -## Return Values +## Returns - **Type:** `bytes` The bytes that were read. -```` From ea0cc501860a3ef117564823429bed4a15ae4c64 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:25:29 +0200 Subject: [PATCH 18/60] Fix vale errors --- .../guards/setModuleGuard.mdx | 4 ++-- .../signatures/signedMessages.mdx | 22 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index 39c03692e..b122e9aa5 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -11,8 +11,8 @@ Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module gu Since a module guard has full power to block Safe transaction execution - initiatied via a module, a broken module guard can cause a denial of service - for the Safe modules. Make sure to carefully audit the module guard code and + initiated via a module, a broken module guard can cause a denial of service + for the Safe Modules. Make sure to carefully audit the module guard code and design recovery mechanisms. diff --git a/pages/reference-smart-account/signatures/signedMessages.mdx b/pages/reference-smart-account/signatures/signedMessages.mdx index 741b6da7b..bfed67d1f 100644 --- a/pages/reference-smart-account/signatures/signedMessages.mdx +++ b/pages/reference-smart-account/signatures/signedMessages.mdx @@ -6,23 +6,27 @@ Returns a `uint256` if the `messageHash` is signed by the owner. ## Usage +{/* */} + -```solidity -interface ISafe { - function signedMessages(bytes32 messageHash) external view returns (uint256) -} + ```solidity + interface ISafe { + function signedMessages(bytes32 messageHash) external view returns (uint256) + } -contract Example { - function example() ... { - (ISafe safe).signedMessages("0x...") + contract Example { + function example() ... { + (ISafe safe).signedMessages("0x...") + } } -} -``` + ``` +{/* */} + ## Parameters ### `messageHash` From 12eb395d2b112745228e9cf96d56365fc8c3a593 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 16:38:11 +0200 Subject: [PATCH 19/60] Fix redirections --- redirects.json | 40 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/redirects.json b/redirects.json index 99c25cd9d..a91a89bae 100644 --- a/redirects.json +++ b/redirects.json @@ -850,48 +850,28 @@ "permanent": true }, { - "source": "/reference-smart-account/owner-functions", - "destination": "/reference-smart-account/owner-functions/addOwnerWithThreshold", + "source": "/reference-smart-account/owners", + "destination": "/reference-smart-account/owners/addOwnerWithThreshold", "permanent": true }, { - "source": "/reference-smart-account/owner-events", - "destination": "/reference-smart-account/owner-events/AddedOwner", + "source": "/reference-smart-account/modules", + "destination": "/reference-smart-account/modules/enableModule", "permanent": true }, { - "source": "/reference-smart-account/module-functions", - "destination": "/reference-smart-account/module-functions/enableModule", + "source": "/reference-smart-account/signatures", + "destination": "/reference-smart-account/signatures/checkSignatures", "permanent": true }, { - "source": "/reference-smart-account/module-events", - "destination": "/reference-smart-account/module-events/ModuleEnabled", + "source": "/reference-smart-account/transactions", + "destination": "/reference-smart-account/transactions/execTransaction", "permanent": true }, { - "source": "/reference-smart-account/signature-functions", - "destination": "/reference-smart-account/signature-functions/checkSignatures", - "permanent": true - }, - { - "source": "/reference-smart-account/signature-events", - "destination": "/reference-smart-account/signature-events/ApproveHash", - "permanent": true - }, - { - "source": "/reference-smart-account/transaction-functions", - "destination": "/reference-smart-account/transaction-functions/execTransaction", - "permanent": true - }, - { - "source": "/reference-smart-account/transaction-events", - "destination": "/reference-smart-account/transaction-events/ExecutionSuccess", - "permanent": true - }, - { - "source": "/reference-smart-account/utility-functions", - "destination": "/reference-smart-account/utility-functions/getStorageAt", + "source": "/reference-smart-account/utilities", + "destination": "/reference-smart-account/utilities/getStorageAt", "permanent": true } ] \ No newline at end of file From 76bafb1b7a0c19cd80e2b1aa575cb8ee6fe9af12 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 22 Oct 2024 17:08:21 +0200 Subject: [PATCH 20/60] Fix missing imports --- .../signatures/checkSignatures.mdx | 11 ++--------- .../signatures/signedMessages.mdx | 2 +- .../transactions/getTransactionHash.mdx | 2 ++ 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index 3793c4f9e..258bc9798 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -1,13 +1,6 @@ -# `checkSignatures` - -Defined in [`Safe.sol`](https://github.com/safe-global/safe-smart-account/tree/main/contracts/Safe.sol#L270) - -## Overview +import { Tabs } from 'nextra/components' -```solidity -function checkSignatures(bytes32 dataHash, bytes signatures) public view - -``` +# `checkSignatures` Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. diff --git a/pages/reference-smart-account/signatures/signedMessages.mdx b/pages/reference-smart-account/signatures/signedMessages.mdx index bfed67d1f..4d93af9fe 100644 --- a/pages/reference-smart-account/signatures/signedMessages.mdx +++ b/pages/reference-smart-account/signatures/signedMessages.mdx @@ -1,4 +1,4 @@ -import { Tabs, Callout } from 'nextra/components' +import { Tabs } from 'nextra/components' # `signedMessages` diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index a53bf5a49..c89b848e4 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -1,3 +1,5 @@ +import { Tabs } from 'nextra/components' + # `getTransactionHash` Returns transaction hash to be signed by owners. From 6882341979d75edb55296ba386f7d373ba2e8e32 Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 24 Oct 2024 23:00:54 +0200 Subject: [PATCH 21/60] Implement requested formatting; add and remove white spaces; implement requested indentation; --- .../fallback/fallback.mdx | 4 +- .../fallback/receive.mdx | 5 +- .../fallback/setFallbackHandler.mdx | 10 +-- .../guards/setGuard.mdx | 12 ++- .../guards/setModuleGuard.mdx | 11 ++- .../modules/disableModule.mdx | 21 +++-- .../modules/enableModule.mdx | 13 ++- .../modules/execTransactionFromModule.mdx | 85 +++++++++---------- .../execTransactionFromModuleReturnData.mdx | 53 ++++++------ .../modules/getModulesPaginated.mdx | 26 +++--- .../modules/isModuleEnabled.mdx | 18 ++-- .../owners/addOwnerWithThreshold.mdx | 37 ++++---- .../owners/changeThreshold.mdx | 23 +++-- .../owners/getOwners.mdx | 6 +- .../owners/getThreshold.mdx | 5 +- .../owners/isOwner.mdx | 11 ++- .../owners/removeOwner.mdx | 22 +++-- .../owners/swapOwner.mdx | 17 ++-- .../setup/domainSeparator.mdx | 5 +- pages/reference-smart-account/setup/setup.mdx | 20 ++--- .../signatures/approveHash.mdx | 15 ++-- .../signatures/checkNSignatures.mdx | 21 +++-- .../signatures/checkSignatures.mdx | 13 ++- .../signatures/signedMessages.mdx | 8 +- .../transactions/encodeTransactionData.mdx | 44 +++++----- .../transactions/execTransaction.mdx | 52 ++++++------ .../transactions/getTransactionHash.mdx | 44 +++++----- .../transactions/simulateAndRevert.mdx | 13 ++- .../utilities/getStorageAt.mdx | 17 ++-- 29 files changed, 295 insertions(+), 336 deletions(-) diff --git a/pages/reference-smart-account/fallback/fallback.mdx b/pages/reference-smart-account/fallback/fallback.mdx index 4d6c11e35..e77196016 100644 --- a/pages/reference-smart-account/fallback/fallback.mdx +++ b/pages/reference-smart-account/fallback/fallback.mdx @@ -12,12 +12,12 @@ This function emits the [`SafeReceived`](./fallback/receive.mdx#safereceived) ev ```solidity interface ISafe { - fallback() external + fallback() external; } contract Example { function example() ... { - (ISafe safe).fallback() + (ISafe safe).fallback(); } } ``` diff --git a/pages/reference-smart-account/fallback/receive.mdx b/pages/reference-smart-account/fallback/receive.mdx index 894b69622..f40aa0916 100644 --- a/pages/reference-smart-account/fallback/receive.mdx +++ b/pages/reference-smart-account/fallback/receive.mdx @@ -12,12 +12,12 @@ Receive function accepts native currency transactions. ```solidity interface ISafe { - receive() external payable + receive() external payable; } contract Example { function example() ... { - (ISafe safe).receive() + (ISafe safe).receive(); } } ``` @@ -30,7 +30,6 @@ Receive function accepts native currency transactions. ```solidity event SafeReceived(address sender, uint256 value) - ``` Emitted when the Safe contract receives a payment. diff --git a/pages/reference-smart-account/fallback/setFallbackHandler.mdx b/pages/reference-smart-account/fallback/setFallbackHandler.mdx index 4af1d30d6..534286f44 100644 --- a/pages/reference-smart-account/fallback/setFallbackHandler.mdx +++ b/pages/reference-smart-account/fallback/setFallbackHandler.mdx @@ -17,12 +17,12 @@ Set Fallback Handler to `handler` for the Safe. ```solidity interface ISafe { - function setFallbackHandler(address handler) external + function setFallbackHandler(address handler) external; } contract Example { function example() ... { - (ISafe safe).setFallbackHandler("0x...") + (ISafe safe).setFallbackHandler("0x..."); } } ``` @@ -40,9 +40,9 @@ Set Fallback Handler to `handler` for the Safe. Contract to handle fallback calls. ```solidity focus=2 -setFallbackHandler( +(ISafe safe).setFallbackHandler( "0x..." -) +); ``` ## Events @@ -50,7 +50,7 @@ setFallbackHandler( ### `ChangedFallbackHandler` ```solidity -event ChangedFallbackHandler(address handler) +event ChangedFallbackHandler(address handler); ``` Emitted when the fallback handler is changed. diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index 38471c1fa..8013d6f94 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -19,16 +19,15 @@ Set Transaction Guard `guard` that checks transactions before execution. ```solidity interface ISafe { - function setGuard(address guard) external + function setGuard(address guard) external; } contract Example { function example() ... { - (ISafe safe).setGuard("0x...") + (ISafe safe).setGuard("0x..."); } } ``` - @@ -41,8 +40,8 @@ Set Transaction Guard `guard` that checks transactions before execution. The address of the guard to be used or the 0 address to disable the guard. ```solidity focus=2 -setGuard( - "0x..." +(ISafe safe).setGuard( + "0x..." ) ``` @@ -51,8 +50,7 @@ setGuard( ### `ChangedGuard` ```solidity -event ChangedGuard(address guard) - +event ChangedGuard(address guard); ``` Emitted when a guard is set for the Safe. diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index b122e9aa5..1c2b50ea1 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -24,12 +24,12 @@ Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module gu ```solidity interface ISafe { - function setModuleGuard(address moduleGuard) external + function setModuleGuard(address moduleGuard) external; } contract Example { function example() ... { - (ISafe safe).setModuleGuard("0x...") + (ISafe safe).setModuleGuard("0x..."); } } ``` @@ -47,8 +47,8 @@ Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module gu The address of the module guard to be used or the zero address to disable the module guard. ```solidity focus=2 -setModuleGuard( - "0x..." +(ISafe safe).setModuleGuard( + "0x..." ) ``` @@ -57,8 +57,7 @@ setModuleGuard( ### `ChangedModuleGuard` ```solidity -event ChangedModuleGuard(address moduleGuard) - +event ChangedModuleGuard(address moduleGuard); ``` Emitted when a module guard is set for the Safe. diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx index a833ad4da..bd81c6f22 100644 --- a/pages/reference-smart-account/modules/disableModule.mdx +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -13,13 +13,13 @@ Disables the module `module` for the Safe. ```solidity - interface IModuleManager { - function disableModule(address prevModule, address module) external + interface ISafe { + function disableModule(address prevModule, address module) external; } contract Example { function example() ... { - (IModuleManager moduleManager).disableModule("0x...", "0x...") + (ISafe safe).disableModule("0x...", "0x..."); } } ``` @@ -37,9 +37,9 @@ Disables the module `module` for the Safe. Previous module in the modules linked list. ```solidity focus=2 -disableModule( - "0x...", - "0x..." +(ISafe safe).disableModule( + "0x...", + "0x..." ) ``` @@ -50,9 +50,9 @@ disableModule( Module to be removed. ```solidity focus=3 -disableModule( - "0x...", - "0x..." +(ISafe safe).disableModule( + "0x...", + "0x..." ) ``` @@ -61,8 +61,7 @@ disableModule( ### `DisabledModule` ```solidity -event DisabledModule(address module) - +event DisabledModule(address module); ``` Emitted when a module is disabled for the Safe. diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index f1514b536..db6fe102c 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -13,13 +13,13 @@ Enables the module `module` for the Safe. ```solidity - interface IModuleManager { - function enableModule(address module) external + interface ISafe { + function enableModule(address module) external; } contract Example { function example() ... { - (IModuleManager moduleManager).enableModule("0x...") + (ISafe safe).enableModule("0x..."); } } ``` @@ -37,8 +37,8 @@ Enables the module `module` for the Safe. Module to be whitelisted. ```solidity focus=2 -enableModule( - "0x..." +(ISafe safe).enableModule( + "0x..." ) ``` @@ -47,8 +47,7 @@ enableModule( ### `EnabledModule` ```solidity -event EnabledModule(address module) - +event EnabledModule(address module); ``` Emitted when a module is enabled for the Safe. diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index 664752539..7bddc68f6 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -17,28 +17,26 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Toke ```solidity interface ISafe { - function execTransactionFromModule( - address to, - uint256 value, - bytes data, - enum Enum.Operation operation - ) external returns (bool success) + function execTransactionFromModule( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation + ) external returns (bool success); } contract Example { - function example() … { - (ISafe safe).execTransactionFromModule( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call - ) - } + function example() … { + (ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call + ); + } } - ``` - - + {/* */} @@ -60,12 +58,12 @@ Boolean flag indicating if the call succeeded. Destination address of module transaction. ```solidity focus=2 -execTransactionFromModule( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `value` @@ -75,12 +73,12 @@ execTransactionFromModule( Ether value of module transaction. ```solidity focus=3 -execTransactionFromModule( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `data` @@ -90,12 +88,12 @@ execTransactionFromModule( Data payload of module transaction. ```solidity focus=4 -execTransactionFromModule( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `operation` @@ -105,12 +103,12 @@ execTransactionFromModule( Operation type of module transaction. ```solidity focus=5 -execTransactionFromModule( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModule( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ## Events @@ -118,15 +116,14 @@ execTransactionFromModule( ### `ExecutionFromModuleSuccess` ```solidity -event ExecutionFromModuleSuccess(address to, uint256 value, bytes data) +event ExecutionFromModuleSuccess(address to, uint256 value, bytes data); ``` Emitted when a transaction executed by a module succeeds. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulesuccess) function. ### `ExecutionFromModuleFailure` ```solidity -event ExecutionFromModuleFailure(address module) - +event ExecutionFromModuleFailure(address module); ``` Emitted when a transaction executed by a module fails. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulefailure) function. diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index 8937eeebc..4d930f1ec 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -17,7 +17,7 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Toke uint256 value, bytes data, enum Enum.Operation operation - ) external returns (bool success, bytes returnData) + ) external returns (bool success, bytes returnData); } contract Example { @@ -27,11 +27,10 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Toke "0x...", "0x...", Enum.Operation.Call - ) + ); } } ``` - @@ -60,12 +59,12 @@ Data returned by the call. Destination address of module transaction. ```solidity focus=2 -execTransactionFromModuleReturnData( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `value` @@ -75,12 +74,12 @@ execTransactionFromModuleReturnData( Ether value of module transaction. ```solidity focus=3 -execTransactionFromModuleReturnData( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `data` @@ -90,12 +89,12 @@ execTransactionFromModuleReturnData( Data payload of module transaction. ```solidity focus=4 -execTransactionFromModuleReturnData( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ### `operation` @@ -105,12 +104,12 @@ execTransactionFromModuleReturnData( Operation type of module transaction. ```solidity focus=5 -execTransactionFromModuleReturnData( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call -) +(ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call +); ``` ## Events diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index decd9d259..af75051ed 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -11,20 +11,16 @@ Returns an array of modules. If all entries fit into a single page, the next poi ```solidity - interface IModuleManager { - function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next) + interface ISafe { + function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next); } contract Example { function example() … { - (IModuleManager moduleManager).getModulesPaginated( - "0x...", - "0x..." - ) + (ISafe safe).getModulesPaginated("0x...", "0x..."); } } ``` - @@ -53,10 +49,10 @@ Start of the next page. Start of the page. Has to be a module or start pointer (0x1 address). ```solidity focus=2 -getModulesPaginated( - "0x...", - "0x..." -) +(ISafe safe).getModulesPaginated( + "0x...", + "0x..." +); ``` ### `pageSize` @@ -66,8 +62,8 @@ getModulesPaginated( Maximum number of modules that should be returned. Has to be > 0. ```solidity focus=3 -getModulesPaginated( - "0x...", - "0x..." -) +(ISafe safe).getModulesPaginated( + "0x...", + "0x..." +); ``` diff --git a/pages/reference-smart-account/modules/isModuleEnabled.mdx b/pages/reference-smart-account/modules/isModuleEnabled.mdx index 6a49a9c24..f5bfec25f 100644 --- a/pages/reference-smart-account/modules/isModuleEnabled.mdx +++ b/pages/reference-smart-account/modules/isModuleEnabled.mdx @@ -11,14 +11,14 @@ Returns if an module is enabled. ```solidity - interface IModuleManager { - function isModuleEnabled(address module) external view returns (bool) + interface ISafe { + function isModuleEnabled(address module) external view returns (bool); } contract Example { - function example() … { - (IModuleManager moduleManager).isModuleEnabled("0x...") - } + function example() … { + (ISafe safe).isModuleEnabled("0x..."); + } } ``` @@ -27,6 +27,7 @@ Returns if an module is enabled. ## Returns ### `isModuleEnabled` + - **Type:** `bool` Boolean flag indicating if the module is enabled. @@ -34,12 +35,13 @@ Boolean flag indicating if the module is enabled. ## Parameters ### `module` + - **Type:** `address` Address of the module. ```solidity focus=2 -isModuleEnabled( - "0x..." -) +(ISafe safe).isModuleEnabled( + "0x..." +); ``` diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index d958f7c7e..5cb96b807 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -12,22 +12,18 @@ Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. -```solidity -interface ISafe { - function addOwnerWithThreshold(address owner, uint256 _threshold) external -} - -contract Example { - function example() ... { - (ISafe safe).addOwnerWithThreshold( - "0x...", - 1 - ) + ```solidity + interface ISafe { + function addOwnerWithThreshold(address owner, uint256 _threshold) external; } -} -```` - + contract Example { + function example() ... { + (ISafe safe).addOwnerWithThreshold("0x...", 1); + } + } + ``` + {/* */} @@ -41,11 +37,11 @@ contract Example { New owner address. ```solidity focus=2 -addOwnerWithThreshold( +(ISafe safe).addOwnerWithThreshold( "0x...", 1 -) -```` +); +``` ### `_threshold` @@ -54,10 +50,10 @@ addOwnerWithThreshold( New threshold. ```solidity focus=3 -addOwnerWithThreshold( +(ISafe safe).addOwnerWithThreshold( "0x...", 1 -) +); ``` ## Events @@ -65,8 +61,7 @@ addOwnerWithThreshold( ### `AddedOwner` ```solidity -event AddedOwner(address owner) - +event AddedOwner(address owner); ``` Emitted when an owner is added to the Safe. diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index 92fe3e0bc..a54f7ab4a 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -12,21 +12,18 @@ Changes the threshold of the Safe to `_threshold`. -```solidity + ```solidity interface ISafe { - function changeThreshold(uint256 _threshold) external + function changeThreshold(uint256 _threshold) external; } contract Example { function example() ... { - (ISafe safe).changeThreshold( - 1 - ) + (ISafe safe).changeThreshold(1); } } - -```` - + ``` + {/* */} @@ -34,23 +31,23 @@ Changes the threshold of the Safe to `_threshold`. ## Parameters ### `_threshold` + - **Type:** `uint256` New threshold. ```solidity focus=2 -changeThreshold( +(ISafe safe).changeThreshold( 1 -) -```` +); +``` ## Events ### `ChangedThreshold` ```solidity -event ChangedThreshold(uint256 threshold) - +event ChangedThreshold(uint256 threshold); ``` Emitted when the threshold for confirmations is changed. diff --git a/pages/reference-smart-account/owners/getOwners.mdx b/pages/reference-smart-account/owners/getOwners.mdx index 853d21448..aa6edc86f 100644 --- a/pages/reference-smart-account/owners/getOwners.mdx +++ b/pages/reference-smart-account/owners/getOwners.mdx @@ -12,17 +12,15 @@ Returns a list of Safe owners. ```solidity interface ISafe { - function getOwners() external view returns (address[]) + function getOwners() external view returns (address[]); } contract Example { function example() ... { - (ISafe safe).getOwners() + (ISafe safe).getOwners(); } } - ``` - diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx index d2d72a2fa..11898be5e 100644 --- a/pages/reference-smart-account/owners/getThreshold.mdx +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -12,16 +12,15 @@ Returns the number of required confirmations for a Safe transaction aka the thre ```solidity interface ISafe { - function getThreshold() external view returns (uint256) + function getThreshold() external view returns (uint256); } contract Example { function example() ... { - (uint256 threshold) = (ISafe safe).getThreshold(); // 1 + (uint256 threshold) = (ISafe safe).getThreshold(); } } ``` - diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index bf0ff7d5e..ac91e9359 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -12,16 +12,15 @@ Returns if `owner` is an owner of the Safe. ```solidity interface ISafe { - function isOwner(address owner) external view returns (bool) + function isOwner(address owner) external view returns (bool); } contract Example { function example() … { - (bool isOwner) = (ISafe safe).isOwner("0x..."); // true + (bool isOwner) = (ISafe safe).isOwner("0x..."); } } ``` - @@ -44,7 +43,7 @@ Boolean flag indicating if `owner` is an owner of the Safe. Owner address. ```solidity focus=2 -isOwner( - "0x..." -) +(ISafe safe).isOwner( + "0x..." +); ``` diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 93a9919c3..131bc2e73 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -20,7 +20,7 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold address prevOwner, address owner, uint256 _threshold - ) external + ) external; } contract Example { @@ -29,12 +29,11 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold "0x...", "0x...", 1 - ) + ); } } ``` - - + {/* */} @@ -48,11 +47,11 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold Owner that pointed to the owner to be removed in the linked list ```solidity focus=2 -removeOwner( +(ISafe safe).removeOwner( "0x...", "0x...", 1 -) +); ``` ### `owner` @@ -62,11 +61,11 @@ removeOwner( Owner address to be removed. ```solidity focus=3 -removeOwner( +(ISafe safe).removeOwner( "0x...", "0x...", 1 -) +); ``` ### `_threshold` @@ -76,11 +75,11 @@ removeOwner( New threshold. ```solidity focus=4 -removeOwner( +(ISafe safe).removeOwner( "0x...", "0x...", 1 -) +); ``` ## Events @@ -88,8 +87,7 @@ removeOwner( ### `RemovedOwner` ```solidity -event RemovedOwner(address owner) - +event RemovedOwner(address owner); ``` Emitted when an owner is removed from the Safe. diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index 615c74b80..087c2f372 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -18,7 +18,7 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. address prevOwner, address oldOwner, address newOwner - ) external + ) external; } contract Example { @@ -27,11 +27,10 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. "0x...", "0x...", "0x..." - ) + ); } } ``` - @@ -46,11 +45,11 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. Owner that pointed to the owner to be replaced in the linked list ```solidity focus=2 -swapOwner( +(ISafe safe).swapOwner( "0x...", "0x...", "0x..." -) +); ``` ### `oldOwner` @@ -60,11 +59,11 @@ swapOwner( Owner address to be replaced. ```solidity focus=3 -swapOwner( +(ISafe safe).swapOwner( "0x...", "0x...", "0x..." -) +); ``` ### `newOwner` @@ -74,11 +73,11 @@ swapOwner( New owner address. ```solidity focus=4 -swapOwner( +(ISafe safe).swapOwner( "0x...", "0x...", "0x..." -) +); ``` ## Events diff --git a/pages/reference-smart-account/setup/domainSeparator.mdx b/pages/reference-smart-account/setup/domainSeparator.mdx index f823457b9..e3e27d252 100644 --- a/pages/reference-smart-account/setup/domainSeparator.mdx +++ b/pages/reference-smart-account/setup/domainSeparator.mdx @@ -12,16 +12,15 @@ Returns the domain separator for this contract, as defined in the EIP-712 standa ```solidity interface ISafe { - function domainSeparator() external view returns (bytes32) + function domainSeparator() external view returns (bytes32); } contract Example { function example() … { - (ISafe safe).domainSeparator() + (ISafe safe).domainSeparator(); } } ``` - diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx index 036888240..31361e547 100644 --- a/pages/reference-smart-account/setup/setup.mdx +++ b/pages/reference-smart-account/setup/setup.mdx @@ -19,16 +19,16 @@ Sets an initial storage of the Safe contract. interface ISafe { function setup( address[] _owners, - uint256 _threshold, - ) external + uint256 _threshold + ) external; } + contract Example { function example() ... { - (ISafe safe).setup([owner1, owner2], 1) + (ISafe safe).setup([owner1, owner2], 1); + } } - ``` - @@ -43,10 +43,10 @@ Sets an initial storage of the Safe contract. List of Safe owners. ```solidity focus=2 -setup( +(ISafe safe).setup( [owner1, owner2], 1 -) +); ``` ### `_threshold` @@ -56,10 +56,10 @@ setup( Number of required confirmations for a Safe transaction. ```solidity focus=3 -setup( +(ISafe safe).setup( [owner1, owner2], 1 -) +); ``` ## Events @@ -73,7 +73,7 @@ event SafeSetup( uint256 threshold, address initializer, address fallbackHandler -) +); ``` Emitted when the Safe is set up. diff --git a/pages/reference-smart-account/signatures/approveHash.mdx b/pages/reference-smart-account/signatures/approveHash.mdx index 11b1d4a5b..d50bde327 100644 --- a/pages/reference-smart-account/signatures/approveHash.mdx +++ b/pages/reference-smart-account/signatures/approveHash.mdx @@ -16,17 +16,15 @@ Marks hash `hashToApprove` as approved. - ```solidity interface ISafe { - function approveHash(bytes32 hashToApprove) external + function approveHash(bytes32 hashToApprove) external; } function example() ... { - (ISafe safe).approveHash("0x...") + (ISafe safe).approveHash("0x..."); } ``` - @@ -41,9 +39,9 @@ Marks hash `hashToApprove` as approved. The hash to mark as approved for signatures that are verified by this contract. ```solidity focus=2 -approveHash( - "0x..." -) +(ISafe safe).approveHash( + "0x..." +); ``` ## Events @@ -51,8 +49,7 @@ approveHash( ### `ApproveHash` ```solidity -event ApproveHash(bytes32 approvedHash, address owner) - +event ApproveHash(bytes32 approvedHash, address owner); ``` Emitted when a hash is approved by an owner. diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 5584d372b..1783f8d85 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -21,7 +21,7 @@ Checks whether the signature provided is valid for the provided data and hash. R bytes32 dataHash, bytes signatures, uint256 requiredSignatures - ) external view + ) external view; } function example() ... { @@ -30,10 +30,9 @@ Checks whether the signature provided is valid for the provided data and hash. R "0x...", "0x...", 1 - ) + ); } ``` - @@ -53,12 +52,12 @@ Address that executing the transaction. ```solidity focus=2 -checkNSignatures( +(ISafe safe).checkNSignatures( "0x...", "0x...", "0x...", 1 -) +); ``` ### `dataHash` @@ -68,12 +67,12 @@ checkNSignatures( Hash of the data (could be either a message hash or transaction hash). ```solidity focus=3 -checkNSignatures( +(ISafe safe).checkNSignatures( "0x...", "0x...", "0x...", 1 -) +); ``` ### `signatures` @@ -83,12 +82,12 @@ checkNSignatures( Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. ```solidity focus=4 -checkNSignatures( +(ISafe safe).checkNSignatures( "0x...", "0x...", "0x...", 1 -) +); ``` ### `requiredSignatures` @@ -98,10 +97,10 @@ checkNSignatures( Amount of required valid signatures. ```solidity focus=5 -checkNSignatures( +(ISafe safe).checkNSignatures( "0x...", "0x...", "0x...", 1 -) +); ``` diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index 258bc9798..335079134 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -15,17 +15,16 @@ Checks whether the signature provided is valid for the provided data and hash. R function checkSignatures( bytes32 dataHash, bytes signatures - ) external view + ) external view; } function example() ... { (ISafe safe).checkSignatures( "0x...", "0x..." - ) + ); } ``` - @@ -40,10 +39,10 @@ Checks whether the signature provided is valid for the provided data and hash. R Hash of the data (could be either a message hash or transaction hash). ```solidity focus=2 -checkSignatures( +(ISafe safe).checkSignatures( "0x...", "0x..." -) +); ``` ### `signatures` @@ -53,8 +52,8 @@ checkSignatures( Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. ```solidity focus=3 -checkSignatures( +(ISafe safe).checkSignatures( "0x...", "0x..." -) +); ``` diff --git a/pages/reference-smart-account/signatures/signedMessages.mdx b/pages/reference-smart-account/signatures/signedMessages.mdx index 4d93af9fe..f001f9f0c 100644 --- a/pages/reference-smart-account/signatures/signedMessages.mdx +++ b/pages/reference-smart-account/signatures/signedMessages.mdx @@ -12,16 +12,15 @@ Returns a `uint256` if the `messageHash` is signed by the owner. ```solidity interface ISafe { - function signedMessages(bytes32 messageHash) external view returns (uint256) + function signedMessages(bytes32 messageHash) external view returns (uint256); } contract Example { function example() ... { - (ISafe safe).signedMessages("0x...") + (ISafe safe).signedMessages("0x..."); } } ``` - @@ -46,8 +45,7 @@ Number denoting if an owner signed the hash. ### `SignMsg` ```solidity -event SignMsg(bytes32 msgHash) - +event SignMsg(bytes32 msgHash); ``` Emitted when a message is signed by an owner. diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index c2923a994..31b0e9083 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -23,7 +23,7 @@ Encodes the transaction data for `execTransaction`. address gasToken, address refundReceiver, uint256 _nonce - ) external view returns (bytes) + ) external view returns (bytes); } function example() ... { @@ -38,7 +38,7 @@ Encodes the transaction data for `execTransaction`. "0x...", "0x...", 1 - ) + ); } ``` @@ -60,7 +60,7 @@ Encoded transaction data. Destination address. ```solidity focus=2 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -71,7 +71,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `value` @@ -80,7 +80,7 @@ encodeTransactionData( Ether value. ```solidity focus=3 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -91,7 +91,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `data` @@ -100,7 +100,7 @@ encodeTransactionData( Data payload. ```solidity focus=4 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -111,7 +111,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `operation` @@ -120,7 +120,7 @@ encodeTransactionData( Operation type. ```solidity focus=5 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -131,7 +131,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `safeTxGas` @@ -140,7 +140,7 @@ encodeTransactionData( Gas that should be used for the Safe transaction. ```solidity focus=6 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -151,7 +151,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `baseGas` @@ -160,7 +160,7 @@ encodeTransactionData( Gas costs for data used to trigger the Safe transaction. ```solidity focus=7 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -171,7 +171,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `gasPrice` @@ -180,7 +180,7 @@ encodeTransactionData( Maximum gas price that should be used for this transaction. ```solidity focus=8 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -191,7 +191,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `gasToken` @@ -200,7 +200,7 @@ encodeTransactionData( Token address (or 0 if ETH) that is used for the payment. ```solidity focus=9 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -211,7 +211,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `refundReceiver` @@ -220,7 +220,7 @@ encodeTransactionData( Address of receiver of gas payment (or 0 if tx.origin). ```solidity focus=10 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -231,7 +231,7 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` ### `_nonce` @@ -240,7 +240,7 @@ encodeTransactionData( Transaction nonce. ```solidity focus=11 -encodeTransactionData( +(ISafe safe).encodeTransactionData( "0x...", 0, "0x...", @@ -251,5 +251,5 @@ encodeTransactionData( "0x...", "0x...", 1 -) +); ``` diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index 335cd238f..40f95cca6 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -30,7 +30,7 @@ Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `val address gasToken, address payable refundReceiver, bytes signatures - ) external payable returns (bool success) + ) external payable returns (bool success); } contract Example { @@ -46,12 +46,10 @@ Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `val address(0), payable(0), "0x..." - ) + ); } } - ``` - @@ -72,7 +70,7 @@ Boolean indicating transaction's success. Destination address of Safe transaction. ```solidity focus=2 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -83,7 +81,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `value` @@ -93,7 +91,7 @@ execTransaction( Ether value of Safe transaction. ```solidity focus=3 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -104,7 +102,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `data` @@ -114,7 +112,7 @@ execTransaction( Data payload of Safe transaction. ```solidity focus=4 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -125,7 +123,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `operation` @@ -135,7 +133,7 @@ execTransaction( Operation type of Safe transaction. ```solidity focus=5 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -146,7 +144,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `safeTxGas` @@ -156,7 +154,7 @@ execTransaction( Gas that should be used for the Safe transaction. ```solidity focus=6 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -167,7 +165,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `baseGas` @@ -177,7 +175,7 @@ execTransaction( Gas costs that are independent of the transaction execution (for example base transaction fee, signature check, payment of the refund). ```solidity focus=7 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -188,7 +186,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `gasPrice` @@ -198,7 +196,7 @@ execTransaction( Gas price that should be used for the payment calculation. ```solidity focus=8 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -209,7 +207,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `gasToken` @@ -219,7 +217,7 @@ execTransaction( Token address (or 0 if ETH) that is used for the payment. ```solidity focus=9 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -230,7 +228,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `refundReceiver` @@ -240,7 +238,7 @@ execTransaction( Address of receiver of gas payment (or 0 if tx.origin). ```solidity focus=10 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -251,7 +249,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ### `signatures` @@ -261,7 +259,7 @@ execTransaction( Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. ```solidity focus=11 -execTransaction( +(ISafe safe).execTransaction( "0x...", 0, "0x...", @@ -272,7 +270,7 @@ execTransaction( address(0), payable(0), "0x..." -) +); ``` ## Events @@ -280,8 +278,7 @@ execTransaction( ### `ExecutionSuccess` ```solidity -event ExecutionSuccess(bytes32 txHash, uint256 payment) - +event ExecutionSuccess(bytes32 txHash, uint256 payment); ``` Emitted when a transaction is executed successfully. @@ -289,8 +286,7 @@ Emitted when a transaction is executed successfully. ### `ExecutionFailure` ```solidity -event ExecutionFailure(bytes32 txHash, uint256 payment) - +event ExecutionFailure(bytes32 txHash, uint256 payment); ``` Emitted when a transaction fails. diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index c89b848e4..9f3c1c2fe 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -23,7 +23,7 @@ Returns transaction hash to be signed by owners. address gasToken, address refundReceiver, uint256 _nonce - ) external view returns (bytes32) + ) external view returns (bytes32); } contract Example { @@ -39,7 +39,7 @@ Returns transaction hash to be signed by owners. address(0), payable(0), 1 - ) + ); } } ``` @@ -60,7 +60,7 @@ Transaction hash. Destination address. ```solidity focus=2 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -71,7 +71,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `value` @@ -80,7 +80,7 @@ getTransactionHash( Ether value. ```solidity focus=3 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -91,7 +91,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `data` @@ -100,7 +100,7 @@ getTransactionHash( Data payload. ```solidity focus=4 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -111,7 +111,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `operation` @@ -120,7 +120,7 @@ getTransactionHash( Operation type. ```solidity focus=5 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -131,7 +131,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `safeTxGas` @@ -140,7 +140,7 @@ getTransactionHash( Gas that should be used for the safe transaction. ```solidity focus=6 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -151,7 +151,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `baseGas` @@ -160,7 +160,7 @@ getTransactionHash( Gas costs for data used to trigger the safe transaction. ```solidity focus=7 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -171,7 +171,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `gasPrice` @@ -180,7 +180,7 @@ getTransactionHash( Maximum gas price that should be used for this transaction. ```solidity focus=8 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -191,7 +191,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `gasToken` @@ -200,7 +200,7 @@ getTransactionHash( Token address (or 0 if ETH) that is used for the payment. ```solidity focus=9 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -211,7 +211,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `refundReceiver` @@ -220,7 +220,7 @@ getTransactionHash( Address of receiver of gas payment (or 0 if tx.origin). ```solidity focus=10 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -231,7 +231,7 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` ### `_nonce` @@ -240,7 +240,7 @@ getTransactionHash( Transaction nonce. ```solidity focus=11 -getTransactionHash( +(ISafe safe).getTransactionHash( "0x...", 0, "0x...", @@ -251,5 +251,5 @@ getTransactionHash( address(0), payable(0), 1 -) +); ``` diff --git a/pages/reference-smart-account/transactions/simulateAndRevert.mdx b/pages/reference-smart-account/transactions/simulateAndRevert.mdx index a0933be49..4b14a5294 100644 --- a/pages/reference-smart-account/transactions/simulateAndRevert.mdx +++ b/pages/reference-smart-account/transactions/simulateAndRevert.mdx @@ -17,16 +17,15 @@ This method reverts with data equal to `abi.encode(bool(success), bytes(response function simulateAndRevert( address targetContract, bytes calldata payload - ) external + ) external; } contract Example { function example() ... { - (ISafe safe).simulateAndRevert("0x...", "0x...") + (ISafe safe).simulateAndRevert("0x...", "0x..."); } } ``` - @@ -39,10 +38,10 @@ This method reverts with data equal to `abi.encode(bool(success), bytes(response Address of the contract containing the code to execute. ```solidity focus=2 -simulateAndRevert( +(ISafe safe).simulateAndRevert( "0x...", "0x..." -) +); ``` ### `calldataPayload` @@ -52,8 +51,8 @@ simulateAndRevert( Payload to be executed. ```solidity focus=3 -simulateAndRevert( +(ISafe safe).simulateAndRevert( "0x...", "0x..." -) +); ``` diff --git a/pages/reference-smart-account/utilities/getStorageAt.mdx b/pages/reference-smart-account/utilities/getStorageAt.mdx index d347257e6..c8af50f79 100644 --- a/pages/reference-smart-account/utilities/getStorageAt.mdx +++ b/pages/reference-smart-account/utilities/getStorageAt.mdx @@ -10,18 +10,17 @@ Reads `length` bytes of storage in the currents contract. -```solidity + ```solidity interface ISafe { - function getStorageAt(uint256 offset, uint256 length) external view returns (bytes) + function getStorageAt(uint256 offset, uint256 length) external view returns (bytes); } contract Example { function example() ... { - (ISafe safe).getStorageAt(0, 1) + (ISafe safe).getStorageAt(0, 1); } } - -``` + ``` @@ -33,10 +32,10 @@ Reads `length` bytes of storage in the currents contract. The offset in the current contract's storage in words to start reading from. ```solidity focus=2 -getStorageAt( +(ISafe safe).getStorageAt( 0, 1 -) +); ``` ### `length` @@ -46,10 +45,10 @@ getStorageAt( The number of words (32 bytes) of data to read. ```solidity focus=3 -getStorageAt( +(ISafe safe).getStorageAt( 0, 1 -) +); ``` ## Returns From 5fb01f384566dd4decee171ba5d48e8c8bfd09e8 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 10:21:16 +0200 Subject: [PATCH 22/60] Implement requested indentation; --- .../guards/setGuard.mdx | 4 +- .../guards/setModuleGuard.mdx | 4 +- .../modules/disableModule.mdx | 6 +-- .../modules/enableModule.mdx | 4 +- .../execTransactionFromModuleReturnData.mdx | 28 +++++------ .../modules/getModulesPaginated.mdx | 11 ++-- .../owners/addOwnerWithThreshold.mdx | 2 +- .../owners/changeThreshold.mdx | 2 +- .../owners/removeOwner.mdx | 2 +- .../owners/swapOwner.mdx | 2 +- pages/reference-smart-account/setup/setup.mdx | 4 +- .../signatures/approveHash.mdx | 6 ++- .../signatures/checkNSignatures.mdx | 13 +++-- .../signatures/checkSignatures.mdx | 8 +-- .../transactions/encodeTransactionData.mdx | 28 ++++++----- .../transactions/execTransaction.mdx | 50 +++++++++---------- .../transactions/getTransactionHash.mdx | 34 ++++++++----- redirects.json | 5 ++ 18 files changed, 120 insertions(+), 93 deletions(-) diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index 8013d6f94..693535501 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Set Transaction Guard `guard` that checks transactions before execution. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. Since a guard has full power to block Safe transaction execution, a broken guard can cause a denial of service for the Safe. Make sure to carefully audit @@ -42,7 +42,7 @@ The address of the guard to be used or the 0 address to disable the guard. ```solidity focus=2 (ISafe safe).setGuard( "0x..." -) +); ``` ## Events diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index 1c2b50ea1..39e3e1b14 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -6,7 +6,7 @@ Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module gu Set a module guard that checks transactions initiated by the module before - execution This can only be done via a Safe transaction. + execution This action can only be done via a Safe transaction. @@ -49,7 +49,7 @@ The address of the module guard to be used or the zero address to disable the mo ```solidity focus=2 (ISafe safe).setModuleGuard( "0x..." -) +); ``` ## Events diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx index bd81c6f22..3940bc005 100644 --- a/pages/reference-smart-account/modules/disableModule.mdx +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Disables the module `module` for the Safe. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage @@ -40,7 +40,7 @@ Previous module in the modules linked list. (ISafe safe).disableModule( "0x...", "0x..." -) +); ``` ### `module` @@ -53,7 +53,7 @@ Module to be removed. (ISafe safe).disableModule( "0x...", "0x..." -) +); ``` ## Events diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index db6fe102c..9e94ca265 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Enables the module `module` for the Safe. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage @@ -39,7 +39,7 @@ Module to be whitelisted. ```solidity focus=2 (ISafe safe).enableModule( "0x..." -) +); ``` ## Events diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index 4d930f1ec..d767f6a53 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -12,23 +12,23 @@ Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Toke ```solidity interface ISafe { - function execTransactionFromModuleReturnData( - address to, - uint256 value, - bytes data, - enum Enum.Operation operation - ) external returns (bool success, bytes returnData); + function execTransactionFromModuleReturnData( + address to, + uint256 value, + bytes data, + enum Enum.Operation operation + ) external returns (bool success, bytes returnData); } contract Example { - function example() … { - (ISafe safe).execTransactionFromModuleReturnData( - "0x...", - "0x...", - "0x...", - Enum.Operation.Call - ); - } + function example() … { + (ISafe safe).execTransactionFromModuleReturnData( + "0x...", + "0x...", + "0x...", + Enum.Operation.Call + ); + } } ``` diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index af75051ed..1659b335c 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -12,13 +12,16 @@ Returns an array of modules. If all entries fit into a single page, the next poi ```solidity interface ISafe { - function getModulesPaginated(address start, uint256 pageSize) external view returns (address[] array, address next); + function getModulesPaginated( + address start, + uint256 pageSize + ) external view returns (address[] array, address next); } contract Example { - function example() … { - (ISafe safe).getModulesPaginated("0x...", "0x..."); - } + function example() … { + (ISafe safe).getModulesPaginated("0x...", "0x..."); + } } ``` diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index 5cb96b807..41f4d1607 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index a54f7ab4a..e5a85f0db 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Changes the threshold of the Safe to `_threshold`. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 131bc2e73..a36148408 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -6,7 +6,7 @@ import { Tabs, Callout } from 'nextra/components' Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index 087c2f372..ef00ad02f 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -4,7 +4,7 @@ import { Tabs, Callout } from 'nextra/components' Replaces the owner `oldOwner` in the Safe with `newOwner`. -This can only be done via a Safe transaction. +This action can only be done via a Safe transaction. ## Usage diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx index 31361e547..0a369122e 100644 --- a/pages/reference-smart-account/setup/setup.mdx +++ b/pages/reference-smart-account/setup/setup.mdx @@ -24,8 +24,8 @@ Sets an initial storage of the Safe contract. } contract Example { - function example() ... { - (ISafe safe).setup([owner1, owner2], 1); + function example() ... { + (ISafe safe).setup([owner1, owner2], 1); } } ``` diff --git a/pages/reference-smart-account/signatures/approveHash.mdx b/pages/reference-smart-account/signatures/approveHash.mdx index d50bde327..7c0a237f7 100644 --- a/pages/reference-smart-account/signatures/approveHash.mdx +++ b/pages/reference-smart-account/signatures/approveHash.mdx @@ -21,8 +21,10 @@ Marks hash `hashToApprove` as approved. function approveHash(bytes32 hashToApprove) external; } - function example() ... { - (ISafe safe).approveHash("0x..."); + contract Example { + function example() ... { + (ISafe safe).approveHash("0x..."); + } } ``` diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 1783f8d85..9856bb875 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -24,13 +24,16 @@ Checks whether the signature provided is valid for the provided data and hash. R ) external view; } - function example() ... { - (ISafe safe).checkNSignatures( - "0x...", + + contract Example { + function example() ... { + (ISafe safe).checkNSignatures( + "0x...", "0x...", "0x...", - 1 - ); + 1 + ); + } } ``` diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index 335079134..c31189120 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -18,11 +18,13 @@ Checks whether the signature provided is valid for the provided data and hash. R ) external view; } - function example() ... { - (ISafe safe).checkSignatures( + contract Example { + function example() ... { + (ISafe safe).checkSignatures( "0x...", "0x..." - ); + ); + } } ``` diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index 31b0e9083..a64232cf6 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -26,19 +26,21 @@ Encodes the transaction data for `execTransaction`. ) external view returns (bytes); } - function example() ... { - (ISafe safe).encodeTransactionData( - "0x...", - 0, - "0x...", - Enum.Operation.Call, - 100000, - 0, - 0, - "0x...", - "0x...", - 1 - ); + contract Example { + function example() ... { + (ISafe safe).encodeTransactionData( + "0x...", + 0, + "0x...", + Enum.Operation.Call, + 100000, + 0, + 0, + "0x...", + "0x...", + 1 + ); + } } ``` diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index 40f95cca6..cdc23b56f 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -43,8 +43,8 @@ Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `val 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); } @@ -78,8 +78,8 @@ Destination address of Safe transaction. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -99,8 +99,8 @@ Ether value of Safe transaction. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -120,8 +120,8 @@ Data payload of Safe transaction. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -141,8 +141,8 @@ Operation type of Safe transaction. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -162,8 +162,8 @@ Gas that should be used for the Safe transaction. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -183,8 +183,8 @@ Gas costs that are independent of the transaction execution (for example base tr 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -204,8 +204,8 @@ Gas price that should be used for the payment calculation. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -214,7 +214,7 @@ Gas price that should be used for the payment calculation. - **Type:** `address` -Token address (or 0 if ETH) that is used for the payment. +Token address (or `0` if ETH) that is used for the payment. ```solidity focus=9 (ISafe safe).execTransaction( @@ -225,8 +225,8 @@ Token address (or 0 if ETH) that is used for the payment. 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -235,7 +235,7 @@ Token address (or 0 if ETH) that is used for the payment. - **Type:** `address payable` -Address of receiver of gas payment (or 0 if tx.origin). +Address of receiver of gas payment (or `0` if `tx.origin`). ```solidity focus=10 (ISafe safe).execTransaction( @@ -246,8 +246,8 @@ Address of receiver of gas payment (or 0 if tx.origin). 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` @@ -256,7 +256,7 @@ Address of receiver of gas payment (or 0 if tx.origin). - **Type:** `bytes` -Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. +Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature (EIP-1271) or approved hash. ```solidity focus=11 (ISafe safe).execTransaction( @@ -267,8 +267,8 @@ Signature data that should be verified. Can be packed ECDSA signature ((bytes32 0, 0, 0, - address(0), - payable(0), + "0x", + "0x", "0x..." ); ``` diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index 9f3c1c2fe..bfc06e05e 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -36,7 +36,7 @@ Returns transaction hash to be signed by owners. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); @@ -46,7 +46,7 @@ Returns transaction hash to be signed by owners. -## Return value +## Returns - **Type:** `bytes32` @@ -55,6 +55,7 @@ Transaction hash. ## Parameters ### `to` + - **Type:** `address` Destination address. @@ -68,13 +69,14 @@ Destination address. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `value` + - **Type:** `uint256` Ether value. @@ -88,13 +90,14 @@ Ether value. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `data` + - **Type:** `bytes` Data payload. @@ -108,13 +111,14 @@ Data payload. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `operation` + - **Type:** `Enum.Operation` Operation type. @@ -128,13 +132,14 @@ Operation type. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `safeTxGas` + - **Type:** `uint256` Gas that should be used for the safe transaction. @@ -148,13 +153,14 @@ Gas that should be used for the safe transaction. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `baseGas` + - **Type:** `uint256` Gas costs for data used to trigger the safe transaction. @@ -168,13 +174,14 @@ Gas costs for data used to trigger the safe transaction. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `gasPrice` + - **Type:** `uint256` Maximum gas price that should be used for this transaction. @@ -188,13 +195,14 @@ Maximum gas price that should be used for this transaction. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `gasToken` + - **Type:** `address` Token address (or 0 if ETH) that is used for the payment. @@ -208,13 +216,14 @@ Token address (or 0 if ETH) that is used for the payment. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `refundReceiver` + - **Type:** `address` Address of receiver of gas payment (or 0 if tx.origin). @@ -228,13 +237,14 @@ Address of receiver of gas payment (or 0 if tx.origin). 0, 0, 0, - address(0), + "0x", payable(0), 1 ); ``` ### `_nonce` + - **Type:** `uint256` Transaction nonce. @@ -248,7 +258,7 @@ Transaction nonce. 0, 0, 0, - address(0), + "0x", payable(0), 1 ); diff --git a/redirects.json b/redirects.json index a91a89bae..51def3744 100644 --- a/redirects.json +++ b/redirects.json @@ -873,5 +873,10 @@ "source": "/reference-smart-account/utilities", "destination": "/reference-smart-account/utilities/getStorageAt", "permanent": true + }, + { + "source": "/reference-smart-account/setup", + "destination": "/reference-smart-account/setup/setup", + "permanent": true } ] \ No newline at end of file From f76c471287a5078b5865c0e69f4a468edf55f3f2 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:26:49 +0200 Subject: [PATCH 23/60] Fix indentation --- pages/reference-smart-account/signatures/checkNSignatures.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 9856bb875..141b43d17 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -29,8 +29,8 @@ Checks whether the signature provided is valid for the provided data and hash. R function example() ... { (ISafe safe).checkNSignatures( "0x...", - "0x...", - "0x...", + "0x...", + "0x...", 1 ); } From e10d33a1456d9a172930c540954bb24fee187b90 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:29:46 +0200 Subject: [PATCH 24/60] Capitalize module guards --- .../guards/setModuleGuard.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index 39e3e1b14..353794c28 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -2,17 +2,17 @@ import { Tabs, Callout } from 'nextra/components' # `setModuleGuard` -Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module guard. +Set Module Guard `moduleGuard` for the Safe. Make sure you trust the Module Guard. - Set a module guard that checks transactions initiated by the module before + Set a Module Guard that checks transactions initiated by the module before execution This action can only be done via a Safe transaction. - Since a module guard has full power to block Safe transaction execution - initiated via a module, a broken module guard can cause a denial of service - for the Safe Modules. Make sure to carefully audit the module guard code and + Since a Module Guard has full power to block Safe transaction execution + initiated via a module, a broken Module Guard can cause a denial of service + for the Safe Modules. Make sure to carefully audit the Module Guard code and design recovery mechanisms. @@ -44,7 +44,7 @@ Set Module Guard `moduleGuard` for the Safe. Make sure you trust the module gu - **Type:** `address` -The address of the module guard to be used or the zero address to disable the module guard. +The address of the Module Guard to be used or the zero address to disable the Module Guard. ```solidity focus=2 (ISafe safe).setModuleGuard( @@ -60,4 +60,4 @@ The address of the module guard to be used or the zero address to disable the mo event ChangedModuleGuard(address moduleGuard); ``` -Emitted when a module guard is set for the Safe. +Emitted when a Module Guard is set for the Safe. From cbe87efe4192bac94a9dbc0e4313f12832ff80ec Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:32:12 +0200 Subject: [PATCH 25/60] Edit definition for setModuleGuard --- pages/reference-smart-account/guards/setModuleGuard.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index 353794c28..c7c50e677 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -2,11 +2,11 @@ import { Tabs, Callout } from 'nextra/components' # `setModuleGuard` -Set Module Guard `moduleGuard` for the Safe. Make sure you trust the Module Guard. +Set a Module Guard that checks transactions initiated by the module before +execution. - Set a Module Guard that checks transactions initiated by the module before - execution This action can only be done via a Safe transaction. + This action can only be done via a Safe transaction. From a7d547a94b2951620e3e13ddea4898ab30a9e869 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:39:45 +0200 Subject: [PATCH 26/60] Update pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- .../modules/execTransactionFromModuleReturnData.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index d767f6a53..767640a02 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -56,7 +56,7 @@ Data returned by the call. - **Type:** `address` -Destination address of module transaction. +Destination address of the Safe Module transaction. ```solidity focus=2 (ISafe safe).execTransactionFromModuleReturnData( From d96c1bc41809bc95da02d70fefcaad13595873eb Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:40:36 +0200 Subject: [PATCH 27/60] Fix indentation --- .../modules/execTransactionFromModule.mdx | 1 + .../modules/execTransactionFromModuleReturnData.mdx | 2 +- pages/reference-smart-account/modules/getModulesPaginated.mdx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index 7bddc68f6..6dd05b2af 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -120,6 +120,7 @@ event ExecutionFromModuleSuccess(address to, uint256 value, bytes data); ``` Emitted when a transaction executed by a module succeeds. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulesuccess) function. + ### `ExecutionFromModuleFailure` ```solidity diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index d767f6a53..ce1c7dbd0 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -71,7 +71,7 @@ Destination address of module transaction. - **Type:** `uint256` -Ether value of module transaction. +Value of the native token transferred in the module transaction. ```solidity focus=3 (ISafe safe).execTransactionFromModuleReturnData( diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index 1659b335c..9dcd6d1ff 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `getModulesPaginated` -Returns an array of modules. If all entries fit into a single page, the next pointer will be 0x1. If another page is present, next will be the last element of the returned array. +Returns an array of modules. If all entries fit into a single page, the next pointer will be `0x1`. If another page is present, next will be the last element of the returned array. ## Usage From 7034a7f2561b1c12f4cdf33df4957e39204b3d3a Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:43:33 +0200 Subject: [PATCH 28/60] Edit definition for execTransactionFromModuleReturnData --- .../modules/execTransactionFromModuleReturnData.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index 7833db881..83cc80af0 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `execTransactionFromModuleReturnData` -Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token) and return `data`. +Executes a transaction from an enabled Safe Module and returns the result data. ## Usage From 71acf9f96b8a87e0ab0f1ba025ec146746bcc6e1 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:45:11 +0200 Subject: [PATCH 29/60] Update pages/reference-smart-account/modules/execTransactionFromModule.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- .../modules/execTransactionFromModule.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index 6dd05b2af..a934e1e0d 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -85,7 +85,7 @@ Ether value of module transaction. - **Type:** `bytes` -Data payload of module transaction. +Data payload of the module transaction. ```solidity focus=4 (ISafe safe).execTransactionFromModule( From fd3c7d280786fcd59944e728bc5b735e8d5405cd Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:45:21 +0200 Subject: [PATCH 30/60] Update pages/reference-smart-account/modules/execTransactionFromModule.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- .../modules/execTransactionFromModule.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index a934e1e0d..a8a2f78ed 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -100,7 +100,7 @@ Data payload of the module transaction. - **Type:** `enum Enum.Operation` -Operation type of module transaction. +Operation type of the module transaction. ```solidity focus=5 (ISafe safe).execTransactionFromModule( From 3c70cc1478e741b663d4ca451140057ececc896b Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:45:29 +0200 Subject: [PATCH 31/60] Update pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- .../modules/execTransactionFromModuleReturnData.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index 7833db881..a25dd297b 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -101,7 +101,7 @@ Data payload of module transaction. - **Type:** `enum Enum.Operation` -Operation type of module transaction. +Operation type of the module transaction. ```solidity focus=5 (ISafe safe).execTransactionFromModuleReturnData( From c27e97d737dbb4e2ef5a293e0d4575fe784b963c Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:45:34 +0200 Subject: [PATCH 32/60] Update pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- .../modules/execTransactionFromModuleReturnData.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index a25dd297b..184014d4b 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -86,7 +86,7 @@ Value of the native token transferred in the module transaction. - **Type:** `bytes` -Data payload of module transaction. +Data payload of the module transaction. ```solidity focus=4 (ISafe safe).execTransactionFromModuleReturnData( From e8fa7ffb8fea371da4f269cf84548208532dda3f Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:45:47 +0200 Subject: [PATCH 33/60] Update pages/reference-smart-account/owners/getThreshold.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- pages/reference-smart-account/owners/getThreshold.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/owners/getThreshold.mdx b/pages/reference-smart-account/owners/getThreshold.mdx index 11898be5e..686928d37 100644 --- a/pages/reference-smart-account/owners/getThreshold.mdx +++ b/pages/reference-smart-account/owners/getThreshold.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `getThreshold` -Returns the number of required confirmations for a Safe transaction aka the threshold. +Returns the threshold of the Safe account. ## Usage From b1a46a608d0eb20880e9b444d3321c5a58877500 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:46:07 +0200 Subject: [PATCH 34/60] Update pages/reference-smart-account/owners/swapOwner.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- pages/reference-smart-account/owners/swapOwner.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index ef00ad02f..ccf5709ce 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -42,7 +42,7 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. - **Type:** `address` -Owner that pointed to the owner to be replaced in the linked list +Owner that points to the owner to be replaced in the linked list. ```solidity focus=2 (ISafe safe).swapOwner( From 0b1c314b520283e0d37c06f9ab2b3c3946571c71 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 16:49:50 +0200 Subject: [PATCH 35/60] Edit wording --- .../modules/execTransactionFromModule.mdx | 2 +- .../transactions/encodeTransactionData.mdx | 2 +- pages/reference-smart-account/transactions/execTransaction.mdx | 2 +- .../reference-smart-account/transactions/getTransactionHash.mdx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index 6dd05b2af..99276893b 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -70,7 +70,7 @@ Destination address of module transaction. - **Type:** `uint256` -Ether value of module transaction. +The native token value transferred in the Safe Module transaction. ```solidity focus=3 (ISafe safe).execTransactionFromModule( diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index a64232cf6..365453b72 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -79,7 +79,7 @@ Destination address. ### `value` - **Type:** `uint256` -Ether value. +Native token value. ```solidity focus=3 (ISafe safe).encodeTransactionData( diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index cdc23b56f..0d2461ad2 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -88,7 +88,7 @@ Destination address of Safe transaction. - **Type:** `uint256` -Ether value of Safe transaction. +Native token value of Safe transaction. ```solidity focus=3 (ISafe safe).execTransaction( diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index bfc06e05e..326b222ed 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -79,7 +79,7 @@ Destination address. - **Type:** `uint256` -Ether value. +Native token value. ```solidity focus=3 (ISafe safe).getTransactionHash( From 6f62a2cba543f6296e78d6e01bc12c468a9e3064 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 17:00:15 +0200 Subject: [PATCH 36/60] Fix indentation --- .../signatures/checkSignatures.mdx | 4 +- .../transactions/encodeTransactionData.mdx | 10 +++++ .../transactions/execTransaction.mdx | 42 +++++++++---------- 3 files changed, 33 insertions(+), 23 deletions(-) diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index c31189120..ce81362e2 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -21,8 +21,8 @@ Checks whether the signature provided is valid for the provided data and hash. R contract Example { function example() ... { (ISafe safe).checkSignatures( - "0x...", - "0x..." + "0x...", + "0x..." ); } } diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index 365453b72..033cec14d 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -57,6 +57,7 @@ Encoded transaction data. ## Parameters ### `to` + - **Type:** `address` Destination address. @@ -77,6 +78,7 @@ Destination address. ``` ### `value` + - **Type:** `uint256` Native token value. @@ -97,6 +99,7 @@ Native token value. ``` ### `data` + - **Type:** `bytes` Data payload. @@ -117,6 +120,7 @@ Data payload. ``` ### `operation` + - **Type:** `enum Enum.Operation` Operation type. @@ -137,6 +141,7 @@ Operation type. ``` ### `safeTxGas` + - **Type:** `uint256` Gas that should be used for the Safe transaction. @@ -157,6 +162,7 @@ Gas that should be used for the Safe transaction. ``` ### `baseGas` + - **Type:** `uint256` Gas costs for data used to trigger the Safe transaction. @@ -177,6 +183,7 @@ Gas costs for data used to trigger the Safe transaction. ``` ### `gasPrice` + - **Type:** `uint256` Maximum gas price that should be used for this transaction. @@ -197,6 +204,7 @@ Maximum gas price that should be used for this transaction. ``` ### `gasToken` + - **Type:** `address` Token address (or 0 if ETH) that is used for the payment. @@ -217,6 +225,7 @@ Token address (or 0 if ETH) that is used for the payment. ``` ### `refundReceiver` + - **Type:** `address` Address of receiver of gas payment (or 0 if tx.origin). @@ -237,6 +246,7 @@ Address of receiver of gas payment (or 0 if tx.origin). ``` ### `_nonce` + - **Type:** `uint256` Transaction nonce. diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index 0d2461ad2..8abf77ee9 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -43,8 +43,8 @@ Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `val 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); } @@ -78,8 +78,8 @@ Destination address of Safe transaction. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -99,8 +99,8 @@ Native token value of Safe transaction. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -120,8 +120,8 @@ Data payload of Safe transaction. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -142,7 +142,7 @@ Operation type of Safe transaction. 0, 0, "0x", - "0x", + "0x...", "0x..." ); ``` @@ -162,8 +162,8 @@ Gas that should be used for the Safe transaction. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -183,8 +183,8 @@ Gas costs that are independent of the transaction execution (for example base tr 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -204,8 +204,8 @@ Gas price that should be used for the payment calculation. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -225,8 +225,8 @@ Token address (or `0` if ETH) that is used for the payment. 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -246,8 +246,8 @@ Address of receiver of gas payment (or `0` if `tx.origin`). 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` @@ -267,8 +267,8 @@ Signature data that should be verified. Can be packed ECDSA signature `((bytes32 0, 0, 0, - "0x", - "0x", + "0x...", + "0x...", "0x..." ); ``` From c5dfede8900be85151f79d65c0e95c0e4fee1d96 Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 17:00:20 +0200 Subject: [PATCH 37/60] Update pages/reference-smart-account/modules/enableModule.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Germán Martínez <6764315+germartinez@users.noreply.github.com> --- pages/reference-smart-account/modules/enableModule.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index 9e94ca265..4032f6b7f 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -34,7 +34,7 @@ Enables the module `module` for the Safe. - **Type:** `address` -Module to be whitelisted. +Safe Module to be enabled. ```solidity focus=2 (ISafe safe).enableModule( From 401411f87661a161ad1fe7d653e994a10b36f12c Mon Sep 17 00:00:00 2001 From: louis-md Date: Fri, 25 Oct 2024 17:02:30 +0200 Subject: [PATCH 38/60] Edit definition for enableModule --- pages/reference-smart-account/modules/enableModule.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index 4032f6b7f..06757626e 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -2,7 +2,7 @@ import { Tabs, Callout } from 'nextra/components' # `enableModule` -Enables the module `module` for the Safe. +Enables a new Safe Module in a Safe account. This action can only be done via a Safe transaction. From dd33e75ea6e540497611b05fc5c18de3bac49664 Mon Sep 17 00:00:00 2001 From: louis-md Date: Tue, 19 Nov 2024 16:20:40 +0100 Subject: [PATCH 39/60] Implement requested changes --- pages/reference-smart-account/setup/setup.mdx | 6 +++--- .../transactions/encodeTransactionData.mdx | 4 ++-- .../transactions/execTransaction.mdx | 4 ++-- .../transactions/getTransactionHash.mdx | 8 ++++---- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx index 0a369122e..cc514ddad 100644 --- a/pages/reference-smart-account/setup/setup.mdx +++ b/pages/reference-smart-account/setup/setup.mdx @@ -25,7 +25,7 @@ Sets an initial storage of the Safe contract. contract Example { function example() ... { - (ISafe safe).setup([owner1, owner2], 1); + (ISafe safe).setup(["0x...", "0x..."], 1); } } ``` @@ -44,7 +44,7 @@ List of Safe owners. ```solidity focus=2 (ISafe safe).setup( - [owner1, owner2], + ["0x...", "0x..."], 1 ); ``` @@ -57,7 +57,7 @@ Number of required confirmations for a Safe transaction. ```solidity focus=3 (ISafe safe).setup( - [owner1, owner2], + ["0x...", "0x..."], 1 ); ``` diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index 033cec14d..e9c4a6190 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -207,7 +207,7 @@ Maximum gas price that should be used for this transaction. - **Type:** `address` -Token address (or 0 if ETH) that is used for the payment. +Token address (or `0x` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).encodeTransactionData( @@ -228,7 +228,7 @@ Token address (or 0 if ETH) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or 0 if tx.origin). +Address of receiver of gas payment (or `0x` if tx.origin). ```solidity focus=10 (ISafe safe).encodeTransactionData( diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index 8abf77ee9..e20c178f6 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -2,7 +2,7 @@ import { Tabs, Callout } from 'nextra/components' # `execTransaction` -Executes an `operation` (0: Call, 1: DelegateCall) transaction to `to` with `value` (Native Currency) and pays `gasPrice` \* `gasLimit` in `gasToken` token to `refundReceiver`. +Executes a Safe transaction to `to` with `value` (Native Currency) and pays `gasPrice` \* `gasLimit` in `gasToken` token to `refundReceiver`. The fees are always transferred, even if the user transaction fails. This @@ -214,7 +214,7 @@ Gas price that should be used for the payment calculation. - **Type:** `address` -Token address (or `0` if ETH) that is used for the payment. +Token address (or `0x` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).execTransaction( diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index 326b222ed..c7ad7c76b 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `getTransactionHash` -Returns transaction hash to be signed by owners. +Returns the Safe transaction hash of a Safe transaction that can be signed by the Safe owners. ## Usage @@ -205,7 +205,7 @@ Maximum gas price that should be used for this transaction. - **Type:** `address` -Token address (or 0 if ETH) that is used for the payment. +Token address (or `0x` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).getTransactionHash( @@ -216,7 +216,7 @@ Token address (or 0 if ETH) that is used for the payment. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -226,7 +226,7 @@ Token address (or 0 if ETH) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or 0 if tx.origin). +Address of receiver of gas payment (or `0x` if tx.origin). ```solidity focus=10 (ISafe safe).getTransactionHash( From 38f3ca1375b35a44451ece7dd7facfaaf8de9864 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:39:46 +0100 Subject: [PATCH 40/60] Update pages/reference-smart-account/transactions/encodeTransactionData.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- .../transactions/encodeTransactionData.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index e9c4a6190..16435786c 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -228,7 +228,7 @@ Token address (or `0x` if native token) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or `0x` if tx.origin). +Address of receiver of gas payment (or `0x` if `tx.origin`). ```solidity focus=10 (ISafe safe).encodeTransactionData( From 88af4027b5ae378920d3538d25c28e37559bb1e5 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:40:01 +0100 Subject: [PATCH 41/60] Update pages/reference-smart-account/signatures/checkNSignatures.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/signatures/checkNSignatures.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 141b43d17..8ae697b1a 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -51,7 +51,7 @@ Address that executing the transaction. Make sure that the executor address is a legitimate executor. Incorrectly - passed the executor might reduce the threshold by 1 signature. + passed, the executor might reduce the threshold by one signature. ```solidity focus=2 From a81dbfd733c0886ac11858b365a9f27dbe73f941 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:40:52 +0100 Subject: [PATCH 42/60] Update pages/reference-smart-account/transactions/execTransaction.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/transactions/execTransaction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index e20c178f6..c8da5fd4a 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -2,7 +2,7 @@ import { Tabs, Callout } from 'nextra/components' # `execTransaction` -Executes a Safe transaction to `to` with `value` (Native Currency) and pays `gasPrice` \* `gasLimit` in `gasToken` token to `refundReceiver`. +Executes a Safe transaction to `to` with `value` (native currency) and pays `gasPrice` \* `gasLimit` in `gasToken` token to `refundReceiver`. The fees are always transferred, even if the user transaction fails. This From 26a6742127c772ee3f998034b3e8183afa44b104 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:41:45 +0100 Subject: [PATCH 43/60] Update pages/reference-smart-account/transactions/execTransaction.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/transactions/execTransaction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index c8da5fd4a..e78949ddc 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -172,7 +172,7 @@ Gas that should be used for the Safe transaction. - **Type:** `uint256` -Gas costs that are independent of the transaction execution (for example base transaction fee, signature check, payment of the refund). +Gas costs that are independent of the transaction execution (for example, the base transaction fee, signature check, and refund payment). ```solidity focus=7 (ISafe safe).execTransaction( From 0d11449e7cb32ad18c83c55b6b5c40d12fe426b4 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:42:50 +0100 Subject: [PATCH 44/60] Update pages/reference-smart-account/modules/execTransactionFromModule.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- .../modules/execTransactionFromModule.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index de4c66734..ec44813a4 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -2,7 +2,7 @@ import { Tabs, Callout } from 'nextra/components' # `execTransactionFromModule` -Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (Native Token). +Execute `operation` (0: Call, 1: DelegateCall) to `to` with `value` (native token). Function is virtual to allow overriding for L2 singleton to emit an event for From 9de19781ffda1bae8995951d8ea75197a56cb820 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:43:26 +0100 Subject: [PATCH 45/60] Update pages/reference-smart-account/signatures/checkNSignatures.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/signatures/checkNSignatures.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 8ae697b1a..43ee2d129 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -50,7 +50,7 @@ Checks whether the signature provided is valid for the provided data and hash. R Address that executing the transaction. - Make sure that the executor address is a legitimate executor. Incorrectly + Make sure that the executor address is a legitimate executor. When incorrectly passed, the executor might reduce the threshold by one signature. From beef5517fb0ca5691ec54e7a1358a6aa30052544 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:43:54 +0100 Subject: [PATCH 46/60] Update pages/reference-smart-account/modules/isModuleEnabled.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/modules/isModuleEnabled.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/isModuleEnabled.mdx b/pages/reference-smart-account/modules/isModuleEnabled.mdx index f5bfec25f..e66678dd7 100644 --- a/pages/reference-smart-account/modules/isModuleEnabled.mdx +++ b/pages/reference-smart-account/modules/isModuleEnabled.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `isModuleEnabled` -Returns if an module is enabled. +Returns if a module is enabled. ## Usage From c14c614dc5677554efaf928915bc21633fa69816 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:44:44 +0100 Subject: [PATCH 47/60] Update pages/reference-smart-account/modules/getModulesPaginated.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/modules/getModulesPaginated.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index 9dcd6d1ff..35b175eb2 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -62,7 +62,7 @@ Start of the page. Has to be a module or start pointer (0x1 address). - **Type:** `uint256` -Maximum number of modules that should be returned. Has to be > 0. +Maximum number of modules that should be returned. Has to be greater than zero. ```solidity focus=3 (ISafe safe).getModulesPaginated( From 483d8c3e03a814bd33f5e7df1b8edd83c7572e82 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:45:14 +0100 Subject: [PATCH 48/60] Update pages/reference-smart-account/guards/setGuard.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/guards/setGuard.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index 693535501..b19b909c0 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -6,7 +6,7 @@ Set Transaction Guard `guard` that checks transactions before execution. This action can only be done via a Safe transaction. - Since a guard has full power to block Safe transaction execution, a broken + Since a guard has the full power to block Safe transaction executions, a broken guard can cause a denial of service for the Safe. Make sure to carefully audit the guard code and design recovery mechanisms. From ae052bc66534000d7c6242cfe5497e5218e253ea Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:45:32 +0100 Subject: [PATCH 49/60] Update pages/reference-smart-account/guards/setGuard.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/guards/setGuard.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index b19b909c0..549054ad5 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -8,7 +8,7 @@ Set Transaction Guard `guard` that checks transactions before execution. Since a guard has the full power to block Safe transaction executions, a broken guard can cause a denial of service for the Safe. Make sure to carefully audit - the guard code and design recovery mechanisms. + the guard code, and design recovery mechanisms. ## Usage From b92d8cc0718f240cf7c345ad4398b9de52e8eb0d Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:45:53 +0100 Subject: [PATCH 50/60] Update pages/reference-smart-account/fallback/receive.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/fallback/receive.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/fallback/receive.mdx b/pages/reference-smart-account/fallback/receive.mdx index f40aa0916..392ef9afc 100644 --- a/pages/reference-smart-account/fallback/receive.mdx +++ b/pages/reference-smart-account/fallback/receive.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `receive` -Receive function accepts native currency transactions. +Receive function accepts native token transactions. ## Usage From 9928073ee7a02807723df704468c4d0cfc760491 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:46:17 +0100 Subject: [PATCH 51/60] Update pages/reference-smart-account/signatures/checkNSignatures.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/signatures/checkNSignatures.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 43ee2d129..07538d9f3 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -5,7 +5,7 @@ import { Tabs, Callout } from 'nextra/components' Checks whether the signature provided is valid for the provided data and hash. Reverts otherwise. - Since the EIP-1271 does an external call, be mindful of re-entrancy attacks. + Since the EIP-1271 makes an external call, be mindful of re-entrancy attacks. ## Usage From 18f8bab35391cabb06cfd3b8e19a7311f9c56c0f Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 10:47:13 +0100 Subject: [PATCH 52/60] Update pages/reference-smart-account/signatures/checkNSignatures.mdx Co-authored-by: Tanay Pant <7481165+tanay1337@users.noreply.github.com> --- pages/reference-smart-account/signatures/checkNSignatures.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 07538d9f3..534fb777c 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -47,7 +47,7 @@ Checks whether the signature provided is valid for the provided data and hash. R - **Type:** `address` -Address that executing the transaction. +Address executing the transaction. Make sure that the executor address is a legitimate executor. When incorrectly From df3201f3489a4652f7f91b97427aecb3bad6bdcd Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 17:09:01 +0100 Subject: [PATCH 53/60] Implement requested changes --- pages/reference-smart-account/_meta.json | 6 ++- .../events/AddedOwner.mdx | 7 ++++ .../events/ApproveHash.mdx | 7 ++++ .../events/ChangedFallbackHandler.mdx | 7 ++++ .../events/ChangedGuard.mdx | 7 ++++ .../events/ChangedModuleGuard.mdx | 7 ++++ .../events/ChangedThreshold.mdx | 7 ++++ .../events/DisabledModule.mdx | 7 ++++ .../events/EnabledModule.mdx | 7 ++++ .../events/ExecutionFailure.mdx | 7 ++++ .../events/ExecutionFromModuleFailure.mdx | 7 ++++ .../events/ExecutionFromModuleSuccess.mdx | 7 ++++ .../events/ExecutionSuccess.mdx | 7 ++++ .../events/RemovedOwner.mdx | 7 ++++ .../events/SafeReceived.mdx | 7 ++++ .../events/SafeSetup.mdx | 13 +++++++ .../events/SignMsg.mdx | 7 ++++ .../fallback/fallback.mdx | 3 +- .../fallback/receive.mdx | 9 +---- .../fallback/setFallbackHandler.mdx | 9 +---- .../guards/setGuard.mdx | 11 ++---- .../guards/setModuleGuard.mdx | 11 ++---- .../modules/disableModule.mdx | 9 +---- .../modules/enableModule.mdx | 9 +---- .../modules/execTransactionFromModule.mdx | 19 ++-------- .../execTransactionFromModuleReturnData.mdx | 7 ++-- .../modules/getModulesPaginated.mdx | 2 +- .../owners/addOwnerWithThreshold.mdx | 15 ++------ .../owners/changeThreshold.mdx | 11 +----- .../owners/removeOwner.mdx | 17 +++------ .../owners/swapOwner.mdx | 12 ++++-- .../setup/domainSeparator.mdx | 2 +- pages/reference-smart-account/setup/setup.mdx | 15 +------- .../signatures/approveHash.mdx | 15 ++++---- .../signatures/checkNSignatures.mdx | 2 +- .../signatures/checkSignatures.mdx | 2 +- .../signatures/signedMessages.mdx | 9 +---- .../transactions/encodeTransactionData.mdx | 2 +- .../transactions/execTransaction.mdx | 21 +++-------- .../transactions/getTransactionHash.mdx | 26 ++++++------- .../utilities/getStorageAt.mdx | 2 +- redirects.json | 37 +------------------ 42 files changed, 202 insertions(+), 199 deletions(-) create mode 100644 pages/reference-smart-account/events/AddedOwner.mdx create mode 100644 pages/reference-smart-account/events/ApproveHash.mdx create mode 100644 pages/reference-smart-account/events/ChangedFallbackHandler.mdx create mode 100644 pages/reference-smart-account/events/ChangedGuard.mdx create mode 100644 pages/reference-smart-account/events/ChangedModuleGuard.mdx create mode 100644 pages/reference-smart-account/events/ChangedThreshold.mdx create mode 100644 pages/reference-smart-account/events/DisabledModule.mdx create mode 100644 pages/reference-smart-account/events/EnabledModule.mdx create mode 100644 pages/reference-smart-account/events/ExecutionFailure.mdx create mode 100644 pages/reference-smart-account/events/ExecutionFromModuleFailure.mdx create mode 100644 pages/reference-smart-account/events/ExecutionFromModuleSuccess.mdx create mode 100644 pages/reference-smart-account/events/ExecutionSuccess.mdx create mode 100644 pages/reference-smart-account/events/RemovedOwner.mdx create mode 100644 pages/reference-smart-account/events/SafeReceived.mdx create mode 100644 pages/reference-smart-account/events/SafeSetup.mdx create mode 100644 pages/reference-smart-account/events/SignMsg.mdx diff --git a/pages/reference-smart-account/_meta.json b/pages/reference-smart-account/_meta.json index 5df3e5ec9..8683d7528 100644 --- a/pages/reference-smart-account/_meta.json +++ b/pages/reference-smart-account/_meta.json @@ -15,5 +15,9 @@ "guards": "Guards", "fallback": "Fallback Handler", "signatures": "Signatures", - "utilities": "Utilities" + "utilities": "Utilities", + "events": { + "type": "page", + "display": "hidden" + } } diff --git a/pages/reference-smart-account/events/AddedOwner.mdx b/pages/reference-smart-account/events/AddedOwner.mdx new file mode 100644 index 000000000..9424b0276 --- /dev/null +++ b/pages/reference-smart-account/events/AddedOwner.mdx @@ -0,0 +1,7 @@ +### `AddedOwner` + +```solidity +event AddedOwner(address owner); +``` + +Emitted when an owner is added to the Safe. diff --git a/pages/reference-smart-account/events/ApproveHash.mdx b/pages/reference-smart-account/events/ApproveHash.mdx new file mode 100644 index 000000000..583626707 --- /dev/null +++ b/pages/reference-smart-account/events/ApproveHash.mdx @@ -0,0 +1,7 @@ +### `ApproveHash` + +```solidity +event ApproveHash(bytes32 approvedHash, address owner); +``` + +Emitted when a hash is approved by an owner. diff --git a/pages/reference-smart-account/events/ChangedFallbackHandler.mdx b/pages/reference-smart-account/events/ChangedFallbackHandler.mdx new file mode 100644 index 000000000..c7b88341b --- /dev/null +++ b/pages/reference-smart-account/events/ChangedFallbackHandler.mdx @@ -0,0 +1,7 @@ +### `ChangedFallbackHandler` + +```solidity +event ChangedFallbackHandler(address handler); +``` + +Emitted when the Fallback Handler is changed. diff --git a/pages/reference-smart-account/events/ChangedGuard.mdx b/pages/reference-smart-account/events/ChangedGuard.mdx new file mode 100644 index 000000000..70200fb76 --- /dev/null +++ b/pages/reference-smart-account/events/ChangedGuard.mdx @@ -0,0 +1,7 @@ +### `ChangedGuard` + +```solidity +event ChangedGuard(address guard); +``` + +Emitted when a guard is set for the Safe. diff --git a/pages/reference-smart-account/events/ChangedModuleGuard.mdx b/pages/reference-smart-account/events/ChangedModuleGuard.mdx new file mode 100644 index 000000000..09af4a0cc --- /dev/null +++ b/pages/reference-smart-account/events/ChangedModuleGuard.mdx @@ -0,0 +1,7 @@ +### `ChangedModuleGuard` + +```solidity +event ChangedModuleGuard(address moduleGuard); +``` + +Emitted when a Module Guard is set for the Safe. diff --git a/pages/reference-smart-account/events/ChangedThreshold.mdx b/pages/reference-smart-account/events/ChangedThreshold.mdx new file mode 100644 index 000000000..25e8719d7 --- /dev/null +++ b/pages/reference-smart-account/events/ChangedThreshold.mdx @@ -0,0 +1,7 @@ +### `ChangedThreshold` + +```solidity +event ChangedThreshold(uint256 threshold); +``` + +Emitted when the threshold for confirmations is changed. diff --git a/pages/reference-smart-account/events/DisabledModule.mdx b/pages/reference-smart-account/events/DisabledModule.mdx new file mode 100644 index 000000000..691a8b1c5 --- /dev/null +++ b/pages/reference-smart-account/events/DisabledModule.mdx @@ -0,0 +1,7 @@ +### `DisabledModule` + +```solidity +event DisabledModule(address module); +``` + +Emitted when a module is disabled for the Safe. diff --git a/pages/reference-smart-account/events/EnabledModule.mdx b/pages/reference-smart-account/events/EnabledModule.mdx new file mode 100644 index 000000000..6ba4ef466 --- /dev/null +++ b/pages/reference-smart-account/events/EnabledModule.mdx @@ -0,0 +1,7 @@ +### `EnabledModule` + +```solidity +event EnabledModule(address module); +``` + +Emitted when a module is enabled for the Safe. diff --git a/pages/reference-smart-account/events/ExecutionFailure.mdx b/pages/reference-smart-account/events/ExecutionFailure.mdx new file mode 100644 index 000000000..88b0dcd07 --- /dev/null +++ b/pages/reference-smart-account/events/ExecutionFailure.mdx @@ -0,0 +1,7 @@ +### `ExecutionFailure` + +```solidity +event ExecutionFailure(bytes32 txHash, uint256 payment); +``` + +Emitted when a transaction fails. diff --git a/pages/reference-smart-account/events/ExecutionFromModuleFailure.mdx b/pages/reference-smart-account/events/ExecutionFromModuleFailure.mdx new file mode 100644 index 000000000..47574c4d2 --- /dev/null +++ b/pages/reference-smart-account/events/ExecutionFromModuleFailure.mdx @@ -0,0 +1,7 @@ +### `ExecutionFromModuleFailure` + +```solidity +event ExecutionFromModuleFailure(address module); +``` + +Emitted when a transaction executed by a module fails. diff --git a/pages/reference-smart-account/events/ExecutionFromModuleSuccess.mdx b/pages/reference-smart-account/events/ExecutionFromModuleSuccess.mdx new file mode 100644 index 000000000..cf078b915 --- /dev/null +++ b/pages/reference-smart-account/events/ExecutionFromModuleSuccess.mdx @@ -0,0 +1,7 @@ +### `ExecutionFromModuleSuccess` + +```solidity +event ExecutionFromModuleSuccess(address to, uint256 value, bytes data); +``` + +Emitted when a transaction executed by a module succeeds. diff --git a/pages/reference-smart-account/events/ExecutionSuccess.mdx b/pages/reference-smart-account/events/ExecutionSuccess.mdx new file mode 100644 index 000000000..00ab62cf7 --- /dev/null +++ b/pages/reference-smart-account/events/ExecutionSuccess.mdx @@ -0,0 +1,7 @@ +### `ExecutionSuccess` + +```solidity +event ExecutionSuccess(bytes32 txHash, uint256 payment); +``` + +Emitted when a transaction is executed successfully. diff --git a/pages/reference-smart-account/events/RemovedOwner.mdx b/pages/reference-smart-account/events/RemovedOwner.mdx new file mode 100644 index 000000000..7605a2189 --- /dev/null +++ b/pages/reference-smart-account/events/RemovedOwner.mdx @@ -0,0 +1,7 @@ +### `RemovedOwner` + +```solidity +event RemovedOwner(address owner); +``` + +Emitted when an owner is removed from the Safe. diff --git a/pages/reference-smart-account/events/SafeReceived.mdx b/pages/reference-smart-account/events/SafeReceived.mdx new file mode 100644 index 000000000..16e0edde8 --- /dev/null +++ b/pages/reference-smart-account/events/SafeReceived.mdx @@ -0,0 +1,7 @@ +### `SafeReceived` + +```solidity +event SafeReceived(address sender, uint256 value) +``` + +Emitted when the Safe contract receives a payment. diff --git a/pages/reference-smart-account/events/SafeSetup.mdx b/pages/reference-smart-account/events/SafeSetup.mdx new file mode 100644 index 000000000..be00d09ab --- /dev/null +++ b/pages/reference-smart-account/events/SafeSetup.mdx @@ -0,0 +1,13 @@ +### `SafeSetup` + +```solidity +event SafeSetup( + address initiator, + address[] owners, + uint256 threshold, + address initializer, + address fallbackHandler +); +``` + +Emitted when the Safe is set up. diff --git a/pages/reference-smart-account/events/SignMsg.mdx b/pages/reference-smart-account/events/SignMsg.mdx new file mode 100644 index 000000000..9b7b26f08 --- /dev/null +++ b/pages/reference-smart-account/events/SignMsg.mdx @@ -0,0 +1,7 @@ +### `SignMsg` + +```solidity +event SignMsg(bytes32 msgHash); +``` + +Emitted when a message is signed by an owner. diff --git a/pages/reference-smart-account/fallback/fallback.mdx b/pages/reference-smart-account/fallback/fallback.mdx index e77196016..8d0646403 100644 --- a/pages/reference-smart-account/fallback/fallback.mdx +++ b/pages/reference-smart-account/fallback/fallback.mdx @@ -1,4 +1,5 @@ import { Tabs } from 'nextra/components' +import SafeReceived from '../../../components/Events/mdx/SafeReceived.mdx' # `fallback` @@ -28,4 +29,4 @@ This function emits the [`SafeReceived`](./fallback/receive.mdx#safereceived) ev ## Events -### [`SafeReceived`](./receive.mdx#safereceived) + \ No newline at end of file diff --git a/pages/reference-smart-account/fallback/receive.mdx b/pages/reference-smart-account/fallback/receive.mdx index f40aa0916..08524f475 100644 --- a/pages/reference-smart-account/fallback/receive.mdx +++ b/pages/reference-smart-account/fallback/receive.mdx @@ -1,4 +1,5 @@ import { Tabs } from 'nextra/components' +import SafeReceived from '../events/SafeReceived.mdx' # `receive` @@ -26,10 +27,4 @@ Receive function accepts native currency transactions. ## Events -### `SafeReceived` - -```solidity -event SafeReceived(address sender, uint256 value) -``` - -Emitted when the Safe contract receives a payment. + \ No newline at end of file diff --git a/pages/reference-smart-account/fallback/setFallbackHandler.mdx b/pages/reference-smart-account/fallback/setFallbackHandler.mdx index 534286f44..d9caedd94 100644 --- a/pages/reference-smart-account/fallback/setFallbackHandler.mdx +++ b/pages/reference-smart-account/fallback/setFallbackHandler.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import ChangedFallbackHandler from '../events/ChangedFallbackHandler.mdx' # `setFallbackHandler` @@ -47,10 +48,4 @@ Contract to handle fallback calls. ## Events -### `ChangedFallbackHandler` - -```solidity -event ChangedFallbackHandler(address handler); -``` - -Emitted when the fallback handler is changed. + diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index 693535501..743b93cde 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import ChangedGuard from '../events/ChangedGuard.mdx' # `setGuard` @@ -37,7 +38,7 @@ Set Transaction Guard `guard` that checks transactions before execution. - **Type:** `address` -The address of the guard to be used or the 0 address to disable the guard. +The address of the guard to be used or the `0x` address to disable the guard. ```solidity focus=2 (ISafe safe).setGuard( @@ -47,10 +48,4 @@ The address of the guard to be used or the 0 address to disable the guard. ## Events -### `ChangedGuard` - -```solidity -event ChangedGuard(address guard); -``` - -Emitted when a guard is set for the Safe. + diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index c7c50e677..a41791cbf 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import ChangedModuleGuard from '../events/ChangedModuleGuard.mdx' # `setModuleGuard` @@ -44,7 +45,7 @@ execution. - **Type:** `address` -The address of the Module Guard to be used or the zero address to disable the Module Guard. +The address of the Module Guard to be used or the `0x` address to disable the Module Guard. ```solidity focus=2 (ISafe safe).setModuleGuard( @@ -54,10 +55,4 @@ The address of the Module Guard to be used or the zero address to disable the Mo ## Events -### `ChangedModuleGuard` - -```solidity -event ChangedModuleGuard(address moduleGuard); -``` - -Emitted when a Module Guard is set for the Safe. + diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx index 3940bc005..6654079ff 100644 --- a/pages/reference-smart-account/modules/disableModule.mdx +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import DisabledModule from '../events/DisabledModule.mdx' # `disableModule` @@ -58,10 +59,4 @@ Module to be removed. ## Events -### `DisabledModule` - -```solidity -event DisabledModule(address module); -``` - -Emitted when a module is disabled for the Safe. + diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index 06757626e..801c32bc8 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import EnabledModule from '../events/EnabledModule.mdx' # `enableModule` @@ -44,10 +45,4 @@ Safe Module to be enabled. ## Events -### `EnabledModule` - -```solidity -event EnabledModule(address module); -``` - -Emitted when a module is enabled for the Safe. + diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index de4c66734..0661f64a7 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -1,4 +1,6 @@ import { Tabs, Callout } from 'nextra/components' +import ExecutionFromModuleSuccess from '../events/ExecutionFromModuleSuccess.mdx' +import ExecutionFromModuleFailure from '../events/ExecutionFromModuleFailure.mdx' # `execTransactionFromModule` @@ -113,18 +115,5 @@ Operation type of the module transaction. ## Events -### `ExecutionFromModuleSuccess` - -```solidity -event ExecutionFromModuleSuccess(address to, uint256 value, bytes data); -``` - -Emitted when a transaction executed by a module succeeds. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulesuccess) function. - -### `ExecutionFromModuleFailure` - -```solidity -event ExecutionFromModuleFailure(address module); -``` - -Emitted when a transaction executed by a module fails. This event is also emitted in the [`execTransactionFromModuleReturnData`](./execTransactionFromModuleReturnData.mdx#executionfrommodulefailure) function. + + diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index c4afa6d89..ac94c2509 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -1,4 +1,6 @@ import { Tabs } from 'nextra/components' +import ExecutionFromModuleSuccess from '../events/ExecutionFromModuleSuccess.mdx' +import ExecutionFromModuleFailure from '../events/ExecutionFromModuleFailure.mdx' # `execTransactionFromModuleReturnData` @@ -114,6 +116,5 @@ Operation type of the module transaction. ## Events -### [`ExecutionFromModuleSuccess`](./execTransactionFromModule.mdx#executionfrommodulesuccess) - -### [`ExecutionFromModuleFailure`](./execTransactionFromModule.mdx#executionfrommodulefailure) \ No newline at end of file + + diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index 9dcd6d1ff..dda9272f5 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -49,7 +49,7 @@ Start of the next page. - **Type:** `address` -Start of the page. Has to be a module or start pointer (0x1 address). +Start of the page. Has to be a module or start pointer (`0x1` address). ```solidity focus=2 (ISafe safe).getModulesPaginated( diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index 41f4d1607..8bc1d2955 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -1,4 +1,6 @@ import { Tabs, Callout } from 'nextra/components' +import AddedOwner from '../events/AddedOwner.mdx' +import ChangedThreshold from '../events/ChangedThreshold.mdx' # `addOwnerWithThreshold` @@ -58,14 +60,5 @@ New threshold. ## 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. - -### [`ChangedThreshold`](./changeThreshold.mdx#changedthreshold) + + diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index e5a85f0db..fa5d3ac3b 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import ChangedThreshold from '../../../components/Events/mdx/ChangedThreshold.mdx' # `changeThreshold` @@ -44,12 +45,4 @@ New threshold. ## 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. + diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index a36148408..8f831fcf5 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -1,4 +1,6 @@ import { Tabs, Callout } from 'nextra/components' +import RemovedOwner from '../../../components/Events/mdx/RemovedOwner.mdx' +import ChangedThreshold from '../../../components/Events/mdx/ChangedThreshold.mdx' # `removeOwner` @@ -44,7 +46,7 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold - **Type:** `address` -Owner that pointed to the owner to be removed in the linked list +Current owner address. ```solidity focus=2 (ISafe safe).removeOwner( @@ -84,14 +86,5 @@ New threshold. ## Events -### `RemovedOwner` - -```solidity -event RemovedOwner(address owner); -``` - -Emitted when an owner is removed from the Safe. - -This event is also emitted in the [`swapOwner`](/reference-smart-account/owner/swapOwner.mdx) functions. - -### [`ChangedThreshold`](./changeThreshold.mdx#changedthreshold) + + diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index ccf5709ce..694d10f41 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -1,10 +1,14 @@ import { Tabs, Callout } from 'nextra/components' +import AddedOwner from '../events/AddedOwner.mdx' +import RemovedOwner from '../events/RemovedOwner.mdx' # `swapOwner` Replaces the owner `oldOwner` in the Safe with `newOwner`. -This action can only be done via a Safe transaction. + + This action can only be done via a Safe transaction. + ## Usage @@ -31,6 +35,7 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. } } ``` + @@ -82,6 +87,5 @@ New owner address. ## Events -### [`AddedOwner`](./addOwnerWithThreshold.mdx#addedowner) - -### [`RemovedOwner`](./removeOwner.mdx#removedowner) + + diff --git a/pages/reference-smart-account/setup/domainSeparator.mdx b/pages/reference-smart-account/setup/domainSeparator.mdx index e3e27d252..e76947d16 100644 --- a/pages/reference-smart-account/setup/domainSeparator.mdx +++ b/pages/reference-smart-account/setup/domainSeparator.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `domainSeparator` -Returns the domain separator for this contract, as defined in the EIP-712 standard. +Returns the domain separator for this contract, as defined in the [EIP-712 standard](../../home/glossary.md#eip-712). ## Usage diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx index cc514ddad..fd2fb9906 100644 --- a/pages/reference-smart-account/setup/setup.mdx +++ b/pages/reference-smart-account/setup/setup.mdx @@ -1,4 +1,5 @@ import { Tabs, Callout } from 'nextra/components' +import SafeSetup from '../events/SafeSetup.mdx' # `setup` @@ -64,16 +65,4 @@ Number of required confirmations for a Safe transaction. ## Events -### `SafeSetup` - -```solidity -event SafeSetup( - address initiator, - address[] owners, - uint256 threshold, - address initializer, - address fallbackHandler -); -``` - -Emitted when the Safe is set up. + diff --git a/pages/reference-smart-account/signatures/approveHash.mdx b/pages/reference-smart-account/signatures/approveHash.mdx index 7c0a237f7..b0fabbb50 100644 --- a/pages/reference-smart-account/signatures/approveHash.mdx +++ b/pages/reference-smart-account/signatures/approveHash.mdx @@ -1,11 +1,15 @@ import { Tabs, Callout } from 'nextra/components' +import ApproveHash from '../events/ApproveHash.mdx' # `approveHash` Marks hash `hashToApprove` as approved. + + This can be used with a pre-approved hash transaction signature. + + - This can be used with a pre-approved hash transaction signature. IMPORTANT: The approved hash stays approved forever. There's no revocation mechanism, so it behaves similarly to ECDSA signatures. @@ -27,6 +31,7 @@ Marks hash `hashToApprove` as approved. } } ``` + @@ -48,10 +53,4 @@ The hash to mark as approved for signatures that are verified by this contract. ## Events -### `ApproveHash` - -```solidity -event ApproveHash(bytes32 approvedHash, address owner); -``` - -Emitted when a hash is approved by an owner. + diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 141b43d17..8f0f193f1 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -82,7 +82,7 @@ Hash of the data (could be either a message hash or transaction hash). - **Type:** `bytes` -Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. +Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature ([EIP-1271](../../home/glossary.md#eip-1271)), or approved hash. ```solidity focus=4 (ISafe safe).checkNSignatures( diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index ce81362e2..8e151a64e 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -51,7 +51,7 @@ Hash of the data (could be either a message hash or transaction hash). - **Type:** `bytes` -Signature data that should be verified. Can be packed ECDSA signature ((bytes32 r)(bytes32 s)(uint8 v)), contract signature (EIP-1271) or approved hash. +Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature ([EIP-1271](../../home/glossary.md#eip-1271)) or approved hash. ```solidity focus=3 (ISafe safe).checkSignatures( diff --git a/pages/reference-smart-account/signatures/signedMessages.mdx b/pages/reference-smart-account/signatures/signedMessages.mdx index f001f9f0c..303f8c140 100644 --- a/pages/reference-smart-account/signatures/signedMessages.mdx +++ b/pages/reference-smart-account/signatures/signedMessages.mdx @@ -1,4 +1,5 @@ import { Tabs } from 'nextra/components' +import SignMsg from '../events/SignMsg.mdx' # `signedMessages` @@ -42,10 +43,4 @@ Number denoting if an owner signed the hash. ## Events -### `SignMsg` - -```solidity -event SignMsg(bytes32 msgHash); -``` - -Emitted when a message is signed by an owner. + diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index e9c4a6190..16435786c 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -228,7 +228,7 @@ Token address (or `0x` if native token) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or `0x` if tx.origin). +Address of receiver of gas payment (or `0x` if `tx.origin`). ```solidity focus=10 (ISafe safe).encodeTransactionData( diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index e20c178f6..4252c01f5 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -1,4 +1,6 @@ import { Tabs, Callout } from 'nextra/components' +import ExecutionSuccess from '../events/ExecutionSuccess.mdx' +import ExecutionFailure from '../events/ExecutionFailure.mdx' # `execTransaction` @@ -256,7 +258,7 @@ Address of receiver of gas payment (or `0` if `tx.origin`). - **Type:** `bytes` -Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature (EIP-1271) or approved hash. +Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature ([EIP-1271](../../home/glossary.md#eip-1271)), or approved hash. ```solidity focus=11 (ISafe safe).execTransaction( @@ -275,18 +277,5 @@ Signature data that should be verified. Can be packed ECDSA signature `((bytes32 ## Events -### `ExecutionSuccess` - -```solidity -event ExecutionSuccess(bytes32 txHash, uint256 payment); -``` - -Emitted when a transaction is executed successfully. - -### `ExecutionFailure` - -```solidity -event ExecutionFailure(bytes32 txHash, uint256 payment); -``` - -Emitted when a transaction fails. + + diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index c7ad7c76b..6e55aba34 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -36,7 +36,7 @@ Returns the Safe transaction hash of a Safe transaction that can be signed by th 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -69,7 +69,7 @@ Destination address. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -90,7 +90,7 @@ Native token value. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -111,7 +111,7 @@ Data payload. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -132,7 +132,7 @@ Operation type. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -142,7 +142,7 @@ Operation type. - **Type:** `uint256` -Gas that should be used for the safe transaction. +Gas that should be used for the Safe transaction. ```solidity focus=6 (ISafe safe).getTransactionHash( @@ -153,7 +153,7 @@ Gas that should be used for the safe transaction. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -163,7 +163,7 @@ Gas that should be used for the safe transaction. - **Type:** `uint256` -Gas costs for data used to trigger the safe transaction. +Gas costs for data used to trigger the Safe transaction. ```solidity focus=7 (ISafe safe).getTransactionHash( @@ -174,7 +174,7 @@ Gas costs for data used to trigger the safe transaction. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -195,7 +195,7 @@ Maximum gas price that should be used for this transaction. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -226,7 +226,7 @@ Token address (or `0x` if native token) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or `0x` if tx.origin). +Address of receiver of gas payment (or `0x` if `tx.origin`). ```solidity focus=10 (ISafe safe).getTransactionHash( @@ -237,7 +237,7 @@ Address of receiver of gas payment (or `0x` if tx.origin). 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); @@ -258,7 +258,7 @@ Transaction nonce. 0, 0, 0, - "0x", + "0x...", payable(0), 1 ); diff --git a/pages/reference-smart-account/utilities/getStorageAt.mdx b/pages/reference-smart-account/utilities/getStorageAt.mdx index c8af50f79..209bf6906 100644 --- a/pages/reference-smart-account/utilities/getStorageAt.mdx +++ b/pages/reference-smart-account/utilities/getStorageAt.mdx @@ -2,7 +2,7 @@ import { Tabs } from 'nextra/components' # `getStorageAt` -Reads `length` bytes of storage in the currents contract. +Reads bytes of storage of length `length` in the current contract, from the position defined by `offset`. ## Usage diff --git a/redirects.json b/redirects.json index db3f23f33..053488484 100644 --- a/redirects.json +++ b/redirects.json @@ -848,40 +848,5 @@ "source": "/advanced/passkeys/supported-networks", "destination": "/advanced/smart-account-supported-networks?module=Safe+Passkey+Module", "permanent": true - }, - { - "source": "/reference-smart-account", - "destination": "/reference-smart-account/overview", - "permanent": true - }, - { - "source": "/reference-smart-account/owners", - "destination": "/reference-smart-account/owners/addOwnerWithThreshold", - "permanent": true - }, - { - "source": "/reference-smart-account/modules", - "destination": "/reference-smart-account/modules/enableModule", - "permanent": true - }, - { - "source": "/reference-smart-account/signatures", - "destination": "/reference-smart-account/signatures/checkSignatures", - "permanent": true - }, - { - "source": "/reference-smart-account/transactions", - "destination": "/reference-smart-account/transactions/execTransaction", - "permanent": true - }, - { - "source": "/reference-smart-account/utilities", - "destination": "/reference-smart-account/utilities/getStorageAt", - "permanent": true - }, - { - "source": "/reference-smart-account/setup", - "destination": "/reference-smart-account/setup/setup", - "permanent": true } -] \ No newline at end of file +] From da6629fa9ce82920027421703baa9950e25c1525 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 17:33:39 +0100 Subject: [PATCH 54/60] Make `prevOwner` definition more detailed --- .../reference-smart-account/owners/removeOwner.mdx | 13 +++++++++++-- pages/reference-smart-account/owners/swapOwner.mdx | 8 +++++++- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 8f831fcf5..8db142e49 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -8,7 +8,9 @@ import ChangedThreshold from '../../../components/Events/mdx/ChangedThreshold.md Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. -This action can only be done via a Safe transaction. + + This action can only be done via a Safe transaction. + ## Usage @@ -35,6 +37,7 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold } } ``` + @@ -46,7 +49,13 @@ Removes the owner `owner` from the Safe and updates the threshold to `_threshold - **Type:** `address` -Current owner address. +Owner address that is pointing to the owner to be removed in the contract [linked list](https://github.com/safe-global/safe-smart-account/blob/7f79aaf05c33df71d9cb687f0bc8a73fa39d25d5/contracts/base/OwnerManager.sol#L19). + + + A linked list is a data structure that allows efficient insertion and removal + of elements in a list. Each element in it will point to the next one. In Safe + contracts, the owners are stored in a linked list. + ```solidity focus=2 (ISafe safe).removeOwner( diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index 694d10f41..185e7627c 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -47,7 +47,13 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. - **Type:** `address` -Owner that points to the owner to be replaced in the linked list. +Owner address that is pointing to the owner to be removed in the contract [linked list](https://github.com/safe-global/safe-smart-account/blob/7f79aaf05c33df71d9cb687f0bc8a73fa39d25d5/contracts/base/OwnerManager.sol#L19). + + + A linked list is a data structure that allows efficient insertion and removal + of elements in a list. Each element in it will point to the next one. In Safe + contracts, the owners are stored in a linked list. + ```solidity focus=2 (ISafe safe).swapOwner( From 77e56c7315123b786e84b424b62dbce59a393439 Mon Sep 17 00:00:00 2001 From: louis-md Date: Wed, 20 Nov 2024 17:52:03 +0100 Subject: [PATCH 55/60] Fix typos --- pages/reference-smart-account/fallback/fallback.mdx | 2 +- pages/reference-smart-account/owners/changeThreshold.mdx | 2 +- pages/reference-smart-account/owners/removeOwner.mdx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/reference-smart-account/fallback/fallback.mdx b/pages/reference-smart-account/fallback/fallback.mdx index 8d0646403..62d1da3f4 100644 --- a/pages/reference-smart-account/fallback/fallback.mdx +++ b/pages/reference-smart-account/fallback/fallback.mdx @@ -1,5 +1,5 @@ import { Tabs } from 'nextra/components' -import SafeReceived from '../../../components/Events/mdx/SafeReceived.mdx' +import SafeReceived from '../events/SafeReceived.mdx' # `fallback` diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index fa5d3ac3b..e2759f7e5 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -1,5 +1,5 @@ import { Tabs, Callout } from 'nextra/components' -import ChangedThreshold from '../../../components/Events/mdx/ChangedThreshold.mdx' +import ChangedThreshold from '../events/ChangedThreshold.mdx' # `changeThreshold` diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 8db142e49..124c982cb 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -1,6 +1,6 @@ import { Tabs, Callout } from 'nextra/components' -import RemovedOwner from '../../../components/Events/mdx/RemovedOwner.mdx' -import ChangedThreshold from '../../../components/Events/mdx/ChangedThreshold.mdx' +import RemovedOwner from '../events/RemovedOwner.mdx' +import ChangedThreshold from '../events/ChangedThreshold.mdx' # `removeOwner` From 565cf14c985eb789c89c47acfe33145dbcdd7e56 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Thu, 21 Nov 2024 09:48:05 +0100 Subject: [PATCH 56/60] Update pages/reference-smart-account/signatures/checkSignatures.mdx --- pages/reference-smart-account/signatures/checkSignatures.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/signatures/checkSignatures.mdx b/pages/reference-smart-account/signatures/checkSignatures.mdx index 8e151a64e..dadfc74ac 100644 --- a/pages/reference-smart-account/signatures/checkSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkSignatures.mdx @@ -51,7 +51,7 @@ Hash of the data (could be either a message hash or transaction hash). - **Type:** `bytes` -Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature ([EIP-1271](../../home/glossary.md#eip-1271)) or approved hash. +Signature data that should be verified. Can be packed ECDSA signature `((bytes32 r)(bytes32 s)(uint8 v))`, contract signature ([EIP-1271](../../home/glossary.md#eip-1271)), or approved hash. ```solidity focus=3 (ISafe safe).checkSignatures( From c7048a198c8a92a340dca12f491b79fa4cc29208 Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 21 Nov 2024 10:58:35 +0100 Subject: [PATCH 57/60] Add Smart account version to reference index --- pages/reference-smart-account/overview.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/reference-smart-account/overview.mdx b/pages/reference-smart-account/overview.mdx index 6f0fbb2e9..4e2a60fdf 100644 --- a/pages/reference-smart-account/overview.mdx +++ b/pages/reference-smart-account/overview.mdx @@ -1,3 +1,3 @@ # Safe Smart Account Reference -This reference lists all public functions and events of the [Safe Smart Account](../advanced/smart-account-overview.mdx) contracts, logically clustered. +This reference lists all public functions and events of the [Safe Smart Account](../advanced/smart-account-overview.mdx) contracts version `1.4.1`, logically clustered. From 847fd03370946c6b633029525000eabb1dc216d4 Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 21 Nov 2024 11:16:36 +0100 Subject: [PATCH 58/60] Factorize callouts --- components/callouts/ModuleCallout.mdx | 7 +++++++ components/callouts/OnlySafeTxCallout.mdx | 5 +++++ pages/reference-smart-account/guards/setGuard.mdx | 10 ++++------ .../guards/setModuleGuard.mdx | 14 ++++---------- .../modules/disableModule.mdx | 3 ++- .../modules/enableModule.mdx | 3 ++- .../owners/addOwnerWithThreshold.mdx | 3 ++- .../owners/changeThreshold.mdx | 3 ++- .../reference-smart-account/owners/removeOwner.mdx | 5 ++--- pages/reference-smart-account/owners/swapOwner.mdx | 5 ++--- 10 files changed, 32 insertions(+), 26 deletions(-) create mode 100644 components/callouts/ModuleCallout.mdx create mode 100644 components/callouts/OnlySafeTxCallout.mdx diff --git a/components/callouts/ModuleCallout.mdx b/components/callouts/ModuleCallout.mdx new file mode 100644 index 000000000..fa26a545b --- /dev/null +++ b/components/callouts/ModuleCallout.mdx @@ -0,0 +1,7 @@ +import { Callout } from 'nextra/components' + + + Since a guard has the full power to block Safe transaction executions, a + broken guard can cause a denial of service for the Safe. Make sure to + carefully audit the guard code, and design recovery mechanisms. + diff --git a/components/callouts/OnlySafeTxCallout.mdx b/components/callouts/OnlySafeTxCallout.mdx new file mode 100644 index 000000000..9ccc9a85b --- /dev/null +++ b/components/callouts/OnlySafeTxCallout.mdx @@ -0,0 +1,5 @@ +import {Callout} from 'nextra/components' + + + This action can only be done via a Safe transaction. + diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index 535309fad..b6a796677 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -1,16 +1,14 @@ import { Tabs, Callout } from 'nextra/components' import ChangedGuard from '../events/ChangedGuard.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' +import ModuleCallout from '../../../components/callouts/ModuleCallout.mdx' # `setGuard` Set Transaction Guard `guard` that checks transactions before execution. -This action can only be done via a Safe transaction. - - Since a guard has the full power to block Safe transaction executions, a broken - guard can cause a denial of service for the Safe. Make sure to carefully audit - the guard code, and design recovery mechanisms. - + + ## Usage diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index a41791cbf..a658d677e 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -1,21 +1,15 @@ import { Tabs, Callout } from 'nextra/components' import ChangedModuleGuard from '../events/ChangedModuleGuard.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' +import ModuleCallout from '../../../components/callouts/ModuleCallout.mdx' # `setModuleGuard` Set a Module Guard that checks transactions initiated by the module before execution. - - This action can only be done via a Safe transaction. - - - - Since a Module Guard has full power to block Safe transaction execution - initiated via a module, a broken Module Guard can cause a denial of service - for the Safe Modules. Make sure to carefully audit the Module Guard code and - design recovery mechanisms. - + + ## Usage diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx index 6654079ff..dc29347b4 100644 --- a/pages/reference-smart-account/modules/disableModule.mdx +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -1,11 +1,12 @@ import { Tabs, Callout } from 'nextra/components' import DisabledModule from '../events/DisabledModule.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `disableModule` Disables the module `module` for the Safe. -This action can only be done via a Safe transaction. + ## Usage diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index 801c32bc8..b6ef16877 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -1,11 +1,12 @@ import { Tabs, Callout } from 'nextra/components' import EnabledModule from '../events/EnabledModule.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `enableModule` Enables a new Safe Module in a Safe account. -This action can only be done via a Safe transaction. + ## Usage diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index 8bc1d2955..f963e399d 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -1,12 +1,13 @@ import { Tabs, Callout } from 'nextra/components' import AddedOwner from '../events/AddedOwner.mdx' import ChangedThreshold from '../events/ChangedThreshold.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `addOwnerWithThreshold` Adds the owner `owner` to the Safe and updates the threshold to `_threshold`. -This action can only be done via a Safe transaction. + ## Usage diff --git a/pages/reference-smart-account/owners/changeThreshold.mdx b/pages/reference-smart-account/owners/changeThreshold.mdx index e2759f7e5..a34a304d5 100644 --- a/pages/reference-smart-account/owners/changeThreshold.mdx +++ b/pages/reference-smart-account/owners/changeThreshold.mdx @@ -1,11 +1,12 @@ import { Tabs, Callout } from 'nextra/components' import ChangedThreshold from '../events/ChangedThreshold.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `changeThreshold` Changes the threshold of the Safe to `_threshold`. -This action can only be done via a Safe transaction. + ## Usage diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 124c982cb..0ebaea8ed 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -1,6 +1,7 @@ import { Tabs, Callout } from 'nextra/components' import RemovedOwner from '../events/RemovedOwner.mdx' import ChangedThreshold from '../events/ChangedThreshold.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `removeOwner` @@ -8,9 +9,7 @@ import ChangedThreshold from '../events/ChangedThreshold.mdx' Removes the owner `owner` from the Safe and updates the threshold to `_threshold`. - - This action can only be done via a Safe transaction. - + ## Usage diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index 185e7627c..b10e6cc61 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -1,14 +1,13 @@ import { Tabs, Callout } from 'nextra/components' import AddedOwner from '../events/AddedOwner.mdx' import RemovedOwner from '../events/RemovedOwner.mdx' +import OnlySafeTxCallout from '../../../components/callouts/OnlySafeTxCallout.mdx' # `swapOwner` Replaces the owner `oldOwner` in the Safe with `newOwner`. - - This action can only be done via a Safe transaction. - + ## Usage From be570c9698f765c41d02e97a1b3e39184b9f0c71 Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 21 Nov 2024 11:16:46 +0100 Subject: [PATCH 59/60] Factorize callouts --- components/callouts/OnlySafeTxCallout.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/callouts/OnlySafeTxCallout.mdx b/components/callouts/OnlySafeTxCallout.mdx index 9ccc9a85b..c658533cf 100644 --- a/components/callouts/OnlySafeTxCallout.mdx +++ b/components/callouts/OnlySafeTxCallout.mdx @@ -1,4 +1,4 @@ -import {Callout} from 'nextra/components' +import { Callout } from 'nextra/components' This action can only be done via a Safe transaction. From 11336b1f399180b8790081be443e599de3b1376b Mon Sep 17 00:00:00 2001 From: louis-md Date: Thu, 21 Nov 2024 14:24:22 +0100 Subject: [PATCH 60/60] Disambiguate `0`, `0x`, `0x...` and `address(0)` --- .../fallback/setFallbackHandler.mdx | 4 +- .../guards/setGuard.mdx | 6 +- .../guards/setModuleGuard.mdx | 6 +- .../modules/disableModule.mdx | 10 +-- .../modules/enableModule.mdx | 4 +- .../modules/execTransactionFromModule.mdx | 20 +++--- .../execTransactionFromModuleReturnData.mdx | 21 +++--- .../modules/getModulesPaginated.mdx | 10 +-- .../modules/isModuleEnabled.mdx | 4 +- .../owners/addOwnerWithThreshold.mdx | 6 +- .../owners/isOwner.mdx | 4 +- .../owners/removeOwner.mdx | 16 ++--- .../owners/swapOwner.mdx | 24 +++---- pages/reference-smart-account/setup/setup.mdx | 6 +- .../signatures/checkNSignatures.mdx | 10 +-- .../transactions/encodeTransactionData.mdx | 70 +++++++++---------- .../transactions/execTransaction.mdx | 66 ++++++++--------- .../transactions/getTransactionHash.mdx | 44 ++++++------ .../transactions/simulateAndRevert.mdx | 6 +- 19 files changed, 169 insertions(+), 168 deletions(-) diff --git a/pages/reference-smart-account/fallback/setFallbackHandler.mdx b/pages/reference-smart-account/fallback/setFallbackHandler.mdx index d9caedd94..59c5aa778 100644 --- a/pages/reference-smart-account/fallback/setFallbackHandler.mdx +++ b/pages/reference-smart-account/fallback/setFallbackHandler.mdx @@ -23,7 +23,7 @@ Set Fallback Handler to `handler` for the Safe. contract Example { function example() ... { - (ISafe safe).setFallbackHandler("0x..."); + (ISafe safe).setFallbackHandler(0x...); } } ``` @@ -42,7 +42,7 @@ Contract to handle fallback calls. ```solidity focus=2 (ISafe safe).setFallbackHandler( - "0x..." + 0x... ); ``` diff --git a/pages/reference-smart-account/guards/setGuard.mdx b/pages/reference-smart-account/guards/setGuard.mdx index b6a796677..1c2aa014e 100644 --- a/pages/reference-smart-account/guards/setGuard.mdx +++ b/pages/reference-smart-account/guards/setGuard.mdx @@ -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...); } } ``` @@ -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... ); ``` diff --git a/pages/reference-smart-account/guards/setModuleGuard.mdx b/pages/reference-smart-account/guards/setModuleGuard.mdx index a658d677e..016addc60 100644 --- a/pages/reference-smart-account/guards/setModuleGuard.mdx +++ b/pages/reference-smart-account/guards/setModuleGuard.mdx @@ -24,7 +24,7 @@ execution. contract Example { function example() ... { - (ISafe safe).setModuleGuard("0x..."); + (ISafe safe).setModuleGuard(0x...); } } ``` @@ -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... ); ``` diff --git a/pages/reference-smart-account/modules/disableModule.mdx b/pages/reference-smart-account/modules/disableModule.mdx index dc29347b4..eedc3e5e2 100644 --- a/pages/reference-smart-account/modules/disableModule.mdx +++ b/pages/reference-smart-account/modules/disableModule.mdx @@ -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...); } } ``` @@ -40,8 +40,8 @@ Previous module in the modules linked list. ```solidity focus=2 (ISafe safe).disableModule( - "0x...", - "0x..." + 0x..., + 0x... ); ``` @@ -53,8 +53,8 @@ Module to be removed. ```solidity focus=3 (ISafe safe).disableModule( - "0x...", - "0x..." + 0x..., + 0x... ); ``` diff --git a/pages/reference-smart-account/modules/enableModule.mdx b/pages/reference-smart-account/modules/enableModule.mdx index b6ef16877..072ab75c6 100644 --- a/pages/reference-smart-account/modules/enableModule.mdx +++ b/pages/reference-smart-account/modules/enableModule.mdx @@ -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...); } } ``` @@ -40,7 +40,7 @@ Safe Module to be enabled. ```solidity focus=2 (ISafe safe).enableModule( - "0x..." + 0x... ); ``` diff --git a/pages/reference-smart-account/modules/execTransactionFromModule.mdx b/pages/reference-smart-account/modules/execTransactionFromModule.mdx index 7e9defc80..e3a4b3edd 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModule.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModule.mdx @@ -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 ); @@ -61,8 +61,8 @@ Destination address of module transaction. ```solidity focus=2 (ISafe safe).execTransactionFromModule( - "0x...", - "0x...", + 0x..., + 0, "0x...", Enum.Operation.Call ); @@ -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 ); @@ -91,8 +91,8 @@ Data payload of the module transaction. ```solidity focus=4 (ISafe safe).execTransactionFromModule( - "0x...", - "0x...", + 0x..., + 0, "0x...", Enum.Operation.Call ); @@ -106,8 +106,8 @@ Operation type of the module transaction. ```solidity focus=5 (ISafe safe).execTransactionFromModule( - "0x...", - "0x...", + 0x..., + 0, "0x...", Enum.Operation.Call ); diff --git a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx index ac94c2509..56c5095b2 100644 --- a/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx +++ b/pages/reference-smart-account/modules/execTransactionFromModuleReturnData.mdx @@ -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 ); } } ``` + @@ -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 ); @@ -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 ); @@ -92,8 +93,8 @@ Data payload of the module transaction. ```solidity focus=4 (ISafe safe).execTransactionFromModuleReturnData( - "0x...", - "0x...", + 0x..., + 0, "0x...", Enum.Operation.Call ); @@ -107,8 +108,8 @@ Operation type of the module transaction. ```solidity focus=5 (ISafe safe).execTransactionFromModuleReturnData( - "0x...", - "0x...", + 0x..., + 0, "0x...", Enum.Operation.Call ); diff --git a/pages/reference-smart-account/modules/getModulesPaginated.mdx b/pages/reference-smart-account/modules/getModulesPaginated.mdx index 149d37bf8..c23176ef8 100644 --- a/pages/reference-smart-account/modules/getModulesPaginated.mdx +++ b/pages/reference-smart-account/modules/getModulesPaginated.mdx @@ -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); } } ``` @@ -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 ); ``` @@ -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 ); ``` diff --git a/pages/reference-smart-account/modules/isModuleEnabled.mdx b/pages/reference-smart-account/modules/isModuleEnabled.mdx index e66678dd7..63caf11e1 100644 --- a/pages/reference-smart-account/modules/isModuleEnabled.mdx +++ b/pages/reference-smart-account/modules/isModuleEnabled.mdx @@ -17,7 +17,7 @@ Returns if a module is enabled. contract Example { function example() … { - (ISafe safe).isModuleEnabled("0x..."); + (ISafe safe).isModuleEnabled(0x...); } } ``` @@ -42,6 +42,6 @@ Address of the module. ```solidity focus=2 (ISafe safe).isModuleEnabled( - "0x..." + 0x... ); ``` diff --git a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx index f963e399d..a60be62dd 100644 --- a/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx +++ b/pages/reference-smart-account/owners/addOwnerWithThreshold.mdx @@ -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); } } ``` @@ -41,7 +41,7 @@ New owner address. ```solidity focus=2 (ISafe safe).addOwnerWithThreshold( - "0x...", + 0x..., 1 ); ``` @@ -54,7 +54,7 @@ New threshold. ```solidity focus=3 (ISafe safe).addOwnerWithThreshold( - "0x...", + 0x..., 1 ); ``` diff --git a/pages/reference-smart-account/owners/isOwner.mdx b/pages/reference-smart-account/owners/isOwner.mdx index ac91e9359..6b5b7919a 100644 --- a/pages/reference-smart-account/owners/isOwner.mdx +++ b/pages/reference-smart-account/owners/isOwner.mdx @@ -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...); } } ``` @@ -44,6 +44,6 @@ Owner address. ```solidity focus=2 (ISafe safe).isOwner( - "0x..." + 0x... ); ``` diff --git a/pages/reference-smart-account/owners/removeOwner.mdx b/pages/reference-smart-account/owners/removeOwner.mdx index 0ebaea8ed..0d907241f 100644 --- a/pages/reference-smart-account/owners/removeOwner.mdx +++ b/pages/reference-smart-account/owners/removeOwner.mdx @@ -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 ); } @@ -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 ); ``` @@ -72,8 +72,8 @@ Owner address to be removed. ```solidity focus=3 (ISafe safe).removeOwner( - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -86,8 +86,8 @@ New threshold. ```solidity focus=4 (ISafe safe).removeOwner( - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` diff --git a/pages/reference-smart-account/owners/swapOwner.mdx b/pages/reference-smart-account/owners/swapOwner.mdx index b10e6cc61..2c31eace2 100644 --- a/pages/reference-smart-account/owners/swapOwner.mdx +++ b/pages/reference-smart-account/owners/swapOwner.mdx @@ -27,9 +27,9 @@ Replaces the owner `oldOwner` in the Safe with `newOwner`. contract Example { function example() … { (ISafe safe).swapOwner( - "0x...", - "0x...", - "0x..." + 0x..., + 0x..., + 0x... ); } } @@ -56,9 +56,9 @@ Owner address that is pointing to the owner to be removed in the contract [linke ```solidity focus=2 (ISafe safe).swapOwner( - "0x...", - "0x...", - "0x..." + 0x..., + 0x..., + 0x... ); ``` @@ -70,9 +70,9 @@ Owner address to be replaced. ```solidity focus=3 (ISafe safe).swapOwner( - "0x...", - "0x...", - "0x..." + 0x..., + 0x..., + 0x... ); ``` @@ -84,9 +84,9 @@ New owner address. ```solidity focus=4 (ISafe safe).swapOwner( - "0x...", - "0x...", - "0x..." + 0x..., + 0x..., + 0x... ); ``` diff --git a/pages/reference-smart-account/setup/setup.mdx b/pages/reference-smart-account/setup/setup.mdx index fd2fb9906..76da1a31e 100644 --- a/pages/reference-smart-account/setup/setup.mdx +++ b/pages/reference-smart-account/setup/setup.mdx @@ -26,7 +26,7 @@ Sets an initial storage of the Safe contract. contract Example { function example() ... { - (ISafe safe).setup(["0x...", "0x..."], 1); + (ISafe safe).setup([0x..., 0x...], 1); } } ``` @@ -45,7 +45,7 @@ List of Safe owners. ```solidity focus=2 (ISafe safe).setup( - ["0x...", "0x..."], + [0x..., 0x...], 1 ); ``` @@ -58,7 +58,7 @@ Number of required confirmations for a Safe transaction. ```solidity focus=3 (ISafe safe).setup( - ["0x...", "0x..."], + [0x..., 0x...], 1 ); ``` diff --git a/pages/reference-smart-account/signatures/checkNSignatures.mdx b/pages/reference-smart-account/signatures/checkNSignatures.mdx index 6af3483ec..888465955 100644 --- a/pages/reference-smart-account/signatures/checkNSignatures.mdx +++ b/pages/reference-smart-account/signatures/checkNSignatures.mdx @@ -28,7 +28,7 @@ Checks whether the signature provided is valid for the provided data and hash. R contract Example { function example() ... { (ISafe safe).checkNSignatures( - "0x...", + 0x..., "0x...", "0x...", 1 @@ -56,7 +56,7 @@ Address executing the transaction. ```solidity focus=2 (ISafe safe).checkNSignatures( - "0x...", + 0x..., "0x...", "0x...", 1 @@ -71,7 +71,7 @@ Hash of the data (could be either a message hash or transaction hash). ```solidity focus=3 (ISafe safe).checkNSignatures( - "0x...", + 0x..., "0x...", "0x...", 1 @@ -86,7 +86,7 @@ Signature data that should be verified. Can be packed ECDSA signature `((bytes32 ```solidity focus=4 (ISafe safe).checkNSignatures( - "0x...", + 0x..., "0x...", "0x...", 1 @@ -101,7 +101,7 @@ Amount of required valid signatures. ```solidity focus=5 (ISafe safe).checkNSignatures( - "0x...", + 0x..., "0x...", "0x...", 1 diff --git a/pages/reference-smart-account/transactions/encodeTransactionData.mdx b/pages/reference-smart-account/transactions/encodeTransactionData.mdx index 16435786c..c48df4f57 100644 --- a/pages/reference-smart-account/transactions/encodeTransactionData.mdx +++ b/pages/reference-smart-account/transactions/encodeTransactionData.mdx @@ -29,15 +29,15 @@ Encodes the transaction data for `execTransaction`. contract Example { function example() ... { (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); } @@ -64,15 +64,15 @@ Destination address. ```solidity focus=2 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -85,15 +85,15 @@ Native token value. ```solidity focus=3 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -106,15 +106,15 @@ Data payload. ```solidity focus=4 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -127,15 +127,15 @@ Operation type. ```solidity focus=5 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -148,15 +148,15 @@ Gas that should be used for the Safe transaction. ```solidity focus=6 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -169,15 +169,15 @@ Gas costs for data used to trigger the Safe transaction. ```solidity focus=7 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -190,15 +190,15 @@ Maximum gas price that should be used for this transaction. ```solidity focus=8 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -207,19 +207,19 @@ Maximum gas price that should be used for this transaction. - **Type:** `address` -Token address (or `0x` if native token) that is used for the payment. +Token address (or `address(0)` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -228,19 +228,19 @@ Token address (or `0x` if native token) that is used for the payment. - **Type:** `address` -Address of receiver of gas payment (or `0x` if `tx.origin`). +Address of receiver of gas payment (or `address(0)` if `tx.origin`). ```solidity focus=10 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` @@ -253,15 +253,15 @@ Transaction nonce. ```solidity focus=11 (ISafe safe).encodeTransactionData( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 100000, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., 1 ); ``` diff --git a/pages/reference-smart-account/transactions/execTransaction.mdx b/pages/reference-smart-account/transactions/execTransaction.mdx index b8abae81e..1b0b3b42b 100644 --- a/pages/reference-smart-account/transactions/execTransaction.mdx +++ b/pages/reference-smart-account/transactions/execTransaction.mdx @@ -38,15 +38,15 @@ Executes a Safe transaction to `to` with `value` (native currency) and pays `gas contract Example { function example() ... { (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); } @@ -73,15 +73,15 @@ Destination address of Safe transaction. ```solidity focus=2 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -94,15 +94,15 @@ Native token value of Safe transaction. ```solidity focus=3 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -115,15 +115,15 @@ Data payload of Safe transaction. ```solidity focus=4 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -136,15 +136,15 @@ Operation type of Safe transaction. ```solidity focus=5 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -157,15 +157,15 @@ Gas that should be used for the Safe transaction. ```solidity focus=6 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -178,15 +178,15 @@ Gas costs that are independent of the transaction execution (for example, the ba ```solidity focus=7 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -199,15 +199,15 @@ Gas price that should be used for the payment calculation. ```solidity focus=8 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -220,15 +220,15 @@ Token address (or `0x` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -241,15 +241,15 @@ Address of receiver of gas payment (or `0` if `tx.origin`). ```solidity focus=10 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` @@ -262,15 +262,15 @@ Signature data that should be verified. Can be packed ECDSA signature `((bytes32 ```solidity focus=11 (ISafe safe).execTransaction( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", - "0x...", + 0x..., + 0x..., "0x..." ); ``` diff --git a/pages/reference-smart-account/transactions/getTransactionHash.mdx b/pages/reference-smart-account/transactions/getTransactionHash.mdx index 6e55aba34..cc4788bd5 100644 --- a/pages/reference-smart-account/transactions/getTransactionHash.mdx +++ b/pages/reference-smart-account/transactions/getTransactionHash.mdx @@ -29,14 +29,14 @@ Returns the Safe transaction hash of a Safe transaction that can be signed by th contract Example { function example() ... { (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -62,14 +62,14 @@ Destination address. ```solidity focus=2 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -83,14 +83,14 @@ Native token value. ```solidity focus=3 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -104,14 +104,14 @@ Data payload. ```solidity focus=4 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -125,14 +125,14 @@ Operation type. ```solidity focus=5 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -146,14 +146,14 @@ Gas that should be used for the Safe transaction. ```solidity focus=6 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -167,14 +167,14 @@ Gas costs for data used to trigger the Safe transaction. ```solidity focus=7 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -188,14 +188,14 @@ Maximum gas price that should be used for this transaction. ```solidity focus=8 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -209,14 +209,14 @@ Token address (or `0x` if native token) that is used for the payment. ```solidity focus=9 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -230,14 +230,14 @@ Address of receiver of gas payment (or `0x` if `tx.origin`). ```solidity focus=10 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); @@ -251,14 +251,14 @@ Transaction nonce. ```solidity focus=11 (ISafe safe).getTransactionHash( - "0x...", + 0x..., 0, "0x...", Enum.Operation.Call, 0, 0, 0, - "0x...", + 0x..., payable(0), 1 ); diff --git a/pages/reference-smart-account/transactions/simulateAndRevert.mdx b/pages/reference-smart-account/transactions/simulateAndRevert.mdx index 4b14a5294..290d276e6 100644 --- a/pages/reference-smart-account/transactions/simulateAndRevert.mdx +++ b/pages/reference-smart-account/transactions/simulateAndRevert.mdx @@ -22,7 +22,7 @@ This method reverts with data equal to `abi.encode(bool(success), bytes(response contract Example { function example() ... { - (ISafe safe).simulateAndRevert("0x...", "0x..."); + (ISafe safe).simulateAndRevert(0x..., "0x..."); } } ``` @@ -39,7 +39,7 @@ Address of the contract containing the code to execute. ```solidity focus=2 (ISafe safe).simulateAndRevert( - "0x...", + 0x..., "0x..." ); ``` @@ -52,7 +52,7 @@ Payload to be executed. ```solidity focus=3 (ISafe safe).simulateAndRevert( - "0x...", + 0x..., "0x..." ); ```