Live Links Kovan Testnet Contract Address: 0xDB6ff940d53698797734E59Fb5f629c7d10229d5 Kovan Deploy TX: 0x088a20921a86ab720ddb1382c345dfb695e8da9084451fa1c53318cd50101c8e Kovan Site (live, interactive): ttps://chainwave-multisignature-wallet.netlify.app/
The Problem:Your entity or company has a wallet and as a part of governance you require that multiple people need to approve and sign off on transactions before funds can be transferred.
Solution: Chainwave Multi Sig Ethereum WalletThis wallet allows n number of participants (“approvers” to share control over a wallet’s transactions. We use a super simple quorum which can be set upon contract creation. Basically anyone who is an approver in the smart contract can submit a transaction. If the transaction is approved by a quorum (usually majority) of all approvers, then the transaction can go through. This multisig wallet demonstrates the simple ability to achieve this.
Features of this multi sig wallet include:
- Add Approvers
- Get List of Approvers
- Create Transfers
- Get List of Transfers
- Approve Transfers
- Modify Quorum (with a vote)
- Modify Approvers (with a vote)
- Receive Ether
- Access Control
- Web Based Interface
- Solidity 0.6.0;
- Truffle Framework
Technical Implementation of Multi Signature WalletWe cover how we produce this contract in order to demonstrate how Chainwave Engineers build on the blockchain.
Creating a New Transfer in our MultiSig WalletFirst we need to create a data structure to describe transfers. We have created a struct that defines a transfer: With our data structure solved, creating a transfer involves populating a new instance of a “proposed” Transfer and adding it to this contract’s stored array of transfers.
Approving a Transfer in A Multi Signature Smart ContractTo approve a transfer, we must first check to ensure that the Transfer has not yet been sent and it has not already been approved. If the amount of approvals received by the smart contract reach quorum, then we populate a new ethereum transaction with the information stored in our proposed Transfer.
Utility Functions: Getting Approvers, Get Transfers, and Access ControlIn the smart contract you will also find utility functions to get approvers and other data out of the contract. The most important utility here is access control. This function restricts actions to users to have been added to the approver array.
Testing Multi Sig Wallet Smart ContractsWe use truffle framework to test and deploy smart contracts. Our tests cover the important behaviors that this multi sig wallet achieves, which in include:
- Creating a Transfer proposal
- Approval of Transfer with Quorum
- Ensuring failures when Transfer is incorrectly approved or created