[Ethereum] How to do an air drop to all ETH token holders

contract-developmenterc-20solidity

Say I have an ERC20 token and I want to distribute it 1:1 to all ETH token holders at a given block. Is there a straight forward way to make a smart contract that anyone could call in order to receive their tokens?

Best Answer

What you can do is to ask the ETH holders to call a custom function in you contract (claim tokens).

Basically this function will do the following:

  1. Get the sender info (address and balance)
  2. If the address is new, send X amount of tokens according to his ETH balance.
  3. Save the address in a mapping so that he cannot claim more tokens using this function.
Related Topic