Skip to content

ERC20: return bool from transfer/transferFrom/approve (EIP-20)#44

Merged
mudgen merged 2 commits intoPerfect-Abstractions:mainfrom
aapsi:feat/erc20-bool-returns
Oct 24, 2025
Merged

ERC20: return bool from transfer/transferFrom/approve (EIP-20)#44
mudgen merged 2 commits intoPerfect-Abstractions:mainfrom
aapsi:feat/erc20-bool-returns

Conversation

@aapsi
Copy link
Copy Markdown
Contributor

@aapsi aapsi commented Oct 20, 2025

Description

Align ERC20Facet with the ERC‑20 ABI by making transfer, transferFrom, and approve return bool and return true on success.

Why

  • EIP‑20 specifies returns (bool) for these functions.
  • Improves compatibility with wallets, routers, and typed bindings that expect the canonical ABI.
  • No behavioral change: functions already revert on failure; this makes success explicit.

Changes

  • approve(address,uint256) external returns (bool) → returns true on success
  • transfer(address,uint256) external returns (bool) → returns true on success
  • transferFrom(address,address,uint256) external returns (bool) → returns true on success
  • No storage or logic changes; libraries unchanged.

Notes

@mudgen
Copy link
Copy Markdown
Contributor

mudgen commented Oct 24, 2025

@aapsi Good point. I checked and OpenZeppelin has these functions return bool too. @aapsi thanks for submitting this pull request.

@mudgen mudgen marked this pull request as ready for review October 24, 2025 02:48
@mudgen mudgen merged commit 318fe4d into Perfect-Abstractions:main Oct 24, 2025
1 check passed
JackieXu pushed a commit to JackieXu/Compose that referenced this pull request Nov 6, 2025
…-returns

ERC20: return bool from transfer/transferFrom/approve (EIP-20)
maxnorm added a commit that referenced this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants