* Now compiling in a separate directory using truffle 5. * Ported to 0.5.1, now compiling using 0.5.1. * test now also compiles using the truffle 5 hack. * Downgraded to 0.5.0. * Sorted scripts. * Cleaned up the compile script a bit.
22 lines
739 B
Solidity
22 lines
739 B
Solidity
pragma solidity ^0.5.0;
|
|
import "../Crowdsale.sol";
|
|
import "../../access/roles/WhitelistedRole.sol";
|
|
|
|
|
|
/**
|
|
* @title WhitelistCrowdsale
|
|
* @dev Crowdsale in which only whitelisted users can contribute.
|
|
*/
|
|
contract WhitelistCrowdsale is WhitelistedRole, Crowdsale {
|
|
/**
|
|
* @dev Extend parent behavior requiring beneficiary to be whitelisted. Note that no
|
|
* restriction is imposed on the account sending the transaction.
|
|
* @param _beneficiary Token beneficiary
|
|
* @param _weiAmount Amount of wei contributed
|
|
*/
|
|
function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view {
|
|
require(isWhitelisted(_beneficiary));
|
|
super._preValidatePurchase(_beneficiary, _weiAmount);
|
|
}
|
|
}
|