location : src/SablierFlow.sol
The contract performs arithmetic operations on balances and amounts without consistently checking for potential underflows or overflows, especially in cases where unchecked
blocks are used.
code:
While the comment notes that it's safe to use unchecked
, any errors in earlier logic or unforeseen circumstances could cause these operations to underflow, particularly if external calls manipulate state in unexpected ways.
If an underflow occurs, balances could wrap around to a very large number, potentially leading to incorrect balances and unauthorized withdrawals.
Avoid unchecked
Unless Necessary: Remove unchecked
blocks unless absolutely certain that underflows cannot occur.
Use SafeMath for Critical Arithmetic: Although Solidity 0.8+ has built-in overflow checks, explicitly ensuring safety in critical operations is prudent.
Replace the unchecked
block with normal arithmetic, which will revert on underflow.
Ensure that all arithmetic operations are safe and cannot underflow or overflow.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.