Whitelisting users for the crowdsale
Sometimes, you may want your sale to be private or you need to provide an increased bonus to a set of users. For these situations, a whitelisting contract is created to keep track of a certain set of users. This allows you to restrict operations between them to provide a more personalized approach.
In this recipe, you will learn to create a whitelisting function that can be used along with the crowdsale
contract.
Getting ready
You need to have a development environment that supports solidity programming and an Ethereum network to deploy and test your code.
Since the contract extends the crowdSale
contract created in the Building your own Initial Coin Offering recipe, it is recommended to finish that before stepping through this recipe.
The contracts are for illustration purposes only, are not well optimized, and may contain bugs. DO NOT USE THEM in your end product.
How to do it…
- Create a
mapping
variable to store the address as a key and whitelisting status...