Skip to content

Commit

Permalink
chore: redeemCream fixed rate elastic increase
Browse files Browse the repository at this point in the history
  • Loading branch information
sandybradley committed Oct 4, 2023
1 parent f63b3d3 commit d10b9e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/MevEth.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d10b9e5

Please sign in to comment.