From d10b9e5fe8720e852cff669912b0ba37e8e756e0 Mon Sep 17 00:00:00 2001 From: sandybradley Date: Wed, 4 Oct 2023 13:41:52 +0200 Subject: [PATCH] chore: redeemCream fixed rate elastic increase --- src/MevEth.sol | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/MevEth.sol b/src/MevEth.sol index 8cf21a7..1bb8734 100644 --- a/src/MevEth.sol +++ b/src/MevEth.sol @@ -750,11 +750,10 @@ contract MevEth is Auth, ERC20, IERC4626, ITinyMevEth { // Calculate the equivalent mevETH to be redeemed based on the ratio uint256 mevEthAmount = creamAmount * uint256(CREAM_TO_MEV_ETH_PERCENT) / 1000; - // Convert the shares to assets and update the fraction elastic and base - uint256 assets = convertToAssets(mevEthAmount); - if (assets < MIN_DEPOSIT) revert MevEthErrors.DepositTooSmall(); + // Update the fraction elastic and base + if (mevEthAmount < MIN_DEPOSIT) revert MevEthErrors.DepositTooSmall(); - fraction.elastic += uint128(assets); + fraction.elastic += uint128(mevEthAmount); fraction.base += uint128(mevEthAmount); // Burn CreamEth2 tokens