code-423n4 / 2021-08-floatcapital-findings

0 stars 0 forks source link

Comment-code mismatch for _balanceIncentiveCurve_exponent threshold #89

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

0xRajeev

Vulnerability details

Impact

The code comment says: “// The exponent has to be less than 5 in these versions of the contracts.” but the code immediately after the comment implements a check “< 6.” It is unclear if the comment is incorrect or the check is wrong. An incorrect check may have mathematical implications.

Proof of Concept

https://github.com/code-423n4/2021-08-floatcapital/blob/bd419abf68e775103df6e40d8f0e8d40156c2f81/contracts/contracts/Staker.sol#L276-L277

Tools Used

Manual Analysis

Recommended Mitigation Steps

Revisit comment and code to sync them by fixing the comment or the code whichever is incorrect.

JasoonS commented 3 years ago

Thanks - has been pointed out before. 0 non-critical

0xean commented 3 years ago

Per https://docs.code4rena.com/roles/wardens/judging-criteria#estimating-risk-tl-dr - comments are a 1 (Low Risk). Agreeing with the warden here.