The depletionTimeOf
function in the SablierFlow
contract adds the snapshotTime
(a uint40
) to solvencyPeriod
(a uint256
) without explicit casting of snapshotTime
to uint256
. This approach is safe and does not introduce overflow or data loss, as Solidity will automatically promote uint40
to uint256
during arithmetic operations. Additionally, the function's return value will not be affected by whether explicit casting is used. However, implicit casting may obscure the code’s intent, particularly in sensitive calculations.
Lack of complete code clarity.
None - Informational
Manual review
Explicit Type Casting for Readability:
Recommendation: Although not required for safety, consider explicitly casting snapshotTime
to uint256
in the depletionTimeOf
function to improve code readability and signal awareness of type differences
Suggested Code Change:
Rationale: This will make it clear to future auditors and developers that the type promotion is intentional, increasing confidence in arithmetic involving type differences.
Code Clarity Documentation:
Recommendation: Add comments explaining the safe promotion from uint40
to uint256
to ensure transparency and maintainability in type-sensitive calculations.
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.