Skip to content

Commit dcdbce3

Browse files
committed
fix: simplify paymaster with mock
remove test setup
1 parent e68c000 commit dcdbce3

File tree

5 files changed

+8
-118
lines changed

5 files changed

+8
-118
lines changed

examples/demo-app/project.json

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -91,41 +91,15 @@
9191
"executor": "nx:run-commands",
9292
"options": {
9393
"cwd": "examples/demo-app",
94-
"commands": [
95-
{
96-
"command": "pnpm nx run sdk-4337:build --skip-nx-cache",
97-
"prefix": "Rebuild-SDK:"
98-
},
99-
{
100-
"command": "cd ../../packages/auth-server && pnpm nuxt build"
101-
},
102-
{
103-
"command": "pnpm nuxt build"
104-
},
105-
{
106-
"command": "pnpm exec playwright install chromium"
107-
},
108-
{
109-
"command": "cd ../.. && ( cd packages/auth-server && PORT=3002 NUXT_PUBLIC_AUTH_SERVER_API_URL=http://localhost:3005 pnpm nuxt preview > /tmp/auth-server.log 2>&1 & echo $! > /tmp/auth-server.pid ) && ( cd examples/demo-app && PORT=3004 pnpm nuxt preview > /tmp/demo-app.log 2>&1 & echo $! > /tmp/demo-app.pid ) && sleep 10"
110-
}
111-
]
94+
"command": "pnpm exec playwright install chromium"
11295
},
11396
"dependsOn": ["deploy-contracts-erc4337"]
11497
},
11598
"e2e": {
11699
"executor": "nx:run-commands",
117100
"options": {
118101
"cwd": "examples/demo-app",
119-
"commands": [
120-
{
121-
"command": "cd ../.. && ( cd packages/auth-server && PORT=3002 NUXT_PUBLIC_AUTH_SERVER_API_URL=http://localhost:3005 pnpm nuxt preview > /tmp/auth-server.log 2>&1 & echo $! > /tmp/auth-server.pid ) && ( cd examples/demo-app && PORT=3004 pnpm nuxt preview > /tmp/demo-app.log 2>&1 & echo $! > /tmp/demo-app.pid ) && sleep 10",
122-
"prefix": "Start-Servers:"
123-
},
124-
{
125-
"command": "playwright test --config=playwright.config.ts",
126-
"prefix": "Tests:"
127-
}
128-
]
102+
"command": "playwright test --config=playwright.config.ts"
129103
},
130104
"dependsOn": ["e2e:setup"]
131105
},

examples/demo-app/scripts/deploy-msa-anvil.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,12 @@ ACCOUNT_IMPL=$(echo "$DEPLOY_OUTPUT" | grep "ModularSmartAccount implementation:
4040
BEACON=$(echo "$DEPLOY_OUTPUT" | grep "UpgradeableBeacon:" | awk '{print $2}')
4141
FACTORY=$(echo "$DEPLOY_OUTPUT" | grep "MSAFactory:" | awk '{print $2}')
4242

43-
# Deploy paymaster separately (with dependencies from erc4337-contracts)
43+
# Deploy MockPaymaster directly from erc4337-contracts (simpler, no dependencies)
4444
echo ""
45-
echo "📦 Deploying TestPaymaster..."
46-
PAYMASTER_OUTPUT=$(cd "$WORKSPACE_ROOT/examples/demo-app/smart-contracts" && forge script DeployPaymaster.s.sol:DeployPaymaster --rpc-url "$RPC_URL" --broadcast --private-key 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 2>&1)
45+
echo "📦 Deploying MockPaymaster..."
46+
PAYMASTER=$(cd "$CONTRACTS_DIR" && forge create test/mocks/MockPaymaster.sol:MockPaymaster --rpc-url "$RPC_URL" --private-key 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 2>&1 | grep "Deployed to:" | awk '{print $3}')
4747

48-
echo "$PAYMASTER_OUTPUT"
49-
50-
PAYMASTER=$(echo "$PAYMASTER_OUTPUT" | grep "TestPaymaster:" | awk '{print $2}')
48+
echo "MockPaymaster deployed to: $PAYMASTER"
5149

5250
# Fund the paymaster with ETH from Anvil account #0 (has plenty of ETH)
5351
echo ""
@@ -76,7 +74,7 @@ echo " GuardianExecutor: $GUARDIAN_EXECUTOR"
7674
echo " ModularSmartAccount impl: $ACCOUNT_IMPL"
7775
echo " UpgradeableBeacon: $BEACON"
7876
echo " MSAFactory: $FACTORY"
79-
echo " TestPaymaster: $PAYMASTER"
77+
echo " MockPaymaster: $PAYMASTER"
8078

8179
# Create contracts-anvil.json
8280
echo ""
@@ -96,6 +94,7 @@ cat > contracts-anvil.json << EOF
9694
"beacon": "$BEACON",
9795
"factory": "$FACTORY",
9896
"testPaymaster": "$PAYMASTER",
97+
"mockPaymaster": "$PAYMASTER",
9998
"entryPoint": "0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108",
10099
"bundlerUrl": "http://localhost:4337"
101100
}

examples/demo-app/smart-contracts/DeployPaymaster.s.sol

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/demo-app/smart-contracts/TestPaymaster.sol

Lines changed: 0 additions & 45 deletions
This file was deleted.

examples/demo-app/smart-contracts/foundry.toml

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)