Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
haythemsellami committed Oct 21, 2024
1 parent 700cc28 commit 76d968b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/common/Shared.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract contract Shared is EVCUtil {
}

// socialize the loss
// this is safe substraction as `_lossAmount` is capped by sum of strategies `.allocated` amounts <= `totalAssetsDeposited`
// this does not underflow because initialLossAmount - totalNotDistributed <= totalAssetsDeposited by definition of totalNotDistributed and because initialLossAmount <= totalAllocated
$.totalAssetsDeposited = totalAssetsDepositedCache - _lossAmount;

emit Events.DeductLoss(_lossAmount);
Expand Down
8 changes: 4 additions & 4 deletions src/module/EulerEarnVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ abstract contract EulerEarnVaultModule is ERC4626Upgradeable, ERC20VotesUpgradea
/// @notice Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance.
/// @dev See {IERC4626-maxWithdraw}.
/// This function does not simulate the hook behavior called in the actual `withdraw()` function.
/// This function return an under-estimated amount when `_owner` is the current fee recipient address and performance fee > 0.
/// This function return an underestimated amount when `_owner` is the current fee recipient address and performance fee > 0.
/// @return Amount of asset to be withdrawn.
function maxWithdraw(address _owner) public view virtual override nonReentrantView returns (uint256) {
(,, uint256 maxAssets) = _maxWithdraw(_owner);
Expand All @@ -282,7 +282,7 @@ abstract contract EulerEarnVaultModule is ERC4626Upgradeable, ERC20VotesUpgradea
/// @notice Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault.
/// @dev See {IERC4626-maxRedeem}.
/// This function does not simulate the hook behavior called in the actual `redeem()` function.
/// This function return an under-estimated amount when `_owner` is the current fee recipient address and performance fee > 0.
/// This function return an underestimated amount when `_owner` is the current fee recipient address and performance fee > 0.
/// @return Amount of shares.
function maxRedeem(address _owner) public view virtual override nonReentrantView returns (uint256) {
(uint256 totalAssetsExpected, uint256 totalSupplyExpected, uint256 maxAssets) = _maxWithdraw(_owner);
Expand Down Expand Up @@ -845,7 +845,7 @@ abstract contract EulerEarnVaultModule is ERC4626Upgradeable, ERC20VotesUpgradea
if (lossAmount > totalNotDistributed) {
lossAmount -= totalNotDistributed;

// this is safe substraction as `_lossAmount` is capped by sum of strategies `.allocated` amounts <= `totalAssetsDeposited`
// this does not underflow because initialLossAmount - totalNotDistributed <= totalAssetsDeposited by definition of totalNotDistributed and because initialLossAmount <= totalAllocated
totalAssetsDepositedExpected -= lossAmount;
}
}
Expand All @@ -858,10 +858,10 @@ abstract contract EulerEarnVaultModule is ERC4626Upgradeable, ERC20VotesUpgradea
yield = totalPositiveYield - totalNegativeYield;
}

// `_totalAssets()` & `_totalSupply()` used for performance fee calc are equal to the cached-recomputed expected ones in the case of positive net yield.
(uint256 feeAssets, uint256 feeShares) = _applyPerformanceFee(yield, cachedPerformanceFee);

if (feeShares != 0) {
// cached `totalAssetsDeposited` & `totalSupply` are accurate in this case.
totalAssetsDepositedExpected += feeAssets;
totalSupplyExpected += feeShares;
}
Expand Down

0 comments on commit 76d968b

Please sign in to comment.