Detailed documentation can be found in IPOR Gitbook
- Install
node
andnpm
.
- Run
npm install
to install all dependencies. - Run
npm run compile
.
- Run
npm run test
.
You can use hardhat and modify the script in scripts/
to deploy the smart contracts to the mainnet or testnet.
- Deploy staked token contract
const StakedToken = await hre.ethers.getContractFactory("MockStakedToken"); stakedToken = (await StakedToken.deploy( "Staked Token", "stToken", await admin.getAddress() )) as MockStakedToken;
- Deploy
LpTokens
contractsconst LpTokenDai = await hre.ethers.getContractFactory("MockLpToken"); lpDai = (await LpToken.deploy( "Lp Dai", "lpDai", await admin.getAddress() )) as MockLpToken; const LpTokensUsdc = await hre.ethers.getContractFactory("MockLpTokens"); lpUsdc = (await LpTokensUsdc.deploy( "Lp Usdc", "lpUsdc", await admin.getAddress() )) as MockLpTokens;
- Deploy
PowerToken
contract as proxyconst PowerToken = await hre.ethers.getContractFactory("PowerToken"); powerToken = (await upgrades.deployProxy(PowerToken, [stakedToken.address], { initializer: "initialize", kind: "uups", })) as PowerToken;
- Deploy
LiquidityMining
contract as proxyconst LiquidityMiningFactory = await hre.ethers.getContractFactory("LiquidityMining"); const liquidityMiningProxy = (await upgrades.deployProxy(LiquidityMiningFactory, [[ lpUSDC, lpDAI], powerTokenProxy.address, STAKED_TOKEN], { initializer: "initialize", kind: "uups", } )) as LiquidityMining;
- Setup
LiquidityMining
address in power token contractawait powerToken.setLiquidityMiningAddress(liquidityMiningProxy.address);
contracts/
contains all the smart contracts.interfaces/
contains all the interfaces.libraries/
contains all the libraries.mocks/
contains all the mock contracts.mining/
contains all the contracts related to liquidity mining.security/
contains all the contracts related to security.tokens/
contains all the contracts related to power token.
scripts/
contains all the scripts to deploy smart contracts.test/
contains all the tests.
- run
brew install ekhtml
- run
brew install lcov
- run
mkdir coverage
- run
forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage