Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update clientreceipt.sol #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions clientreceipt/clientreceipt.sol
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
pragma solidity ^0.4.10;
import "owned";

contract killswitch is owned {
/* State variables */
bool isOpen;
address keyholder;
address executive;
/* Modifiers */
modifier restricted {
require(msg.sender == owner || (isOpen && msg.sender == executive));
_;
}
/* Events */
event NomineesChanged(address keyholder, address executive);
event BoxOpened();
event BoxClosed();
/* Methods */
function nominate(address _keyholder, address _executive) onlyowner {
keyholder = _keyholder;
executive = _executive;
NomineesChanged(keyholder, executive);
}

function open() {
if (msg.sender == owner || msg.sender == keyholder) {
require(msg.sender == owner || msg.sender == keyholder) {
isOpen = true;
BoxOpened();
}
}
function close() {
if (msg.sender == owner || msg.sender == keyholder) {
require(msg.sender == owner || msg.sender == keyholder) {
isOpen = false;
BoxClosed();
}
}
modifier restricted {
if (msg.sender == owner || (isOpen && msg.sender == executive)) {
_
}
}

bool isOpen;
address keyholder;
address executive;
}

contract ClientReceipt is owned, killswitch {
/* Events */
event AnonymousDeposit(address indexed _from, uint _value);
event Deposit(address indexed _from, bytes32 _id, uint _value);
event Refill(address indexed _from, uint _value);
event Withdraw(address indexed _from, address indexed _to, uint _value);
event Drain(address indexed _from, address indexed _to, uint _value);

function() {
/* fallback function */
function() payable {
AnonymousDeposit(msg.sender, msg.value);
}
/* Methods */
function deposit(bytes32 _id) {
Deposit(msg.sender, _id, msg.value);
}
Expand All @@ -57,4 +61,4 @@ contract ClientReceipt is owned, killswitch {
_to.send(_value);
Drain(msg.sender, _to, _value);
}
}
}