Skip to content

EIP 7702 Implement SetCode transactions #2755

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

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

EIP 7702 Implement SetCode transactions #2755

wants to merge 4 commits into from

Conversation

anvacaru
Copy link
Contributor

@anvacaru anvacaru commented May 6, 2025

Add EIP-7702 SetCode Transaction Type Implementation

Adding support for a new transaction type that can include signed authorizations from various accounts. Each authorization lets you set a special code (0xEF0100 || address) for said authorized account, which points to another account/SC. Later, whenever anyone interacts with the authorized account, instead of just sending funds, the system runs the contract code that was pointed to (address).

Changes include:

Key Components:

  • Add SetCode transaction type with prefix 0x04
  • Define SetCodeTx data structure with authorization list
  • Add processing for SetCode authority lists
  • Implement delegation indicator (0xEF0100) for EOAs
  • Add gas refund mechanism for existing accounts

Notable Changes:

  • Add #loadAuthorities and #addAuthority operations for processing
  • Implement authority recovery from message parameters
  • Add verification of authority chain ID, address, and nonce
  • Support account delegation and code clearing

TODO:

  • Need to implement delegation resolution in CALL*/EXTCODECOPY/EXTCODESIZE/CODECOPY/CODESIZE operations
  • Run conformance tests

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.

1 participant