The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.
Example:
uint256 timePassed = block.timestamp - cycle; // seconds since cycle was created
Recommendation:
Given that safe arithmetics are toggled on by default in pragma versions of 0.8.X, we advise the linked statement to be wrapped in an unchecked code block thereby optimizing its execution cost.
RSE-01C: Ineffectual Usage of Safe Arithmetics
Description:
The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either
require
checks orif-else
constructs.Example:
Recommendation:
Given that safe arithmetics are toggled on by default in
pragma
versions of0.8.X
, we advise the linked statement to be wrapped in anunchecked
code block thereby optimizing its execution cost.