re-al-Foundation / rwa-contracts

0 stars 0 forks source link

[VER-01C] Ineffectual Usage of Safe Arithmetics #101

Closed chasebrownn closed 5 months ago

chasebrownn commented 5 months ago

VER-01C: Ineffectual Usage of Safe Arithmetics

Type Severity Location
Language Specific VotingEscrowRWAAPI.sol:L137

Description:

The linked mathematical operation is guaranteed to be performed safely by surrounding conditionals evaluated in either require checks or if-else constructs.

Example:

tokenData[i].votingPower = veRWA.getPastVotingPower(tokenData[i].tokenId, block.timestamp-1);

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