Omniscia Mantissa Finance Audit
Vesting Code Style Findings
Vesting Code Style Findings
VGN-01C: Ineffectual Usage of Safe Arithmetics
Type | Severity | Location |
---|---|---|
Language Specific | Vesting.sol:L67, L78 |
Description:
The linked mathematical operations are guaranteed to be performed safely by surrounding conditionals evaluated in either require
checks or if-else
constructs.
Example:
contracts/Vesting.sol
66require(contractBalance > amountRemaining, "Nothing to withdraw");67uint256 safeAmount = contractBalance - amountRemaining;
Recommendation:
Given that safe arithmetics are toggled on by default in pragma
versions of 0.8.X
, we advise the linked statements to be wrapped in unchecked
code blocks thereby optimizing their execution cost.
Alleviation (418ee413ad8e26f7eea383764c19953ff31b2bf3):
The referenced arithmetic statement has been safely wrapped in an unchecked
code block, optimizing its execution cost.