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.
This PR tweaks the
minBinShareForDonate
from1e18
to1e3
Context:
1e18
was a magic number we derived as for most cases, most pool will have at least that amount of liquidity easilyWhy we change:
potentially there might be other scenario that we've missed where pool might have lesser than 1e18 liqudity (eg. pool where token0 and token1 price differences are very big and very little token in pool)
1e3
would probably be a good min level (similar to pcs v2 of burning10e3
lp), as attacker need at least 3x fund of victim to perform share inflation. eg. if they mint with 1000 token, attacker need 1000 * 1e3 tokens.However we are keeping the initial
2 ** 128
for now until we see such cases where we need to adjustsetMinBinSharesForDonate