From 5295d1c34dd86f7466c9e181a9a485449fb47c6a Mon Sep 17 00:00:00 2001 From: Jun Kim <64379343+junkim012@users.noreply.github.com> Date: Sat, 6 Jul 2024 00:28:16 -0400 Subject: [PATCH] chore: remove redundant last total assets update and use _updateLastTotalAssets() helperfunction instead of direct update --- src/vault/Vault.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/vault/Vault.sol b/src/vault/Vault.sol index 4b82c1c0..fd15154f 100644 --- a/src/vault/Vault.sol +++ b/src/vault/Vault.sol @@ -577,9 +577,6 @@ contract Vault is ERC4626, Multicall, AccessControlDefaultAdminRules, Reentrancy function mint(uint256 shares, address receiver) public override nonReentrant returns (uint256 assets) { uint256 newTotalAssets = _accrueFee(); - // This is updated again with the deposited assets amount in `_deposit`. - lastTotalAssets = newTotalAssets; - assets = _convertToAssetsWithTotals(shares, totalSupply(), newTotalAssets, Math.Rounding.Ceil); _deposit(_msgSender(), receiver, assets, shares); @@ -837,7 +834,7 @@ contract Vault is ERC4626, Multicall, AccessControlDefaultAdminRules, Reentrancy (feeShares, newTotalAssets) = _accruedFeeShares(); if (feeShares != 0) _mint(feeRecipient, feeShares); - lastTotalAssets = newTotalAssets; + _updateLastTotalAssets(newTotalAssets); emit FeeAccrued(feeShares, newTotalAssets); }