Skip to content

Instantly share code, notes, and snippets.

@EtherTyper
Forked from anonymous/Untitled
Created March 24, 2016 18:33
Show Gist options
  • Save EtherTyper/7e6babeafbb11bc43ded to your computer and use it in GitHub Desktop.
Save EtherTyper/7e6babeafbb11bc43ded to your computer and use it in GitHub Desktop.
Multisig wallet, very useless
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