From c05acd4c2d23dda4d4b58a996f644ca12d86fc44 Mon Sep 17 00:00:00 2001 From: Rahul Sethuram Date: Fri, 8 Mar 2024 17:47:02 +0400 Subject: [PATCH 1/2] test: new market --- contracts/test/Mode.t.sol | 53 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 contracts/test/Mode.t.sol diff --git a/contracts/test/Mode.t.sol b/contracts/test/Mode.t.sol new file mode 100644 index 00000000..1ecb55a8 --- /dev/null +++ b/contracts/test/Mode.t.sol @@ -0,0 +1,53 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.0; + +import {WithPool} from "./helpers/WithPool.sol"; +import {BaseTest} from "./config/BaseTest.t.sol"; + +import {ERC20} from "solmate/tokens/ERC20.sol"; +import {FuseFlywheelDynamicRewards} from "fuse-flywheel/rewards/FuseFlywheelDynamicRewards.sol"; +import {MockERC20} from "solmate/test/utils/mocks/MockERC20.sol"; +import {MasterPriceOracle} from "../oracles/MasterPriceOracle.sol"; +import {IRedemptionStrategy} from "../liquidators/IRedemptionStrategy.sol"; +import {IFundsConversionStrategy} from "../liquidators/IFundsConversionStrategy.sol"; +import {IUniswapV2Router02} from "../external/uniswap/IUniswapV2Router02.sol"; +import {IonicComptroller} from "../compound/ComptrollerInterface.sol"; +import {PoolLensSecondary} from "../PoolLensSecondary.sol"; +import {UniswapLpTokenLiquidator} from "../liquidators/UniswapLpTokenLiquidator.sol"; +import {IUniswapV2Pair} from "../external/uniswap/IUniswapV2Pair.sol"; +import {IUniswapV2Factory} from "../external/uniswap/IUniswapV2Factory.sol"; +import {PoolLens} from "../PoolLens.sol"; +import {IonicLiquidator, ILiquidator} from "../IonicLiquidator.sol"; +import {CErc20} from "../compound/CToken.sol"; +import {ERC20Upgradeable} from "openzeppelin-contracts-upgradeable/contracts/token/ERC20/ERC20Upgradeable.sol"; +import {ICErc20} from "../compound/CTokenInterfaces.sol"; +import {AuthoritiesRegistry} from "../ionic/AuthoritiesRegistry.sol"; +import {PoolRolesAuthority} from "../ionic/PoolRolesAuthority.sol"; + +contract MockWNeon is MockERC20 { + constructor() MockERC20("test", "test", 18) {} + + function deposit() external payable {} +} + +contract ModeE2ETest is BaseTest { + IonicComptroller comptroller = IonicComptroller(0xFB3323E24743Caf4ADD0fDCCFB268565c0685556); + address feeDistributor = 0x8ea3fc79D9E463464C5159578d38870b770f6E57; + address jumpRateModel = 0x21a455cEd9C79BC523D4E340c2B97521F4217817; + + function testModeDeployEzEth() public fork(MODE_MAINNET) { + address ezETH = 0x2416092f143378750bb29b79eD961ab195CcEea5; + bytes memory constructorData = abi.encode( + ezETH, + address(comptroller), + feeDistributor, + jumpRateModel, + "Ionic Renzo Staked Eth", + "ionezETH", + 0.1 ether, + 0.1 ether + ); + bytes memory becomeImplData = hex"00"; + comptroller._deployMarket(1, constructorData, becomeImplData, 0.7 ether); + } +} From 902502025d5905f020d087abdcaae5cdfca58c6c Mon Sep 17 00:00:00 2001 From: Rahul Sethuram Date: Fri, 8 Mar 2024 19:00:14 +0400 Subject: [PATCH 2/2] test --- contracts/test/Mode.t.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/test/Mode.t.sol b/contracts/test/Mode.t.sol index 1ecb55a8..b389d419 100644 --- a/contracts/test/Mode.t.sol +++ b/contracts/test/Mode.t.sol @@ -48,6 +48,7 @@ contract ModeE2ETest is BaseTest { 0.1 ether ); bytes memory becomeImplData = hex"00"; - comptroller._deployMarket(1, constructorData, becomeImplData, 0.7 ether); + uint256 err = comptroller._deployMarket(1, constructorData, becomeImplData, 0.7 ether); + emit log_named_uint("err", err); } }