-
-
Save EtherTyper/7e6babeafbb11bc43ded to your computer and use it in GitHub Desktop.
Multisig wallet, very useless
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract multisig{ | |
struct tx{ | |
address to; | |
uint amount; | |
mapping (address => bool) approved; | |
} | |
uint nextId=0; | |
mapping (uint => tx) txBook; | |
address[] owners; | |
function multisig(address[] _owners){ | |
owners=_owners; | |
} | |
function make(address to, uint amount) constant returns (uint id){ | |
txBook[nextId++]=tx(to,amount); | |
return nextId-1; | |
} | |
function verifySend(uint id){ | |
txBook[id].approved[msg.sender]=true; | |
bool verified=true; | |
for (uint i=0; i<owners.length; i++) | |
verified=verified&&txBook[id].approved[owners[i]]; | |
if (verified) | |
txBook[id].to.send(txBook[id].amount); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment