This repository contains a smart contract for conducting ERC20 token airdrops, specifically designed and utilized for the airdrops of MARK tokens on the Arbitrum One network. The contract allows users to send a specific ERC20 token to multiple recipients in a single transaction, ensuring efficiency and cost-effectiveness.
- Allows sending ERC20 tokens to multiple recipients in a single transaction.
- Includes a function to recover accidental tokens sent to the contract.
- Utilizes OpenZeppelin's SafeERC20 library for safe token transfers.
- Clone this repository:
git clone https://github.com/MchainNetwork/airdrop-contract.git
cd airdrop-contract- Install the dependencies:
npm install- Copy the
.env.examplefile to a new.envfile and update the environment variables as needed:
cp .env.example .envContent of the .env.example file:
DEPLOYER_ADDRESS=0xYourDeployerAddressHere
TOKEN_ADDRESS=0xYourTokenAddressHereEnsure to replace 0xYourDeployerAddressHere and 0xYourTokenAddressHere with your actual addresses.
- Compile the contracts:
truffle compile- Deploy the contracts to the desired network:
truffle migrate --network <network-name>To conduct an airdrop, call the bulkTransfer function with the following parameters:
recipients: An array of Ethereum addresses you want to send the tokens to.amounts: An array of token amounts you want to send to each corresponding recipient.
Ensure you have approved enough tokens for the contract before calling bulkTransfer.
To run the unit tests, start Ganache and execute:
truffle test0x731670572D5aF7876031c68a3F87C2445CbBF823
This project is licensed under the MIT License - see the LICENSE file for details.