Skip to Content
Ethereum Cookbook
book

Ethereum Cookbook

by Manoj P R
August 2018
Intermediate to advanced
404 pages
11h 19m
English
Packt Publishing
Content preview from Ethereum Cookbook

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Ethereum Dapps

Building Ethereum Dapps

Roberto Infante
Ethereum For Dummies

Ethereum For Dummies

Michael G. Solomon

Publisher Resources

ISBN: 9781789133998Supplemental Content