Question for my airdrop(or batch transfer) contract

Hey there! I'm suffering from problems with batch transfer function. Can you give me little help please?

The code is like this.

    constructor (address _BDAIadress) public {
        BDAI = IERC20(_BDAIadress);
        owner = msg.sender;
    }



  function drop(address[] memory recipients, uint256[] memory amount) public onlyOwner {
    for (uint256 i = 0; i < recipients.length; i++) {
      BDAI.transfer(recipients[i], amount[i]*10**18);
    }
  }

I tried the code and have seen good result with 3~4 address/small amount of tokens. But when I try to do a massive transfer( around 150 address / x*10**7~8 amount), it fails with error.

Is there proper form to send it? (like ["address1", "address2", .... ] and ["amount1", "amount2",... ] or [address1, address2, ....] and [amount1, amount2, ....]

Or shoud I try to do partial transfers at once? (like upto 10 address)

Thank you for any advice!!

I think the code looks like ok, so maybe the array of the all addresses is too large to loop. And just like you said, you can distribute tokens with some times.

And maybe you can do a merkle-drop contract that let users claim tokens by themselves.

Thank you for an advice! I tried claiming way before, find out a lot of people don't know how to claim the tokens and some people having trouble with their wallet connection :slight_smile:

1 Like

Can claiming tokens be designed to be a simple click on a button?