Skip to content

Commit

Permalink
style: rename internal function
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisGD committed Aug 13, 2024
1 parent 493273e commit 2a1b3a1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/MetaMorpho.sol
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph

/// @inheritdoc IERC4626
function totalAssets() public view override returns (uint256) {
(, uint256 newTotalAssets,) = _accruedSupplyAndAssets();
(, uint256 newTotalAssets,) = _accruedFeeAndAssets();

return newTotalAssets;
}
Expand All @@ -592,7 +592,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
returns (uint256 assets, uint256 newTotalSupply, uint256 newTotalAssets)
{
uint256 feeShares;
(feeShares, newTotalAssets,) = _accruedSupplyAndAssets();
(feeShares, newTotalAssets,) = _accruedFeeAndAssets();
newTotalSupply = totalSupply() + feeShares;

assets = _convertToAssetsWithTotals(balanceOf(owner), newTotalSupply, newTotalAssets, Math.Rounding.Floor);
Expand All @@ -619,15 +619,15 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
/// @inheritdoc ERC4626
/// @dev The accrual of performance fees is taken into account in the conversion.
function _convertToShares(uint256 assets, Math.Rounding rounding) internal view override returns (uint256) {
(uint256 feeShares, uint256 newTotalAssets,) = _accruedSupplyAndAssets();
(uint256 feeShares, uint256 newTotalAssets,) = _accruedFeeAndAssets();

return _convertToSharesWithTotals(assets, totalSupply() + feeShares, newTotalAssets, rounding);
}

/// @inheritdoc ERC4626
/// @dev The accrual of performance fees is taken into account in the conversion.
function _convertToAssets(uint256 shares, Math.Rounding rounding) internal view override returns (uint256) {
(uint256 feeShares, uint256 newTotalAssets,) = _accruedSupplyAndAssets();
(uint256 feeShares, uint256 newTotalAssets,) = _accruedFeeAndAssets();

return _convertToAssetsWithTotals(shares, totalSupply() + feeShares, newTotalAssets, rounding);
}
Expand Down Expand Up @@ -872,7 +872,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph

/// @dev Accrues `lastTotalAssets`, `lostAssets` and mints the fee shares to the fee recipient.
function _accrueInterest() internal {
(uint256 feeShares, uint256 newTotalAssets, uint256 newLostAssets) = _accruedSupplyAndAssets();
(uint256 feeShares, uint256 newTotalAssets, uint256 newLostAssets) = _accruedFeeAndAssets();

_updateLastTotalAssets(newTotalAssets);
lostAssets = newLostAssets;
Expand All @@ -887,7 +887,7 @@ contract MetaMorpho is ERC4626, ERC20Permit, Ownable2Step, Multicall, IMetaMorph
/// @return feeShares the shares to mint to `feeRecipient`.
/// @return newTotalAssets the new `totalAssets`.
/// @return newLostAssets the new lostAssets.
function _accruedSupplyAndAssets() internal view returns (uint256, uint256, uint256) {
function _accruedFeeAndAssets() internal view returns (uint256, uint256, uint256) {
// The assets that the vault has on Morpho.
uint256 realTotalAssets;
for (uint256 i; i < withdrawQueue.length; ++i) {
Expand Down

0 comments on commit 2a1b3a1

Please sign in to comment.