Return values of approve()
not checked
#565
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-a
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2024-04-panoptic/blob/833312ebd600665b577fbd9c03ffa0daf250ed24/contracts/libraries/InteractionHelper.sol#L32-L37
Vulnerability details
Impact
By not checking the return value, operations that should have marked as failed, may potentially go through without actually approving anything.
Proof of Concept
Not all
IERC20
implementationsrevert()
when there's a failure inapprove()
. The function signature has aboolean
return value and they indicate errors that way instead.There are 4 instance of this issue:
32, 33, 36, 37.
Tools Used
Bot
Recommended Mitigation Steps
Make sure the return value is
true
.Assessed type
ERC20
The text was updated successfully, but these errors were encountered: