Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OZ] L-01 #115

Merged
merged 1 commit into from
Jul 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions src/vault/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
Loading