We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC20Facet::decreaseApproval
pmerkleplant
The subtraction in ERC20Facet::decreaseApproval in line 128 could be unchecked, i.e. it's not necessary to use OZ's SafeMath::sub function here.
SafeMath::sub
An underflow is not possible, as the expression is only called if oldValue >= _amount.
oldValue >= _amount
Use solidity's builtin subtraction instead of OZ's SafeMath::sub to save gas on unnecessary checks.
The text was updated successfully, but these errors were encountered:
pmerkleplant issue #80
fe3dd29
No branches or pull requests
Handle
pmerkleplant
Vulnerability details
Impact
The subtraction in
ERC20Facet::decreaseApproval
in line 128 could be unchecked, i.e. it's not necessary to use OZ'sSafeMath::sub
function here.An underflow is not possible, as the expression is only called if
oldValue >= _amount
.Recommended Mitigation Steps
Use solidity's builtin subtraction instead of OZ's
SafeMath::sub
to save gason unnecessary checks.
The text was updated successfully, but these errors were encountered: