-
Notifications
You must be signed in to change notification settings - Fork 18
Deployment and production front-end fixes #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
09eb1d7
feat: scripts and address for main net deploy
cpb8010 09c1003
feat: add addresses
cpb8010 2e01164
fix: remove appkit
cpb8010 329e249
fix: code review comments
cpb8010 dd22bb4
chore: cspell update for gwei
cpb8010 34d840b
Merge branch 'main' into main-net-deploy
cpb8010 f325487
fix: addresses and scripts
cpb8010 2c246ec
fix: update url to app config
cpb8010 28b33fc
fix: remove deployment workflow
cpb8010 1baca33
Merge branch 'main' into main-net-deploy
cpb8010 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| name: "Deploy Dawn Mainnet Contracts" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| fund_amount: | ||
| description: "Amount of ETH to fund the paymaster (e.g., 0.1)" | ||
| required: false | ||
| default: "0" | ||
| deploy_bundler: | ||
| description: "Deploy bundler service" | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
| deploy_auth_server: | ||
| description: "Deploy auth server" | ||
| type: boolean | ||
| required: false | ||
| default: false | ||
|
|
||
| env: | ||
| HUSKY: 0 | ||
| CI: true | ||
|
|
||
| jobs: | ||
| deploy-contracts: | ||
| permissions: | ||
| contents: write | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| contracts: ${{ steps.deploy.outputs.contracts }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.11.0 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/Iron | ||
| cache: "pnpm" | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install -r --frozen-lockfile | ||
|
|
||
| - name: Install contract dependencies | ||
| run: pnpm install -r --frozen-lockfile | ||
| working-directory: packages/contracts | ||
|
|
||
| - name: Build contracts | ||
| run: pnpm build | ||
| working-directory: packages/contracts | ||
|
|
||
| - name: Deploy contracts to Dawn Mainnet | ||
| id: deploy | ||
| env: | ||
| WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} | ||
| KEY_REGISTRY_OWNER_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} | ||
| run: | | ||
| # Deploy all contracts | ||
| pnpm hardhat deploy \ | ||
| --network dawnMainnet \ | ||
| --file ../auth-server/stores/dawn-mainnet.json \ | ||
| --fund ${{ github.event.inputs.fund_amount }} \ | ||
| --keyregistryowner $KEY_REGISTRY_OWNER_PRIVATE_KEY | ||
|
|
||
| # Read the deployed contracts | ||
| echo "contracts=$(cat ../auth-server/stores/dawn-mainnet.json)" >> $GITHUB_OUTPUT | ||
| working-directory: packages/contracts | ||
|
|
||
| - name: Initialize OIDC Key Registry with Google keys | ||
| env: | ||
| WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_KEY_REGISTRY_OWNER_PRIVATE_KEY }} | ||
| run: | | ||
| pnpm hardhat run scripts/add-google-keys.ts --network dawnMainnet | ||
| working-directory: packages/contracts | ||
|
|
||
| - name: Verify deployment | ||
| env: | ||
| WALLET_PRIVATE_KEY: ${{ secrets.DAWN_MAINNET_DEPLOYER_PRIVATE_KEY }} | ||
| run: | | ||
| node verify-dawn-deployment.js | ||
| working-directory: packages/contracts | ||
|
|
||
cpb8010 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - name: Upload deployment artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: dawn-mainnet-deployment | ||
| path: packages/auth-server/stores/dawn-mainnet.json | ||
| retention-days: 90 | ||
|
|
||
| - name: Comment deployment info on commit | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const contracts = JSON.parse('${{ steps.deploy.outputs.contracts }}'); | ||
| const comment = ` | ||
| ## 🚀 Dawn Mainnet Deployment Complete | ||
|
|
||
| **Network:** Dawn Mainnet (Chain ID: 30715) | ||
| **RPC URL:** https://zksync-os-mainnet-dawn.zksync.io | ||
| **Block Explorer:** https://zksync-os-mainnet-dawn.staging-scan-v2.zksync.dev | ||
|
|
||
| ### Deployed Contracts | ||
|
|
||
| | Contract | Address | | ||
| |----------|---------| | ||
| | Factory | \`${contracts.accountFactory}\` | | ||
| | WebAuthn Validator | \`${contracts.passkey}\` | | ||
| | Session Validator | \`${contracts.session}\` | | ||
| | Beacon | \`${contracts.beacon}\` | | ||
| | Guardian Recovery | \`${contracts.recovery}\` | | ||
| | OIDC Recovery | \`${contracts.recoveryOidc}\` | | ||
| | OIDC Key Registry | \`${contracts.oidcKeyRegistry}\` | | ||
| | Paymaster | \`${contracts.accountPaymaster}\` | | ||
cpb8010 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### Next Steps | ||
| 1. Add these addresses to \`packages/auth-server/stores/client.ts\` | ||
| 2. Update bundler configuration if deploying bundler service | ||
| 3. Deploy auth-server if needed | ||
| 4. Test account creation and transactions | ||
| `; | ||
|
|
||
| github.rest.repos.createCommitComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| commit_sha: context.sha, | ||
| body: comment | ||
| }); | ||
|
|
||
| deploy-bundler: | ||
| needs: deploy-contracts | ||
| if: ${{ github.event.inputs.deploy_bundler == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Deploy Bundler Service | ||
| run: | | ||
| echo "Bundler deployment would happen here" | ||
| # TODO: Add bundler deployment steps when ready | ||
|
|
||
| deploy-auth-server: | ||
| needs: deploy-contracts | ||
| if: ${{ github.event.inputs.deploy_auth_server == 'true' }} | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 9.11.0 | ||
|
|
||
| - name: Use Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: lts/Iron | ||
| cache: "pnpm" | ||
|
|
||
| - name: Download deployment artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: dawn-mainnet-deployment | ||
| path: packages/auth-server/stores/ | ||
|
|
||
| - name: Install dependencies | ||
| run: pnpm install -r --frozen-lockfile | ||
|
|
||
| - name: Build auth server | ||
| run: pnpm nx build auth-server | ||
| env: | ||
| NUXT_PUBLIC_CHAIN_ID: 30715 | ||
|
|
||
| - name: Deploy to Firebase (or other hosting) | ||
| run: | | ||
| echo "Auth server deployment would happen here" | ||
| # TODO: Configure Firebase or other hosting for Dawn Mainnet | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ ethereum | |
| sepolia | ||
| foundryup | ||
| unpermitted | ||
| gwei | ||
|
|
||
| // auth-server | ||
| oidc | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| import { createAppKit } from "@reown/appkit/vue"; | ||
|
|
||
| export default defineNuxtPlugin(async () => { | ||
| const { defaultChain } = useClientStore(); | ||
|
|
||
| // Dynamic import to ensure browser globals are available | ||
| const { WagmiAdapter } = await import("@reown/appkit-adapter-wagmi"); | ||
| const runtimeConfig = useRuntimeConfig(); | ||
|
|
||
| const projectId = runtimeConfig.public.appKitProjectId; | ||
| const origin = window.location.origin; | ||
|
|
||
| const metadata = { | ||
| name: "ZKsync SSO Auth Server", | ||
| description: "ZKsync SSO Auth Server", | ||
| url: origin, | ||
| icons: [new URL("/icon-512.png", origin).toString()], | ||
| }; | ||
|
|
||
| // Create plain chain object to avoid Viem Proxy issues | ||
| const plainChain = { | ||
| id: defaultChain.id, | ||
| name: defaultChain.name, | ||
| nativeCurrency: { | ||
| name: defaultChain.nativeCurrency.name, | ||
| symbol: defaultChain.nativeCurrency.symbol, | ||
| decimals: defaultChain.nativeCurrency.decimals, | ||
| }, | ||
| rpcUrls: { | ||
| default: { | ||
| http: [...defaultChain.rpcUrls.default.http], | ||
| }, | ||
| }, | ||
| blockExplorers: defaultChain.blockExplorers | ||
| ? { | ||
| default: { | ||
| name: defaultChain.blockExplorers.default.name, | ||
| url: defaultChain.blockExplorers.default.url, | ||
| }, | ||
| } | ||
| : undefined, | ||
| }; | ||
|
|
||
| const wagmiAdapter = new WagmiAdapter({ | ||
| networks: [plainChain], | ||
| projectId, | ||
| }); | ||
|
|
||
| createAppKit({ | ||
| adapters: [wagmiAdapter], | ||
| networks: [plainChain], | ||
| projectId, | ||
| metadata, | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "eoaValidator": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512", | ||
| "sessionValidator": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", | ||
| "webauthnValidator": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707", | ||
| "guardianExecutor": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853", | ||
| "accountImplementation": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6", | ||
| "beacon": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318", | ||
| "factory": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e", | ||
| "entryPoint": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE" | ||
cpb8010 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.