@@ -23,6 +23,71 @@ testing guide for the guardian recovery feature, including:
2323- Managing multiple guardians
2424- Edge cases and troubleshooting
2525
26+ ## Local Development Setup for Guardian Recovery
27+
28+ Guardian recovery uses the ` GuardianExecutor ` module from
29+ ` packages/erc4337-contracts ` . To enable guardian recovery locally:
30+
31+ ### 1. Start Local Anvil Node
32+
33+ ``` sh
34+ cd packages/erc4337-contracts
35+ pnpm anvil # or anvil if installed globally
36+ ```
37+
38+ ### 2. Deploy ERC-4337 Contracts
39+
40+ In a new terminal:
41+
42+ ``` sh
43+ cd packages/erc4337-contracts
44+ forge script script/Deploy.s.sol --broadcast \
45+ --rpc-url http://localhost:8545 \
46+ --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
47+ ```
48+
49+ After deployment, update ` packages/auth-server/stores/local-node.json ` with the
50+ deployed contract addresses from the console output. Key addresses to update:
51+
52+ - ` guardianExecutor ` : The GuardianExecutor module address (4th module)
53+ - ` eoaValidator ` : EOA validator address (1st module)
54+ - ` webauthnValidator ` : WebAuthn validator address (3rd module)
55+ - ` sessionValidator ` : Session validator address (2nd module)
56+ - ` factory ` : Account factory address
57+
58+ ### 3. Start the Bundler
59+
60+ ``` sh
61+ cd packages/bundler
62+ pnpm start # Starts bundler at http://localhost:4337
63+ ```
64+
65+ ### 4. Start the Auth Server API
66+
67+ ``` sh
68+ pnpm nx dev auth-server-api
69+ ```
70+
71+ ### 5. Start the Auth Server
72+
73+ ``` sh
74+ pnpm nx dev auth-server
75+ ```
76+
77+ ### Testnet Deployment (zksyncOsTestnet)
78+
79+ For deploying to zksyncOsTestnet:
80+
81+ ``` sh
82+ cd packages/erc4337-contracts
83+ forge script script/Deploy.s.sol --broadcast \
84+ --rpc-url https://zksync-os-testnet-alpha.zksync.dev \
85+ --private-key < YOUR_PRIVATE_KEY>
86+ ```
87+
88+ Then update ` packages/auth-server/stores/client.ts `
89+ ` contractsByChain[zksyncOsTestnet.id] ` with the deployed addresses.
90+
2691## How to deploy to a new chain
2792
2893If you are a ZKsync chain operator, there are a few more updates to make to
0 commit comments