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

ILoveToken does not follow ERC-20 Specification, leading to failure of operation when interacting with the protocol

Summary

While LoveToken adheres to the ERC-20 token standard, its interface, ILoveToken, is inconsistent with the ERC-20 token interface. This discrepancy may lead to user confusion during interactions with the protocol.

Vulnerability Details

The LoveToken contract utilizes the solmate template for ERC-20 tokens. In a standard ERC-20 token, the transfer, transferFrom, and approve functions are expected to return a boolean to indicate the success of the operation.

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)

However, in ILoveToken, the interface for LoveToken, there is a slight difference:

function transfer(address to, uint256 amount) external;
function transferFrom(address from, address to, uint256 amount) external;
function approve(address to, uint256 amount) external;

It does not include a return boolean value. Interacting with these functions using a contract compiled with Solidity > 0.4.22 will result in execution failure due to the missing return value.

Impact

If the protocol is deployed and users claim Love Tokens, attempting to interact with the contract using ILoveToken as a reference may prove unsuccessful.

Tools Used

Slither

Recommendations

To solve this issue, update the ILoveToken interface to align with the ERC-20 token standard by adding return values to the transfer, transferFrom, and approve functions.

Updates

Lead Judging Commences

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.