DittoETH

Ditto
DeFiFoundryOracle
55,000 USDC
View results
Submission Details
Severity: medium
Invalid

Not handling approve return value in the construnctor

Summary

The return value of the approve() method in the constructor isn't handled.

Vulnerability Details

As defined in the ERC20 Specification (ref. https://eips.ethereum.org/EIPS/eip-20), the approve function returns a bool that signals the success of the call. However, in the constructor the value returned from calls to approve is ignored.

Line 26 -29

steth.approve(
address(unsteth),
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
);

Impact

The function signature has a boolean return value and it indicates the errors that way instead. By not checking the return value, operations that should have marked as failed, may potentially go through without actually approving anything.

Tools Used

Slither

Recommendations

Add return value check to avoid unexpected behaviour/crash of the contract. Return value check will help in handling the exceptions in better way.

Updates

Lead Judging Commences

0xnevi Lead Judge
over 1 year ago
0xnevi Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Other

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.