Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: medium
Invalid

Wrong ERC20 Interface implementation

Summary

  • The ERC20 approve, transfer, and transferFrom functions return bool but in src/ICredToken.sol contract approve, transfer, and transferFrom functions do not return any bool that's why interface implementation is Wrong.

Vulnerability Details

interface ICredToken {
.
.
function approve(address to, uint256 amount) external;
function transfer(address to, uint256 amount) external;
function transferFrom(address from, address to, uint256 amount) external;
.
.
}

Impact

Implementing the ERC-20 interface incorrectly can lead to a loss of interoperability, funds, and security vulnerabilities, resulting in inconsistent behavior and potential regulatory compliance issues.

Tools Used

manually

Recommendations

interface ICredToken {
function decimals() external returns (uint8);
+ function transfer(address _to, uint256 _value) public returns (bool success)
+ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
+ function approve(address _spender, uint256 _value) public returns (bool success)
- function approve(address to, uint256 amount) external;
- function transfer(address to, uint256 amount) external;
- function transferFrom(address from, address to, uint256 amount) external;
function balanceOf(address user) external returns (uint256 balance);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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