The initialLiquidity value is set when the first swap occurs (re-read from pool if it was 0 at initialization):
This can be permanently manipulated via sandwich attack on the first swap:
LP adds 1,000,000 tokens of liquidity
Attacker front-runs first swap, removes 99.99% of liquidity
First swap triggers initialLiquidity = getLiquidity() = only 1,000 tokens
Attacker back-runs, re-adds their liquidity
initialLiquidity is now permanently griefed to 0.1% of actual
Impact: HIGH - maxSwapAmount = (initialLiquidity * limitBps) / 10000. With griefed initialLiquidity:
If limitBps = 100 (1%), maxSwap = 10 tokens instead of 10,000
ALL users are permanently limited to tiny swaps
Token launch is completely griefed
Likelihood: HIGH - Sandwich attacks are trivial for MEV bots. Cost is only gas.
Use maximum observed liquidity (can only increase):
Describe the normal behavior in one or more sentences
Explain the specific issue or problem in one or more sentences
Likelihood:
Reason 1 // Describe WHEN this will occur (avoid using "if" statements)
Reason 2
Impact:
Impact 1
Impact 2
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.