From 9c2855b85a0b675f9709ddb899b7ad202f95ca0c Mon Sep 17 00:00:00 2001 From: Krishang Date: Fri, 21 Apr 2023 15:30:32 -0400 Subject: [PATCH] docs update + remove tw from name --- ...WDynamicAccount.sol => DynamicAccount.sol} | 10 +- ...tFactory.sol => DynamicAccountFactory.sol} | 12 +- ...AccountFactory.sol => IAccountFactory.sol} | 2 +- .../{TWAccountCore.sol => AccountCore.sol} | 22 +- ...ountExtension.sol => AccountExtension.sol} | 9 +- ...WManagedAccount.sol => ManagedAccount.sol} | 8 +- ...tFactory.sol => ManagedAccountFactory.sol} | 12 +- .../{TWAccount.sol => Account.sol} | 27 +- ...WAccountFactory.sol => AccountFactory.sol} | 12 +- docs/{TWAccountLogic.md => Account.md} | 58 +- docs/AccountCore.md | 272 ++++++++ docs/AccountExtension.md | 455 +++++++++++++ ...{TWAccountFactory.md => AccountFactory.md} | 27 +- docs/AccountStorage.md | 12 + docs/AirdropERC1155.md | 146 +++- docs/AirdropERC20.md | 156 ++++- docs/AirdropERC721.md | 156 ++++- .../{TWAccountRouter.md => DynamicAccount.md} | 7 +- docs/DynamicAccountFactory.md | 120 ++++ docs/EntryPoint.md | 621 ++++++++++++++++++ docs/Exec.md | 12 + ...TWAccountFactory.md => IAccountFactory.md} | 23 +- docs/IAirdropERC1155.md | 102 ++- docs/IAirdropERC20.md | 102 ++- docs/IAirdropERC721.md | 102 ++- docs/IPaymaster.md | 58 ++ docs/ManagedAccount.md | 311 +++++++++ docs/SenderCreator.md | 56 ++ docs/StakeManager.md | 252 +++++++ docs/TWAccountStorage.md | 12 - docs/TWManagedAccountFactory.md | 607 +++++++++++++++++ 31 files changed, 3573 insertions(+), 208 deletions(-) rename contracts/smart-wallet/dynamic/{TWDynamicAccount.sol => DynamicAccount.sol} (90%) rename contracts/smart-wallet/dynamic/{TWDynamicAccountFactory.sol => DynamicAccountFactory.sol} (89%) rename contracts/smart-wallet/interfaces/{ITWAccountFactory.sol => IAccountFactory.sol} (97%) rename contracts/smart-wallet/managed/{TWAccountCore.sol => AccountCore.sol} (89%) rename contracts/smart-wallet/managed/{TWAccountExtension.sol => AccountExtension.sol} (93%) rename contracts/smart-wallet/managed/{TWManagedAccount.sol => ManagedAccount.sol} (86%) rename contracts/smart-wallet/managed/{TWManagedAccountFactory.sol => ManagedAccountFactory.sol} (89%) rename contracts/smart-wallet/non-upgradeable/{TWAccount.sol => Account.sol} (90%) rename contracts/smart-wallet/non-upgradeable/{TWAccountFactory.sol => AccountFactory.sol} (90%) rename docs/{TWAccountLogic.md => Account.md} (91%) create mode 100644 docs/AccountCore.md create mode 100644 docs/AccountExtension.md rename docs/{TWAccountFactory.md => AccountFactory.md} (68%) create mode 100644 docs/AccountStorage.md rename docs/{TWAccountRouter.md => DynamicAccount.md} (99%) create mode 100644 docs/DynamicAccountFactory.md create mode 100644 docs/EntryPoint.md create mode 100644 docs/Exec.md rename docs/{ITWAccountFactory.md => IAccountFactory.md} (59%) create mode 100644 docs/IPaymaster.md create mode 100644 docs/ManagedAccount.md create mode 100644 docs/SenderCreator.md create mode 100644 docs/StakeManager.md delete mode 100644 docs/TWAccountStorage.md create mode 100644 docs/TWManagedAccountFactory.md diff --git a/contracts/smart-wallet/dynamic/TWDynamicAccount.sol b/contracts/smart-wallet/dynamic/DynamicAccount.sol similarity index 90% rename from contracts/smart-wallet/dynamic/TWDynamicAccount.sol rename to contracts/smart-wallet/dynamic/DynamicAccount.sol index 251a7406b..92e22297c 100644 --- a/contracts/smart-wallet/dynamic/TWDynamicAccount.sol +++ b/contracts/smart-wallet/dynamic/DynamicAccount.sol @@ -5,7 +5,7 @@ pragma solidity ^0.8.11; /* solhint-disable no-inline-assembly */ /* solhint-disable reason-string */ -import "../non-upgradeable/TWAccount.sol"; +import "../non-upgradeable/Account.sol"; import "../utils/BaseRouter.sol"; // $$\ $$\ $$\ $$\ $$\ @@ -17,7 +17,7 @@ import "../utils/BaseRouter.sol"; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -contract TWDynamicAccount is TWAccount, BaseRouter { +contract DynamicAccount is Account, BaseRouter { /*/////////////////////////////////////////////////////////////// Constants //////////////////////////////////////////////////////////////*/ @@ -28,9 +28,9 @@ contract TWDynamicAccount is TWAccount, BaseRouter { Constructor and Initializer //////////////////////////////////////////////////////////////*/ - receive() external payable override(Router, TWAccount) {} + receive() external payable override(Router, Account) {} - constructor(IEntryPoint _entrypoint) TWAccount(_entrypoint) {} + constructor(IEntryPoint _entrypoint) Account(_entrypoint) {} function initialize(address _defaultAdmin) public override initializer { _setupRole(DEFAULT_ADMIN_ROLE, _defaultAdmin); @@ -42,7 +42,7 @@ contract TWDynamicAccount is TWAccount, BaseRouter { //////////////////////////////////////////////////////////////*/ /// @dev See {IERC165-supportsInterface}. - function supportsInterface(bytes4 interfaceId) public view virtual override(TWAccount, BaseRouter) returns (bool) { + function supportsInterface(bytes4 interfaceId) public view virtual override(Account, BaseRouter) returns (bool) { return interfaceId == type(IBaseRouter).interfaceId || interfaceId == type(IRouter).interfaceId || diff --git a/contracts/smart-wallet/dynamic/TWDynamicAccountFactory.sol b/contracts/smart-wallet/dynamic/DynamicAccountFactory.sol similarity index 89% rename from contracts/smart-wallet/dynamic/TWDynamicAccountFactory.sol rename to contracts/smart-wallet/dynamic/DynamicAccountFactory.sol index 5bf7d08b2..f5293cc3e 100644 --- a/contracts/smart-wallet/dynamic/TWDynamicAccountFactory.sol +++ b/contracts/smart-wallet/dynamic/DynamicAccountFactory.sol @@ -7,10 +7,10 @@ import "@openzeppelin/contracts/proxy/Clones.sol"; import "../../lib/TWStringSet.sol"; // Interface -import "./../interfaces/ITWAccountFactory.sol"; +import "./../interfaces/IAccountFactory.sol"; // Smart wallet implementation -import "./TWDynamicAccount.sol"; +import "./DynamicAccount.sol"; // $$\ $$\ $$\ $$\ $$\ // $$ | $$ | \__| $$ | $$ | @@ -21,21 +21,21 @@ import "./TWDynamicAccount.sol"; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -contract TWDynamicAccountFactory is ITWAccountFactory, Multicall { +contract DynamicAccountFactory is IAccountFactory, Multicall { using TWStringSet for TWStringSet.Set; /*/////////////////////////////////////////////////////////////// State //////////////////////////////////////////////////////////////*/ - TWDynamicAccount private immutable _accountImplementation; + DynamicAccount private immutable _accountImplementation; /*/////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ constructor(IEntryPoint _entrypoint) { - _accountImplementation = new TWDynamicAccount(_entrypoint); + _accountImplementation = new DynamicAccount(_entrypoint); } /*/////////////////////////////////////////////////////////////// @@ -54,7 +54,7 @@ contract TWDynamicAccountFactory is ITWAccountFactory, Multicall { account = Clones.cloneDeterministic(impl, salt); - TWAccount(payable(account)).initialize(_admin); + Account(payable(account)).initialize(_admin); emit AccountCreated(account, _admin, _accountId); diff --git a/contracts/smart-wallet/interfaces/ITWAccountFactory.sol b/contracts/smart-wallet/interfaces/IAccountFactory.sol similarity index 97% rename from contracts/smart-wallet/interfaces/ITWAccountFactory.sol rename to contracts/smart-wallet/interfaces/IAccountFactory.sol index 147a33015..22a337411 100644 --- a/contracts/smart-wallet/interfaces/ITWAccountFactory.sol +++ b/contracts/smart-wallet/interfaces/IAccountFactory.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.12; -interface ITWAccountFactory { +interface IAccountFactory { /*/////////////////////////////////////////////////////////////// Events //////////////////////////////////////////////////////////////*/ diff --git a/contracts/smart-wallet/managed/TWAccountCore.sol b/contracts/smart-wallet/managed/AccountCore.sol similarity index 89% rename from contracts/smart-wallet/managed/TWAccountCore.sol rename to contracts/smart-wallet/managed/AccountCore.sol index e783fafa4..9ec0e4710 100644 --- a/contracts/smart-wallet/managed/TWAccountCore.sol +++ b/contracts/smart-wallet/managed/AccountCore.sol @@ -29,22 +29,22 @@ import "../../dynamic-contracts/extension/PermissionsEnumerable.sol"; Storage layout //////////////////////////////////////////////////////////////*/ -library TWAccountStorage { - bytes32 internal constant TWACCOUNT_STORAGE_POSITION = keccak256("twaccount.storage"); +library AccountStorage { + bytes32 internal constant ACCOUNT_STORAGE_POSITION = keccak256("account.storage"); struct Data { uint256 nonce; } - function accountStorage() internal pure returns (Data storage twaccountData) { - bytes32 position = TWACCOUNT_STORAGE_POSITION; + function accountStorage() internal pure returns (Data storage accountData) { + bytes32 position = ACCOUNT_STORAGE_POSITION; assembly { - twaccountData.slot := position + accountData.slot := position } } } -contract TWAccountCore is Initializable, Multicall, BaseAccount { +contract AccountCore is Initializable, Multicall, BaseAccount { using ECDSA for bytes32; /*/////////////////////////////////////////////////////////////// @@ -79,8 +79,8 @@ contract TWAccountCore is Initializable, Multicall, BaseAccount { /// @notice Returns the nonce of the account. function nonce() public view virtual override returns (uint256) { - TWAccountStorage.Data storage twaccountData = TWAccountStorage.accountStorage(); - return twaccountData.nonce; + AccountStorage.Data storage accountData = AccountStorage.accountStorage(); + return accountData.nonce; } /// @notice Returns the EIP 4337 entrypoint contract. @@ -109,7 +109,7 @@ contract TWAccountCore is Initializable, Multicall, BaseAccount { /// @notice Withdraw funds for this account from Entrypoint. function withdrawDepositTo(address payable withdrawAddress, uint256 amount) public { - require(_hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "TWAccount: not admin"); + require(_hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "Account: not admin"); entryPoint().withdrawTo(withdrawAddress, amount); } @@ -119,8 +119,8 @@ contract TWAccountCore is Initializable, Multicall, BaseAccount { /// @dev Validates the nonce of a user operation and updates account nonce. function _validateAndUpdateNonce(UserOperation calldata userOp) internal override { - TWAccountStorage.Data storage data = TWAccountStorage.accountStorage(); - require(data.nonce == userOp.nonce, "TWAccount: invalid nonce"); + AccountStorage.Data storage data = AccountStorage.accountStorage(); + require(data.nonce == userOp.nonce, "Account: invalid nonce"); data.nonce += 1; } diff --git a/contracts/smart-wallet/managed/TWAccountExtension.sol b/contracts/smart-wallet/managed/AccountExtension.sol similarity index 93% rename from contracts/smart-wallet/managed/TWAccountExtension.sol rename to contracts/smart-wallet/managed/AccountExtension.sol index 53bdb0801..379d5b83a 100644 --- a/contracts/smart-wallet/managed/TWAccountExtension.sol +++ b/contracts/smart-wallet/managed/AccountExtension.sol @@ -23,7 +23,7 @@ import "../../openzeppelin-presets/utils/cryptography/ECDSA.sol"; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -contract TWAccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Holder, ERC1155Holder { +contract AccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Holder, ERC1155Holder { using ECDSA for bytes32; /*/////////////////////////////////////////////////////////////// @@ -50,7 +50,7 @@ contract TWAccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Ho modifier onlyAdminOrEntrypoint() { require( msg.sender == entrypointContract || hasRole(DEFAULT_ADMIN_ROLE, msg.sender), - "TWAccount: not admin or EntryPoint." + "Account: not admin or EntryPoint." ); _; } @@ -86,10 +86,7 @@ contract TWAccountExtension is ContractMetadata, PermissionsEnumerable, ERC721Ho uint256[] calldata _value, bytes[] calldata _calldata ) external virtual onlyAdminOrEntrypoint { - require( - _target.length == _calldata.length && _target.length == _value.length, - "TWAccount: wrong array lengths." - ); + require(_target.length == _calldata.length && _target.length == _value.length, "Account: wrong array lengths."); for (uint256 i = 0; i < _target.length; i++) { _call(_target[i], _value[i], _calldata[i]); } diff --git a/contracts/smart-wallet/managed/TWManagedAccount.sol b/contracts/smart-wallet/managed/ManagedAccount.sol similarity index 86% rename from contracts/smart-wallet/managed/TWManagedAccount.sol rename to contracts/smart-wallet/managed/ManagedAccount.sol index b426d912d..1cec20996 100644 --- a/contracts/smart-wallet/managed/TWManagedAccount.sol +++ b/contracts/smart-wallet/managed/ManagedAccount.sol @@ -14,13 +14,13 @@ pragma solidity ^0.8.11; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -import "./TWAccountCore.sol"; +import "./AccountCore.sol"; import "lib/dynamic-contracts/src/core/Router.sol"; -contract TWManagedAccount is TWAccountCore, Router { +contract ManagedAccount is AccountCore, Router { address public factory; - constructor(IEntryPoint _entrypoint) TWAccountCore(_entrypoint) {} + constructor(IEntryPoint _entrypoint) AccountCore(_entrypoint) {} /// @notice Initializes the smart contract wallet. function initialize(address _defaultAdmin) public virtual override initializer { @@ -29,7 +29,7 @@ contract TWManagedAccount is TWAccountCore, Router { } // solhint-disable-next-line no-empty-blocks - receive() external payable virtual override(Router, TWAccountCore) {} + receive() external payable virtual override(Router, AccountCore) {} /// @notice Returns the implementation contract address for a given function signature. function getImplementationForFunction(bytes4) public view virtual override returns (address) { diff --git a/contracts/smart-wallet/managed/TWManagedAccountFactory.sol b/contracts/smart-wallet/managed/ManagedAccountFactory.sol similarity index 89% rename from contracts/smart-wallet/managed/TWManagedAccountFactory.sol rename to contracts/smart-wallet/managed/ManagedAccountFactory.sol index 4ffcc4a6f..977c3a162 100644 --- a/contracts/smart-wallet/managed/TWManagedAccountFactory.sol +++ b/contracts/smart-wallet/managed/ManagedAccountFactory.sol @@ -9,10 +9,10 @@ import "@openzeppelin/contracts/proxy/Clones.sol"; import "../../dynamic-contracts/extension/PermissionsEnumerable.sol"; // Interface -import "../interfaces/ITWAccountFactory.sol"; +import "../interfaces/IAccountFactory.sol"; // Smart wallet implementation -import "./TWManagedAccount.sol"; +import "./ManagedAccount.sol"; // $$\ $$\ $$\ $$\ $$\ // $$ | $$ | \__| $$ | $$ | @@ -23,12 +23,12 @@ import "./TWManagedAccount.sol"; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -contract TWManagedAccountFactory is ITWAccountFactory, Multicall, PermissionsEnumerable, BaseRouter { +contract TWManagedAccountFactory is IAccountFactory, Multicall, PermissionsEnumerable, BaseRouter { /*/////////////////////////////////////////////////////////////// State //////////////////////////////////////////////////////////////*/ - TWManagedAccount private immutable _accountImplementation; + ManagedAccount private immutable _accountImplementation; /*/////////////////////////////////////////////////////////////// Constructor @@ -36,7 +36,7 @@ contract TWManagedAccountFactory is ITWAccountFactory, Multicall, PermissionsEnu constructor(IEntryPoint _entrypoint) { _setupRole(DEFAULT_ADMIN_ROLE, msg.sender); - _accountImplementation = new TWManagedAccount(_entrypoint); + _accountImplementation = new ManagedAccount(_entrypoint); } /*/////////////////////////////////////////////////////////////// @@ -55,7 +55,7 @@ contract TWManagedAccountFactory is ITWAccountFactory, Multicall, PermissionsEnu account = Clones.cloneDeterministic(impl, salt); - TWManagedAccount(payable(account)).initialize(_admin); + ManagedAccount(payable(account)).initialize(_admin); emit AccountCreated(account, _admin, _accountId); diff --git a/contracts/smart-wallet/non-upgradeable/TWAccount.sol b/contracts/smart-wallet/non-upgradeable/Account.sol similarity index 90% rename from contracts/smart-wallet/non-upgradeable/TWAccount.sol rename to contracts/smart-wallet/non-upgradeable/Account.sol index 6a8420683..3779a2973 100644 --- a/contracts/smart-wallet/non-upgradeable/TWAccount.sol +++ b/contracts/smart-wallet/non-upgradeable/Account.sol @@ -32,22 +32,22 @@ import "../../openzeppelin-presets/utils/cryptography/ECDSA.sol"; Storage layout //////////////////////////////////////////////////////////////*/ -library TWAccountStorage { - bytes32 internal constant TWACCOUNT_STORAGE_POSITION = keccak256("twaccount.storage"); +library AccountStorage { + bytes32 internal constant ACCOUNT_STORAGE_POSITION = keccak256("account.storage"); struct Data { uint256 nonce; } - function accountStorage() internal pure returns (Data storage twaccountData) { - bytes32 position = TWACCOUNT_STORAGE_POSITION; + function accountStorage() internal pure returns (Data storage accountData) { + bytes32 position = ACCOUNT_STORAGE_POSITION; assembly { - twaccountData.slot := position + accountData.slot := position } } } -contract TWAccount is +contract Account is Initializable, Multicall, BaseAccount, @@ -87,7 +87,7 @@ contract TWAccount is modifier onlyAdminOrEntrypoint() { require( msg.sender == address(entryPoint()) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender), - "TWAccount: not admin or EntryPoint." + "Account: not admin or EntryPoint." ); _; } @@ -106,8 +106,8 @@ contract TWAccount is /// @notice Returns the nonce of the account. function nonce() public view virtual override returns (uint256) { - TWAccountStorage.Data storage twaccountData = TWAccountStorage.accountStorage(); - return twaccountData.nonce; + AccountStorage.Data storage accountData = AccountStorage.accountStorage(); + return accountData.nonce; } /// @notice Returns the EIP 4337 entrypoint contract. @@ -144,10 +144,7 @@ contract TWAccount is uint256[] calldata _value, bytes[] calldata _calldata ) external virtual onlyAdminOrEntrypoint { - require( - _target.length == _calldata.length && _target.length == _value.length, - "TWAccount: wrong array lengths." - ); + require(_target.length == _calldata.length && _target.length == _value.length, "Account: wrong array lengths."); for (uint256 i = 0; i < _target.length; i++) { _call(_target[i], _value[i], _calldata[i]); } @@ -183,8 +180,8 @@ contract TWAccount is /// @dev Validates the nonce of a user operation and updates account nonce. function _validateAndUpdateNonce(UserOperation calldata userOp) internal override { - TWAccountStorage.Data storage data = TWAccountStorage.accountStorage(); - require(data.nonce == userOp.nonce, "TWAccount: invalid nonce"); + AccountStorage.Data storage data = AccountStorage.accountStorage(); + require(data.nonce == userOp.nonce, "Account: invalid nonce"); data.nonce += 1; } diff --git a/contracts/smart-wallet/non-upgradeable/TWAccountFactory.sol b/contracts/smart-wallet/non-upgradeable/AccountFactory.sol similarity index 90% rename from contracts/smart-wallet/non-upgradeable/TWAccountFactory.sol rename to contracts/smart-wallet/non-upgradeable/AccountFactory.sol index c13cf9387..b6ff14e43 100644 --- a/contracts/smart-wallet/non-upgradeable/TWAccountFactory.sol +++ b/contracts/smart-wallet/non-upgradeable/AccountFactory.sol @@ -7,10 +7,10 @@ import "@openzeppelin/contracts/proxy/Clones.sol"; import "../../lib/TWStringSet.sol"; // Interface -import "./../interfaces/ITWAccountFactory.sol"; +import "./../interfaces/IAccountFactory.sol"; // Smart wallet implementation -import "./TWAccount.sol"; +import "./Account.sol"; // $$\ $$\ $$\ $$\ $$\ // $$ | $$ | \__| $$ | $$ | @@ -21,21 +21,21 @@ import "./TWAccount.sol"; // \$$$$ |$$ | $$ |$$ |$$ | \$$$$$$$ |\$$$$$\$$$$ |\$$$$$$$\ $$$$$$$ | // \____/ \__| \__|\__|\__| \_______| \_____\____/ \_______|\_______/ -contract TWAccountFactory is ITWAccountFactory, Multicall { +contract AccountFactory is IAccountFactory, Multicall { using TWStringSet for TWStringSet.Set; /*/////////////////////////////////////////////////////////////// State //////////////////////////////////////////////////////////////*/ - TWAccount private immutable _accountImplementation; + Account private immutable _accountImplementation; /*/////////////////////////////////////////////////////////////// Constructor //////////////////////////////////////////////////////////////*/ constructor(IEntryPoint _entrypoint) { - _accountImplementation = new TWAccount(_entrypoint); + _accountImplementation = new Account(_entrypoint); } /*/////////////////////////////////////////////////////////////// @@ -54,7 +54,7 @@ contract TWAccountFactory is ITWAccountFactory, Multicall { account = Clones.cloneDeterministic(impl, salt); - TWAccount(payable(account)).initialize(_admin); + Account(payable(account)).initialize(_admin); emit AccountCreated(account, _admin, _accountId); diff --git a/docs/TWAccountLogic.md b/docs/Account.md similarity index 91% rename from docs/TWAccountLogic.md rename to docs/Account.md index 23db4ef19..515fbc54e 100644 --- a/docs/TWAccountLogic.md +++ b/docs/Account.md @@ -1,4 +1,4 @@ -# TWAccountLogic +# Account @@ -272,6 +272,22 @@ Checks whether an account has a particular role; role restricti |---|---|---| | _0 | bool | undefined | +### initialize + +```solidity +function initialize(address _defaultAdmin) external nonpayable +``` + +Initializes the smart contract wallet. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _defaultAdmin | address | undefined | + ### isValidSigner ```solidity @@ -294,6 +310,28 @@ Returns whether a signer is authorized to perform transactions using the wallet. |---|---|---| | _0 | bool | undefined | +### multicall + +```solidity +function multicall(bytes[] data) external nonpayable returns (bytes[] results) +``` + +Receives and executes a batch of function calls on this contract. + +*Receives and executes a batch of function calls on this contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| data | bytes[] | The bytes data that makes up the batch of function calls to execute. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. | + ### nonce ```solidity @@ -444,9 +482,9 @@ Lets a contract admin set the URI for contract-level metadata. function supportsInterface(bytes4 interfaceId) external view returns (bool) ``` +See {IERC165-supportsInterface}. -*See {IERC165-supportsInterface}.* #### Parameters @@ -522,6 +560,22 @@ event ContractURIUpdated(string prevURI, string newURI) | prevURI | string | undefined | | newURI | string | undefined | +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + ### RoleAdminChanged ```solidity diff --git a/docs/AccountCore.md b/docs/AccountCore.md new file mode 100644 index 000000000..0c2752b90 --- /dev/null +++ b/docs/AccountCore.md @@ -0,0 +1,272 @@ +# AccountCore + + + + + + + + + +## Methods + +### DEFAULT_ADMIN_ROLE + +```solidity +function DEFAULT_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SIGNER_ROLE + +```solidity +function SIGNER_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### _hasRole + +```solidity +function _hasRole(bytes32 _role, address _account) external view returns (bool) +``` + +See Permissions-hasRole + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _role | bytes32 | undefined | +| _account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### addDeposit + +```solidity +function addDeposit() external payable +``` + +Deposit funds for this account in Entrypoint. + + + + +### entryPoint + +```solidity +function entryPoint() external view returns (contract IEntryPoint) +``` + +Returns the EIP 4337 entrypoint contract. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IEntryPoint | undefined | + +### getDeposit + +```solidity +function getDeposit() external view returns (uint256) +``` + +Returns the balance of the account in Entrypoint. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### initialize + +```solidity +function initialize(address _defaultAdmin) external nonpayable +``` + +Initializes the smart contract wallet. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _defaultAdmin | address | undefined | + +### isValidSigner + +```solidity +function isValidSigner(address _signer) external view returns (bool) +``` + +Returns whether a signer is authorized to perform transactions using the wallet. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _signer | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### multicall + +```solidity +function multicall(bytes[] data) external nonpayable returns (bytes[] results) +``` + +Receives and executes a batch of function calls on this contract. + +*Receives and executes a batch of function calls on this contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| data | bytes[] | The bytes data that makes up the batch of function calls to execute. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. | + +### nonce + +```solidity +function nonce() external view returns (uint256) +``` + +Returns the nonce of the account. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### validateUserOp + +```solidity +function validateUserOp(UserOperation userOp, bytes32 userOpHash, uint256 missingAccountFunds) external nonpayable returns (uint256 validationData) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOp | UserOperation | undefined | +| userOpHash | bytes32 | undefined | +| missingAccountFunds | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| validationData | uint256 | undefined | + +### withdrawDepositTo + +```solidity +function withdrawDepositTo(address payable withdrawAddress, uint256 amount) external nonpayable +``` + +Withdraw funds for this account from Entrypoint. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | undefined | +| amount | uint256 | undefined | + + + +## Events + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### RoleGranted + +```solidity +event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +``` + +See Permissions-RoleGranted + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + + + diff --git a/docs/AccountExtension.md b/docs/AccountExtension.md new file mode 100644 index 000000000..1cc33126e --- /dev/null +++ b/docs/AccountExtension.md @@ -0,0 +1,455 @@ +# AccountExtension + + + + + + + + + +## Methods + +### DEFAULT_ADMIN_ROLE + +```solidity +function DEFAULT_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SIGNER_ROLE + +```solidity +function SIGNER_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### contractURI + +```solidity +function contractURI() external view returns (string) +``` + +Returns the contract metadata URI. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | string | undefined | + +### execute + +```solidity +function execute(address _target, uint256 _value, bytes _calldata) external nonpayable +``` + +Executes a transaction (called directly from an admin, or by entryPoint) + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _target | address | undefined | +| _value | uint256 | undefined | +| _calldata | bytes | undefined | + +### executeBatch + +```solidity +function executeBatch(address[] _target, uint256[] _value, bytes[] _calldata) external nonpayable +``` + +Executes a sequence transaction (called directly from an admin, or by entryPoint) + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _target | address[] | undefined | +| _value | uint256[] | undefined | +| _calldata | bytes[] | undefined | + +### getRoleAdmin + +```solidity +function getRoleAdmin(bytes32 role) external view returns (bytes32) +``` + +Returns the admin role that controls the specified role. + +*See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### getRoleMember + +```solidity +function getRoleMember(bytes32 role, uint256 index) external view returns (address member) +``` + +Returns the role-member from a list of members for a role, at a given index. + +*Returns `member` who has `role`, at `index` of role-members list. See struct {RoleMembers}, and mapping {roleMembers}* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| index | uint256 | Index in list of current members for the role. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| member | address | Address of account that has `role` | + +### getRoleMemberCount + +```solidity +function getRoleMemberCount(bytes32 role) external view returns (uint256 count) +``` + +Returns total number of accounts that have a role. + +*Returns `count` of accounts that have `role`. See struct {RoleMembers}, and mapping {roleMembers}* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| count | uint256 | Total number of accounts that have `role` | + +### grantRole + +```solidity +function grantRole(bytes32 role, address account) external nonpayable +``` + +Grants a role to an account, if not previously granted. + +*Caller must have admin role for the `role`. Emits {RoleGranted Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account to which the role is being granted. | + +### hasRole + +```solidity +function hasRole(bytes32 role, address account) external view returns (bool) +``` + +Checks whether an account has a particular role. + +*Returns `true` if `account` has been granted `role`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account for which the role is being checked. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### hasRoleWithSwitch + +```solidity +function hasRoleWithSwitch(bytes32 role, address account) external view returns (bool) +``` + +Checks whether an account has a particular role; role restrictions can be swtiched on and off. + +*Returns `true` if `account` has been granted `role`. Role restrictions can be swtiched on and off: - If address(0) has ROLE, then the ROLE restrictions don't apply. - If address(0) does not have ROLE, then the ROLE restrictions will apply.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account for which the role is being checked. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### onERC1155BatchReceived + +```solidity +function onERC1155BatchReceived(address, address, uint256[], uint256[], bytes) external nonpayable returns (bytes4) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256[] | undefined | +| _3 | uint256[] | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC1155Received + +```solidity +function onERC1155Received(address, address, uint256, uint256, bytes) external nonpayable returns (bytes4) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | uint256 | undefined | +| _4 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### onERC721Received + +```solidity +function onERC721Received(address, address, uint256, bytes) external nonpayable returns (bytes4) +``` + + + +*See {IERC721Receiver-onERC721Received}. Always returns `IERC721Receiver.onERC721Received.selector`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | +| _1 | address | undefined | +| _2 | uint256 | undefined | +| _3 | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +### renounceRole + +```solidity +function renounceRole(bytes32 role, address account) external nonpayable +``` + +Revokes role from the account. + +*Caller must have the `role`, with caller being the same as `account`. Emits {RoleRevoked Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account from which the role is being revoked. | + +### revokeRole + +```solidity +function revokeRole(bytes32 role, address account) external nonpayable +``` + +Revokes role from an account. + +*Caller must have admin role for the `role`. Emits {RoleRevoked Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account from which the role is being revoked. | + +### setContractURI + +```solidity +function setContractURI(string _uri) external nonpayable +``` + +Lets a contract admin set the URI for contract-level metadata. + +*Caller should be authorized to setup contractURI, e.g. contract admin. See {_canSetContractURI}. Emits {ContractURIUpdated Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _uri | string | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + +See {IERC165-supportsInterface}. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + + + +## Events + +### ContractURIUpdated + +```solidity +event ContractURIUpdated(string prevURI, string newURI) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| prevURI | string | undefined | +| newURI | string | undefined | + +### RoleAdminChanged + +```solidity +event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| previousAdminRole `indexed` | bytes32 | undefined | +| newAdminRole `indexed` | bytes32 | undefined | + +### RoleGranted + +```solidity +event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + +### RoleRevoked + +```solidity +event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + + + diff --git a/docs/TWAccountFactory.md b/docs/AccountFactory.md similarity index 68% rename from docs/TWAccountFactory.md rename to docs/AccountFactory.md index ee628b090..c182de67f 100644 --- a/docs/TWAccountFactory.md +++ b/docs/AccountFactory.md @@ -1,10 +1,10 @@ -# TWAccountFactory +# AccountFactory + -TWAccountFactory capabilities: - deploy a clone pointing to a TWAccount implementation. @@ -30,10 +30,10 @@ Returns the implementation of the Account. ### createAccount ```solidity -function createAccount(bytes32 _salt, bytes _initData) external nonpayable returns (address account) +function createAccount(address _admin, string _accountId) external nonpayable returns (address) ``` -Deploys a new Account with the given salt and initialization data. +Deploys a new Account with the given admin and accountId used as salt. @@ -41,22 +41,22 @@ Deploys a new Account with the given salt and initialization data. | Name | Type | Description | |---|---|---| -| _salt | bytes32 | undefined | -| _initData | bytes | undefined | +| _admin | address | undefined | +| _accountId | string | undefined | #### Returns | Name | Type | Description | |---|---|---| -| account | address | undefined | +| _0 | address | undefined | ### getAddress ```solidity -function getAddress(bytes32 _salt) external view returns (address) +function getAddress(string _accountId) external view returns (address) ``` -Returns the address of an Account that would be deployed with the given salt. +Returns the address of an Account that would be deployed with the given accountId as salt. @@ -64,7 +64,7 @@ Returns the address of an Account that would be deployed with the given salt. | Name | Type | Description | |---|---|---| -| _salt | bytes32 | undefined | +| _accountId | string | undefined | #### Returns @@ -101,10 +101,10 @@ Receives and executes a batch of function calls on this contract. ### AccountCreated ```solidity -event AccountCreated(address indexed account, bytes32 salt) +event AccountCreated(address indexed account, address indexed accountAdmin, string accountId) ``` - +Emitted when a new Account is created. @@ -113,7 +113,8 @@ event AccountCreated(address indexed account, bytes32 salt) | Name | Type | Description | |---|---|---| | account `indexed` | address | undefined | -| salt | bytes32 | undefined | +| accountAdmin `indexed` | address | undefined | +| accountId | string | undefined | diff --git a/docs/AccountStorage.md b/docs/AccountStorage.md new file mode 100644 index 000000000..a1243404e --- /dev/null +++ b/docs/AccountStorage.md @@ -0,0 +1,12 @@ +# AccountStorage + + + + + + + + + + + diff --git a/docs/AirdropERC1155.md b/docs/AirdropERC1155.md index d2e2ac84a..12c2825ee 100644 --- a/docs/AirdropERC1155.md +++ b/docs/AirdropERC1155.md @@ -27,10 +27,10 @@ function DEFAULT_ADMIN_ROLE() external view returns (bytes32) |---|---|---| | _0 | bytes32 | undefined | -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC1155.AirdropContent[] _contents) external nonpayable +function addRecipients(IAirdropERC1155.AirdropContent[] _contents) external nonpayable ``` @@ -46,7 +46,7 @@ function addAirdropRecipients(IAirdropERC1155.AirdropContent[] _contents) extern ### airdrop ```solidity -function airdrop(address _tokenAddress, address _tokenOwner, IAirdropERC1155.AirdropContent[] _contents) external nonpayable +function airdrop(IAirdropERC1155.AirdropContent[] _contents) external nonpayable ``` @@ -57,17 +57,15 @@ function airdrop(address _tokenAddress, address _tokenOwner, IAirdropERC1155.Air | Name | Type | Description | |---|---|---| -| _tokenAddress | address | undefined | -| _tokenOwner | address | undefined | | _contents | IAirdropERC1155.AirdropContent[] | undefined | -### airdrop +### cancelPendingPayments ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable ``` -Lets contract-owner send ERC721 NFTs to a list of addresses. +Lets contract-owner cancel any pending payments. @@ -75,7 +73,30 @@ Lets contract-owner send ERC721 NFTs to a list of addresses. | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | undefined | +| numberOfPaymentsToCancel | uint256 | undefined | + +### cancelledPaymentIndices + +```solidity +function cancelledPaymentIndices(uint256) external view returns (uint256 startIndex, uint256 endIndex) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### contractType @@ -114,13 +135,19 @@ function contractVersion() external pure returns (uint8) ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC1155.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -148,13 +175,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC1155.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -162,13 +195,13 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC1155.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### getCancelledPaymentIndices ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function getCancelledPaymentIndices() external view returns (struct IAirdropERC1155.CancelledPayments[]) ``` -Returns all pending airdrop processed. +Returns all blocks of cancelled payments as an array of index range. @@ -177,7 +210,7 @@ Returns all pending airdrop processed. | Name | Type | Description | |---|---|---| -| contents | IAirdropERC1155.AirdropContent[] | undefined | +| _0 | IAirdropERC1155.CancelledPayments[] | undefined | ### getRoleAdmin @@ -309,6 +342,28 @@ Checks whether an account has a particular role; role restricti |---|---|---| | _0 | bool | undefined | +### indicesOfFailed + +```solidity +function indicesOfFailed(uint256) external view returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ### initialize ```solidity @@ -381,6 +436,22 @@ function payeeCount() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | +### processPayments + +```solidity +function processPayments(uint256 paymentsToProcess) external nonpayable +``` + +Lets contract-owner send ERC721 NFTs to a list of addresses. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| paymentsToProcess | uint256 | undefined | + ### processedCount ```solidity @@ -455,7 +526,7 @@ Lets an authorized wallet set a new owner for the contract. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC1155.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -467,7 +538,8 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC1155.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | ### Initialized @@ -502,10 +574,27 @@ event OwnerUpdated(address indexed prevOwner, address indexed newOwner) | prevOwner `indexed` | address | undefined | | newOwner `indexed` | address | undefined | +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC1155.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -516,7 +605,8 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC1155.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RoleAdminChanged @@ -572,5 +662,23 @@ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed | account `indexed` | address | undefined | | sender `indexed` | address | undefined | +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC1155.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC1155.AirdropContent | undefined | +| failed | bool | undefined | + diff --git a/docs/AirdropERC20.md b/docs/AirdropERC20.md index 96089a672..519d7bbf1 100644 --- a/docs/AirdropERC20.md +++ b/docs/AirdropERC20.md @@ -27,10 +27,10 @@ function DEFAULT_ADMIN_ROLE() external view returns (bytes32) |---|---|---| | _0 | bytes32 | undefined | -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC20.AirdropContent[] _contents) external payable +function addRecipients(IAirdropERC20.AirdropContent[] _contents) external payable ``` @@ -46,10 +46,10 @@ function addAirdropRecipients(IAirdropERC20.AirdropContent[] _contents) external ### airdrop ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function airdrop(IAirdropERC20.AirdropContent[] _contents) external payable ``` -Lets contract-owner send ERC20 or native tokens to a list of addresses. + @@ -57,7 +57,46 @@ Lets contract-owner send ERC20 or native tokens to a list of addresses. | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | undefined | +| _contents | IAirdropERC20.AirdropContent[] | undefined | + +### cancelPendingPayments + +```solidity +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable +``` + +Lets contract-owner cancel any pending payments. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| numberOfPaymentsToCancel | uint256 | undefined | + +### cancelledPaymentIndices + +```solidity +function cancelledPaymentIndices(uint256) external view returns (uint256 startIndex, uint256 endIndex) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### contractType @@ -96,13 +135,19 @@ function contractVersion() external pure returns (uint8) ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC20.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -130,13 +175,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC20.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -144,13 +195,13 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC20.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### getCancelledPaymentIndices ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function getCancelledPaymentIndices() external view returns (struct IAirdropERC20.CancelledPayments[]) ``` -Returns all pending airdrop processed. +Returns all blocks of cancelled payments as an array of index range. @@ -159,7 +210,7 @@ Returns all pending airdrop processed. | Name | Type | Description | |---|---|---| -| contents | IAirdropERC20.AirdropContent[] | undefined | +| _0 | IAirdropERC20.CancelledPayments[] | undefined | ### getRoleAdmin @@ -291,6 +342,28 @@ Checks whether an account has a particular role; role restricti |---|---|---| | _0 | bool | undefined | +### indicesOfFailed + +```solidity +function indicesOfFailed(uint256) external view returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ### initialize ```solidity @@ -363,6 +436,22 @@ function payeeCount() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | +### processPayments + +```solidity +function processPayments(uint256 paymentsToProcess) external nonpayable +``` + +Lets contract-owner send ERC20 or native tokens to a list of addresses. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| paymentsToProcess | uint256 | undefined | + ### processedCount ```solidity @@ -437,7 +526,7 @@ Lets an authorized wallet set a new owner for the contract. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC20.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -449,7 +538,8 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC20.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | ### Initialized @@ -484,10 +574,27 @@ event OwnerUpdated(address indexed prevOwner, address indexed newOwner) | prevOwner `indexed` | address | undefined | | newOwner `indexed` | address | undefined | +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC20.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -498,7 +605,8 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC20.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RoleAdminChanged @@ -554,5 +662,23 @@ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed | account `indexed` | address | undefined | | sender `indexed` | address | undefined | +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC20.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC20.AirdropContent | undefined | +| failed | bool | undefined | + diff --git a/docs/AirdropERC721.md b/docs/AirdropERC721.md index 2b156ae5c..52e364e05 100644 --- a/docs/AirdropERC721.md +++ b/docs/AirdropERC721.md @@ -27,10 +27,10 @@ function DEFAULT_ADMIN_ROLE() external view returns (bytes32) |---|---|---| | _0 | bytes32 | undefined | -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC721.AirdropContent[] _contents) external nonpayable +function addRecipients(IAirdropERC721.AirdropContent[] _contents) external nonpayable ``` @@ -46,10 +46,10 @@ function addAirdropRecipients(IAirdropERC721.AirdropContent[] _contents) externa ### airdrop ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function airdrop(IAirdropERC721.AirdropContent[] _contents) external nonpayable ``` -Lets contract-owner send ERC721 NFTs to a list of addresses. + @@ -57,7 +57,46 @@ Lets contract-owner send ERC721 NFTs to a list of addresses. | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | undefined | +| _contents | IAirdropERC721.AirdropContent[] | undefined | + +### cancelPendingPayments + +```solidity +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable +``` + +Lets contract-owner cancel any pending payments. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| numberOfPaymentsToCancel | uint256 | undefined | + +### cancelledPaymentIndices + +```solidity +function cancelledPaymentIndices(uint256) external view returns (uint256 startIndex, uint256 endIndex) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### contractType @@ -96,13 +135,19 @@ function contractVersion() external pure returns (uint8) ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC721.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -130,13 +175,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC721.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -144,13 +195,13 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC721.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### getCancelledPaymentIndices ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function getCancelledPaymentIndices() external view returns (struct IAirdropERC721.CancelledPayments[]) ``` -Returns all pending airdrop processed. +Returns all blocks of cancelled payments as an array of index range. @@ -159,7 +210,7 @@ Returns all pending airdrop processed. | Name | Type | Description | |---|---|---| -| contents | IAirdropERC721.AirdropContent[] | undefined | +| _0 | IAirdropERC721.CancelledPayments[] | undefined | ### getRoleAdmin @@ -291,6 +342,28 @@ Checks whether an account has a particular role; role restricti |---|---|---| | _0 | bool | undefined | +### indicesOfFailed + +```solidity +function indicesOfFailed(uint256) external view returns (uint256) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + ### initialize ```solidity @@ -363,6 +436,22 @@ function payeeCount() external view returns (uint256) |---|---|---| | _0 | uint256 | undefined | +### processPayments + +```solidity +function processPayments(uint256 paymentsToProcess) external nonpayable +``` + +Lets contract-owner send ERC721 NFTs to a list of addresses. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| paymentsToProcess | uint256 | undefined | + ### processedCount ```solidity @@ -437,7 +526,7 @@ Lets an authorized wallet set a new owner for the contract. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC721.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -449,7 +538,8 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC721.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | ### Initialized @@ -484,10 +574,27 @@ event OwnerUpdated(address indexed prevOwner, address indexed newOwner) | prevOwner `indexed` | address | undefined | | newOwner `indexed` | address | undefined | +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC721.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -498,7 +605,8 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC721.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RoleAdminChanged @@ -554,5 +662,23 @@ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed | account `indexed` | address | undefined | | sender `indexed` | address | undefined | +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC721.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC721.AirdropContent | undefined | +| failed | bool | undefined | + diff --git a/docs/TWAccountRouter.md b/docs/DynamicAccount.md similarity index 99% rename from docs/TWAccountRouter.md rename to docs/DynamicAccount.md index 1c3cc113f..e61ccaffe 100644 --- a/docs/TWAccountRouter.md +++ b/docs/DynamicAccount.md @@ -1,4 +1,4 @@ -# TWAccountRouter +# DynamicAccount @@ -435,10 +435,10 @@ Checks whether an account has a particular role; role restricti ### initialize ```solidity -function initialize(address _defaultAdmin, string _contractURI) external nonpayable +function initialize(address _defaultAdmin) external nonpayable ``` - +Initializes the smart contract wallet. @@ -447,7 +447,6 @@ function initialize(address _defaultAdmin, string _contractURI) external nonpaya | Name | Type | Description | |---|---|---| | _defaultAdmin | address | undefined | -| _contractURI | string | undefined | ### isValidSigner diff --git a/docs/DynamicAccountFactory.md b/docs/DynamicAccountFactory.md new file mode 100644 index 000000000..d38983c5d --- /dev/null +++ b/docs/DynamicAccountFactory.md @@ -0,0 +1,120 @@ +# DynamicAccountFactory + + + + + + + + + +## Methods + +### accountImplementation + +```solidity +function accountImplementation() external view returns (address) +``` + +Returns the implementation of the Account. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### createAccount + +```solidity +function createAccount(address _admin, string _accountId) external nonpayable returns (address) +``` + +Deploys a new Account with the given admin and accountId used as salt. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _admin | address | undefined | +| _accountId | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getAddress + +```solidity +function getAddress(string _accountId) external view returns (address) +``` + +Returns the address of an Account that would be deployed with the given accountId as salt. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _accountId | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### multicall + +```solidity +function multicall(bytes[] data) external nonpayable returns (bytes[] results) +``` + +Receives and executes a batch of function calls on this contract. + +*Receives and executes a batch of function calls on this contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| data | bytes[] | The bytes data that makes up the batch of function calls to execute. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. | + + + +## Events + +### AccountCreated + +```solidity +event AccountCreated(address indexed account, address indexed accountAdmin, string accountId) +``` + +Emitted when a new Account is created. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| accountAdmin `indexed` | address | undefined | +| accountId | string | undefined | + + + diff --git a/docs/EntryPoint.md b/docs/EntryPoint.md new file mode 100644 index 000000000..1094ece84 --- /dev/null +++ b/docs/EntryPoint.md @@ -0,0 +1,621 @@ +# EntryPoint + + + + + + + + + +## Methods + +### SIG_VALIDATION_FAILED + +```solidity +function SIG_VALIDATION_FAILED() external view returns (uint256) +``` + +for simulation purposes, validateUserOp (and validatePaymasterUserOp) must return this value in case of signature failure, instead of revert. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### _validateSenderAndPaymaster + +```solidity +function _validateSenderAndPaymaster(bytes initCode, address sender, bytes paymasterAndData) external view +``` + +Called only during simulation. This function always reverts to prevent warm/cold storage differentiation in simulation vs execution. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| initCode | bytes | undefined | +| sender | address | undefined | +| paymasterAndData | bytes | undefined | + +### addStake + +```solidity +function addStake(uint32 unstakeDelaySec) external payable +``` + +add to the account's stake - amount and delay any pending unstake is first cancelled. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| unstakeDelaySec | uint32 | the new lock duration before the deposit can be withdrawn. | + +### balanceOf + +```solidity +function balanceOf(address account) external view returns (uint256) +``` + +return the deposit (for gas payment) of the account + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### depositTo + +```solidity +function depositTo(address account) external payable +``` + +add to the deposit of the given account + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +### deposits + +```solidity +function deposits(address) external view returns (uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +``` + +maps paymaster to their deposits and stakes + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| deposit | uint112 | undefined | +| staked | bool | undefined | +| stake | uint112 | undefined | +| unstakeDelaySec | uint32 | undefined | +| withdrawTime | uint48 | undefined | + +### getDepositInfo + +```solidity +function getDepositInfo(address account) external view returns (struct IStakeManager.DepositInfo info) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| info | IStakeManager.DepositInfo | - full deposit information of given account | + +### getSenderAddress + +```solidity +function getSenderAddress(bytes initCode) external nonpayable +``` + +Get counterfactual sender address. Calculate the sender contract address that will be generated by the initCode and salt in the UserOperation. this method always revert, and returns the address in SenderAddressResult error + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| initCode | bytes | the constructor code to be passed into the UserOperation. | + +### getUserOpHash + +```solidity +function getUserOpHash(UserOperation userOp) external view returns (bytes32) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOp | UserOperation | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### handleAggregatedOps + +```solidity +function handleAggregatedOps(IEntryPoint.UserOpsPerAggregator[] opsPerAggregator, address payable beneficiary) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| opsPerAggregator | IEntryPoint.UserOpsPerAggregator[] | undefined | +| beneficiary | address payable | undefined | + +### handleOps + +```solidity +function handleOps(UserOperation[] ops, address payable beneficiary) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| ops | UserOperation[] | undefined | +| beneficiary | address payable | undefined | + +### innerHandleOp + +```solidity +function innerHandleOp(bytes callData, EntryPoint.UserOpInfo opInfo, bytes context) external nonpayable returns (uint256 actualGasCost) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| callData | bytes | undefined | +| opInfo | EntryPoint.UserOpInfo | undefined | +| context | bytes | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| actualGasCost | uint256 | undefined | + +### simulateHandleOp + +```solidity +function simulateHandleOp(UserOperation op, address target, bytes targetCallData) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| op | UserOperation | undefined | +| target | address | undefined | +| targetCallData | bytes | undefined | + +### simulateValidation + +```solidity +function simulateValidation(UserOperation userOp) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOp | UserOperation | undefined | + +### unlockStake + +```solidity +function unlockStake() external nonpayable +``` + +attempt to unlock the stake. the value can be withdrawn (using withdrawStake) after the unstake delay. + + + + +### withdrawStake + +```solidity +function withdrawStake(address payable withdrawAddress) external nonpayable +``` + +withdraw from the (unlocked) stake. must first call unlockStake and wait for the unstakeDelay to pass + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | the address to send withdrawn value. | + +### withdrawTo + +```solidity +function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external nonpayable +``` + +withdraw from the deposit. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | the address to send withdrawn value. | +| withdrawAmount | uint256 | the amount to withdraw. | + + + +## Events + +### AccountDeployed + +```solidity +event AccountDeployed(bytes32 indexed userOpHash, address indexed sender, address factory, address paymaster) +``` + +account "sender" was deployed. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOpHash `indexed` | bytes32 | undefined | +| sender `indexed` | address | undefined | +| factory | address | undefined | +| paymaster | address | undefined | + +### Deposited + +```solidity +event Deposited(address indexed account, uint256 totalDeposit) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| totalDeposit | uint256 | undefined | + +### OpHash + +```solidity +event OpHash(bytes32 hashVal) +``` + +call account.validateUserOp. revert (with FailedOp) in case validateUserOp reverts, or account didn't send required prefund. decrement account's deposit if needed + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| hashVal | bytes32 | undefined | + +### SignatureAggregatorChanged + +```solidity +event SignatureAggregatorChanged(address indexed aggregator) +``` + +signature aggregator used by the following UserOperationEvents within this bundle. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| aggregator `indexed` | address | undefined | + +### StakeLocked + +```solidity +event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +``` + +Emitted when stake or unstake delay are modified + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| totalStaked | uint256 | undefined | +| unstakeDelaySec | uint256 | undefined | + +### StakeUnlocked + +```solidity +event StakeUnlocked(address indexed account, uint256 withdrawTime) +``` + +Emitted once a stake is scheduled for withdrawal + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawTime | uint256 | undefined | + +### StakeWithdrawn + +```solidity +event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawAddress | address | undefined | +| amount | uint256 | undefined | + +### UserOperationEvent + +```solidity +event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOpHash `indexed` | bytes32 | undefined | +| sender `indexed` | address | undefined | +| paymaster `indexed` | address | undefined | +| nonce | uint256 | undefined | +| success | bool | undefined | +| actualGasCost | uint256 | undefined | +| actualGasUsed | uint256 | undefined | + +### UserOperationRevertReason + +```solidity +event UserOperationRevertReason(bytes32 indexed userOpHash, address indexed sender, uint256 nonce, bytes revertReason) +``` + +An event emitted if the UserOperation "callData" reverted with non-zero length + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOpHash `indexed` | bytes32 | undefined | +| sender `indexed` | address | undefined | +| nonce | uint256 | undefined | +| revertReason | bytes | undefined | + +### Withdrawn + +```solidity +event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawAddress | address | undefined | +| amount | uint256 | undefined | + + + +## Errors + +### ExecutionResult + +```solidity +error ExecutionResult(uint256 preOpGas, uint256 paid, uint48 validAfter, uint48 validUntil, bool targetSuccess, bytes targetResult) +``` + +return value of simulateHandleOp + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| preOpGas | uint256 | undefined | +| paid | uint256 | undefined | +| validAfter | uint48 | undefined | +| validUntil | uint48 | undefined | +| targetSuccess | bool | undefined | +| targetResult | bytes | undefined | + +### FailedOp + +```solidity +error FailedOp(uint256 opIndex, string reason) +``` + +a custom revert error of handleOps, to identify the offending op. NOTE: if simulateValidation passes successfully, there should be no reason for handleOps to fail on it. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| opIndex | uint256 | - index into the array of ops to the failed one (in simulateValidation, this is always zero) | +| reason | string | - revert reason The string starts with a unique code "AAmn", where "m" is "1" for factory, "2" for account and "3" for paymaster issues, so a failure can be attributed to the correct entity. Should be caught in off-chain handleOps simulation and not happen on-chain. Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts. | + +### SenderAddressResult + +```solidity +error SenderAddressResult(address sender) +``` + +return value of getSenderAddress + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| sender | address | undefined | + +### SignatureValidationFailed + +```solidity +error SignatureValidationFailed(address aggregator) +``` + +error case when a signature aggregator fails to verify the aggregated signature it had created. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| aggregator | address | undefined | + +### ValidationResult + +```solidity +error ValidationResult(IEntryPoint.ReturnInfo returnInfo, IStakeManager.StakeInfo senderInfo, IStakeManager.StakeInfo factoryInfo, IStakeManager.StakeInfo paymasterInfo) +``` + +Successful result from simulateValidation. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| returnInfo | IEntryPoint.ReturnInfo | gas and time-range returned values | +| senderInfo | IStakeManager.StakeInfo | stake information about the sender | +| factoryInfo | IStakeManager.StakeInfo | stake information about the factory (if any) | +| paymasterInfo | IStakeManager.StakeInfo | stake information about the paymaster (if any) | + +### ValidationResultWithAggregation + +```solidity +error ValidationResultWithAggregation(IEntryPoint.ReturnInfo returnInfo, IStakeManager.StakeInfo senderInfo, IStakeManager.StakeInfo factoryInfo, IStakeManager.StakeInfo paymasterInfo, IEntryPoint.AggregatorStakeInfo aggregatorInfo) +``` + +Successful result from simulateValidation, if the account returns a signature aggregator + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| returnInfo | IEntryPoint.ReturnInfo | gas and time-range returned values | +| senderInfo | IStakeManager.StakeInfo | stake information about the sender | +| factoryInfo | IStakeManager.StakeInfo | stake information about the factory (if any) | +| paymasterInfo | IStakeManager.StakeInfo | stake information about the paymaster (if any) | +| aggregatorInfo | IEntryPoint.AggregatorStakeInfo | signature aggregation info (if the account requires signature aggregator) bundler MUST use it to verify the signature, or reject the UserOperation | + + diff --git a/docs/Exec.md b/docs/Exec.md new file mode 100644 index 000000000..a48629287 --- /dev/null +++ b/docs/Exec.md @@ -0,0 +1,12 @@ +# Exec + + + + + +Utility functions helpful when making different kinds of contract calls in Solidity. + + + + + diff --git a/docs/ITWAccountFactory.md b/docs/IAccountFactory.md similarity index 59% rename from docs/ITWAccountFactory.md rename to docs/IAccountFactory.md index 888ff398e..df16fe0df 100644 --- a/docs/ITWAccountFactory.md +++ b/docs/IAccountFactory.md @@ -1,4 +1,4 @@ -# ITWAccountFactory +# IAccountFactory @@ -30,10 +30,10 @@ Returns the address of the Account implementation. ### createAccount ```solidity -function createAccount(bytes32 _salt, bytes _initData) external nonpayable returns (address account) +function createAccount(address admin, string accountId) external nonpayable returns (address account) ``` -Deploys a new Account with the given salt and initialization data. +Deploys a new Account with the given admin and accountId used as salt. @@ -41,8 +41,8 @@ Deploys a new Account with the given salt and initialization data. | Name | Type | Description | |---|---|---| -| _salt | bytes32 | undefined | -| _initData | bytes | undefined | +| admin | address | undefined | +| accountId | string | undefined | #### Returns @@ -53,10 +53,10 @@ Deploys a new Account with the given salt and initialization data. ### getAddress ```solidity -function getAddress(bytes32 _salt) external view returns (address) +function getAddress(string accountId) external view returns (address) ``` -Returns the address of an Account that would be deployed with the given salt. +Returns the address of an Account that would be deployed with the given accountId as salt. @@ -64,7 +64,7 @@ Returns the address of an Account that would be deployed with the given salt. | Name | Type | Description | |---|---|---| -| _salt | bytes32 | undefined | +| accountId | string | undefined | #### Returns @@ -79,10 +79,10 @@ Returns the address of an Account that would be deployed with the given salt. ### AccountCreated ```solidity -event AccountCreated(address indexed account, bytes32 salt) +event AccountCreated(address indexed account, address indexed accountAdmin, string accountId) ``` - +Emitted when a new Account is created. @@ -91,7 +91,8 @@ event AccountCreated(address indexed account, bytes32 salt) | Name | Type | Description | |---|---|---| | account `indexed` | address | undefined | -| salt | bytes32 | undefined | +| accountAdmin `indexed` | address | undefined | +| accountId | string | undefined | diff --git a/docs/IAirdropERC1155.md b/docs/IAirdropERC1155.md index c38c557a3..4efce192b 100644 --- a/docs/IAirdropERC1155.md +++ b/docs/IAirdropERC1155.md @@ -10,10 +10,10 @@ Thirdweb's `Airdrop` contracts provide a lightweight and easy to use mechani ## Methods -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC1155.AirdropContent[] _contents) external nonpayable +function addRecipients(IAirdropERC1155.AirdropContent[] _contents) external nonpayable ``` @@ -29,29 +29,51 @@ function addAirdropRecipients(IAirdropERC1155.AirdropContent[] _contents) extern ### airdrop ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function airdrop(IAirdropERC1155.AirdropContent[] _contents) external nonpayable ``` -Lets contract-owner set up an airdrop of ERC1155 tokens to a list of addresses. -*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* + + #### Parameters | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | The number of airdrop payments to process. | +| _contents | IAirdropERC1155.AirdropContent[] | undefined | + +### cancelPendingPayments + +```solidity +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable +``` + +Lets contract-owner cancel any pending payments. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| numberOfPaymentsToCancel | uint256 | undefined | ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC1155.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -79,13 +101,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC1155.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -93,22 +121,21 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC1155.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### processPayments ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC1155.AirdropContent[] contents) +function processPayments(uint256 paymentsToProcess) external nonpayable ``` -Returns all pending airdrop processed. - - +Lets contract-owner set up an airdrop of ERC1155 tokens to a list of addresses. +*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* -#### Returns +#### Parameters | Name | Type | Description | |---|---|---| -| contents | IAirdropERC1155.AirdropContent[] | undefined | +| paymentsToProcess | uint256 | The number of airdrop payments to process. | @@ -117,7 +144,7 @@ Returns all pending airdrop processed. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC1155.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -129,12 +156,30 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC1155.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | + +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC1155.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -145,7 +190,26 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC1155.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC1155.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC1155.AirdropContent | undefined | +| failed | bool | undefined | diff --git a/docs/IAirdropERC20.md b/docs/IAirdropERC20.md index 44c3e3ba9..89248a3f7 100644 --- a/docs/IAirdropERC20.md +++ b/docs/IAirdropERC20.md @@ -10,10 +10,10 @@ Thirdweb's `Airdrop` contracts provide a lightweight and easy to use mechani ## Methods -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC20.AirdropContent[] _contents) external payable +function addRecipients(IAirdropERC20.AirdropContent[] _contents) external payable ``` @@ -29,29 +29,51 @@ function addAirdropRecipients(IAirdropERC20.AirdropContent[] _contents) external ### airdrop ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function airdrop(IAirdropERC20.AirdropContent[] _contents) external payable ``` -Lets contract-owner send ERC20 or native tokens to a list of addresses. -*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* + + #### Parameters | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | The number of airdrop payments to process. | +| _contents | IAirdropERC20.AirdropContent[] | undefined | + +### cancelPendingPayments + +```solidity +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable +``` + +Lets contract-owner cancel any pending payments. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| numberOfPaymentsToCancel | uint256 | undefined | ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC20.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -79,13 +101,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC20.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -93,22 +121,21 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC20.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### processPayments ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC20.AirdropContent[] contents) +function processPayments(uint256 paymentsToProcess) external nonpayable ``` -Returns all pending airdrop processed. - - +Lets contract-owner send ERC20 or native tokens to a list of addresses. +*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* -#### Returns +#### Parameters | Name | Type | Description | |---|---|---| -| contents | IAirdropERC20.AirdropContent[] | undefined | +| paymentsToProcess | uint256 | The number of airdrop payments to process. | @@ -117,7 +144,7 @@ Returns all pending airdrop processed. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC20.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -129,12 +156,30 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC20.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | + +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC20.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -145,7 +190,26 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC20.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC20.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC20.AirdropContent | undefined | +| failed | bool | undefined | diff --git a/docs/IAirdropERC721.md b/docs/IAirdropERC721.md index 08d05e0cb..a28f741be 100644 --- a/docs/IAirdropERC721.md +++ b/docs/IAirdropERC721.md @@ -10,10 +10,10 @@ Thirdweb's `Airdrop` contracts provide a lightweight and easy to use mechani ## Methods -### addAirdropRecipients +### addRecipients ```solidity -function addAirdropRecipients(IAirdropERC721.AirdropContent[] _contents) external nonpayable +function addRecipients(IAirdropERC721.AirdropContent[] _contents) external nonpayable ``` @@ -29,29 +29,51 @@ function addAirdropRecipients(IAirdropERC721.AirdropContent[] _contents) externa ### airdrop ```solidity -function airdrop(uint256 paymentsToProcess) external nonpayable +function airdrop(IAirdropERC721.AirdropContent[] _contents) external nonpayable ``` -Lets contract-owner set up an airdrop of ERC721 tokens to a list of addresses. -*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* + + #### Parameters | Name | Type | Description | |---|---|---| -| paymentsToProcess | uint256 | The number of airdrop payments to process. | +| _contents | IAirdropERC721.AirdropContent[] | undefined | + +### cancelPendingPayments + +```solidity +function cancelPendingPayments(uint256 numberOfPaymentsToCancel) external nonpayable +``` + +Lets contract-owner cancel any pending payments. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| numberOfPaymentsToCancel | uint256 | undefined | ### getAllAirdropPayments ```solidity -function getAllAirdropPayments() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function getAllAirdropPayments(uint256 startId, uint256 endId) external view returns (struct IAirdropERC721.AirdropContent[] contents) ``` Returns all airdrop payments set up -- pending, processed or failed. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -79,13 +101,19 @@ Returns all pending airdrop failed. ### getAllAirdropPaymentsPending ```solidity -function getAllAirdropPaymentsPending() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function getAllAirdropPaymentsPending(uint256 startId, uint256 endId) external view returns (struct IAirdropERC721.AirdropContent[] contents) ``` Returns all pending airdrop payments. +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startId | uint256 | undefined | +| endId | uint256 | undefined | #### Returns @@ -93,22 +121,21 @@ Returns all pending airdrop payments. |---|---|---| | contents | IAirdropERC721.AirdropContent[] | undefined | -### getAllAirdropPaymentsProcessed +### processPayments ```solidity -function getAllAirdropPaymentsProcessed() external view returns (struct IAirdropERC721.AirdropContent[] contents) +function processPayments(uint256 paymentsToProcess) external nonpayable ``` -Returns all pending airdrop processed. - - +Lets contract-owner set up an airdrop of ERC721 tokens to a list of addresses. +*The token-owner should approve target tokens to Airdrop contract, which acts as operator for the tokens.* -#### Returns +#### Parameters | Name | Type | Description | |---|---|---| -| contents | IAirdropERC721.AirdropContent[] | undefined | +| paymentsToProcess | uint256 | The number of airdrop payments to process. | @@ -117,7 +144,7 @@ Returns all pending airdrop processed. ### AirdropPayment ```solidity -event AirdropPayment(address indexed recipient, IAirdropERC721.AirdropContent content) +event AirdropPayment(address indexed recipient, uint256 index, bool failed) ``` Emitted when an airdrop payment is made to a recipient. @@ -129,12 +156,30 @@ Emitted when an airdrop payment is made to a recipient. | Name | Type | Description | |---|---|---| | recipient `indexed` | address | undefined | -| content | IAirdropERC721.AirdropContent | undefined | +| index | uint256 | undefined | +| failed | bool | undefined | + +### PaymentsCancelledByAdmin + +```solidity +event PaymentsCancelledByAdmin(uint256 startIndex, uint256 endIndex) +``` + +Emitted when pending payments are cancelled, and processed count is reset. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | ### RecipientsAdded ```solidity -event RecipientsAdded(IAirdropERC721.AirdropContent[] _contents) +event RecipientsAdded(uint256 startIndex, uint256 endIndex) ``` Emitted when airdrop recipients are uploaded to the contract. @@ -145,7 +190,26 @@ Emitted when airdrop recipients are uploaded to the contract. | Name | Type | Description | |---|---|---| -| _contents | IAirdropERC721.AirdropContent[] | undefined | +| startIndex | uint256 | undefined | +| endIndex | uint256 | undefined | + +### StatelessAirdrop + +```solidity +event StatelessAirdrop(address indexed recipient, IAirdropERC721.AirdropContent content, bool failed) +``` + +Emitted when an airdrop is made using the stateless airdrop function. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| recipient `indexed` | address | undefined | +| content | IAirdropERC721.AirdropContent | undefined | +| failed | bool | undefined | diff --git a/docs/IPaymaster.md b/docs/IPaymaster.md new file mode 100644 index 000000000..d965080e8 --- /dev/null +++ b/docs/IPaymaster.md @@ -0,0 +1,58 @@ +# IPaymaster + + + + + +the interface exposed by a paymaster contract, who agrees to pay the gas for user's operations. a paymaster must hold a stake to cover the required entrypoint stake and also the gas for the transaction. + + + +## Methods + +### postOp + +```solidity +function postOp(enum IPaymaster.PostOpMode mode, bytes context, uint256 actualGasCost) external nonpayable +``` + +post-operation handler. Must verify sender is the entryPoint + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| mode | enum IPaymaster.PostOpMode | enum with the following options: opSucceeded - user operation succeeded. opReverted - user op reverted. still has to pay for gas. postOpReverted - user op succeeded, but caused postOp (in mode=opSucceeded) to revert. Now this is the 2nd call, after user's op was deliberately reverted. | +| context | bytes | - the context value returned by validatePaymasterUserOp | +| actualGasCost | uint256 | - actual gas used so far (without this postOp call). | + +### validatePaymasterUserOp + +```solidity +function validatePaymasterUserOp(UserOperation userOp, bytes32 userOpHash, uint256 maxCost) external nonpayable returns (bytes context, uint256 validationData) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOp | UserOperation | undefined | +| userOpHash | bytes32 | undefined | +| maxCost | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| context | bytes | undefined | +| validationData | uint256 | undefined | + + + + diff --git a/docs/ManagedAccount.md b/docs/ManagedAccount.md new file mode 100644 index 000000000..02ccab41a --- /dev/null +++ b/docs/ManagedAccount.md @@ -0,0 +1,311 @@ +# ManagedAccount + + + + + + + + + +## Methods + +### DEFAULT_ADMIN_ROLE + +```solidity +function DEFAULT_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### SIGNER_ROLE + +```solidity +function SIGNER_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### _hasRole + +```solidity +function _hasRole(bytes32 _role, address _account) external view returns (bool) +``` + +See Permissions-hasRole + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _role | bytes32 | undefined | +| _account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### addDeposit + +```solidity +function addDeposit() external payable +``` + +Deposit funds for this account in Entrypoint. + + + + +### entryPoint + +```solidity +function entryPoint() external view returns (contract IEntryPoint) +``` + +Returns the EIP 4337 entrypoint contract. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | contract IEntryPoint | undefined | + +### factory + +```solidity +function factory() external view returns (address) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getDeposit + +```solidity +function getDeposit() external view returns (uint256) +``` + +Returns the balance of the account in Entrypoint. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### getImplementationForFunction + +```solidity +function getImplementationForFunction(bytes4) external view returns (address) +``` + +Returns the implementation contract address for a given function signature. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### initialize + +```solidity +function initialize(address _defaultAdmin) external nonpayable +``` + +Initializes the smart contract wallet. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _defaultAdmin | address | undefined | + +### isValidSigner + +```solidity +function isValidSigner(address _signer) external view returns (bool) +``` + +Returns whether a signer is authorized to perform transactions using the wallet. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _signer | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### multicall + +```solidity +function multicall(bytes[] data) external nonpayable returns (bytes[] results) +``` + +Receives and executes a batch of function calls on this contract. + +*Receives and executes a batch of function calls on this contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| data | bytes[] | The bytes data that makes up the batch of function calls to execute. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. | + +### nonce + +```solidity +function nonce() external view returns (uint256) +``` + +Returns the nonce of the account. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### validateUserOp + +```solidity +function validateUserOp(UserOperation userOp, bytes32 userOpHash, uint256 missingAccountFunds) external nonpayable returns (uint256 validationData) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| userOp | UserOperation | undefined | +| userOpHash | bytes32 | undefined | +| missingAccountFunds | uint256 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| validationData | uint256 | undefined | + +### withdrawDepositTo + +```solidity +function withdrawDepositTo(address payable withdrawAddress, uint256 amount) external nonpayable +``` + +Withdraw funds for this account from Entrypoint. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | undefined | +| amount | uint256 | undefined | + + + +## Events + +### Initialized + +```solidity +event Initialized(uint8 version) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| version | uint8 | undefined | + +### RoleGranted + +```solidity +event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +``` + +See Permissions-RoleGranted + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + + + diff --git a/docs/SenderCreator.md b/docs/SenderCreator.md new file mode 100644 index 000000000..e72d008eb --- /dev/null +++ b/docs/SenderCreator.md @@ -0,0 +1,56 @@ +# SenderCreator + + + + + +helper contract for EntryPoint, to call userOp.initCode from a "neutral" address, which is explicitly not the entryPoint itself. + + + +## Methods + +### createSender + +```solidity +function createSender(bytes initCode) external nonpayable returns (address sender) +``` + +call the "initCode" factory to create and return the sender account address + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| initCode | bytes | the initCode value from a UserOp. contains 20 bytes of factory address, followed by calldata | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| sender | address | the returned address of the created account, or zero address on failure. | + + + +## Events + +### FactoryAddress + +```solidity +event FactoryAddress(address factory) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| factory | address | undefined | + + + diff --git a/docs/StakeManager.md b/docs/StakeManager.md new file mode 100644 index 000000000..f9f3bfde8 --- /dev/null +++ b/docs/StakeManager.md @@ -0,0 +1,252 @@ +# StakeManager + + + + + +manage deposits and stakes. deposit is just a balance used to pay for UserOperations (either by a paymaster or an account) stake is value locked for at least "unstakeDelay" by a paymaster. + + + +## Methods + +### addStake + +```solidity +function addStake(uint32 unstakeDelaySec) external payable +``` + +add to the account's stake - amount and delay any pending unstake is first cancelled. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| unstakeDelaySec | uint32 | the new lock duration before the deposit can be withdrawn. | + +### balanceOf + +```solidity +function balanceOf(address account) external view returns (uint256) +``` + +return the deposit (for gas payment) of the account + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | uint256 | undefined | + +### depositTo + +```solidity +function depositTo(address account) external payable +``` + +add to the deposit of the given account + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +### deposits + +```solidity +function deposits(address) external view returns (uint112 deposit, bool staked, uint112 stake, uint32 unstakeDelaySec, uint48 withdrawTime) +``` + +maps paymaster to their deposits and stakes + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| deposit | uint112 | undefined | +| staked | bool | undefined | +| stake | uint112 | undefined | +| unstakeDelaySec | uint32 | undefined | +| withdrawTime | uint48 | undefined | + +### getDepositInfo + +```solidity +function getDepositInfo(address account) external view returns (struct IStakeManager.DepositInfo info) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account | address | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| info | IStakeManager.DepositInfo | - full deposit information of given account | + +### unlockStake + +```solidity +function unlockStake() external nonpayable +``` + +attempt to unlock the stake. the value can be withdrawn (using withdrawStake) after the unstake delay. + + + + +### withdrawStake + +```solidity +function withdrawStake(address payable withdrawAddress) external nonpayable +``` + +withdraw from the (unlocked) stake. must first call unlockStake and wait for the unstakeDelay to pass + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | the address to send withdrawn value. | + +### withdrawTo + +```solidity +function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount) external nonpayable +``` + +withdraw from the deposit. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| withdrawAddress | address payable | the address to send withdrawn value. | +| withdrawAmount | uint256 | the amount to withdraw. | + + + +## Events + +### Deposited + +```solidity +event Deposited(address indexed account, uint256 totalDeposit) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| totalDeposit | uint256 | undefined | + +### StakeLocked + +```solidity +event StakeLocked(address indexed account, uint256 totalStaked, uint256 unstakeDelaySec) +``` + +Emitted when stake or unstake delay are modified + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| totalStaked | uint256 | undefined | +| unstakeDelaySec | uint256 | undefined | + +### StakeUnlocked + +```solidity +event StakeUnlocked(address indexed account, uint256 withdrawTime) +``` + +Emitted once a stake is scheduled for withdrawal + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawTime | uint256 | undefined | + +### StakeWithdrawn + +```solidity +event StakeWithdrawn(address indexed account, address withdrawAddress, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawAddress | address | undefined | +| amount | uint256 | undefined | + +### Withdrawn + +```solidity +event Withdrawn(address indexed account, address withdrawAddress, uint256 amount) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| withdrawAddress | address | undefined | +| amount | uint256 | undefined | + + + diff --git a/docs/TWAccountStorage.md b/docs/TWAccountStorage.md deleted file mode 100644 index 2e82142dc..000000000 --- a/docs/TWAccountStorage.md +++ /dev/null @@ -1,12 +0,0 @@ -# TWAccountStorage - - - - - - - - - - - diff --git a/docs/TWManagedAccountFactory.md b/docs/TWManagedAccountFactory.md new file mode 100644 index 000000000..5acdddc6f --- /dev/null +++ b/docs/TWManagedAccountFactory.md @@ -0,0 +1,607 @@ +# TWManagedAccountFactory + + + + + + + + + +## Methods + +### DEFAULT_ADMIN_ROLE + +```solidity +function DEFAULT_ADMIN_ROLE() external view returns (bytes32) +``` + + + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### accountImplementation + +```solidity +function accountImplementation() external view returns (address) +``` + +Returns the implementation of the Account. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### addExtension + +```solidity +function addExtension(IExtension.Extension _extension) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extension | IExtension.Extension | undefined | + +### createAccount + +```solidity +function createAccount(address _admin, string _accountId) external nonpayable returns (address) +``` + +Deploys a new Account with the given admin and accountId used as salt. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _admin | address | undefined | +| _accountId | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getAddress + +```solidity +function getAddress(string _accountId) external view returns (address) +``` + +Returns the address of an Account that would be deployed with the given accountId as salt. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _accountId | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getAllExtensions + +```solidity +function getAllExtensions() external view returns (struct IExtension.Extension[] allExtensions) +``` + +Returns all extensions stored. Override default lugins stored in router are given precedence over default extensions in DefaultExtensionSet. + + + + +#### Returns + +| Name | Type | Description | +|---|---|---| +| allExtensions | IExtension.Extension[] | undefined | + +### getAllFunctionsOfExtension + +```solidity +function getAllFunctionsOfExtension(string _extensionName) external view returns (struct IExtension.ExtensionFunction[]) +``` + + + +*Returns all functions that belong to the given extension contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extensionName | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IExtension.ExtensionFunction[] | undefined | + +### getExtension + +```solidity +function getExtension(string _extensionName) external view returns (struct IExtension.Extension) +``` + + + +*Returns the extension metadata and functions for a given extension.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extensionName | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IExtension.Extension | undefined | + +### getExtensionForFunction + +```solidity +function getExtensionForFunction(bytes4 _functionSelector) external view returns (struct IExtension.ExtensionMetadata) +``` + + + +*Returns the extension metadata for a given function.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | IExtension.ExtensionMetadata | undefined | + +### getExtensionImplementation + +```solidity +function getExtensionImplementation(string _extensionName) external view returns (address) +``` + + + +*Returns the extension's implementation smart contract address.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extensionName | string | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | address | undefined | + +### getImplementationForFunction + +```solidity +function getImplementationForFunction(bytes4 _functionSelector) external view returns (address extensionAddress) +``` + + + +*Returns the extension implementation address stored in router, for the given function.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _functionSelector | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| extensionAddress | address | undefined | + +### getRoleAdmin + +```solidity +function getRoleAdmin(bytes32 role) external view returns (bytes32) +``` + +Returns the admin role that controls the specified role. + +*See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bytes32 | undefined | + +### getRoleMember + +```solidity +function getRoleMember(bytes32 role, uint256 index) external view returns (address member) +``` + +Returns the role-member from a list of members for a role, at a given index. + +*Returns `member` who has `role`, at `index` of role-members list. See struct {RoleMembers}, and mapping {roleMembers}* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| index | uint256 | Index in list of current members for the role. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| member | address | Address of account that has `role` | + +### getRoleMemberCount + +```solidity +function getRoleMemberCount(bytes32 role) external view returns (uint256 count) +``` + +Returns total number of accounts that have a role. + +*Returns `count` of accounts that have `role`. See struct {RoleMembers}, and mapping {roleMembers}* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| count | uint256 | Total number of accounts that have `role` | + +### grantRole + +```solidity +function grantRole(bytes32 role, address account) external nonpayable +``` + +Grants a role to an account, if not previously granted. + +*Caller must have admin role for the `role`. Emits {RoleGranted Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account to which the role is being granted. | + +### hasRole + +```solidity +function hasRole(bytes32 role, address account) external view returns (bool) +``` + +Checks whether an account has a particular role. + +*Returns `true` if `account` has been granted `role`.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account for which the role is being checked. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### hasRoleWithSwitch + +```solidity +function hasRoleWithSwitch(bytes32 role, address account) external view returns (bool) +``` + +Checks whether an account has a particular role; role restrictions can be swtiched on and off. + +*Returns `true` if `account` has been granted `role`. Role restrictions can be swtiched on and off: - If address(0) has ROLE, then the ROLE restrictions don't apply. - If address(0) does not have ROLE, then the ROLE restrictions will apply.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account for which the role is being checked. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### multicall + +```solidity +function multicall(bytes[] data) external nonpayable returns (bytes[] results) +``` + +Receives and executes a batch of function calls on this contract. + +*Receives and executes a batch of function calls on this contract.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| data | bytes[] | The bytes data that makes up the batch of function calls to execute. | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| results | bytes[] | The bytes data that makes up the result of the batch of function calls executed. | + +### removeExtension + +```solidity +function removeExtension(string _extensionName) external nonpayable +``` + + + +*Removes an existing extension from the router.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extensionName | string | undefined | + +### renounceRole + +```solidity +function renounceRole(bytes32 role, address account) external nonpayable +``` + +Revokes role from the account. + +*Caller must have the `role`, with caller being the same as `account`. Emits {RoleRevoked Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account from which the role is being revoked. | + +### revokeRole + +```solidity +function revokeRole(bytes32 role, address account) external nonpayable +``` + +Revokes role from an account. + +*Caller must have admin role for the `role`. Emits {RoleRevoked Event}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role | bytes32 | keccak256 hash of the role. e.g. keccak256("TRANSFER_ROLE") | +| account | address | Address of the account from which the role is being revoked. | + +### supportsInterface + +```solidity +function supportsInterface(bytes4 interfaceId) external view returns (bool) +``` + + + +*See {IERC165-supportsInterface}.* + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| interfaceId | bytes4 | undefined | + +#### Returns + +| Name | Type | Description | +|---|---|---| +| _0 | bool | undefined | + +### updateExtension + +```solidity +function updateExtension(IExtension.Extension _extension) external nonpayable +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| _extension | IExtension.Extension | undefined | + + + +## Events + +### AccountCreated + +```solidity +event AccountCreated(address indexed account, address indexed accountAdmin, string accountId) +``` + +Emitted when a new Account is created. + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| account `indexed` | address | undefined | +| accountAdmin `indexed` | address | undefined | +| accountId | string | undefined | + +### ExtensionAdded + +```solidity +event ExtensionAdded(address indexed extensionAddress, bytes4 indexed functionSelector, string functionSignature) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| extensionAddress `indexed` | address | undefined | +| functionSelector `indexed` | bytes4 | undefined | +| functionSignature | string | undefined | + +### ExtensionRemoved + +```solidity +event ExtensionRemoved(address indexed extensionAddress, bytes4 indexed functionSelector, string functionSignature) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| extensionAddress `indexed` | address | undefined | +| functionSelector `indexed` | bytes4 | undefined | +| functionSignature | string | undefined | + +### ExtensionUpdated + +```solidity +event ExtensionUpdated(address indexed oldExtensionAddress, address indexed newExtensionAddress, bytes4 indexed functionSelector, string functionSignature) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| oldExtensionAddress `indexed` | address | undefined | +| newExtensionAddress `indexed` | address | undefined | +| functionSelector `indexed` | bytes4 | undefined | +| functionSignature | string | undefined | + +### RoleAdminChanged + +```solidity +event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| previousAdminRole `indexed` | bytes32 | undefined | +| newAdminRole `indexed` | bytes32 | undefined | + +### RoleGranted + +```solidity +event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + +### RoleRevoked + +```solidity +event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender) +``` + + + + + +#### Parameters + +| Name | Type | Description | +|---|---|---| +| role `indexed` | bytes32 | undefined | +| account `indexed` | address | undefined | +| sender `indexed` | address | undefined | + + +