* Change import path from zos-lib to upgrades in all contracts * Update readme with new naming * Update package and deps names * Change path to initializable in AST of networks.jsons * Migrate manifest version * Use new oz file locations * Rename in ERC20Migrator comments * Update SDK install instructions in README * Update gitignore to use new session file name * trigger CI * Fixes to readme and package version * Use 2.5.0 release of OpenZeppelin SDK
32 lines
1.1 KiB
Solidity
32 lines
1.1 KiB
Solidity
pragma solidity ^0.5.2;
|
|
|
|
import "@openzeppelin/upgrades/contracts/Initializable.sol";
|
|
|
|
import "../Crowdsale.sol";
|
|
import "../../lifecycle/Pausable.sol";
|
|
|
|
/**
|
|
* @title PausableCrowdsale
|
|
* @dev Extension of Crowdsale contract where purchases can be paused and unpaused by the pauser role.
|
|
*/
|
|
contract PausableCrowdsale is Initializable, Crowdsale, Pausable {
|
|
function initialize(address sender) public initializer {
|
|
assert(Crowdsale._hasBeenInitialized());
|
|
|
|
Pausable.initialize(sender);
|
|
}
|
|
|
|
/**
|
|
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met.
|
|
* Use super to concatenate validations.
|
|
* Adds the validation that the crowdsale must not be paused.
|
|
* @param _beneficiary Address performing the token purchase
|
|
* @param _weiAmount Value in wei involved in the purchase
|
|
*/
|
|
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view whenNotPaused {
|
|
return super._preValidatePurchase(_beneficiary, _weiAmount);
|
|
}
|
|
|
|
uint256[50] private ______gap;
|
|
}
|