Remove obsolete ERC4626 mint
NatSpec
#4837
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removes NatSpec for ERC4626
mint
function, which says that minting is allowed when the price of a share is zero. With the introduction of virtual shares and assets mitigation mechanism for the inflation attack, this is no longer true, because a price of a share can no longer be zero.Zero price of a share in this context means that shares amount requested in
mint
would be converted to zero assets bypreviewMint
. It would only be possible iftotalSupply
was greater than zero, andtotalAssets
was zero in the previous version of the code (given thatpreviewMint
function rounds up):The new version of the function unconditionally adds 1 virtual asset to the numerator in the conversion, making 'zero price of a share' impossible, given upward rounding.
The original comment was introduced in: Improve some NatSpec and revert reasons #3809
It was made obsolete in ERC4626 inflation attack mitigation #3979
Where the test of the original behaviour was removed
PR Checklist
npx changeset add
)