Closed code423n4 closed 2 years ago
Dravee
Waste of gas
There's a redondant check on ThreePieceWiseLinearPriceCurve.sol: percentBacked >= 0, but percentBacked is of type uint, therefore it's always true.
percentBacked >= 0
percentBacked
uint
https://github.com/code-423n4/2021-12-yetifinance/blob/1da782328ce4067f9654c3594a34014b0329130a/packages/contracts/contracts/PriceCurves/ThreePieceWiseLinearPriceCurve.sol#L131
VS Code
Delete the >= 0 check
>= 0
@LilYeti: Duplicate #102
Handle
Dravee
Vulnerability details
Impact
Waste of gas
Proof of Concept
There's a redondant check on ThreePieceWiseLinearPriceCurve.sol:
percentBacked >= 0
, butpercentBacked
is of typeuint
, 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