How to do it...

Every multisig wallet should have the following basic components:

  • A list of addresses who have permission to do something
  • A set of rules for approval
  • An option to receive Ether
  • Ways to submit/approve a request
  1. Create a contract that can act as the Multisig wallet. Create a mapping to store the approver list:
pragma solidity^0.4.24;contract MultiSig {    // Mapping to save the ownership status    mapping (address => bool) public isOwner;    // Owners array    address[] public owners;    // Returns list of owners.    function getOwners() public view returns (address[]) {        return owners;    }    // Modifier to restrict access    modifier onlyOwner(address owner) {        require(isOwner[owner]);        _;    }}
  1. Use a state variable to store the number of approvals ...

Get Ethereum Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.