From 070bcbcdbd7beaaec694265ef42c3f31867aa907 Mon Sep 17 00:00:00 2001 From: Francisco Giordano Date: Sun, 2 Jul 2017 17:05:06 -0300 Subject: [PATCH] rename purchaseValid to validPurchase --- contracts/crowdsale/CappedCrowdsale.sol | 6 +++--- contracts/crowdsale/Crowdsale.sol | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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;