ERC20 token which allocates a non-zero initial balance to all addresses. Based on the ERC20 implementation provided by OpenZeppelin version 3.0.1
.
This repository was generated from a template or is the template itself. For more information, see docs/TEMPLATE.md.
Included are several abstract
contracts containing basic implementation of an implicit-balance ERC20 token. A fully implemented contract must call all base contract constructors, including that of ERC20
.
contract | constructor signature | description |
---|---|---|
ImplicitFixedBalanceToken |
uint base |
each account is allocated an implicit balance equal to base ; base is immutable and may not be updated |
ImplicitRandomBalanceToken |
uint min, uint mod, uint mul |
each account is allocated an implicit balance between min * mul and (min + mod) * mul , determined by the uint representation of its address |
ImplicitVariableBalanceToken |
uint base |
each account is allocated an implicit balance equal to the value of base at the time of account activation; base may be updated |
Install dependencies via Yarn:
yarn install
Compile contracts via Buidler:
yarn run buidler compile
By default, Buidler uses the BuidlerEVM.
To use Ganache, append commands with --network localhost
, after having started ganache-cli
in a separate process:
yarn run 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]" yarn run buidler test --network generic
Test contracts via Buidler:
yarn run 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 yarn run buidler test --network localhost
Generate a code coverage report for Solidity contracts:
yarn run buidler coverage