Skip to content

Commit f325487

Browse files
committed
fix: addresses and scripts
tested locally
1 parent 34d840b commit f325487

File tree

5 files changed

+139
-36
lines changed

5 files changed

+139
-36
lines changed

.github/workflows/deploy-dawn-mainnet.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,20 @@ jobs:
7676
echo "contracts=$(cat ../auth-server/stores/dawn-mainnet.json)" >> $GITHUB_OUTPUT
7777
working-directory: packages/contracts
7878

79-
- name: Initialize OIDC Key Registry with Google keys
79+
- name: Verify contracts on block explorer
8080
env:
81-
WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }}
81+
WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }}
8282
run: |
83-
pnpm hardhat run scripts/add-google-keys.ts --network dawnMainnet
83+
# Verify all deployed contracts on the block explorer
84+
echo "🔍 Verifying contracts on Dawn Mainnet block explorer..."
85+
pnpm hardhat verify-all --network dawnMainnet --file ../auth-server/stores/dawn-mainnet.json || echo "⚠️ Verification failed or already verified"
8486
working-directory: packages/contracts
8587

8688
- name: Verify deployment
8789
env:
8890
WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }}
8991
run: |
90-
node verify-dawn-deployment.js
91-
working-directory: packages/contracts
92+
node scripts/verify-dawn-deployment.js
9293
9394
- name: Upload deployment artifacts
9495
uses: actions/upload-artifact@v4
@@ -113,14 +114,14 @@ jobs:
113114
114115
| Contract | Address |
115116
|----------|---------|
116-
| Factory | \`${contracts.accountFactory}\` |
117-
| WebAuthn Validator | \`${contracts.passkey}\` |
118-
| Session Validator | \`${contracts.session}\` |
117+
| Factory | \`${contracts.factory}\` |
118+
| WebAuthn Validator | \`${contracts.webauthnValidator}\` |
119+
| Session Validator | \`${contracts.sessionValidator}\` |
120+
| EOA Validator | \`${contracts.eoaValidator}\` |
121+
| Guardian Executor | \`${contracts.guardianExecutor}\` |
119122
| Beacon | \`${contracts.beacon}\` |
120-
| Guardian Recovery | \`${contracts.recovery}\` |
121-
| OIDC Recovery | \`${contracts.recoveryOidc}\` |
122-
| OIDC Key Registry | \`${contracts.oidcKeyRegistry}\` |
123-
| Paymaster | \`${contracts.accountPaymaster}\` |
123+
| Account Implementation | \`${contracts.accountImplementation}\` |
124+
| Entry Point | \`${contracts.entryPoint}\` |
124125
125126
### Next Steps
126127
1. Add these addresses to \`packages/auth-server/stores/client.ts\`
@@ -140,6 +141,8 @@ jobs:
140141
needs: deploy-contracts
141142
if: ${{ github.event.inputs.deploy_bundler == 'true' }}
142143
runs-on: ubuntu-latest
144+
permissions:
145+
contents: read
143146
steps:
144147
- uses: actions/checkout@v4
145148

@@ -152,6 +155,8 @@ jobs:
152155
needs: deploy-contracts
153156
if: ${{ github.event.inputs.deploy_auth_server == 'true' }}
154157
runs-on: ubuntu-latest
158+
permissions:
159+
contents: read
155160
steps:
156161
- uses: actions/checkout@v4
157162

packages/auth-server/stores/client.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,13 @@ export const contractsByChain: Record<SupportedChainId, ChainContracts> = {
103103
beacon: "0x1D779D791B55a093dE60da664C3F301a87f96C62",
104104
},
105105
[dawnMainnet.id]: {
106-
eoaValidator: "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
107-
webauthnValidator: "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
108-
sessionValidator: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
109-
factory: "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
110106
bundlerUrl: "https://bundler-api.dawn-mainnet.zksync.io", // Update with actual bundler URL when available
111-
beacon: "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
112-
guardianExecutor: "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
113-
accountPaymaster: "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1", // MockPaymaster
107+
eoaValidator: "0x6f9861381E67DA7B26E7112cb1098027DD9e3dc6",
108+
webauthnValidator: "0xe11bCfC99754CA38e1c0b0EE48E1C54C9e5B006B",
109+
sessionValidator: "0x8Bd9da9021734fa962a57900ef6d626531158419",
110+
guardianExecutor: "0xA1454A0cE96A52A3c8082675FE8C8Be7D620eF0E",
111+
beacon: "0xF0a5f0f274aAfd2cA649a3B00b1d9FA22BD7d39A",
112+
factory: "0x6F652864bDe910565beA169B89e133d70e2A9770",
114113
},
115114
};
116115

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"eoaValidator": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
3-
"sessionValidator": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
4-
"webauthnValidator": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
5-
"guardianExecutor": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
6-
"accountImplementation": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
7-
"beacon": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
8-
"factory": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
9-
"entryPoint": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE"
2+
"eoaValidator": "0x6f9861381E67DA7B26E7112cb1098027DD9e3dc6",
3+
"webauthnValidator": "0xe11bCfC99754CA38e1c0b0EE48E1C54C9e5B006B",
4+
"sessionValidator": "0x8Bd9da9021734fa962a57900ef6d626531158419",
5+
"guardianExecutor": "0xA1454A0cE96A52A3c8082675FE8C8Be7D620eF0E",
6+
"accountImplementation": "0x223406537f502d3dC3Da23804b2c9F0E635267ad",
7+
"beacon": "0xF0a5f0f274aAfd2cA649a3B00b1d9FA22BD7d39A",
8+
"factory": "0x6F652864bDe910565beA169B89e133d70e2A9770",
9+
"entryPoint": "0x0000000071727De22E5E9d8BAf0edAc6f37da032"
1010
}

scripts/deploy-dawn-mainnet.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,6 @@ pnpm hardhat deploy \
6868
echo "✅ Contracts deployed"
6969
echo ""
7070

71-
# Initialize OIDC Key Registry
72-
echo "🔑 Initializing OIDC Key Registry with Google keys..."
73-
ORIGINAL_WALLET=$WALLET_PRIVATE_KEY
74-
export WALLET_PRIVATE_KEY=$KEY_REGISTRY_OWNER_PRIVATE_KEY
75-
pnpm hardhat run scripts/add-google-keys.ts --network dawnMainnet
76-
export WALLET_PRIVATE_KEY=$ORIGINAL_WALLET
77-
echo "✅ OIDC Key Registry initialized"
78-
echo ""
79-
8071
# Verify deployment
8172
echo "🔍 Verifying deployment..."
8273
export WALLET_PRIVATE_KEY=$ORIGINAL_WALLET

scripts/verify-dawn-deployment.js

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/**
2+
* Verification script for Dawn Mainnet deployment
3+
* Checks that all contracts are deployed correctly and accessible
4+
*/
5+
6+
import { ethers } from "ethers";
7+
import fs from "fs";
8+
import path from "path";
9+
import { fileURLToPath } from "url";
10+
import { Provider, Wallet } from "zksync-ethers";
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
14+
15+
const DAWN_MAINNET_RPC = "https://zksync-os-mainnet-dawn.zksync.io";
16+
const DEPLOYMENT_FILE = path.join(__dirname, "../packages/auth-server/stores/dawn-mainnet.json");
17+
18+
async function main() {
19+
console.log("🔍 Verifying Dawn Mainnet Deployment...\n");
20+
21+
// Check if deployment file exists
22+
if (!fs.existsSync(DEPLOYMENT_FILE)) {
23+
throw new Error(`Deployment file not found: ${DEPLOYMENT_FILE}`);
24+
}
25+
26+
const contracts = JSON.parse(fs.readFileSync(DEPLOYMENT_FILE, "utf8"));
27+
const provider = new Provider(DAWN_MAINNET_RPC);
28+
29+
console.log("📋 Checking deployed contracts:\n");
30+
31+
const contractNames = {
32+
factory: "Factory",
33+
webauthnValidator: "WebAuthn Validator",
34+
sessionValidator: "Session Validator",
35+
eoaValidator: "EOA Validator",
36+
guardianExecutor: "Guardian Executor",
37+
beacon: "Beacon",
38+
accountImplementation: "Account Implementation",
39+
entryPoint: "Entry Point",
40+
};
41+
42+
let allValid = true;
43+
44+
for (const [key, name] of Object.entries(contractNames)) {
45+
const address = contracts[key];
46+
if (!address) {
47+
console.log(`❌ ${name}: NOT DEPLOYED`);
48+
allValid = false;
49+
continue;
50+
}
51+
52+
try {
53+
const code = await provider.getCode(address);
54+
if (code === "0x" || code === "0x0") {
55+
console.log(`❌ ${name}: No code at ${address}`);
56+
allValid = false;
57+
} else {
58+
console.log(`✅ ${name}: ${address}`);
59+
}
60+
} catch (error) {
61+
console.log(`❌ ${name}: Error checking ${address} - ${error.message}`);
62+
allValid = false;
63+
}
64+
}
65+
66+
console.log("\n📊 Network Information:");
67+
const blockNumber = await provider.getBlockNumber();
68+
console.log(` Current block: ${blockNumber}`);
69+
70+
if (process.env.WALLET_PRIVATE_KEY) {
71+
const wallet = new Wallet(process.env.WALLET_PRIVATE_KEY, provider);
72+
const balance = await wallet.getBalance();
73+
console.log(` Deployer balance: ${ethers.formatEther(balance)} ETH`);
74+
}
75+
76+
// Check paymaster balance if deployed
77+
if (contracts.accountPaymaster) {
78+
try {
79+
const paymasterBalance = await provider.getBalance(contracts.accountPaymaster);
80+
console.log(` Paymaster balance: ${ethers.formatEther(paymasterBalance)} ETH`);
81+
82+
if (paymasterBalance === 0n) {
83+
console.log(`\n⚠️ Warning: Paymaster has zero balance. Fund it to enable sponsored transactions.`);
84+
}
85+
} catch (error) {
86+
console.log(` ⚠️ Could not check paymaster balance: ${error.message}`);
87+
}
88+
}
89+
90+
if (!allValid) {
91+
console.log("\n❌ Deployment verification FAILED");
92+
process.exit(1);
93+
}
94+
95+
console.log("\n✅ Deployment verification PASSED");
96+
console.log("\n📝 Next steps:");
97+
console.log("1. Add these contract addresses to packages/auth-server/stores/client.ts");
98+
console.log("2. If paymaster balance is low, fund it with: pnpm hardhat fund-paymaster --network dawnMainnet");
99+
console.log("3. Test account creation and transactions");
100+
console.log("4. Deploy bundler service with these contract addresses");
101+
}
102+
103+
main()
104+
.then(() => process.exit(0))
105+
.catch((error) => {
106+
console.error("\n❌ Error:", error.message);
107+
process.exit(1);
108+
});

0 commit comments

Comments
 (0)