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/CappedCrowdsale.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/CappedCrowdsale.sol')
-rw-r--r-- | test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol b/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol deleted file mode 100644 index 98c8c3d4..00000000 --- a/test/compilationTests/zeppelin/crowdsale/CappedCrowdsale.sol +++ /dev/null @@ -1,33 +0,0 @@ -pragma solidity ^0.4.11; - -import '../math/SafeMath.sol'; -import './Crowdsale.sol'; - -/** - * @title CappedCrowdsale - * @dev Extension of Crowsdale with a max amount of funds raised - */ -contract CappedCrowdsale is Crowdsale { - using SafeMath for uint256; - - uint256 public cap; - - constructor(uint256 _cap) public { - cap = _cap; - } - - // overriding Crowdsale#validPurchase to add extra cap logic - // @return true if investors can buy at the moment - function validPurchase() internal view returns (bool) { - bool withinCap = weiRaised.add(msg.value) <= cap; - return super.validPurchase() && withinCap; - } - - // overriding Crowdsale#hasEnded to add cap logic - // @return true if crowdsale event has ended - function hasEnded() public view returns (bool) { - bool capReached = weiRaised >= cap; - return super.hasEnded() || capReached; - } - -} |