Token-0x

First Flight #54
Beginner FriendlyDeFi
100 EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

ERC20 Does Not Inherit IERC20

ERC20 Does Not Inherit IERC20 + Medium

Description

  • Normal behavior: Standard ERC-20 contracts implement the IERC20 interface to guarantee all standard functions and events are present.

Issue: Current ERC20 contract implements the functions totalSupply, balanceOf, transfer, approve, transferFrom, and allowance, but does not inherit from IERC20.

  • Problem: This means the contract will not be recognized as a formal ERC-20 by Solidity’s type system, tools, or other contracts expecting an IERC20 interface.

contract ERC20 is IERC20Errors, ERC20Internals { // LOC 9
...
}

Risk

Likelihood: Medium

  • The issue occurs whenever this token is integrated with contracts or tools that check interface compliance (DEXs, wallets, aggregators).

Impact: Medium

  • Could prevent the token from being used seamlessly in existing ERC-20 compliant systems.

  • Tools or contracts may reject it or fail to interact with it.

Proof of Concept

ERC20 contract should inherit IERC20 interface. Because of that we can make sure this contract followed the standard ERC20 interface.

ERC20 token = new ERC20("MyToken", "MTK");
IERC20(token); // ❌ This cast will potentially fail because ERC20 does not inherit IERC20

Recommended Mitigation

By inheriting IERC20, the contract guarantees interface compliance.

Existing functions (totalSupply, balanceOf, etc.) already match the interface, so no additional changes are required.

- contract ERC20 is IERC20Errors, ERC20Internals {
+ contract ERC20 is IERC20, IERC20Errors, ERC20Internals {
Updates

Lead Judging Commences

gaurangbrdv Lead Judge 19 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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

Give us feedback!