Multisend ERC20 tokens and Ether airdrop smart contract

I want to share the MultiSend contract I’ve developed: https://etherscan.io/address/0xcd5485b34c9902527bbee21f69312fe2a73bc802#code

This contract has methods to efficiently send ERC20 or Ether to many recipients at once.
It does not enforce any fee by itself, so you can safely use it in your own project as is, saving $100+ on the deployment fee.

The contract code is based on the OpenZeppelin contracts and open source. You are free learn, copy and use it in your own projects as you wish :slight_smile:

4 Likes

Currently, it is used in two of my projects:

  1. WordPress Ethereum Wallet plugin for the admin fee feature implementation, and
  2. The MultiSend app to efficiently airdrop ERC20 tokens or Ether to many recipients at once
1 Like

Hi @olegabr,

Thanks for sharing :pray:

transact to MultiSend.multiTransfer_OST errored: Error encoding arguments: Error: expected array value (argument=null, value=“0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2”, code=INVALID_ARGUMENT, version=abi/5.1.2) getting this error

if i want to use bep20 token, which one should i use, multitransfer_ost. i am having a hard time. can you plz tell me the right way.

Use multiTransferTokenEqual_71p for equal amounts token transfers, and
multiTransferToken_a4A for non-equal amount transfers.

Here you can find javascript code that uses it: https://github.com/olegabr/multisender

i gives me this error…

when i try to transfer a token…metamask says " ALERT: Transaction Error. Exception thrown in contract code.

wiht following error…

`transaction has been reverted by the EVM: { "blockHash": 
"0xe0d12e4a804e7fd8aa37f2399550b8b14a2023d67086945c77c3345a4c0f5191", 
"blockNumber": 9531115, "contractAddress": null, "cumulativeGasUsed": 
28274197, "from": "0xe097f4eab36b61f6cec44611d2994e6d2476ac1a", 
"gasUsed": 28055528, "logsBloom": 
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
 "status": false, "to": "0x3e3947ad99cfa11dba78c40465a1eb50c20b8c96", 
"transactionHash": 
"0xe7dfab7aa603e80b913f1ca78a064cbae568e0e08de16c1879b888abd9fac583", 
"transactionIndex": 3, "type": "0x0", "events": {} }`

I am trying to convert this contract to BEP-20 but am receiving the following error at line 1250 after manually converting every line of code:

1249 contract MultiSend is Pausable, Escapable,
1250 MultiTransfer,
MultiTransferEqual,
MultiTransferToken,
MultiTransferTokenEqual,
MultiTransferTokenEther,
MultiTransferTokenEtherEqual

Parsererror: expected pragma, import directive or enum definition...

Does anyone have a BEP-20 version of this contract?

The BSC version: https://bscscan.com/address/0xe5c6BABcB9209994a989C0339d90fa4a120F0CB6#code
The Polygon (MATIC) version: https://polygonscan.com/address/0xe5c6BABcB9209994a989C0339d90fa4a120F0CB6#code

1 Like

Hi there, I'm trying to use multiTransferTokenEqual_71p on BscScan to send my tokens to several addresses at once, each receiving 110000. Since my token has 9 decimals, I set the _amount (uint256) to be 110000000000000 (110000 + 9 zeroes) but on MetaMask I get "Transaction Error. Exception thrown in contract code.". I can however successfully send using the method with less zeroes in the amount. Can you please let me know how I can fix the problem? Thanks in advance.

Hi @olegabr, I am very new to all this, so sorry for the newb/basic questions.
I was trying to copy you MultiSend BSC contract and add to Defender, but I was not getting the ABI to work once I copied the source code into remix. I know it is just something I missed and was hoping you could point me in the right direction.
Thanks for your great contribution.

Thank you for sharing! Does it also work on Avalanche C Chain or Fuji Testnet? Would love to work with it!

I am trying to transfer tokens on BSC. However :

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Internal JSON-RPC error.
{
"code": 3,
"message": "execution reverted: ERC20: insufficient allowance",
"data": "0x08c379a00000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000001d45524332303a20696e737566666369656e7420616c6c6f77616e6365000000"
}

error. I also have enough tokens in my account. What is the solution? Thank you