From 924149ec19b0e95f17636af2bb96ca5b26f5513e Mon Sep 17 00:00:00 2001 From: ckoopmann Date: Wed, 26 Jun 2024 10:27:09 +0800 Subject: [PATCH] Adjust tests to new composition including morpho --- contracts/exchangeIssuance/FlashMintHyETHV2.sol | 4 ++-- test/integration/ethereum/addresses.ts | 1 + test/integration/ethereum/flashMintHyETHV2.spec.ts | 11 ++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/contracts/exchangeIssuance/FlashMintHyETHV2.sol b/contracts/exchangeIssuance/FlashMintHyETHV2.sol index 16afa95e..a7e4ad47 100644 --- a/contracts/exchangeIssuance/FlashMintHyETHV2.sol +++ b/contracts/exchangeIssuance/FlashMintHyETHV2.sol @@ -37,7 +37,7 @@ import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { DEXAdapterV2 } from "./DEXAdapterV2.sol"; /** - * @title FlashMintHyETH + * @title FlashMintHyETHV2 */ contract FlashMintHyETHV2 is Ownable, ReentrancyGuard { using DEXAdapterV2 for DEXAdapterV2.Addresses; @@ -504,7 +504,7 @@ contract FlashMintHyETHV2 is Ownable, ReentrancyGuard { if (erc4626Components[_component]) { address asset = IERC4626(_component).asset(); uint256 assetAmount = IERC4626(_component).redeem(_amount, address(this), address(this)); - _swapExactTokenForEth(IERC20(_component), assetAmount, swapData[asset][DEXAdapterV2.ETH_ADDRESS]); + _swapExactTokenForEth(IERC20(asset), assetAmount, swapData[asset][DEXAdapterV2.ETH_ADDRESS]); return; } revert("Missing Swapdata for non-standard component"); diff --git a/test/integration/ethereum/addresses.ts b/test/integration/ethereum/addresses.ts index 34dc4870..42782117 100644 --- a/test/integration/ethereum/addresses.ts +++ b/test/integration/ethereum/addresses.ts @@ -37,6 +37,7 @@ export const PRODUCTION_ADDRESSES = { rsEth: "0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7", rswEth: "0xFAe103DC9cf190eD75350761e95403b7b8aFa6c0", acrossWethLP: "0x28F77208728B0A45cAb24c4868334581Fe86F95B", + morphoRe7WETH: "0x78Fc2c2eD1A4cDb5402365934aE5648aDAd094d0", }, whales: { stEth: "0xdc24316b9ae028f1497c275eb9192a3ea0f67022", diff --git a/test/integration/ethereum/flashMintHyETHV2.spec.ts b/test/integration/ethereum/flashMintHyETHV2.spec.ts index 415a065f..27ab7d5d 100644 --- a/test/integration/ethereum/flashMintHyETHV2.spec.ts +++ b/test/integration/ethereum/flashMintHyETHV2.spec.ts @@ -133,7 +133,7 @@ if (process.env.INTEGRATIONTEST) { addresses.tokens.pendleEzEth1226, addresses.tokens.pendleEEth0926, addresses.tokens.pendleEEth1226, - addresses.tokens.acrossWethLP, + addresses.tokens.morphoRe7WETH, addresses.tokens.USDC, ]; const positions = [ @@ -212,6 +212,15 @@ if (process.env.INTEGRATIONTEST) { exchange: 4, }); + await flashMintHyETH.setERC4626Component( + addresses.tokens.morphoRe7WETH, + true + ); + await flashMintHyETH.approveToken( + addresses.tokens.weth, + addresses.tokens.morphoRe7WETH, + MAX_UINT_256 + ); const ezEth1226PendleToken = IPendlePrincipalToken__factory.connect( addresses.tokens.pendleEzEth1226, owner.wallet,