Token-0x

First Flight #54
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: high
Likelihood: high

# Missing IERC20 Interface in `ERC20.sol` contract

Author Revealed upon completion

Missing IERC20 Interface in ERC20.sol contract

Description

The contract does not import nor implement the standard IERC20 interface. It manually defines the ERC20 functions but does NOT declare:

contract ERC20 is IERC20
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {ERC20Internals} from "./helpers/ERC20Internals.sol";
import {IERC20Errors} from "./helpers/IERC20Errors.sol";
@> No import here for "IERC20.sol"
@> contract ERC20 is IERC20Errors, ERC20Internals {

Risk

Likelihood:

  • Tools cannot detect that the contract is ERC20-compliant

  • Other contracts expecting a standard interface may fail

  • ABI-level compatibility issues may occur

Impact:

  • Not formally compliant with ERC20 despite exposing the functions. Integrations may break because systems expect an explicit IERC20 inheritance.

Recommended Mitigation

Add to ensure system works correctly.

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {ERC20Internals} from "./helpers/ERC20Internals.sol";
import {IERC20Errors} from "./helpers/IERC20Errors.sol";
+ import {IERC20} from "./IERC20.sol";
- contract ERC20 is IERC20Errors, ERC20Internals {}
+ contract ERC20 is IERC20, IERC20Errors, ERC20Internals {}

Support

FAQs

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

Give us feedback!