Vanguard

First Flight #56
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Phase 3 Returns Override Flag With Zero Fee - LPs Earn Nothing After Bot Protection

## Root + Impact


### Description

In Phase 3 (post-bot-protection), the `_beforeSwap` function returns `LPFeeLibrary.OVERRIDE_FEE_FLAG` without any fee value, causing **all swaps to have 0% LP fees permanently**. Liquidity providers earn nothing once the bot protection phases end.


```solidity

// @> Phase 3 returns only the override flag with NO fee value

if (currentPhase == 3) {

return (BaseHook.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, LPFeeLibrary.OVERRIDE_FEE_FLAG);

}

```


## Risk


### Likelihood

- This ALWAYS occurs once Phase 3 begins

- Every token launch using this hook experiences this issue


### Impact

- LPs earn 0% fees on ALL swaps after Phase 2 ends, permanently

- Pool becomes unusable due to lack of liquidity


## Proof of Concept


```solidity

uint24 returnValue = LPFeeLibrary.OVERRIDE_FEE_FLAG; // = 0x800000

// Fee value = returnValue & 0x7FFFFF = 0

```


## Recommended Mitigation


```diff

if (currentPhase == 3) {

- return (BaseHook.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, LPFeeLibrary.OVERRIDE_FEE_FLAG);

+ return (BaseHook.beforeSwap.selector, BeforeSwapDeltaLibrary.ZERO_DELTA, 0);

}

```

- remove this code
+ add this code
Updates

Lead Judging Commences

chaossr Lead Judge
18 days ago

Appeal created

chaossr Lead Judge 17 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!