How to automatically deliver the tokens in a PostDeliveryCrowdsale

by iappmaker   Last Updated December 06, 2018 13:28 PM

My goal is to deliver the tokens only at the end of the crowd sale. I have seen the below code which can deliver the tokens in a batch.


  1. Will this work even when there is a million _to address ?
  2. Apart from the below snippet, Is there any better way to do this ?

     * @dev Function to batch mint tokens
     * @param _to An array of addresses that will receive the minted tokens.
     * @param _amount An array with the amounts of tokens each address will get     minted.
     * @return A boolean that indicates whether the operation was successful.
    function batchMint(address[] _to, uint256[] _amount) external
    returns (bool) {
        require(_to.length == _amount.length);
        for (uint i = 0; i < _to.length; i++) {
            require(_to[i] != address(0));
            require(mint(_to[i], _amount[i]));
        return true;

Related Questions

What is IERC20?

Updated October 21, 2018 18:28 PM

OpenZeppelin crowdsale token ownership

Updated December 31, 2018 06:28 AM