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.

Questions

  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
    canMint
    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


Updated October 21, 2018 18:28 PM

Updated November 28, 2018 03:28 AM

Updated October 03, 2018 10:28 AM

Updated December 03, 2018 23:28 PM

Updated November 27, 2018 07:28 AM