Skip to content
This repository has been archived by the owner on Apr 1, 2021. It is now read-only.

ItsNickBarry/unscatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unscatter

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

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.

Deployment

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.

Filtering

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.

Scattering

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.

Withdrawing

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

Setup

Install dependencies via Yarn:

yarn install

Networks

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

Development and Testing

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