PausableCrowdsale.sol 837 B

123456789101112131415161718192021
  1. pragma solidity ^0.5.0;
  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.
  11. * Use super to concatenate validations.
  12. * Adds the validation that the crowdsale must not be paused.
  13. * @param _beneficiary Address performing the token purchase
  14. * @param _weiAmount Value in wei involved in the purchase
  15. */
  16. function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view whenNotPaused {
  17. return super._preValidatePurchase(_beneficiary, _weiAmount);
  18. }
  19. }