Skip to content

Updated SignatureChecker NatSpec to better reflect EIP-7702 behavior #5670

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gonzaotc
Copy link

@gonzaotc gonzaotc commented May 6, 2025

As already acknowledged in PR #4951 and issue #4855, SignatureChecker.isValidSignatureNow validates signatures via ERC-1271 instead of ECDSA recover for any signer that has code. This is enforced by design and the justification can found in the mentioned issue.

This NatSpec slight change has the objective of making it more explicit in the context of EIP-7702 EOA's delegations, where the EOA get's Smart Contract code associated, and therefore ERC-1271 verifications apply.

@gonzaotc gonzaotc changed the title updated SignatureChecker NatSpect to better reflect 7702 behavior Updated SignatureChecker NatSpectto better reflect ERC-7702 behavior May 6, 2025
@gonzaotc gonzaotc changed the title Updated SignatureChecker NatSpectto better reflect ERC-7702 behavior Updated SignatureChecker NatSpec to better reflect ERC-7702 behavior May 6, 2025
@gonzaotc gonzaotc changed the title Updated SignatureChecker NatSpec to better reflect ERC-7702 behavior Updated SignatureChecker NatSpec to better reflect EIP-7702 behavior May 6, 2025
@gonzaotc gonzaotc requested review from ernestognw and a team May 6, 2025 20:17
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC-1271, otherwise it's validated using `ECDSA.recover`.
* @dev Checks if a signature is valid for a given signer and data hash. If the signer has code, the
* signature is validated against it using ERC-1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* NOTE: Unlike ECDSA signatures, ERC-1271 signatures are revocable, and the outcome of this function can thus

Copy link
Member

@ernestognw ernestognw left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants