re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[RSE-01C] Ineffectual Usage of Safe Arithmetics #95

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

RSE-01C: Ineffectual Usage of Safe Arithmetics

Type Severity Location
Language Specific RevenueStreamETH.sol:L320

Description:

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.

chasebrownn commented 5 months ago

Acknowledged