0

If I want to airdrop the token to 10,000 addresses can we do it all under 1 transaction rather than 10,000 separate transactions all incurring separate fees.

Thanks Amit M

2

Sort of. If you do more work in a single transaction, that transaction will get more expensive (but cheaper than doing separate transactions).

That said, 10,000 transfers is too many. The required gas would exceed the current block limit, so such a transaction is impossible to get mined.

A more realistic number would be on the order of 100-1,000 transfers per transaction. Once you've written your code, it will be easy to measure the gas required and pick the right number.

  • Thanks @Smarx for the answer. You we can do 100-1000 transfers in single transaction? – Amit Modi Feb 23 '18 at 5:18
  • 2
    I think you're missing a word in that question? As I said, I think 100-1,000 transfers in a single transaction is realistic. – smarx Feb 23 '18 at 5:21
  • 1
    A single transaction can do it but each token transfer is going to be a seperate internal transaction. The gas required for the token transfer is going to be the same. The gas saved will be a notable difference but not much I would say. It saves a lot of time though. – Kannan Ravindran Feb 23 '18 at 5:27
  • The gas saving will be quite significant. Each transaction has a base fee of 21,000, while an "internal transaction" (misleading term, really just a CALL opcode) has a base fee of around 700. (But see Appendix H of the yellow paper... calculating the gas cost of a CALL is tricky.) And, of course, if the airdrop code is part of the ERC20 token code, then there's no CALL at all. – smarx Feb 23 '18 at 5:31
  • I am still not sure, how in a single transaction we can do multiple transfers. I tried this to add a loop in method for 10 times. But in block explorer its showing 10 different mined transactions. – Amit Modi Feb 23 '18 at 5:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.