Skip to content

Conversation

@TaprootFreak
Copy link
Collaborator

Summary

  • Replace hardcoded nonce: 0 with dynamic nonce from web3.eth.getTransactionCount()
  • Ensures EIP-7702 delegations work for accounts with existing transaction history

Problem

The EIP-7702 authorization nonce was hardcoded to 0, which only works for:

  • New accounts that never sent a transaction
  • First-time EIP-7702 usage

It fails for:

  • Accounts that previously made transactions (nonce > 0)
  • Repeated EIP-7702 delegations from the same account

Solution

Fetch the current nonce from the network before signing the authorization.

Test plan

  • Test sell flow with new wallet (nonce = 0)
  • Test sell flow with wallet that has transaction history (nonce > 0)
  • Verify repeated EIP-7702 delegations work correctly

The nonce was hardcoded to 0, which only works for accounts that have
never sent a transaction. Now fetches the current nonce from the network
using web3.eth.getTransactionCount(), ensuring EIP-7702 delegations work
correctly for accounts with existing transaction history.
@TaprootFreak
Copy link
Collaborator Author

Closing this PR - further investigation revealed that the entire EIP-7702 authorization signature method in the frontend is fundamentally broken (uses EIP-712 instead of proper EIP-7702 format). The nonce fix is irrelevant until we implement wallet_sendCalls + Paymaster approach. See analysis in plan.

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.

2 participants