Skip to content

Commit

Permalink
Merge branch 'master' into refactor/1174/private-state-vars-timed-cro…
Browse files Browse the repository at this point in the history
…wdsale
  • Loading branch information
frangio authored Sep 6, 2018
2 parents 63b93cc + 616124e commit b6bddb2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion contracts/crowdsale/validation/TimedCrowdsale.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ contract TimedCrowdsale is Crowdsale {
* @dev Reverts if not in crowdsale time range.
*/
modifier onlyWhileOpen {
// solium-disable-next-line security/no-block-members
require(isOpen());
_;
}
Expand Down Expand Up @@ -59,6 +58,14 @@ contract TimedCrowdsale is Crowdsale {
return block.timestamp >= openingTime_ && block.timestamp <= closingTime_;
}

/**
* @return true if the crowdsale is open, false otherwise.
*/
function isOpen() public view returns (bool) {
// solium-disable-next-line security/no-block-members
return block.timestamp >= openingTime && block.timestamp <= closingTime;
}

/**
* @dev Checks whether the period in which the crowdsale is open has already elapsed.
* @return Whether crowdsale period has elapsed
Expand Down

0 comments on commit b6bddb2

Please sign in to comment.