-
Notifications
You must be signed in to change notification settings - Fork 586
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
Fixes #730. accruedToTreasury not being properly considered together with aToken supply #733
Fixes #730. accruedToTreasury not being properly considered together with aToken supply #733
Conversation
…e flash loan fee (same as bridging) imprecision
@@ -72,7 +73,9 @@ library ValidationLogic { | |||
supplyCap == 0 || | |||
(IAToken(reserveCache.aTokenAddress).scaledTotalSupply().rayMul( | |||
reserveCache.nextLiquidityIndex | |||
) + amount) <= | |||
) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess adding up the scaled amounts and multiplying will be the same and save 1 operation. Is there a reason you didn't do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right, makes more sense. Will change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Looking forward to the validation tests
I'm in doubt about if the aToken should also reflects this in its Three issues:
|
|
Fair enough. Although debatable, this is probably the approach that makes most sense. Thanks |
Co-authored-by: miguelmtz <[email protected]>
…bs/aave-v3-core into fix/730-precision-liquidity-index
…on-liquidity-index
#730
The changes included in this PR are the following:
FlashLoan
andBridgeLogic
the accumulation to the liquidity index now includes both aToken supply and scaled-up accruedToTreasury.ValidationLogic
, nowvalidateSupply()
takes into account accruedToTreasury, to not allow deposits when (aToken supply + scaled-up accruedToTreasury) is bigger than the supply cap.ValidationLogic
,validateDropReserve
now checks that both aToken supply and accruedToTreasury are 0.PoolConfigurator
,_checkNoSuppliers()
checks that accruedToTreasury is 0, as factually the Collector is a depositor in that case, even if not holding aToken.