Skip to content

Conversation

@llbartekll
Copy link
Contributor

@llbartekll llbartekll commented Oct 22, 2025

Summary

This PR simplifies ERC-7730 by removing embedded ABIs and making display.formats the single source of truth for routing, decoding, and labeling.

Functions only: scope limited to calldata clear-signing; events/errors out of scope.

Keys = schema & router: each display.formats key is a Human-Readable ABI function with parameter names (e.g., transfer(address to,uint256 value)).

Selector matching: wallets compute keccak256()[:4] from the key to match calldata.

Decoding from key: wallets parse the key’s canonical types to decode; names from the key populate paths.

Why: reduces duplication and drift, shrinks descriptors, and aligns with existing wallet UX while keeping overloads and complex types (tuples/arrays) precise via canonical types.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Oct 22, 2025

🛑 Auto merge failed. Please see logs for more details, and report this issue at the eip-review-bot repository.

@eip-review-bot eip-review-bot changed the title Document ABI sourcing guidance for ERC-7730 Update ERC-7730: Document ABI sourcing guidance for ERC-7730 Oct 22, 2025
@llbartekll llbartekll marked this pull request as draft October 22, 2025 12:07
@kuzdogan
Copy link
Member

I'm actually thinking if a full ABI JSON in this spec is an overkill. In a way this information is redundant because we are already providing it in the format spec of each function:

        "formats": {
            "myFunction(address _address,uint256 _amount,MyParamType _param)": {

The key here contains all the information needed to identify and ABI-decode the parameters. This is the preferred format in ethers.js and is fully translatable to other formats.

We can even fully remove the "abi" field and require proper formatting of display.formats keys.

Right now the spec allows 3 possibilities on this key:

For contracts, the key names MUST be one of those three forms:

  • A 4-bytes selector of the function being described, in hex string notation: the corresponding function MUST be in the abi specified in context.contract.abi.
  • The function signature used to compute the selector, i.e. without parameter names and without spaces (refer to Solidity documentation): the corresponding function MUST be in the abi specified in context.contract.abi.
  • A full solidity signature, including parameter names: the corresponding function MUST be in the abi specified in context.contract.abi and the parameters names MUST match those in the ABI.

With that the spec would only allow the last one, "full Solidity signature", or maybe better defined as the ether.js Human-readable ABI

The ABI itself requires a verification/validation step anyway so I don't see the benefit of including the full ABI.

@llbartekll llbartekll changed the title Update ERC-7730: Document ABI sourcing guidance for ERC-7730 ERC-7730: Remove embedded ABI; keys-as-schema Oct 28, 2025
@eip-review-bot eip-review-bot changed the title ERC-7730: Remove embedded ABI; keys-as-schema Update ERC-7730: Remove embedded ABI; keys-as-schema Oct 28, 2025
Copy link
Member

@kuzdogan kuzdogan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments. Otherwise lgtm thank you! I guess we need to update the JSON schema as well

@llbartekll llbartekll requested a review from kuzdogan October 31, 2025 08:30
"interpolatedIntent": "Approve {spender} to spend up to {amount} on your behalf until {deadline}",
"fields": [
{"path": "spender", "label": "Spender", "format": "addressName"},
{"path": "amount", "label": "Amount", "format": "tokenAmount", "params": {"tokenPath": "@.to"}},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params should not be dropped here and in next line

"formats": {
"title": "List of field formats",
"description": "The list includes formatting info for each field of a structure. This list is indexed by a key identifying uniquely the message's type in the abi. For smartcontracts, it is the selector of the function or its signature; and for EIP712 messages it is the primaryType of the message.",
"description": "The list includes formatting info for each field of a structure. This list is indexed by the full function signature with parameter names.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the index type for EIP-712 (since they do not have an equivalent of human readable ABI)

"description": "The contract binding context is a set constraints that are used to bind the ERC7730 file to a specific smart contract.",

"properties": {
"abi": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we leave the ABI key and mark it as deprecated? To avoid breaking a lot of existing files?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a short mention

"title": "List of field formats",
"description": "The list includes formatting info for each field of a structure. This list is indexed by a key identifying uniquely the message's type in the abi. For smartcontracts, it is the selector of the function or its signature; and for EIP712 messages it is the primaryType of the message.",
"description": "The list includes formatting info for each field of a structure. This list is indexed by the full function signature with parameter names.",
"type": "object",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're making the key itself a reference of the schema, might be useful to validate the format itself using the schema. Something like this should work:

"propertyNames": {
    "pattern": "^[A-Za-z_][A-Za-z0-9_]*\\([A-Za-z0-9_\\[\\]()]+ [A-Za-z_][A-Za-z0-9_]*(?:,[A-Za-z0-9_\\[\\]()]+ [A-Za-z_][A-Za-z0-9_]*)*\\)$"
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for surfacing that. I’ve reintroduced a stricter propertyNames guard so schema validation enforces the “full function signature with parameter names” contract. The pattern now allows:

  • Named parameters with optional array suffixes and memory|calldata|storage qualifiers.
  • Tuple/struct parameters, including nested tuples (tuple((uint256,address) info)).
  • Optional whitespace and the empty-parameter case (pause()).

Here’s what landed:

  "propertyNames": {
    "pattern": "^[A-Za-z_][A-Za-z0-9_]*\\(\\s*(?:(?:(?:tuple(?:\\s*\\((?:[^()]|\\([^()]*\\))*\\))?|[A-Za-z0-9_]+)(?:\\[[0-9]*\\])*(?:\\s+(?:memory|calldata|
  storage))?\\s+[A-Za-z_][A-Za-z0-9_]*)(?:\\s*,\\s*(?:(?:tuple(?:\\s*\\((?:[^()]|\\([^()]*\\))*\\))?|[A-Za-z0-9_]+)(?:\\[[0-9]*\\])*(?:\\s+(?:memory|
  calldata|storage))?\\s+[A-Za-z_][A-Za-z0-9_]*))*\\s*)?\\)$"
  }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanx for all the help

@llbartekll llbartekll marked this pull request as ready for review November 5, 2025 09:34
@lightclient lightclient merged commit 1a3aacf into ethereum:master Nov 5, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants