TokenDistributor
automatically sends tokens to multiple receivers with specified allocations when a threshold is reached.
- Visit the AutoTopUpFactory Page on Etherscan
- Connect to your Web3 Wallet and click
createTokenDistributor
- Fill in the details of
createTokenDistributor
.- _tokenAddress: The address of the token you want
TokenDistributor
to monitor. For ETH, use0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
. - _balanceThreshold: The token balance which will trigger distribute.
- _receivers: Array of receivers who tokens will be distributed to.
- _allocation: Array of percentages each representing the percentage of _balanceThreshold which will be received by each _receivers. Percentages can have a maximum of 3 decimal places. For 51.456%,
51456
will be the input.
- _tokenAddress: The address of the token you want
- Click Write and submit the transaction
- Go to Logs of the transaction and to find your
TokenDistributor
address. - Git clone this repo and complete Local Setup.
- Verify your contract by running:
npx hardhat verify --network ropsten YOUR_TOKEN_DISTRIBUTOR_ADDRESS "0xCc4CcD69D31F9FfDBD3BFfDe49c6aA886DaB98d9"
- Use
getDistributorSpecs
to check out the specs of distributor which was set up previously. - To withdraw funds, use the
withdraw
function.
- Put in your
ALCHEMY_ROPSTEN
,PRIVATE_KEY
,ETHERSCAN_API
in.env
- Run
yarn
Run: yarn test