Tron, one of the largest blockchain network in the world. It is faster and cheaper comparing to most other networks.
Usdt, introduced by Tether, is the top 1 stablecoin in the blockchain industry. Most of current USDT is running on top of Omni Layer, while a few are running on top of Ethereum network.
This summary design document is mainly used to guide the detailed design of the USDT airdrop solution, providing a unified reference standard for detailed design, including the system's internal and external interfaces, system architecture, programming model and other major problems.
After this document has been peer reviewed, all detailed design of the system must be in accordance with the relevant standards and constraints of this document. In addition, this document serves as one of the criteria for peer review of detailed design documents.
In the detailed design process, if it is found that new summary design standards or constraints need to be added to guide the detailed design work, it must be updated and reviewed in this document to ensure the consistency and correctness of the detailed design of each module.
This document mainly describes the outline design of the airdrop solution, which includes defining the internal and external interfaces of the system, the related system architecture and design standards, and does not involve the details of the reality of the system business logic.
You should install the necessary environment before you perform the airdrop.
- Install prerequisites
$ sudo apt-get update
$ sudo apt upgrade -y
$ sudo apt install gcc -y
- Install go
$ cd /tmp
$ GO_PACKAGE=go1.11.linux-amd64.tar.gz
$ wget https://dl.google.com/go/$GO_PACKAGE
$ sudo tar -xvf $GO_PACKAGE
$ sudo mv go /usr/local
$ sudo rm $GO_PACKAGE
- Setting go environment
$ mkdir $HOME/go
$ export GOROOT=/usr/local/go
$ export GOPATH=$HOME/go
$ export PATH=$GOPATH/bin:$GOROOT/bin:$GOPATH:$PATH
$ go version
- Install Homebrew
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- Install GoLang
$ mkdir $HOME/go
$ brew install go
$ go version
$ go version go1.11.2 darwin/amd64
Note: If Go has been installed and needs an update, use $ brew update go
.
- Set up environment in
~/.bash_profile
$ export GOPATH="$HOME/go"
$ export PATH=$GOPATH:$PATH
- Download package
$ go install
- Build project
$ go build
It will generate an executable file named USDT in the current directory.
blacklist.yaml file must be in the same directory as USDT file.
Add address after - address:
.
If you want to add more address to blacklist list, you should add line - address: address
.
blacklist:
- address: exampleA
- address: exampleB
whitelist.yaml file must be in the same directory as USDT file.
Add address after - address:
.
If you want to add more address to whitelist list, you should add line - address: address
.
If address is in the whitelist, it will be added in file base_account_(date you input).txt even if it exceeds limit.
whitelist:
- address: exampleA
- address: exampleB
The naming convention for accounts file is date + '.txt', like 20190430.txt
.
You can download account file by shell.
$ bash download.sh -date yyyymmdd
And then you can get file named date in package.
- init
$ ./USDT
Please enter the command:
$ init
Please enter usdt airdrop address:
$ input hex address of airdrop.
Please enter usdt smart contract address:
$ input hex address of usdt smart contract
Please enter interest limit:
$ input limit of interest audit
Please enter the command:
$ help
[Init] ---Init usdt airdrop params.
[InitPrivateKey] ---Init usdt airdrop address's private key.
[GenerateInterestFile] ---Generate account interest file by account snapshot.
[GenerateTransactionFile]---Generate transaction file by audit file.
[Sign] ---Sign transaction by transaction file.
[Broadcast] ---Broadcast transaction by transactionSigned file.
[Check] ---Check smart contract is success.
[Exit] ---Exit the transaction
- Generate account interest file by account snapshot
Please enter the command:
$ GenerateInterestFile
Please enter date you want to deal with:
$ input the date you want to deal with(e.g. 20190430)
Now you will get audit_account_(date you input).txt
, base_account_(date you input).txt
and blacklist_account_(date you input).txt
.
You must check address in audit_account_(date you input).txt
and delete illegal address.
And then you must combine two files into one name by audit.txt
- Generate transaction file by audit file
Please enter the command:
$ GenerateTransactionFile
Now you will get transaction.txt
.
- Sign transaction.
Please enter the command:
$ InitPrivateKey
Please enter private key:
$ airdrop private key
Please enter the command:
$ sign
Now you will get transactionSigned.txt
.
- Broadcast transaction.
Please enter the command:
$ Broadcast
- Check transaction.
Please enter the command:
$ Check
- install
$ make install
- build
$ make build
- run
$ make run
- clean
$ make clean