{"id":20476599,"url":"https://github.com/abdk-consulting/abdk-multisig-wallet","last_synced_at":"2025-04-13T12:43:28.766Z","repository":{"id":121269364,"uuid":"185946952","full_name":"abdk-consulting/abdk-multisig-wallet","owner":"abdk-consulting","description":"Advanced Ethereum Multisig Wallet by ABDK Consulting","archived":false,"fork":false,"pushed_at":"2019-05-13T04:33:41.000Z","size":19,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T03:41:46.066Z","etag":null,"topics":["ethereum","multisig-wallets","smart-contracts","solidity"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abdk-consulting.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-10T08:09:45.000Z","updated_at":"2025-03-02T03:07:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"dba698a6-a20e-4cfe-9250-d6e89495ed9a","html_url":"https://github.com/abdk-consulting/abdk-multisig-wallet","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdk-consulting%2Fabdk-multisig-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdk-consulting%2Fabdk-multisig-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdk-consulting%2Fabdk-multisig-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abdk-consulting%2Fabdk-multisig-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abdk-consulting","download_url":"https://codeload.github.com/abdk-consulting/abdk-multisig-wallet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717241,"owners_count":21150387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","multisig-wallets","smart-contracts","solidity"],"created_at":"2024-11-15T15:21:46.330Z","updated_at":"2025-04-13T12:43:28.760Z","avatar_url":"https://github.com/abdk-consulting.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"ABDK Multisig Wallet\r\n====================\r\n\r\nCopyright (c) 2017-2019, [ABDK Consulting](https://abdk.consulting/)\r\n\r\nAll rights reserved.\r\n\r\nRedistribution and use in source and binary forms, with or without modification,\r\nare permitted provided that the following conditions are met:\r\n1. Redistributions of source code must retain the above copyright notice, this\r\n   list of conditions and the following disclaimer.\r\n2. Redistributions in binary form must reproduce the above copyright notice,\r\n   this list of conditions and the following disclaimer in the documentation\r\n   and/or other materials provided with the distribution.\r\n3. All advertising materials mentioning features or use of this software must\r\n   display the following acknowledgement: This product includes software\r\n   developed by ABDK Consulting.\r\n4. Neither the name of ABDK Consulting nor the names of its contributors may be\r\n   used to endorse or promote products derived from this software without\r\n   specific prior written permission.\r\n\r\nTHIS SOFTWARE IS PROVIDED BY ABDK CONSULTING ''AS IS'' AND ANY EXPRESS OR\r\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r\nMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\r\nSHALL ABDK CONSULTING BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r\nEXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\r\nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\r\nIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\r\nOF SUCH DAMAGE.\r\n\r\nOverview\r\n--------\r\n\r\nABDK Multisig Wallet is an Ethereum smart contract that allows multiple (up to\r\n255) parties to collectively own an Ethereum address.  The owners may suggest\r\ntransactions to be executed from wallet's address, approve suggested\r\ntransactions, and execute transaction that collected enough approvals.\r\n\r\nThe smart contract is available in two versions:\r\n[stand alone](ABDKMultisigWallet.sol) and\r\n[delegated](ABDKMultisigWalletDelegated.sol).\r\n\r\nStand alone version is more expansive to deploy, but slightly cheaper to use.\r\nDelegated version is about ten times cheaper to deploy than stand alone version,\r\nbut more expensive to use and requires stand alone version to be already\r\ndeployed on the same blockchain.\r\n\r\nFeatures\r\n--------\r\n\r\nHere is the list of high-level features offered by ABDK Multisig Wallet:\r\n\r\n1. public and private transactions are both supported via single API;\r\n2. it is possible to deploy smart contract from wallet's address via `CREATE`\r\n   and `CREATE2` opcodes;\r\n3. data returned by executed transaction is captured and logged;\r\n4. smart contract is available in two versions: stand alone (expensive\r\n   deployment, cheaper use) and delegated (cheaper deployment, more expensive\r\n   use).\r\n\r\nUsage Scenarios\r\n---------------\r\n\r\nThis section describes most common usage scenarios for ABDK Multisig Wallet.\r\n\r\n### 1. Stand Alone Deployment\r\n\r\nFor stand alone deployment just deploy\r\n[ABDKMultisigWallet](ABDKMultisigWallet.sol) smart contract from some of your\r\naddresses.  This will create new stand alone ABDK Multisig Wallet.  The address\r\nused for deployment will become the only owner of the wallet.\r\n\r\n### 2. Delegated Deployment\r\n\r\nFor delegated deployment, deploy\r\n[ABDKMultisigWalletDelegated](ABDKMultisigWalletDelegated.sol) providing address\r\nof some already deployed stand alone ABDK Multisig Wallet as constructor\r\nparameter.  Make sure that this stand alone wallet is deployed in the same\r\nblockchain and is based on the same code version as new deployed delegated\r\nwallet.\r\n\r\n### 3. Public Transaction\r\n\r\nIn order to execute public transaction, initiator needs to call\r\n`suggestRevealAndApprove` method providing transaction destination,\r\nether amount, and binary data as parameters.\r\nThen other owners need to call `approve` method providing transaction ID as\r\nparameter.  Transaction ID may be extracted from the events logged by\r\n`suggestRevealAndApprove`.\r\nFinally, when transaction collected enough approvals, one of the owners needs to\r\ncall `execute` method providing transaction details as parameters.  These\r\ndetails may also be extracted from the events logged by\r\n`suggestRevealAndApprove`.\r\nOptionally, the last approver may call `approveAndExecute` method instead\r\nof`approve` to save some gas.\r\n\r\n### 4. Private Transaction\r\n\r\nFor private transaction, initiator calls `suggestAndApprove` method\r\nproviding hash of transaction details.  The hash may be calculated off-chain\r\nfrom transaction details via `calcualteHash` constant method.\r\nThen, initiator sends transaction details to other owners via e-mail or some\r\nother off-chain media.\r\nThe owners use `checkHash` constant method to ensure that transaction details\r\nthey receive from initiator actually match hash stored in the smart contract.\r\nThen owners call `approve` and finally `execute` the same way as for public\r\ntransaction.  For this flow, transaction details appear on-chain only when\r\n`execute` method is called.\r\n\r\n### 5. Smart Contract Creation\r\n\r\nIn order to create smart contract from wallet's address, owners need to make\r\nwallet to execute a transaction that calls `createSmartContract` or\r\n`createSmartContract2` method on the wallet itself.  The former method\r\ngets as a parameter contract's byte code packed together with constructor\r\narguments and creates smart contract using `CREATE` opcode.  The latter method\r\naccepts `salt` parameter along with byte code, and uses `CREATE2` opcode.\r\n\r\n### 6. Change Number of Approvals Required\r\n\r\nTo change number of approvals required to execute a transaction, owners need to\r\nmake wallet to execute a transaction that calls `setApprovalsRequired`\r\nmethod, providing new number of required approvals as a parameter.  Note that\r\nis number of required approvals will ever be set higher than current number of\r\nowner, the wallet will be locked forever and there will be no way to execute\r\nany transaction from it anymore.\r\n\r\n### 7. Change Owner\r\n\r\nABDK Multisig Wallet may have up to 255 owners.  Wallet smart contract has 255\r\nslots for owners with indexed by numbers 1..255.  Indexes of the slots occupied\r\nby current owner do not have to go in sequence.  I.e. there could be owners at\r\nslots \\#1 and \\#3, while slot \\#2 may be vacant.\r\n\r\nIn order to change the owner occupying certain slot, owners need to\r\nmake wallet to execute a transaction that calls `changeOwner` method,\r\nproviding slot index and new owner address as parameters.  Providing zero owner\r\naddress will effectively make slot vacant.  Note that one owner may not occupy\r\nmore than one slot, so providing an address of existing owner to\r\n`changeOwner` method will revert the transaction.\r\n\r\nTransaction approvals made by owners are bound to slot indexes rather than to\r\nowner addresses, so new owner may revoke approvals made be the owner who\r\npreviously occupied the same slot.\r\n\r\n### 8. Cancel Transaction\r\n\r\nIn some cases owners may decide not to execute suggested transaction.  This may\r\nhappen if transaction was suggested by mistake, or became irrelevant while\r\ncollecting approvals, or was submitted by malicious party using compromised\r\nowner's key.  Such transaction may be cancelled by calling\r\n`cancelSuggestion` method and providing transaction ID as a parameter.\r\nThis method should be called from wallet's address, so owners need to suggest,\r\napprove, and execute transaction that will call this method.\r\n\r\nFunctions and Properties\r\n------------------------\r\n\r\nThis section describes all public functions and properties of ABDK Multisig\r\nWallet smart contract.\r\n\r\n    function suggest (bytes32 _hash)\r\n    public returns (uint256)\r\n\r\nSuggest a transaction to be executed from the wallet's address.  Parameter\r\n`_hash` is the hash of transaction details calculated via `calculateHash`\r\nmethod.  Returns transaction ID.  This method may be called only by wallet\r\nowners.  Logs `Suggestion` event on successful invocation.\r\n\r\n    function reveal (uint256 _id, address _to, uint256 _value, bytes memory _data, uint256 _salt)\r\n    public\r\n\r\nReveal details of the transaction with given ID, revert in case provided\r\ntransaction do not match hash stored in the smart contract.  This method may be\r\ncalled only by wallet owners.  Logs `Revelation` event on successful\r\ninvocation.\r\n\r\n    function approve (uint256 _id)\r\n    public\r\n\r\nApprove the transaction with given ID.  This method may be called only be wallet\r\nowners.  Logs `Approval` event on successful invocation.\r\n\r\n    function revokeApproval (uint256 _id)\r\n    public\r\n\r\nRevoke approval from the transaction with given ID.  This method may be called\r\nonly be wallet owners.  Logs `ApprovalRevocation` event on successful\r\ninvocation.\r\n\r\n    function execute (uint256 _id, address _to, uint256 _value, bytes memory _data, uint256 _salt)\r\n    public returns (bool _status, bytes memory _returnedData)\r\n\r\nExecute the transaction with given ID and transaction details, revert in case\r\nthe transaction didn't collect enough approvals yet, or transaction details do\r\nnot match hash stored in the smart contract.  This method may be called\r\nonly be wallet owners.  Logs `Execution` event on successful invocation.\r\n\r\n    function createSmartContract (bytes memory _byteCode)\r\n    public payable returns (address _contractAddress, bytes memory _returnedData)\r\n\r\nCreate new smart contract using `CREATE` opcode.  Parameter `_byteCode`\r\nis the byte code of the smart contract to be deployed packed together with\r\nconstructor arguments.  This method may only be called by the wallet itself via\r\napproved transaction.  Logs `ContractCreation` event on successful\r\ninvocation.\r\n\r\n    function createSmartContract2 (bytes memory _byteCode, bytes32 _salt)\r\n    public payable returns (address _contractAddress, bytes memory _returnedData)\r\n\r\nWorks similar to `createSmartContract` function but uses `CREATE2`\r\nopcode with given salt. \r\n\r\n    function changeOwner (uint8 _ownerIndex, address _newOwner)\r\n    public\r\n\r\nChange wallet owner at given index.  This method may only be called by the wallet itself via\r\napproved transaction.  Logs `OwnerChange` event on successful invocation.\r\n\r\n    function setApprovalsRequired (uint8 _approvalsRequired)\r\n    public\r\n\r\nChange number of approvals required to execute a transaction.  This method may\r\nonly be called by the wallet itself via approved transaction.  Logs\r\n`ApprovalsRequiredChange` event on successful invocation.\r\n\r\n    function cancelSuggestion (uint256 _id)\r\n    public\r\n\r\nCancel suggested transaction with given ID.  This method may only be called by\r\nthe wallet itself via approved transaction.  Logs\r\n`SuggestionCancellation` event on successful invocation.\r\n\r\n    function calculateHash (address _to, uint256 _value, bytes memory _data, uint256 _salt)\r\n    public pure returns (bytes32)\r\n\r\nCalculate transaction hash from destination address, ether amount, data, and\r\nsalt.\r\n\r\n    function checkHash (uint256 _id, address _to, uint256 _value, bytes memory _data, uint256 _salt)\r\n    public view returns (bool)\r\n\r\nCheck, whether transaction details match hash stored in smart contract.\r\n\r\n    function approvalsCount (uint256 _id)\r\n    public view returns (uint8)\r\n\r\nGet number of approvals required to execute a transaction.\r\n\r\n    function hashOf (uint256 _id)\r\n    public view returns (bytes32)\r\n\r\nGet hash of transaction details stored in smart contract.\r\n\r\n    function isApproved (uint256 _id)\r\n    public view returns (bool)\r\n\r\nCheck, whether transaction with given ID collected enough approvals to be\r\nexecuted.\r\n\r\n    function isApprovedBy (uint256 _id, address _owner)\r\n    public view returns (bool)\r\n\r\nTell, whether transaction with given ID is approved by given owner.\r\n\r\n    function getOwnerAt (uint8 _index)\r\n    public view returns (address)\r\n\r\nGet address of the owner at given index.  Return zero address in case owner slot\r\nwith given index is currently vacant.\r\n\r\n    function suggestAndReveal (address _to, uint256 _value, bytes memory _data)\r\n    public returns (uint256)\r\n\r\nConvenient and gas effective way to suggest and reveal a transaction.\r\n\r\n    function suggestRevealAndApprove (address _to, uint256 _value, bytes memory _data)\r\n    public returns (uint256)\r\n\r\nConvenient and gas effective way to suggest, reveal, and approve a transaction.\r\n\r\n    function suggestAndApprove (bytes32 _hash)\r\n    public returns (uint256)\r\n\r\nConvenient and gas effective way to suggest and approve a transaction.\r\n\r\n    function suggestApproveAndExecute (address _to, uint256 _value, bytes memory _data)\r\n    public returns (bool _status, bytes memory _returnedData)\r\n\r\nConvenient and gas effective way to suggest, approve, and execute a transaction.\r\nUse this method when number of required approvals is less than or equals to one.\r\n\r\n    function approveAndExecute (uint256 _id, address _to, uint256 _value, bytes memory _data, uint256 _salt)\r\n    public returns (bool _status, bytes memory _returnedData)\r\n\r\nConvenient and gas effective way to approve and execute a transaction.\r\n\r\n    uint8 public ownersCount\r\n\r\nCurrent number of owners.\r\n\r\n    uint8 public approvalsRequired\r\n\r\nNumber of approvals required to execute a transaction.\r\n\r\nEvents\r\n------\r\n\r\nThis section describes all events that ABDK Multisig Wallet smart contract may\r\nlog.\r\n\r\n    event Deposit (\r\n      address indexed from,\r\n      uint256 value,\r\n      bytes data)\r\n\r\nLogged by fallback function on incoming transactions.\r\n\r\n    event Suggestion (\r\n      uint256 indexed id,\r\n      address indexed owner,\r\n      bytes32 indexed hash)\r\n\r\nLogged when new transaction is suggested.\r\n\r\n    event Revelation (\r\n      uint256 indexed id,\r\n      address indexed owner,\r\n      address indexed to,\r\n      uint256 value,\r\n      bytes data,\r\n      uint256 salt)\r\n\r\nLogged when transaction details are revealed.\r\n\r\n    event Approval (\r\n      uint256 indexed id,\r\n      address indexed owner)\r\n\r\nLogged when transaction is approved by wallet owner.  \r\n\r\n    event ApprovalRevocation (\r\n      uint256 indexed id,\r\n      address indexed owner)\r\n\r\nLogged when wallet owner revokes transaction approval.\r\n\r\n    event Execution (\r\n      uint256 indexed id,\r\n      address indexed owner,\r\n      bool status,\r\n      bytes returnedData)\r\n\r\nLogged when transaction has been executed.\r\n\r\n    event SmartContractCreation (\r\n      address indexed contractAddress,\r\n      bytes returnedData)\r\n\r\nLogged when smart contract has been created.\r\n\r\n    event OwnerChange (\r\n      uint8 indexed ownerIndex,\r\n      address indexed oldOwner,\r\n      address indexed newOwner)\r\n\r\nLogged when owner has been changed.\r\n\r\n    event ApprovalsRequiredChange (\r\n      uint8 newApprovalsRequired)\r\n\r\nLogged when number of approvals required to execute a transaction has been\r\nchanged.\r\n\r\n    event SuggestionCancellation (\r\n      uint256 indexed id)\r\n\r\nLogged when suggested transaction has been cancelled.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdk-consulting%2Fabdk-multisig-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabdk-consulting%2Fabdk-multisig-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabdk-consulting%2Fabdk-multisig-wallet/lists"}