Gasless in-browser EIP-7702 onboarding (relayer + SafeVaultFactory)#3
Merged
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…, 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-click, gasless onboarding from the
/appdashboard: 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
SafeVaultFactory.vaultOf).configureWithSig) + an EIP-7702 authorization (delegate → GuardianModule). No gas.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-ownerSafeVault, so the vault address is known before deployment.0x1ef2…c4A5.configureWithSigkeepers array now uses standard EIP-712 encoding (32-byte words) so a wallet'ssignTypedDataverifies in-browser. Required a GuardianModule redeploy →0x9953…E8dA(fresh demo re-onboarded; all addresses/docs refreshed).Validation
SafeVaultFactorytests + updatedconfigureWithSigtest (70 total, 1 fork skip).pnpm onboard:gasless— end-to-end on testnet: a fresh, unfunded EOA signs; the relayer sponsors; the account ends upconfiguredwith the factory vault + keeper. User paid 0 gas.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
ETHGlobal/Hederafooter → Arbitrum Open House London./docsrunbook +.env.exampleupdated (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/onboardto sponsor txs.