-
Notifications
You must be signed in to change notification settings - Fork 968
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
[BUG]: investigate overflow safety of donate and feeGrowthGlobal #60
Comments
Okay i think this is possible in very extreme circumstances. I decided to start experimenting using the numbers on a super low liquidity v3 pool (because low liquidity => tiny denominator in the code). The one I played around with is JEJUDOGE ETH Assuming liquidity JEJUDOGE has the following:
Lets say instead of decimals 18 we have 24, which seems a reasonable number of decimals. With $1million, someone can:
Given that This is of course a slightly extreme circumstance (very cheap token/high decimals, and very low liquidity), but its definitely within the realms of possibility. |
fee growth global is meant to overflow, i.e. overflow of fee growth global is not itself broken in the example given, you're buying the issue is, given the total supply constraint of |
one more note: because another type of mitigation would be to only accept smaller uints in |
it seems like it's possible that donate could allow overflowing fees earned to
type(uint256).max
, but needs investigationThe text was updated successfully, but these errors were encountered: