code-423n4 / 2021-12-yetifinance-findings

0 stars 0 forks source link

Tautology on "variable >= 0" which is always true as variable is uint #172

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

Dravee

Vulnerability details

Impact

Waste of gas

Proof of Concept

There's a redondant check on ThreePieceWiseLinearPriceCurve.sol: percentBacked >= 0, but percentBacked is of type uint, therefore it's always true.

https://github.com/code-423n4/2021-12-yetifinance/blob/1da782328ce4067f9654c3594a34014b0329130a/packages/contracts/contracts/PriceCurves/ThreePieceWiseLinearPriceCurve.sol#L131

Tools Used

VS Code

Recommended Mitigation Steps

Delete the >= 0 check

kingyetifinance commented 2 years ago

@LilYeti: Duplicate #102