PausableCrowdsale.sol 833 B

12345678910111213141516171819202122
  1. pragma solidity ^0.4.24;
  2. import "../Crowdsale.sol";
  3. import "../../lifecycle/Pausable.sol";
  4. /**
  5. * @title PausableCrowdsale
  6. * @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role.
  7. */
  8. contract PausableCrowdsale is Crowdsale, Pausable {
  9. /**
  10. * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
  11. * Adds the validation that the crowdsale must not be paused.
  12. * @param _beneficiary Address performing the token purchase
  13. * @param _weiAmount Value in wei involved in the purchase
  14. */
  15. function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view whenNotPaused {
  16. return super._preValidatePurchase(_beneficiary, _weiAmount);
  17. }
  18. }