August 2019
Intermediate to advanced
486 pages
13h 52m
English
As we have seen, Crowdsale.sol is the basic version of the crowdsale contract and, on top of that, different features can be added. By using the WhitelistCrowdsale.sol contract, you can allow ether to be received from known/whitelisted addresses; other addresses cannot send ether to the contract. Whitelisted addresses can be investors' addresses, who are allowed to purchase tokens from the contract.
The OpenZeppelin contract present at Chapter09/openzeppelin-solidity/contracts/crowdsale/WhitelistCrowdsale.sol is defined as follows:
contract WhitelistCrowdsale is WhitelistedRole, Crowdsale { function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal view {