From ae9de5e913482049f37472469d2901ebe8b25187 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Tue, 5 Apr 2016 19:37:12 +0200 Subject: [PATCH] Simple lazy contract for sharing mining funds --- Ethereum/Contracts/Sexpool | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Ethereum/Contracts/Sexpool diff --git a/Ethereum/Contracts/Sexpool b/Ethereum/Contracts/Sexpool new file mode 100644 index 0000000..5da4b5b --- /dev/null +++ b/Ethereum/Contracts/Sexpool @@ -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; + } + } +}