Scatter Token (scatter.cx) minting contract.
This repository was generated from a template or is the template itself. For more information, see docs/TEMPLATE.md.
Usage of this contract to mint Scatter Token requires a sizable list of addresses, each of which has a non-zero ether balance and has never held STT. A suggested approach to generating such a list is to download the list of holders of an extablished token from Etherscan. This list should then be converted to a JSON array containing only addresses and saved in the data/addresses
directory under any filename(s) with a .json
extension.
Deploy the contract:
MNEMONIC="[MNEMONIC]" URL="https://mainnet.infura.io/v3/[INFURA_KEY]" npx buidler run scripts/deploy.js --no-compile --network generic
Update the contents of data/deployed.json
to reflect the address of the new deployment.
To filter a prepared list of addresses:
URL="https://mainnet.infura.io/v3/[INFURA_KEY]" npx buidler run scripts/filter.js --no-compile --network generic
The result will be written to data/filtered.json
.
To distribute tokens to a filtered list of addresses:
MNEMONIC="[MNEMONIC]" URL="https://mainnet.infura.io/v3/[INFURA_KEY]" GAS_PRICE="1e9" npx buidler run scripts/scatter.js --no-compile --network generic
This script requires that the contract holds a balance of STT sufficient for scattering.
The contract will execute transfers to itself if the contract's share of the reward pool is sufficient.
To withdraw STT from the contract:
MNEMONIC="[MNEMONIC]" URL="https://mainnet.infura.io/v3/[INFURA_KEY]" npx buidler run scripts/withdraw.js --no-compile --network generic
Install dependencies via Yarn:
yarn install
By default, Buidler uses the BuidlerEVM.
To use Ganache append commands with --network localhost
, after having started ganache-cli
in a separate process:
npx ganache-cli
To use an external network via URL, set the URL
environment variable and append commands with --network generic
:
URL="https://mainnet.infura.io/v3/[INFURA_KEY]" buidler test --network generic
Compile contracts via Buidler:
npx buidler compile
Test contracts via Buidler:
npx buidler test
If using a supported network (such as Ganache), activate gas usage reporting by setting the REPORT_GAS
environment variable to true
:
REPORT_GAS=true npx buidler test --network localhost