DittoETH

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

Unchecked Return Values and Potential Re-entrancy in ERC20 Token Interactions

Summary

Vulnerability Details

The unchecked return values from burnFrom and mint functions of the IERC20 contracts could lead to an inconsistent state within the contract.If these functions fail for any reason, the contract's state could become inconsistent, which could lead to incorrect accounting of user balances or even loss of funds

Impact

This could result in incorrect accounting of user balances or even loss of funds.

Tools Used

Manual Review

Recommendations

To address the identified issue, it is recommended to validate the return values of burnFrom and mint functions, ensuring their successful execution. In the event of failure, these functions will return false, necessitating appropriate handling within your contract to avoid state inconsistency.

Furthermore, it is advisable to utilize OpenZeppelin's SafeERC20 library. This library offers secure versions of ERC20 operations, which throw an exception in case of an error. The functions would be referred to as safeBurnFrom and safeMint, replacing burnFrom and mint.

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.