Polygon's Native stablecoin
An upgradable
, ownable
, pausable
polygon stablecoin/borrowing smart contract which can be used as a protocol layer.
- It's a Polygon's native stablecoin protocol smart contract.
- For more, refer Wiki.
- To launch the protocol, follow Getting Started manual.
Install node packages
$ yarn install
Build the smart contracts
$ yarn compile
yarn contract-size
Run unit tests
$ yarn test
Compile the smart contracts and generate TypeChain artifacts:
$ yarn typechain
Lint the Solidity code:
$ yarn lint:sol
Lint the TypeScript code:
$ yarn lint:ts
Generate the code coverage report:
$ yarn coverage
See the gas usage per unit test and average gas per method call:
$ REPORT_GAS=true yarn test
Delete the smart contract artifacts, the coverage reports and the Hardhat cache:
$ yarn clean
Environment variables: Create a .env
file with its values in .env.example
Sequence:
- Deploy the
MojoCustomBase
contract. - Deploy the "MojoDiamond.sol" contract with facets & libraries & address of
MojoCustomBase
contract.- "DefaultPool.sol"
- "ActivePool.sol"
- "Whitelist.sol"
- "BorrowerOperations.sol"
- Set addresses using
setAddresses()
function (inside Diamond Proxy SC)- only Owner
- Add assets as whitelisted for respective pools (active, default, collSurplus) from
Whitelist::addCollateral
function. Whenever an asset is added, the asset is updated in the pools as well.
// on terminal-1
$ npx hardhat node
// on terminal-2
$ yarn hardhat run deployment/deploy.main.ts --network rinkeby
- Deploy the contracts
$ yarn hardhat run deployment/deploy.main.ts --network rinkeby
- Deploy the contracts
$ yarn hardhat run deployment/deploy.main.ts --network ethmainnet