Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 719d735

Browse files
committed
fixing the tests
1 parent 1067898 commit 719d735

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

contracts/compound/CTokenFirstExtension.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ contract CTokenFirstExtension is
346346
function borrowRatePerBlockAfterBorrow(uint256 borrowAmount) public view returns (uint256) {
347347
uint256 cash = asCToken().getCash();
348348
require(cash >= borrowAmount, "market cash not enough");
349-
//if (cash < borrowAmount) revert ;
350349

351350
return
352351
interestRateModel.getBorrowRate(

contracts/test/PoolLensTest.t.sol

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,53 @@ import "./config/BaseTest.t.sol";
55

66
import { PoolLens } from "../PoolLens.sol";
77
import "../compound/ComptrollerInterface.sol";
8+
import { JumpRateModel } from "../compound/JumpRateModel.sol";
89

910
contract PoolLensTest is BaseTest {
1011
function testPolygonFPL() public debuggingOnly fork(POLYGON_MAINNET) {
1112
PoolLens fpl = PoolLens(0xD7225110D8F419b0E8Ad0A536977965E62fB5769);
1213
fpl.getPoolAssetsWithData(IonicComptroller(0xB08A309eFBFFa41f36A06b2D0C9a4629749b17a2));
1314
}
1415

16+
function testModeFPL() public debuggingOnly fork(MODE_MAINNET) {
17+
IonicComptroller pool = IonicComptroller(0xFB3323E24743Caf4ADD0fDCCFB268565c0685556);
18+
// PoolLens fpl = PoolLens(0x611a68618412c2e15A36e3e59C0b979746d87AB8);
19+
// PoolLens.PoolAsset[] memory datas = fpl.getPoolAssetsWithData(pool);
20+
//
21+
// emit log_named_uint("ionicFee", datas[0].ionicFee);
22+
// emit log_named_uint("adminFee", datas[0].adminFee);
23+
24+
ICErc20[] memory markets = pool.getAllMarkets();
25+
26+
for (uint256 i = 0; i < markets.length; i++) {
27+
uint256 totalUnderlyingSupplied = markets[i].getTotalUnderlyingSupplied();
28+
uint256 totalBorrows = markets[i].totalBorrows();
29+
uint256 totalReserves = markets[i].totalReserves();
30+
uint256 cash = markets[i].getCash();
31+
32+
emit log("");
33+
emit log(markets[i].symbol());
34+
emit log_named_uint("totalUnderlyingSupplied", totalUnderlyingSupplied);
35+
emit log_named_uint("totalBorrows", totalBorrows);
36+
emit log_named_uint("totalReserves", totalReserves);
37+
emit log_named_uint("cash", cash);
38+
emit log_named_uint("reserves + fees", cash + totalBorrows - totalUnderlyingSupplied);
39+
40+
JumpRateModel irm = JumpRateModel(markets[i].interestRateModel());
41+
42+
emit log_named_uint("blocksPerYear", irm.blocksPerYear());
43+
44+
emit log_named_uint(
45+
"borrow rate per year",
46+
irm.blocksPerYear() * irm.getBorrowRate(cash, totalBorrows, totalReserves)
47+
);
48+
emit log_named_uint(
49+
"supply rate per year",
50+
irm.blocksPerYear() * irm.getSupplyRate(cash, totalBorrows, totalReserves, 0.1e18)
51+
);
52+
}
53+
}
54+
1555
function testWhitelistsFPL() public debuggingOnly fork(BSC_CHAPEL) {
1656
PoolLens fpl = PoolLens(0x604805B587C939042120D2e22398f299547A130c);
1757
fpl.getSupplyCapsDataForPool(IonicComptroller(0x307BEc9d1368A459E9168fa6296C1e69025ab30f));

contracts/test/liquidators/UniswapV3LiquidatorTest.t.sol

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ contract UniswapV3LiquidatorTest is IonicLiquidatorTest {
8282
IRedemptionStrategy strategy = KimUniV2Liquidator(0x6aC17D406a820fa464fFdc0940FCa7E60b3b36B7);
8383
liquidatorsRegistry._setRedemptionStrategy(strategy, weth, usdc);
8484
vm.stopPrank();
85+
liquidator._whitelistRedemptionStrategy(strategy, true);
8586
}
8687
}
8788

0 commit comments

Comments
 (0)