Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
ab01e3a
feat: connect guardian
cpb8010 Nov 20, 2025
1d23c5f
fix: update project link
cpb8010 Nov 23, 2025
d62d71e
fix: update lockfile
cpb8010 Nov 23, 2025
5fa108c
fix: update foldername
cpb8010 Dec 8, 2025
b6ef0d1
feat: update to latest abi
cpb8010 Dec 8, 2025
453bf03
chore: reinstall deps to lockfile
cpb8010 Dec 23, 2025
24c5fe8
feat: enable guardian ui
cpb8010 Dec 23, 2025
0a7fa33
feat: remove empty tabs
cpb8010 Dec 23, 2025
71b3da7
fix: move passkey util to new sdk
cpb8010 Dec 23, 2025
8209e12
fix: more import changes
cpb8010 Dec 23, 2025
d58b659
fix: remove oidc abis
cpb8010 Dec 24, 2025
c98e9ec
fix: add oidc abis
cpb8010 Dec 24, 2025
1d3dfed
feat: add 4337 sdk to package for build
cpb8010 Dec 24, 2025
97a69d3
fix: change imports to all 4337 sdk
cpb8010 Dec 24, 2025
9c49d7a
fix: more import changes
cpb8010 Dec 24, 2025
bd50301
fix: undo all oidc server changes
cpb8010 Dec 24, 2025
6d87237
fix: package lockfile update
cpb8010 Dec 24, 2025
9883172
feat: add more debugging options from local test
cpb8010 Dec 29, 2025
1eec992
feat: add e2e test for guardian
cpb8010 Jan 1, 2026
e81ddbd
feat: one passing test
cpb8010 Jan 3, 2026
1430570
fix: formatting from linting
cpb8010 Jan 3, 2026
b7927d3
chore: remove debug logging
cpb8010 Jan 3, 2026
2e7e87a
fix: ignore lints
cpb8010 Jan 3, 2026
ae0000a
fix: more cspell packages
cpb8010 Jan 3, 2026
a0cc0ff
chore: address code comments
cpb8010 Jan 3, 2026
35eb533
feat: add more to recovery test
cpb8010 Jan 3, 2026
b955031
feat: failing test
cpb8010 Jan 5, 2026
7899eb1
fix: add module installation verification and fix linting
cpb8010 Jan 6, 2026
99a8687
fix: call installModule directly
cpb8010 Jan 6, 2026
96952fb
fix: update deploy type
cpb8010 Jan 6, 2026
48960d9
fix: nearly complete tests
cpb8010 Jan 6, 2026
9701078
fix: manual testing works
cpb8010 Jan 6, 2026
1fa327f
feat: passing tests
cpb8010 Jan 8, 2026
156fcb4
chore: linting errors
cpb8010 Jan 8, 2026
049c341
fix: add playwright install
cpb8010 Jan 8, 2026
f3a6d04
chore: cleanup console logs and dead code
cpb8010 Jan 9, 2026
8321a4c
fix: undo breaking tests
cpb8010 Jan 9, 2026
7a7cb33
chore: rust formatting
cpb8010 Jan 9, 2026
ff4e812
fix: update for test in ci
cpb8010 Jan 9, 2026
e461856
fix: add more timeout functions
cpb8010 Jan 9, 2026
e111d72
fix: cleanup unused code
cpb8010 Jan 9, 2026
31f6432
fix: more timeouts to help with slow ci
cpb8010 Jan 9, 2026
f166bf4
fix: get to next stage in test
cpb8010 Jan 10, 2026
5f1997f
fix: removing timeout
cpb8010 Jan 10, 2026
8bdc87a
fix: locally passing tests again
cpb8010 Jan 10, 2026
aa6a6a8
Merge branch 'main' into 4337-guardian
cpb8010 Jan 10, 2026
258d582
chore: code review comments
cpb8010 Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,19 @@ jobs:
path: examples/demo-app/playwright-report/
retention-days: 3

# Run Guardian E2E tests (reuses same Anvil + bundler setup)
- name: Install Playwright Chromium Browser for Guardian tests
run: pnpm exec playwright install chromium
working-directory: packages/auth-server
- name: Run Guardian e2e tests
run: pnpm nx e2e:guardian auth-server
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: auth-server-guardian-playwright-report
path: packages/auth-server/playwright-report/
retention-days: 3

