code-423n4 / 2021-09-sushitrident-2-findings

0 stars 0 forks source link

Wrong reserve decrease in `burn` #81

Closed code423n4 closed 3 years ago

code423n4 commented 3 years ago

Handle

0xsanson

Vulnerability details

Impact

When burning a liquidity position the reserves should be decreased by the tokens' amount that leaves the contract. However in ConcentratedLiquidityPool's burn they are decreased only by the fees.

Proof of Concept

https://github.com/sushiswap/trident/blob/c405f3402a1ed336244053f8186742d2da5975e9/contracts/pool/concentrated/ConcentratedLiquidityPool.sol#L263-L266

Tools Used

editor

Recommended Mitigation Steps

Consider subtracting amount0 and amount1 to the reserves, instead of amount0fees and amount1fees.

sarangparikh22 commented 3 years ago

Duplicate of #51