Simple lazy contract for sharing mining funds
This commit is contained in:
parent
bac93edcb5
commit
ae9de5e913
33
Ethereum/Contracts/Sexpool
Normal file
33
Ethereum/Contracts/Sexpool
Normal file
@ -0,0 +1,33 @@
|
||||
contract sexpool
|
||||
{
|
||||
address public Fredrik;
|
||||
address public Daniel;
|
||||
|
||||
modifier onlyMembers
|
||||
{
|
||||
if (msg.sender != Fredrik || msg.sender != Daniel) throw;
|
||||
_
|
||||
}
|
||||
|
||||
function sexpool(address initFredrik, address initDaniel)
|
||||
{
|
||||
Fredrik = initFredrik;
|
||||
Daniel = initDaniel;
|
||||
}
|
||||
|
||||
function payout() onlyMembers {
|
||||
uint256 payout = this.balance/2;
|
||||
Fredrik.send(payout);
|
||||
Daniel.send(payout);
|
||||
}
|
||||
|
||||
|
||||
function changeAdress(address newAdress) onlyMembers {
|
||||
if (msg.sender == Fredrik) {
|
||||
Fredrik = newAdress;
|
||||
}
|
||||
else {
|
||||
Daniel = newAdress;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user