https://docs.lemma.finance/concepts-overview/usdl
- Install forge dependency
forge install
- Compile contract code
forge build
- Run testcases
forge test --fork-url https://opt-mainnet.g.alchemy.com/v2/API_KEY --ffi
- Run deployment scripts (not used)
source .env
forge script script/LemmaTestnetScripts.sol:LemmaTestnetScripts --rpc-url $OPTIMISM_KOVAN_RPC_URL --private-key $PRIVATE_KEY --broadcast --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv
- NOTE: In theory everything should be already set properly for the above to run but in case there are issues try to initialize the repo as Foundry Repo
forge init --force --no-commit
- It should add all the necessary files like the
foundry.toml
,installinglib
theforge-std
Standard Library that is required for tests - It could also be possible the
lib
dir is not added in thefoundry.toml
to thelibs
array that is used for the import lookups, as when Foundry detects Hardhat it could just add thenode_modules
dir so in that case remember to add it so thatlibs = ['lib', 'node_modules']
- Deploy command
- Optimism:
npx hardhat run scripts/perpetual/deploy.ts --network optimism
- Optimism-Kovan:
npx hardhat run scripts/perpetual/deploy.ts --network optimismKovan
- Optimism:
- Verify contract command
npx hardhat verify --network optimismKovan <Deployment Address>
https://immunefi.com/bounty/lemmafinance/
- Go to root repo\
- cd basis-trading-stablecoin\
- open terminal-1 and run,
- npx hardhat node
- open terminal-2 and run
- npx hardhat test --network local
- test coverage (no need to start
npx hardhat node
)\- npx hardhat coverage --network local\
- npx hardhat coverage --testfiles "test/perpetual/perpLemma.multiCollateral.ts" --network local
- ethlint check
- solium -d contracts/
- slither check
- slither .
- git submodule update --init
- git submodule update
- npm install
- cd mai-protocol-v3/
- npm install
- cd ..
- npm run compile
- npx hardhat node
- npx hardhat test --network local