|
1 | 1 | name: "Deploy Dawn Mainnet Contracts" |
2 | 2 |
|
| 3 | +permissions: |
| 4 | + contents: read |
| 5 | + |
3 | 6 | on: |
4 | | - workflow_dispatch: |
5 | | - inputs: |
6 | | - fund_amount: |
7 | | - description: "Amount of ETH to fund the paymaster (e.g., 0.1)" |
8 | | - required: false |
9 | | - default: "0" |
10 | | - deploy_bundler: |
11 | | - description: "Deploy bundler service" |
12 | | - type: boolean |
13 | | - required: false |
14 | | - default: false |
15 | | - deploy_auth_server: |
16 | | - description: "Deploy auth server" |
17 | | - type: boolean |
18 | | - required: false |
19 | | - default: false |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + fund_amount: |
| 10 | + description: "Amount of ETH to fund the paymaster (e.g., 0.1)" |
| 11 | + required: false |
| 12 | + default: "0" |
| 13 | + deploy_bundler: |
| 14 | + description: "Deploy bundler service" |
| 15 | + type: boolean |
| 16 | + required: false |
| 17 | + default: false |
| 18 | + deploy_auth_server: |
| 19 | + description: "Deploy auth server" |
| 20 | + type: boolean |
| 21 | + required: false |
| 22 | + default: false |
20 | 23 |
|
21 | 24 | env: |
22 | | - HUSKY: 0 |
23 | | - CI: true |
| 25 | + HUSKY: 0 |
| 26 | + CI: true |
24 | 27 |
|
25 | 28 | jobs: |
26 | | - deploy-contracts: |
27 | | - runs-on: ubuntu-latest |
28 | | - outputs: |
29 | | - contracts: ${{ steps.deploy.outputs.contracts }} |
30 | | - steps: |
31 | | - - uses: actions/checkout@v4 |
32 | | - with: |
33 | | - submodules: recursive |
34 | | - |
35 | | - - name: Setup pnpm |
36 | | - uses: pnpm/action-setup@v4 |
37 | | - with: |
38 | | - version: 9.11.0 |
39 | | - |
40 | | - - name: Use Node.js |
41 | | - uses: actions/setup-node@v4 |
42 | | - with: |
43 | | - node-version: lts/Iron |
44 | | - cache: "pnpm" |
45 | | - |
46 | | - - name: Install dependencies |
47 | | - run: pnpm install -r --frozen-lockfile |
48 | | - |
49 | | - - name: Install contract dependencies |
50 | | - run: pnpm install -r --frozen-lockfile |
51 | | - working-directory: packages/contracts |
52 | | - |
53 | | - - name: Build contracts |
54 | | - run: pnpm build |
55 | | - working-directory: packages/contracts |
56 | | - |
57 | | - - name: Deploy contracts to Dawn Mainnet |
58 | | - id: deploy |
59 | | - env: |
60 | | - WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} |
61 | | - KEY_REGISTRY_OWNER_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} |
62 | | - run: | |
63 | | - # Deploy all contracts |
64 | | - pnpm hardhat deploy \ |
65 | | - --network dawnMainnet \ |
66 | | - --file ../auth-server/stores/dawn-mainnet.json \ |
67 | | - --fund ${{ github.event.inputs.fund_amount }} \ |
68 | | - --keyregistryowner $KEY_REGISTRY_OWNER_PRIVATE_KEY |
69 | | -
|
70 | | - # Read the deployed contracts |
71 | | - echo "contracts=$(cat ../auth-server/stores/dawn-mainnet.json)" >> $GITHUB_OUTPUT |
72 | | - working-directory: packages/contracts |
73 | | - |
74 | | - - name: Initialize OIDC Key Registry with Google keys |
75 | | - env: |
76 | | - WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} |
77 | | - run: | |
78 | | - pnpm hardhat run scripts/add-google-keys.ts --network dawnMainnet |
79 | | - working-directory: packages/contracts |
80 | | - |
81 | | - - name: Verify deployment |
82 | | - env: |
83 | | - WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} |
84 | | - run: | |
85 | | - node verify-dawn-deployment.js |
86 | | - working-directory: packages/contracts |
87 | | - |
88 | | - - name: Upload deployment artifacts |
89 | | - uses: actions/upload-artifact@v4 |
90 | | - with: |
91 | | - name: dawn-mainnet-deployment |
92 | | - path: packages/auth-server/stores/dawn-mainnet.json |
93 | | - retention-days: 90 |
94 | | - |
95 | | - - name: Comment deployment info on commit |
96 | | - uses: actions/github-script@v7 |
97 | | - with: |
98 | | - script: | |
99 | | - const contracts = JSON.parse('${{ steps.deploy.outputs.contracts }}'); |
100 | | - const comment = ` |
101 | | - ## 🚀 Dawn Mainnet Deployment Complete |
102 | | -
|
103 | | - **Network:** Dawn Mainnet (Chain ID: 30715) |
104 | | - **RPC URL:** https://zksync-os-mainnet-dawn.zksync.io |
105 | | - **Block Explorer:** https://zksync-os-mainnet-dawn.staging-scan-v2.zksync.dev |
106 | | -
|
107 | | - ### Deployed Contracts |
108 | | -
|
109 | | - | Contract | Address | |
110 | | - |----------|---------| |
111 | | - | Factory | \`${contracts.accountFactory}\` | |
112 | | - | WebAuthn Validator | \`${contracts.passkey}\` | |
113 | | - | Session Validator | \`${contracts.session}\` | |
114 | | - | Beacon | \`${contracts.beacon}\` | |
115 | | - | Guardian Recovery | \`${contracts.recovery}\` | |
116 | | - | OIDC Recovery | \`${contracts.recoveryOidc}\` | |
117 | | - | OIDC Key Registry | \`${contracts.oidcKeyRegistry}\` | |
118 | | - | Paymaster | \`${contracts.accountPaymaster}\` | |
119 | | -
|
120 | | - ### Next Steps |
121 | | - 1. Add these addresses to \`packages/auth-server/stores/client.ts\` |
122 | | - 2. Update bundler configuration if deploying bundler service |
123 | | - 3. Deploy auth-server if needed |
124 | | - 4. Test account creation and transactions |
125 | | - `; |
126 | | -
|
127 | | - github.rest.repos.createCommitComment({ |
128 | | - owner: context.repo.owner, |
129 | | - repo: context.repo.repo, |
130 | | - commit_sha: context.sha, |
131 | | - body: comment |
132 | | - }); |
133 | | -
|
134 | | - deploy-bundler: |
135 | | - needs: deploy-contracts |
136 | | - if: ${{ github.event.inputs.deploy_bundler == 'true' }} |
137 | | - runs-on: ubuntu-latest |
138 | | - steps: |
139 | | - - uses: actions/checkout@v4 |
140 | | - |
141 | | - - name: Deploy Bundler Service |
142 | | - run: | |
143 | | - echo "Bundler deployment would happen here" |
144 | | - # TODO: Add bundler deployment steps when ready |
145 | | -
|
146 | | - deploy-auth-server: |
147 | | - needs: deploy-contracts |
148 | | - if: ${{ github.event.inputs.deploy_auth_server == 'true' }} |
149 | | - runs-on: ubuntu-latest |
150 | | - steps: |
151 | | - - uses: actions/checkout@v4 |
152 | | - |
153 | | - - name: Setup pnpm |
154 | | - uses: pnpm/action-setup@v4 |
155 | | - with: |
156 | | - version: 9.11.0 |
157 | | - |
158 | | - - name: Use Node.js |
159 | | - uses: actions/setup-node@v4 |
160 | | - with: |
161 | | - node-version: lts/Iron |
162 | | - cache: "pnpm" |
163 | | - |
164 | | - - name: Download deployment artifacts |
165 | | - uses: actions/download-artifact@v4 |
166 | | - with: |
167 | | - name: dawn-mainnet-deployment |
168 | | - path: packages/auth-server/stores/ |
169 | | - |
170 | | - - name: Install dependencies |
171 | | - run: pnpm install -r --frozen-lockfile |
172 | | - |
173 | | - - name: Build auth server |
174 | | - run: pnpm nx build auth-server |
175 | | - env: |
176 | | - NUXT_PUBLIC_CHAIN_ID: 30715 |
177 | | - |
178 | | - - name: Deploy to Firebase (or other hosting) |
179 | | - run: | |
180 | | - echo "Auth server deployment would happen here" |
181 | | - # TODO: Configure Firebase or other hosting for Dawn Mainnet |
| 29 | + deploy-contracts: |
| 30 | + permissions: |
| 31 | + contents: write |
| 32 | + runs-on: ubuntu-latest |
| 33 | + outputs: |
| 34 | + contracts: ${{ steps.deploy.outputs.contracts }} |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: recursive |
| 39 | + |
| 40 | + - name: Setup pnpm |
| 41 | + uses: pnpm/action-setup@v4 |
| 42 | + with: |
| 43 | + version: 9.11.0 |
| 44 | + |
| 45 | + - name: Use Node.js |
| 46 | + uses: actions/setup-node@v4 |
| 47 | + with: |
| 48 | + node-version: lts/Iron |
| 49 | + cache: "pnpm" |
| 50 | + |
| 51 | + - name: Install dependencies |
| 52 | + run: pnpm install -r --frozen-lockfile |
| 53 | + |
| 54 | + - name: Install contract dependencies |
| 55 | + run: pnpm install -r --frozen-lockfile |
| 56 | + working-directory: packages/contracts |
| 57 | + |
| 58 | + - name: Build contracts |
| 59 | + run: pnpm build |
| 60 | + working-directory: packages/contracts |
| 61 | + |
| 62 | + - name: Deploy contracts to Dawn Mainnet |
| 63 | + id: deploy |
| 64 | + env: |
| 65 | + WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} |
| 66 | + KEY_REGISTRY_OWNER_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} |
| 67 | + run: | |
| 68 | + # Deploy all contracts |
| 69 | + pnpm hardhat deploy \ |
| 70 | + --network dawnMainnet \ |
| 71 | + --file ../auth-server/stores/dawn-mainnet.json \ |
| 72 | + --fund ${{ github.event.inputs.fund_amount }} \ |
| 73 | + --keyregistryowner $KEY_REGISTRY_OWNER_PRIVATE_KEY |
| 74 | +
|
| 75 | + # Read the deployed contracts |
| 76 | + echo "contracts=$(cat ../auth-server/stores/dawn-mainnet.json)" >> $GITHUB_OUTPUT |
| 77 | + working-directory: packages/contracts |
| 78 | + |
| 79 | + - name: Initialize OIDC Key Registry with Google keys |
| 80 | + env: |
| 81 | + WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} |
| 82 | + run: | |
| 83 | + pnpm hardhat run scripts/add-google-keys.ts --network dawnMainnet |
| 84 | + working-directory: packages/contracts |
| 85 | + |
| 86 | + - name: Verify deployment |
| 87 | + env: |
| 88 | + WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} |
| 89 | + run: | |
| 90 | + node verify-dawn-deployment.js |
| 91 | + working-directory: packages/contracts |
| 92 | + |
| 93 | + - name: Upload deployment artifacts |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: dawn-mainnet-deployment |
| 97 | + path: packages/auth-server/stores/dawn-mainnet.json |
| 98 | + retention-days: 90 |
| 99 | + |
| 100 | + - name: Comment deployment info on commit |
| 101 | + uses: actions/github-script@v7 |
| 102 | + with: |
| 103 | + script: | |
| 104 | + const contracts = JSON.parse('${{ steps.deploy.outputs.contracts }}'); |
| 105 | + const comment = ` |
| 106 | + ## 🚀 Dawn Mainnet Deployment Complete |
| 107 | +
|
| 108 | + **Network:** Dawn Mainnet (Chain ID: 30715) |
| 109 | + **RPC URL:** https://zksync-os-mainnet-dawn.zksync.io |
| 110 | + **Block Explorer:** https://zksync-os-mainnet-dawn.staging-scan-v2.zksync.dev |
| 111 | +
|
| 112 | + ### Deployed Contracts |
| 113 | +
|
| 114 | + | Contract | Address | |
| 115 | + |----------|---------| |
| 116 | + | Factory | \`${contracts.accountFactory}\` | |
| 117 | + | WebAuthn Validator | \`${contracts.passkey}\` | |
| 118 | + | Session Validator | \`${contracts.session}\` | |
| 119 | + | Beacon | \`${contracts.beacon}\` | |
| 120 | + | Guardian Recovery | \`${contracts.recovery}\` | |
| 121 | + | OIDC Recovery | \`${contracts.recoveryOidc}\` | |
| 122 | + | OIDC Key Registry | \`${contracts.oidcKeyRegistry}\` | |
| 123 | + | Paymaster | \`${contracts.accountPaymaster}\` | |
| 124 | +
|
| 125 | + ### Next Steps |
| 126 | + 1. Add these addresses to \`packages/auth-server/stores/client.ts\` |
| 127 | + 2. Update bundler configuration if deploying bundler service |
| 128 | + 3. Deploy auth-server if needed |
| 129 | + 4. Test account creation and transactions |
| 130 | + `; |
| 131 | +
|
| 132 | + github.rest.repos.createCommitComment({ |
| 133 | + owner: context.repo.owner, |
| 134 | + repo: context.repo.repo, |
| 135 | + commit_sha: context.sha, |
| 136 | + body: comment |
| 137 | + }); |
| 138 | +
|
| 139 | + deploy-bundler: |
| 140 | + needs: deploy-contracts |
| 141 | + if: ${{ github.event.inputs.deploy_bundler == 'true' }} |
| 142 | + runs-on: ubuntu-latest |
| 143 | + steps: |
| 144 | + - uses: actions/checkout@v4 |
| 145 | + |
| 146 | + - name: Deploy Bundler Service |
| 147 | + run: | |
| 148 | + echo "Bundler deployment would happen here" |
| 149 | + # TODO: Add bundler deployment steps when ready |
| 150 | +
|
| 151 | + deploy-auth-server: |
| 152 | + needs: deploy-contracts |
| 153 | + if: ${{ github.event.inputs.deploy_auth_server == 'true' }} |
| 154 | + runs-on: ubuntu-latest |
| 155 | + steps: |
| 156 | + - uses: actions/checkout@v4 |
| 157 | + |
| 158 | + - name: Setup pnpm |
| 159 | + uses: pnpm/action-setup@v4 |
| 160 | + with: |
| 161 | + version: 9.11.0 |
| 162 | + |
| 163 | + - name: Use Node.js |
| 164 | + uses: actions/setup-node@v4 |
| 165 | + with: |
| 166 | + node-version: lts/Iron |
| 167 | + cache: "pnpm" |
| 168 | + |
| 169 | + - name: Download deployment artifacts |
| 170 | + uses: actions/download-artifact@v4 |
| 171 | + with: |
| 172 | + name: dawn-mainnet-deployment |
| 173 | + path: packages/auth-server/stores/ |
| 174 | + |
| 175 | + - name: Install dependencies |
| 176 | + run: pnpm install -r --frozen-lockfile |
| 177 | + |
| 178 | + - name: Build auth server |
| 179 | + run: pnpm nx build auth-server |
| 180 | + env: |
| 181 | + NUXT_PUBLIC_CHAIN_ID: 30715 |
| 182 | + |
| 183 | + - name: Deploy to Firebase (or other hosting) |
| 184 | + run: | |
| 185 | + echo "Auth server deployment would happen here" |
| 186 | + # TODO: Configure Firebase or other hosting for Dawn Mainnet |
0 commit comments