feat: align v2 with spec (@.chainId path and metadata.contractName) - #320
Merged
Conversation
ckorchane-ledger
approved these changes
Aug 6, 2026
fsamier
enabled auto-merge (squash)
August 6, 2026 11:54
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.
Summary
Aligns the v2 implementation with the ERC-7730 spec on two points.
1. Implement
@.chainIdcontainer pathThe spec lists
@.chainIdas a canonical container field (for both EVM transaction and EIP-712 containers), notably used as a mapkeyPath(e.g.underlyingTokenkeyed by chain id). This adds full support for it:CHAIN_ID = "chainId"toContainerField.chainIdto the path parser grammar.CHAIN_ID = 0x3to the calldata binary value enum and handled it inconvert_container_path(encoded as a 32-byteUINT).@.chainId.2. Use
metadata.contractNamefor the contract namePrefer the explicit
metadata.contractNamefield where a contract name is set, falling back to the previous value when not available:metadata.contractName or context.id.InputEIP712Contract.contractNameprefersmetadata.contractName, falling back tometadata.owner(dapp name keeps its owner-based fallback).metadata.contractName or context.id).v1 paths are left untouched since v1 metadata has no
contractNamefield.Testing
pdm run pytest tests/model tests/convert tests/v2 tests/lint— all passing.