- Clone the repo.
- Install foundry.
- IronBank.sol - The core implementation of IB v2.
- MarketConfigurator.sol - The admin contract that configures the support markets.
- CreditLimitManager.sol - The admin contract that controls the credit limit.
- IBToken.sol - The recipt contract that represents user supply.
- DebtToken.sol - The debt contract that represents user borrow.
- PToken.sol - The pToken contract that could only be used as collateral.
- TripleSlopeRateModel.sol - The interest rate model contract that calculates the supply and borrow rate.
- PriceOracle.sol - The price oracle contract that fetches the prices from ChainLink.
- IronBankLens.sol - The lens contract that provides some useful on-chain data of IB v2.
- TxBuilderExtension.sol - The extension contract that could help users perform multiple operations in a single transaction.
- UniswapExtension.sol - The extension contract that supports leverage, debt swap, and collateral swap.
- FlashLoan.sol - The flashLoan contract that complies ERC-3156.
$ forge build
Display contract size.
$ forge build --sizes
Extension tests are using mainnet forking. Need to export the alchemy key to environment first.
export ALCHEMY_KEY=xxxxxx
Run all the tests.
$ forge test -vvv
Run specific test.
$ forge test -vvv --match-path test/TestSupply.t.sol
Display test coverage.
$ forge coverage
Display test coverage in lcov.
$ forge coverage --report lcov
$ genhtml -o report --branch-coverage lcov.info