DRAFT Should be thoroughly audited before production use !
The Sprout token contract allows anyone to mint SPRT by depositing/staking ECO (for at least a minimum amount of time).
The generation reward is as follows:
- Flat 200% annual
- Linearly increasing annual generation bonus reaching 100% after 20 years
- Minimum 90 day lockup
- Note: lockup times (& bonuses) reset on any deposit (partial withdrawal is allowed without penalizing generation bonus of remaining amount)
- Sprout Generation distribution: 90% user, 5% EcoFi, 5% user reserve balance (user can get this once account is full withdrawn/unstaked; this is currently called reservePool but should probably be renamed)
yarn installyarn hardhat nodeThis node is hosted on the port 8545 with chain ID 1337.
The deploy script deploys the two contracts on the node, then saves the
ABI and contract address as JSON files to the frontend/contracts folder.
Call with:
yarn hardhat run deploy.js --network localhostThe frontend part was largely inspired by the hardhat-hackathon-boilerplate repository.
The frontend requires the artifacts and contract addresses JSON files to be generated first. This is done by the deploy script above.
To run a local server:
cd frontend
yarn install
yarn startNOTE: If using metamask for in browser testing, each time the hardhat node is started/reset you should reset the metamask account (to reset nonce etc) by going to the menu --> Settings --> Advanced --> Reset Account
The scripts in the tasks folder serve to manipulate the hardhat node,
for developement purposes.
This task increases the node time by 91 days, which is useful to manually
test the stakeWithdraw method of the sprout contract.
yarn hardhat --network localhost increase_timeThis task takes an address as parameter, this address will receive 1 ETH and 1,000 ECO tokens. Call with:
yarn hardhat --network localhost faucet <receiver>This also generates the typechain bindings and the documentation using
hardhat-typechain and
hardhat-docgen.
yarn hardhat compileyarn hardhat test