Skip to content

Zy0n/7702 base main#131

Open
zy0n wants to merge 11 commits into
mainfrom
zy0n/7702-base-main
Open

Zy0n/7702 base main#131
zy0n wants to merge 11 commits into
mainfrom
zy0n/7702-base-main

Conversation

@zy0n

@zy0n zy0n commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces support for EIP-7702 relay-adapt contracts and ephemeral account management, along with related utilities and comprehensive tests. Key changes include adding new modules for ephemeral key management, extending provider loading logic to handle 7702 contracts, and implementing execution helpers for relay-adapt-7702. The update also increases the provider polling interval and adds robust test coverage for the new functionality.

EIP-7702 and Relay-Adapt Contract Integration:

  • Added logic in load-provider.ts to detect and load relay-adapt-7702 contracts and their execution types, including support for relayAdapt7702Contract and railgunRegistryContract when the network supports 7702. The provider polling interval was also increased to 60 seconds. [1] [2] [3] [4] [5]
  • Updated poi-validation.ts and extract-transaction-data.ts to support a useRelayAdapt7702 parameter, ensuring correct contract address selection and transaction handling for 7702-enabled flows. [1] [2] [3] [4] [5] [6]

Ephemeral Account and Key Management:

  • Introduced new modules ephemeral-account.ts and ephemeral-key-manager.ts to manage ephemeral accounts and indexes, with logic to scan transaction history for index recovery. [1] [2]
  • Exported the new ephemeral account management modules from the wallet index.

Relay-Adapt-7702 Execution Utilities:

  • Added relay-adapt-7702-execution.ts with helpers to determine execution type per network, read/handle execute nonces, and encode relay-adapt-7702 execute calls.

Testing:

  • Added comprehensive tests for ephemeral key manager and relay-adapt-7702 execution logic, covering edge cases and error handling. [1] [2]

Miscellaneous:

  • Updated wallet imports to include new types and utilities for relay-adapt-7702 and ephemeral account management. [1] [2]

These changes collectively enable advanced ephemeral account workflows and support for EIP-7702 relay-adapt contracts, improving flexibility and future-proofing the wallet infrastructure.

zy0n added 8 commits June 24, 2026 19:51
…er derivation

The EIP-7702 ephemeral signer was derived from the password-less seed, while the wallet's
spending keys and address derive from the password-protected seed. Mirror the engine fix:
the ephemeral wrappers (getCurrentEphemeralWallet/Address, sign7702Request) and
EphemeralKeyManager now pass the mnemonic password to the engine derivation (which now
requires it for password-protected wallets), and the 7702 cross-contract callers forward it.

Also route the manager's index ratchet and history scan through the engine's atomic
incrementEphemeralKeyIndex / setEphemeralKeyIndexIfGreater so concurrent callers can't reuse
the same ephemeral key/nonce.
…702 path

The cross-contract 7702 path forwarded the mnemonic password to the ephemeral signer
calls, but the unshield-base-token 7702 path did not: getCurrentEphemeralAddress and
sign7702Request were called without it, and createUnshieldBaseTokenTransaction7702 lacked
the parameter entirely. For a password-protected wallet that path failed the engine's
password assertion. Thread mnemonicPassword through it to match the cross-contract path.
@zy0n
zy0n force-pushed the zy0n/7702-base-main branch from ed5668f to f848073 Compare July 1, 2026 20:27
zy0n added 3 commits July 6, 2026 12:54
The shield base-token path hardcoded the EIP-7702 authorization nonce to
0. That is correct only for a never-delegated account; a reused ephemeral
account has a non-zero account nonce, so 0 is stale and the authorization
is silently skipped on-chain, producing a no-op shield. Read the nonce
live via getTransactionCount(address, 'latest'), matching the
cross-contract and unshield paths.
The existing encode test only checks the encoded nonce. Drive the real
sign and encode primitives from one shared executionDetails at nonce > 0,
and assert recovery matches only over the nonce-7 payload, so a
sign-0/encode-7 divergence (which reverts on-chain) is caught.
…one ephemeral

sign7702Request read the authorization nonce and execute nonce from getCurrentEphemeralWallet while the authorization itself was signed by getCurrentEphemeralSigner. With a pinned ephemeral the two diverged: tx.to and the nonce came from one account and the authorization authority from another, so the sponsored execute no-oped on-chain.

Read to, nonce, and executeNonce from the signer's address (getCurrentEphemeralAddress + provider.getTransactionCount), and resolve getCurrentEphemeralAddress to the engine signer address so recipients and tx.to match the authorization authority. Add regression coverage for the pinned-override path.
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