Skip to content

This project can be used for all ERC20 based tokens for airdrop distribution!

License

Notifications You must be signed in to change notification settings

IoTChainCode/tokenAirdrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ERC20TokenAridrop

This project can be used for all ERC20 based tokens for airdrop distribution!

  1. A single transmission can support up to two hundred transfers.
  2. Realize the monitoring transaction status and automatically send the next one.
  3. The implementation fee is reduced to 0.000045--0.00007 eth/transcation.

Airdrop
——config
config.js
——contract
*.sol
——filemanger
airdropListManager.js
awards.js
errorAirdropList.js
excelHandleManager.js
——function
——base
deploy.js
execute.js
listen.js
transaction.js
airdrop.js
approve.js
deployAirdropContract.js
transferETH.js
transferToken.js
start.js


Dependency library

web3 solc ethereumjs-tx ethjs-account node-xlsx node-schedule silly-datetime

Description of some key files

--- deploy.js

This deploy.js can help you deploy the contract,you need set the'userPrivateKey' in config.js and run the func .

parameters: 'contractPath' is mean that path of your contract.sol file, 'contractName' is the contract name which you want to deploy, 'extraParameter' is the parameters of what you need to init your contract.

The contract address will be printed on the console and save the contract address in your file!

--- approve.js

This approve.js can help you authorize the airdrop contract address to use your specified number of tokens from your account; you need set 'amount','airdropApproveAddress','userPrivateKey' and 'tokenContractAddress' then run approve.js , it will print the txHash and transfer result;

--- airdrop.js

This airdrop.js is an executive document of the airdrop contract.

parameters: 'filePath':your airdrop address file,and i am using the *.xlsx 'addressIndex': this means the index of eth address in your *.xlsx, 'amountIndex': this means the index of token amount in your *.xlsx, 'addressNeedJudgeRepeat': this parameter represents whether you want to filter duplicate addresses.

--- execute.js

This execute.js can execute the function of your contract.

parameters: 'functionABI' is the data of your want to send in this transaction.

--- config.js

This config.js is the config file, contain 'userModule','airdropModule','approveModule'

The airdrop sequence is as follows:

  1. Deploy ERC20Token contract and airdrop contract.
  2. Approve enough ERC20 tokens to the airdrop contract.
  3. Compile a list of reciepient addresses and store them in 'airdropList.txt' file.
  4. Run 'start.js' script.
  5. You can look the airdrop result on the console or check the txHash in 'https://etherscan.io';

If you are not familiar with the smart contract, then follow the steps below!

  1. run npm install
  2. Config your userPrivateKey and other info in config.js
  3. Run deploy.js , then you will get the result on console
  4. copy the contractAddress on the console, and paste it in config.js ->approveModule->airdropApproveAddress
  5. Config your tokenContractAddress and userPrivateKey in config.js ->approveModule. this userPrivateKey is the private key of the account which you want to use for transfer token;
  6. Run approve.js, then your will get the result on console .
  7. The address and number of airdrop will be required to be listed in xlsx.
  8. Run 'start.js' script.
  9. You can check the airdrop result on the console or check the txHash in 'https://etherscan.io'.

About

This project can be used for all ERC20 based tokens for airdrop distribution!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published