diff --git a/contracts/crowdsale/CappedCrowdsale.sol b/contracts/crowdsale/CappedCrowdsale.sol index 8b8ed82f8..9142efb37 100644 --- a/contracts/crowdsale/CappedCrowdsale.sol +++ b/contracts/crowdsale/CappedCrowdsale.sol @@ -16,11 +16,11 @@ contract CappedCrowdsale is Crowdsale { cap = _cap; } - // overriding Crowdsale#purchaseValid to add extra cap logic + // overriding Crowdsale#validPurchase to add extra cap logic // @return true if investors can buy at the moment - function purchaseValid() internal constant returns (bool) { + function validPurchase() internal constant returns (bool) { bool withinCap = weiRaised.add(msg.value) <= cap; - return super.purchaseValid() && withinCap; + return super.validPurchase() && withinCap; } // overriding Crowdsale#hasEnded to add cap logic diff --git a/contracts/crowdsale/Crowdsale.sol b/contracts/crowdsale/Crowdsale.sol index 04244dca7..8c4a00395 100644 --- a/contracts/crowdsale/Crowdsale.sol +++ b/contracts/crowdsale/Crowdsale.sol @@ -68,7 +68,7 @@ contract Crowdsale { // low level token purchase function function buyTokens(address beneficiary) payable { require(beneficiary != 0x0); - require(purchaseValid()); + require(validPurchase()); uint256 weiAmount = msg.value; uint256 updatedWeiRaised = weiRaised.add(weiAmount); @@ -92,7 +92,7 @@ contract Crowdsale { } // @return true if the transaction can buy tokens - function purchaseValid() internal constant returns (bool) { + function validPurchase() internal constant returns (bool) { uint256 current = block.number; bool withinPeriod = current >= startBlock && current <= endBlock; bool nonZeroPurchase = msg.value != 0;