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.
Notable Changes
VaultFactory
msg.sender
protection andVaultBytecode
SeparationVaultBytecode
fromVaultFactory
due to codesize limit with the embedded Vault bytecode.Vault
_supplyToIonPool
Early Exit (See Issue Below)_supplyToIonPool
iteration, if thetoSupply
amount is small enoough to normalize to zero and thistoSupply
is the last remaining bit of the user's requested deposit amount, we skip the supply to avoid the revert. This has the effect of depositing to theIDLE
pool and not the IonPool specified in the loop.toSupply
can be to truncate to zero when normalized is determined by:maxBound = ceil(supplyFactor/ RAY) - 1
supplyFactor
is between1e27 + 1
and2e27 - 1
, thentoSupply
needs to be exactly1
. And in the next range2e27
to3e27 - 1
, thetoSupply
needs to be exactly2
.supplyFactor
will most likely never be above2e27
, the user will have to deposit an exact amount that ends up depositing exactly1
wei as its last supply into theIonPool
.feeRecipient
from being set to the zero address.Issue
_supplyToIonPool
iteration, if thetoSupply
amount is small enoough to normalize to zero, then it throws theIonPool.InvalidMintAmount
error.assets
are being supplied through the loop, and if the last remaining bit to supply led to theInvalidMintAmount
error, then the loop exited without being able to decrementassets
down to zero, which reverts the transaction.withdraw
because thetoWithdraw
will never be zero when callingIonPool.withdraw
which means theIonPool
will round up and not throwInvalidBurnAmount
.