Omniscia LimeChain Audit

WrappedToken Static Analysis Findings

WrappedToken Static Analysis Findings

WTN-01S: Tautology Evaluation

TypeSeverityLocation
Gas OptimizationInformationalWrappedToken.sol:L42-L45

Description:

The linked require check will always validate as the decreasedAllowance variable is of type uint256, otherwise known as an unsigned integer which can only hold values that are non-negative.

Example:

contracts/WrappedToken.sol
40uint256 decreasedAllowance = allowance(_account, _msgSender()) -
41 _amount;
42require(
43 decreasedAllowance >= 0,
44 "ERC20: burn amount exceeds allowance"
45);

Recommendation:

We advise the require check to be omitted given that an insufficient allowance will indirectly throw in the subtraction above the check due to Solidity's 0.8.0+ built-in safe arithmetics.

Alleviation:

The code was instead adjusted to perform a different require check that is valid and perform an unchecked mathematical subtraction as it would be guaranteed to succeed. As such, we consider this exhibit dealt with.