# e2e-nft-quest:
# runs-on: ubuntu-latest
# defaults:
Expand Down
1 change: 1 addition & 0 deletions cspell-config/cspell-packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ levischuck
ofetch
reown
jose
pinia
8 changes: 8 additions & 0 deletions examples/demo-app/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
},
"dependsOn": ["e2e:setup"]
},
"e2e:guardian": {
"executor": "nx:run-commands",
"options": {
"cwd": "examples/demo-app",
"command": "PW_TEST_HTML_REPORT_OPEN=never playwright test tests/guardian.spec.ts --config=playwright-erc4337.config.ts"
},
"dependsOn": ["e2e:setup:erc4337"]
},
"e2e:demo-only": {
"executor": "nx:run-commands",
"options": {
Expand Down
4 changes: 4 additions & 0 deletions examples/demo-app/scripts/deploy-msa-anvil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ cast send "$PAYMASTER" --value 10ether --private-key "$ANVIL_ACCOUNT_0_KEY" --rp
echo "💳 Depositing 10 ETH into EntryPoint for paymaster..."
cast send "$PAYMASTER" "deposit()" --value 10ether --private-key "$ANVIL_ACCOUNT_0_KEY" --rpc-url "$RPC_URL" 2>&1 || echo "Deposit initiated"

# Add stake to the paymaster (required for ERC-4337)
echo "🔒 Adding stake to paymaster (1 day unlock delay)..."
cast send "$PAYMASTER" "addStake(uint32)" 86400 --value 1ether --private-key "$ANVIL_ACCOUNT_0_KEY" --rpc-url "$RPC_URL" 2>&1 || echo "Stake added"

# Verify all addresses were extracted
if [ -z "$EOA_VALIDATOR" ] || [ -z "$SESSION_VALIDATOR" ] || [ -z "$WEBAUTHN_VALIDATOR" ] || \
[ -z "$GUARDIAN_EXECUTOR" ] || [ -z "$ACCOUNT_IMPL" ] || [ -z "$BEACON" ] || [ -z "$FACTORY" ] || [ -z "$PAYMASTER" ]; then
Expand Down
5 changes: 4 additions & 1 deletion packages/auth-server-api/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ let contractsFromFile: {
eoaValidator?: string;
webauthnValidator?: string;
sessionValidator?: string;
guardianExecutor?: string;
} = {};

try {
Expand All @@ -38,6 +39,7 @@ const envSchema = z.object({
EOA_VALIDATOR_ADDRESS: z.string().optional(),
WEBAUTHN_VALIDATOR_ADDRESS: z.string().optional(),
SESSION_VALIDATOR_ADDRESS: z.string().optional(),
GUARDIAN_EXECUTOR_ADDRESS: z.string().optional(),
// Prividium Mode Configuration
PRIVIDIUM_MODE: z.string().transform((v) => v === "true").default("false"),
PRIVIDIUM_PERMISSIONS_BASE_URL: z.string().optional(),
Expand Down Expand Up @@ -79,6 +81,7 @@ const FACTORY_ADDRESS = env.FACTORY_ADDRESS || contractsFromFile.factory;
const EOA_VALIDATOR_ADDRESS = env.EOA_VALIDATOR_ADDRESS || contractsFromFile.eoaValidator;
const WEBAUTHN_VALIDATOR_ADDRESS = env.WEBAUTHN_VALIDATOR_ADDRESS || contractsFromFile.webauthnValidator;
const SESSION_VALIDATOR_ADDRESS = env.SESSION_VALIDATOR_ADDRESS || contractsFromFile.sessionValidator;
const GUARDIAN_EXECUTOR_ADDRESS = env.GUARDIAN_EXECUTOR_ADDRESS || contractsFromFile.guardianExecutor;

// Validate that we have all required contract addresses
if (!FACTORY_ADDRESS || !EOA_VALIDATOR_ADDRESS || !WEBAUTHN_VALIDATOR_ADDRESS || !SESSION_VALIDATOR_ADDRESS) {
Expand Down Expand Up @@ -162,4 +165,4 @@ const rateLimitConfig = {
deployWindowMs: parseInt(env.RATE_LIMIT_DEPLOY_WINDOW_MS, 10),
};

export { env, EOA_VALIDATOR_ADDRESS, FACTORY_ADDRESS, getChain, prividiumConfig, rateLimitConfig, SESSION_VALIDATOR_ADDRESS, SUPPORTED_CHAINS, WEBAUTHN_VALIDATOR_ADDRESS };
export { env, EOA_VALIDATOR_ADDRESS, FACTORY_ADDRESS, getChain, GUARDIAN_EXECUTOR_ADDRESS, prividiumConfig, rateLimitConfig, SESSION_VALIDATOR_ADDRESS, SUPPORTED_CHAINS, WEBAUTHN_VALIDATOR_ADDRESS };
5 changes: 4 additions & 1 deletion packages/auth-server-api/src/handlers/deploy-account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { privateKeyToAccount } from "viem/accounts";
import { waitForTransactionReceipt } from "viem/actions";
import { getAccountAddressFromLogs, prepareDeploySmartAccount } from "zksync-sso-4337/client";

import { env, EOA_VALIDATOR_ADDRESS, FACTORY_ADDRESS, getChain, prividiumConfig, SESSION_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from "../config.js";
import { env, EOA_VALIDATOR_ADDRESS, FACTORY_ADDRESS, getChain, GUARDIAN_EXECUTOR_ADDRESS, prividiumConfig, SESSION_VALIDATOR_ADDRESS, WEBAUTHN_VALIDATOR_ADDRESS } from "../config.js";
import { deployAccountSchema } from "../schemas.js";
import { addAddressToUser, createProxyTransport, getAdminAuthService, whitelistContract } from "../services/prividium/index.js";

Expand Down Expand Up @@ -79,6 +79,8 @@ export const deployAccountHandler = async (req: Request, res: Response): Promise
}

// Prepare deployment transaction
const executorModulesToInstall = GUARDIAN_EXECUTOR_ADDRESS ? [GUARDIAN_EXECUTOR_ADDRESS as Address] : [];

const { transaction, accountId } = prepareDeploySmartAccount({
contracts: {
factory: FACTORY_ADDRESS as Address,
Expand All @@ -96,6 +98,7 @@ export const deployAccountHandler = async (req: Request, res: Response): Promise
eoaSigners: body.eoaSigners,
userId: body.userId,
installSessionValidator: true,
executorModules: executorModulesToInstall,
});

console.log("Deploying account with ID:", accountId);
Expand Down
Loading
Loading