- Prepare a CSV bonus list with
users address
,bonus amount
- Deploy Airdrop contract (pointing to RNDR token ERC20 contract address in a constuctor)
- Call
addManyUsers(userAddresses[], bonusAmounts[])
with corresponding arrays. Can be done several batches (adding each user costs around 80k gas) - Call
finalizeList()
to lock the modification of user bonus list - Perform safety checks on the blockchain list:
- Check that
bonusAddresses[]
array contain only allowed users - Check that corresponding
bonusAmounts
mappings have relevant amount of bonus - Check
totalBonus
- Check
userCount
- Check that
- If all checks correspond to your local bonus list, send a number of RNDR tokens equal to the
totalBonus
variable to the Airdrop contract's address before calling the payment function. - Call
payManyUsers(batchSize)
with a chosenbatchSize
several times (paying each user costs around 40-50k gas) - If any excess tokens are left on the contract - it can be withdrawn by calling
returnTokens()
There are a couple of truffle tests which run through the above basic workflow and some safety-checks.
To run, do the following:
npm install
- Get latest ganache or any other blockchain that supports require messages running on port 8545
truffle compile
truffle test