Token-0x

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

Missing Return Values Violates ERC-20 Standard & Breaks Integrations

Author Revealed upon completion

Root + Impact

Wallets, DEXes, bridges, and third-party tooling rely on transfer() and approve() returning true.
Missing or inconsistent return values cause:

  • broken integrations

  • failed token listings

  • lost approvals

  • inability for protocols to trust Token-0x’s behavior

This makes Token-0x behave like a non-standard ERC20, reducing composability.

Description

  • ERC-20 requires that transfer() and approve() must return a boolean (true for success).

  • The Token-0x Yul implementation completes the internal logic but does not return any value, causing the function to return “empty bytes” instead of the required boolean.

// Root cause in the codebase with @> marks to highlight the relevant section
function transfer(address to, uint256 amount) external {
assembly {
// token logic …
// @> Missing mstore(0x00, 1) and return(0x00, 32)
// @> Function exits without returning bool
}
}

Risk

Protocols like Uniswap, Balancer, or Safe multisig treat this as failure.

Likelihood:

  • Occurs on every ERC20 interaction.

All DeFi systems expecting true will revert.

Impact:

  • DEX integrations fail (token becomes untradeable).

Wallets cannot show balances or send transactions.

Proof of Concept

The require() fails because the token returns no boolean.

contract IntegrationTest {
function test(address token) external {
// This will revert on tokens that don't return bool
require(
IToken(token).transfer(msg.sender, 1 ether),
"Transfer did not return true"
);
}
}
interface IToken {
function transfer(address, uint256) external returns (bool);
}

Recommended Mitigation

The require() fails because the token returns no boolean.

- remove this code
+ add this code
- assembly {
- // logic ...
- // no return value
- }
+ assembly {
+ // logic...
+
+ // Return true as required by ERC20
+ mstore(0x00, 1)
+ return(0x00, 0x20)
+ }

Support

FAQs

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

Give us feedback!