diff options
author | chriseth <chris@ethereum.org> | 2018-10-24 20:51:37 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-10-24 20:52:55 +0800 |
commit | eded236e67d714802e62365381c6aa2588a091c5 (patch) | |
tree | 8213d65d048e33743eaefef7ad1435f5071a6146 /test/compilationTests/zeppelin/crowdsale/RefundVault.sol | |
parent | f5f977eaf5b57c5fbed99692eed1b6e3b0f5527f (diff) | |
download | dexon-solidity-eded236e67d714802e62365381c6aa2588a091c5.tar.gz dexon-solidity-eded236e67d714802e62365381c6aa2588a091c5.tar.zst dexon-solidity-eded236e67d714802e62365381c6aa2588a091c5.zip |
Only run zeppelin as external tests.
Diffstat (limited to 'test/compilationTests/zeppelin/crowdsale/RefundVault.sol')
-rw-r--r-- | test/compilationTests/zeppelin/crowdsale/RefundVault.sol | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol b/test/compilationTests/zeppelin/crowdsale/RefundVault.sol deleted file mode 100644 index ef1d8061..00000000 --- a/test/compilationTests/zeppelin/crowdsale/RefundVault.sol +++ /dev/null @@ -1,56 +0,0 @@ -pragma solidity ^0.4.11; - -import '../math/SafeMath.sol'; -import '../ownership/Ownable.sol'; - -/** - * @title RefundVault - * @dev This contract is used for storing funds while a crowdsale - * is in progress. Supports refunding the money if crowdsale fails, - * and forwarding it if crowdsale is successful. - */ -contract RefundVault is Ownable { - using SafeMath for uint256; - - enum State { Active, Refunding, Closed } - - mapping (address => uint256) public deposited; - address payable public wallet; - State public state; - - event Closed(); - event RefundsEnabled(); - event Refunded(address indexed beneficiary, uint256 weiAmount); - - constructor(address payable _wallet) public { - require(_wallet != address(0x0)); - wallet = _wallet; - state = State.Active; - } - - function deposit(address payable investor) public onlyOwner payable { - require(state == State.Active); - deposited[investor] = deposited[investor].add(msg.value); - } - - function close() public onlyOwner { - require(state == State.Active); - state = State.Closed; - emit Closed(); - wallet.transfer(address(this).balance); - } - - function enableRefunds() public onlyOwner { - require(state == State.Active); - state = State.Refunding; - emit RefundsEnabled(); - } - - function refund(address payable investor) public { - require(state == State.Refunding); - uint256 depositedValue = deposited[investor]; - deposited[investor] = 0; - investor.transfer(depositedValue); - emit Refunded(investor, depositedValue); - } -} |