PoolTogether Yield Source that uses mStable to generate yield by depositing a mStable asset, eg mUSD, into a mStable interest-bearing savings contract, eg imUSD.
Install dependencies:
yarn
To compile the Solidity contracts and generate the contract types and factories:
yarn run compile
The contract ABIs are output to /abis.
The Hardhat build artifacts are output to /build
.
The contract types are output to /types/pooltogether.
Typescript outputs to /dist.
We use Hardhat, Ethers V5, Waffle and Chai matchers for testing.
To run unit tests:
yarn test
To run coverage:
yarn coverage
To run tests against local fork of mainnet
export NODE_URL=https://eth-mainnet.alchemyapi.io/v2/<your key>
yarn test:fork
The forks tests are in test-fork/poolTogether.spec.ts.
A Hardhat task is used for deployment to mainnet using Open Zeppelin's Defender Relay wallet. Create and API key for the Relay wallet; export the API key and secret as per the below; and then delete the API key so it can not be used again.
export DEFENDER_API_KEY=<Open Zeppelin Defender Relay API key>
export DEFENDER_API_SECRET=<Open Zeppelin Defender Relay API secret>
yarn deploy --masset mUSD
The deployment task can be found in tasks/poolTogether.ts.
Prettier is used to format TypeScript code. Use it by running:
yarn format
yarn run flatten
Output to the _flat
folder.