Repository navigation
Document EIP-7708 ETH transfer logs and add helpers to identify them - #309
Merged
Merged
Conversation
This was referenced Nov 15, 2026
Under EIP-7708 (Glamsterdam) every non-zero ETH transfer emits a Transfer(address,address,uint256) log from SYSTEM_ADDRESS (0xff...fe), which ERC-20 Transfer filters decode as a token transfer. Ethers.Event.system_address/0 returns that emitter and Ethers.Event.eth_transfer_log?/1 tells such events apart (emitter and Transfer topic, case-insensitive). get_logs/2 is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hqvX8DbbP3mgXy5hVEDc6
Without an address, a Transfer(address,address,uint256) filter (ERC-20, ERC-777, or a combined filter including it) also returns native ETH transfers on networks with EIP-7708 active. Warn about it on Ethers.get_logs/2, Ethers.EventFilter, Ethers.CombinedEventFilter, the README and in the generated docs of event filters with that signature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hqvX8DbbP3mgXy5hVEDc6
Decoded events carry an EIP-55 checksummed `address` since #312, so system_address/0 returns the checksummed form too and compares equal to the `address` of an ETH transfer log. eth_transfer_log?/1 still compares case-insensitively. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hqvX8DbbP3mgXy5hVEDc6
alisinabh
force-pushed
the
feat/glamsterdam-readiness
branch
from
November 16, 2026 01:05
619cc04 to
ff6adf7
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012hqvX8DbbP3mgXy5hVEDc6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prepares the library for the Glamsterdam network upgrade (live on Sepolia since 2026-10-06; no mainnet date yet).
Changes
Ethers.Event.system_address/0andEthers.Event.eth_transfer_log?/1to identify EIP-7708 ETH transfer logs. These logs are emitted bySYSTEM_ADDRESS(0xfffffffffffffffffffffffffffffffffffffffe) with the ERC-20Transfer(address,address,uint256)topics and data, soTransferfilters decode them as token transfers. The predicate checks both the emitter andtopics[0], case-insensitively.Ethers.get_logs/2behaviour is unchanged (no automatic filtering).Ethers.get_logs/2,Ethers.EventFilter,Ethers.CombinedEventFilter,Ethers.Event, the README, and in the generated docs of any event filter with theTransfer(address,address,uint256)signature (user contracts and the built-in ERC20/ERC777/ERC721).Ethers.Event.decode/2andEthers.CombinedEventFilter.decode_logs/2(it decodes asTransfer, and the predicate separates it from a token transfer).Also under EIP-7708, the transaction-level transfer log comes "before any other logs created by EVM execution". Value-bearing transactions to contracts will therefore see their event
log_indexvalues shift by one.EIP status
The included EIPs (7708, 2780, 7976, 7981, 7954, 8037) are in Last Call, not Final. The meta EIP-7773 is in Review. EIP-8037 notes that some values "are not yet final", so the constants below should be re-checked once the EIPs are Final and mainnet is scheduled.
Where the EIP text differs from the issue:
21,000". Other cases: self-transfer 12,000; zero-value transfer 15,000; transfer creating an account 21,000 + 183,600 state gas; contract creation 24,000 + 183,600 state gas.Audit
Gas repricing (EIP-2780, 7976, 7981, 8037, 8038). The library hardcodes no intrinsic gas. The only
21_000inlibis aTransaction.new/1doctest example. Gas auto-fill iseth_estimateGas× margin, and nodes must apply the new rules in their estimates. I audited tests and docs for hardcoded gas values:test/ethers/state_override_test.exs:209{:ok, 21_000}(1 ETH to an existing EOA)test/ethers_test.exs:900gas_used > 21_000(createAccessList with an SSTORE)state_override_test.exs:203override_gas > base_gasgas: 10_000/23_170signing tests,gas: 100:no_to_addresstests0x5208,21_000, ...), fee-estimation fake RPC, doc examples (transaction.ex,ethers.ex:878,guides/upgrading.md:227)No test changes are needed, and no live test sends with a hardcoded gas limit.
The default 10% gas margin remains adequate:
EIP-7954 (contract size). Nothing in the library enforces the old 24 KiB / 48 KiB limits.
Testing against Glamsterdam
anvil 1.9.0 (the CI version) supports Amsterdam as an opt-in
--hardfork amsterdam; the default stays pre-Amsterdam. Verified from the Foundry v1.9.0 source:Not verified: running anvil 1.9.0 itself, the
amsterdamCLI string at runtime, and this suite on an Amsterdam node.Proposed follow-up (not part of this PR): add a hardfork matrix to the non-blocking canary workflow
.github/workflows/latest-tools.yml, and move it to required CI once mainnet is scheduled:Refs #291
🤖 Generated with Claude Code
https://claude.ai/code/session_012hqvX8DbbP3mgXy5hVEDc6