Thanks to visit codestin.com
Credit goes to github.com

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

Merged
merged 16 commits into from
Jul 10, 2025
Merged

EIP 7702 Implement SetCode transactions #2755

merged 16 commits into from
Jul 10, 2025

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 the delegation indicator (0xEF0100) for EOAs
  • Add gas refund mechanism for existing accounts
  • Delegation Resolution: When calling an account, check if its code represents a valid delegation using #isValidDelegation, and fetch the code of the delegated account.

Notable Changes:

  • Add #loadAuthorities and #addAuthority operations for processing
  • Implement authority recovery from message parameters
  • Add verification of authority chain ID, address, and nonce
  • Update the Cextra function when computing the cost of a call to also check if there is a delegation and if the delegated account is warm.
  • Support account delegation and code clearing

TODO:

  • Need to implement delegation resolution in CALL*/`operations
  • Run conformance tests

@anvacaru anvacaru marked this pull request as ready for review May 26, 2025 16:59
@anvacaru anvacaru requested a review from palinatolmach July 10, 2025 12:26
Copy link
Contributor

@palinatolmach palinatolmach left a comment

Choose a reason for hiding this comment

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

lgtm!

@anvacaru anvacaru merged commit 0957714 into master Jul 10, 2025
12 checks passed
@anvacaru anvacaru deleted the eip-7702 branch July 10, 2025 14:19
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.

2 participants