code-423n4 / 2023-03-polynomial-findings

2 stars 1 forks source link

Upgraded Q -> 2 from #211 [1679800480796] #241

Closed c4-judge closed 1 year ago

c4-judge commented 1 year ago

Judge has assessed an item in Issue #211 as 2 risk. The relevant finding follows:

[L-4] LiquidityPool processWithdraws overwrites returnedAmount for withdrawals processed in multiple steps https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L306

https://github.com/code-423n4/2023-03-polynomial/blob/main/src/LiquidityPool.sol#L320

The returnedAmount field in the QueuedWithdraw struct is incorrectly overwritten when the withdraw is processed and available funds aren't enough to cover the withdrawal. As these cases are processed in multiple steps, the implementation should add the amounts instead of overwriting the value for returnedAmount.

if (susdToReturn > availableFunds) {

c4-judge commented 1 year ago

JustDravee marked the issue as nullified