Skip to content

Gasless in-browser EIP-7702 onboarding (relayer + SafeVaultFactory)#3

Merged
gamween merged 4 commits into
mainfrom
feat/gasless-onboarding
Jun 16, 2026
Merged

Gasless in-browser EIP-7702 onboarding (relayer + SafeVaultFactory)#3
gamween merged 4 commits into
mainfrom
feat/gasless-onboarding

Conversation

@gamween

@gamween gamween commented Jun 16, 2026

Copy link
Copy Markdown
Owner

One-click, gasless onboarding from the /app dashboard: the wallet signs two messages (off-chain, zero gas) and a relayer sponsors the EIP-7702 delegation + policy config. Proven end-to-end on Robinhood Chain testnet.

How it works

  1. The dashboard reads the user's deterministic SafeVault address (SafeVaultFactory.vaultOf).
  2. The wallet signs an EIP-712 Policy (configureWithSig) + an EIP-7702 authorization (delegate → GuardianModule). No gas.
  3. site/api/onboard.ts (Vercel relayer) validates the canonical policy (official keeper + the caller's own factory vault, signer == owner), deploys the vault if needed, and submits one sponsored type-4 tx that delegates and configures. The user pays nothing.

Contracts

  • SafeVaultFactory (CREATE2) — deterministic per-owner SafeVault, so the vault address is known before deployment. 0x1ef2…c4A5.
  • configureWithSig keepers array now uses standard EIP-712 encoding (32-byte words) so a wallet's signTypedData verifies in-browser. Required a GuardianModule redeploy → 0x9953…E8dA (fresh demo re-onboarded; all addresses/docs refreshed).

Validation

  • Foundry: 5 SafeVaultFactory tests + updated configureWithSig test (70 total, 1 fork skip).
  • pnpm onboard:gasless — end-to-end on testnet: a fresh, unfunded EOA signs; the relayer sponsors; the account ends up configured with the factory vault + keeper. User paid 0 gas.
  • site build + lint, video typecheck — green.

Frontend / UX

  • /app "Protect my wallet — gasless" button (signing → relaying → PROTECTED), with a CLI fallback message if the wallet can't sign an EIP-7702 authorization yet.

Also in here

  • README: gasless onboarding moved to ✅ live; live CI status badge (supersedes PR docs: live CI status badge #2 — can be closed); fixed the stray ETHGlobal/Hedera footer → Arbitrum Open House London.
  • /docs runbook + .env.example updated (VAULT_FACTORY, RELAYER_PRIVATE_KEY).

Deploy note

The relayer needs RELAYER_PRIVATE_KEY (a funded testnet key) set in the host env (Vercel) for /api/onboard to sponsor txs.

gamween added 3 commits June 17, 2026 00:05
…s in configureWithSig

- SafeVaultFactory deploys a deterministic per-owner SafeVault (counterfactual vaultOf),
  so the gasless flow can sign a policy against a known vault before it exists.
- configureWithSig now hashes the keepers array per the EIP-712 spec (32-byte words), so a
  wallet's standard signTypedData verifies — enabling in-browser gasless onboarding.
- Tests: 5 factory tests; configureWithSig test updated to the standard encoding (70 total).
…ashboard)

- site/api/onboard.ts: Vercel relayer — validates the canonical policy (official keeper +
  caller's factory vault), deploys the vault, submits the sponsored delegate+configure type-4 tx.
- useGaslessOnboard hook + /app 'Protect my wallet — gasless' button (2 wallet signatures,
  zero gas), with a clean CLI fallback if the wallet can't sign an EIP-7702 authorization.
- watcher: pnpm onboard:gasless — end-to-end proof on testnet (fresh unfunded EOA → relayer).
…live CI badge; fix README footer

- GuardianModule redeployed (0x9953…E8dA) + SafeVaultFactory (0x1ef2…c4A5); fresh demo set
  re-onboarded. Refresh deployments.json, site addresses, video shorts, .env.example.
- README: gasless onboarding now live (out of roadmap), CI badge (replaces static tests badge),
  95 tests, repo structure; fix the stray 'ETHGlobal/Hedera' footer → Arbitrum Open House London.
- /docs: DeployFactory in the runbook + gasless onboarding note.
Copilot AI review requested due to automatic review settings June 16, 2026 22:06
@vercel

vercel Bot commented Jun 16, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
coincoin Ready Ready Preview, Comment Jun 16, 2026 10:21pm

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…, typecheck the relayer

Self-audit of the gasless feature caught real issues:
- EIP-7702 authorization nonce was hard-coded 0 → would be silently skipped (delegation
  never applies) for any account with tx history. Now fetched explicitly at `latest`.
- site/api used `recoverAuthorizationAddress` which viem does NOT export from the root →
  the relayer would have failed. Switched to `verifyAuthorization` (viem/utils).
- dropped the `as never` casts on sendTransaction (viem types authorizationList).
- added tsconfig.api.json + `typecheck:api` (wired into CI) so the relayer is type-checked —
  the blind spot that hid the import bug.
Re-proven end-to-end on testnet (pnpm onboard:gasless); 70 forge / 25 watcher / site green.
@gamween gamween merged commit 0f95888 into main Jun 16, 2026
5 checks passed
@gamween gamween deleted the feat/gasless-onboarding branch June 16, 2026 22:22
@gamween gamween mentioned this pull request Jun 16, 2026
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