Code Monkey home page Code Monkey logo

tokenairdrop's Introduction

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'.

tokenairdrop's People

Contributors

saber-yy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.