-
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 9 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
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 |
|---|---|---|
|
|
@@ -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": "0x6f9861381E67DA7B26E7112cb1098027DD9e3dc6", | ||
| "webauthnValidator": "0xe11bCfC99754CA38e1c0b0EE48E1C54C9e5B006B", | ||
| "sessionValidator": "0x8Bd9da9021734fa962a57900ef6d626531158419", | ||
| "guardianExecutor": "0xA1454A0cE96A52A3c8082675FE8C8Be7D620eF0E", | ||
| "accountImplementation": "0x223406537f502d3dC3Da23804b2c9F0E635267ad", | ||
| "beacon": "0xF0a5f0f274aAfd2cA649a3B00b1d9FA22BD7d39A", | ||
| "factory": "0x6F652864bDe910565beA169B89e133d70e2A9770", | ||
| "entryPoint": "0x0000000071727De22E5E9d8BAf0edAc6f37da032" | ||
| } |
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,160 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Dawn Mainnet Pre-Deployment Checklist | ||
| # Run this before deploying to ensure everything is ready | ||
|
|
||
| set -e | ||
|
|
||
| echo "🔍 Dawn Mainnet Pre-Deployment Checklist" | ||
| echo "=========================================" | ||
| echo "" | ||
|
|
||
| ISSUES=0 | ||
|
|
||
| # Check 1: Environment variables | ||
| echo "1. Checking environment variables..." | ||
| if [ -z "$WALLET_PRIVATE_KEY" ]; then | ||
| echo " ❌ WALLET_PRIVATE_KEY not set" | ||
| ISSUES=$((ISSUES + 1)) | ||
| else | ||
| echo " ✅ WALLET_PRIVATE_KEY set" | ||
| fi | ||
|
|
||
| if [ -z "$KEY_REGISTRY_OWNER_PRIVATE_KEY" ]; then | ||
| echo " ❌ KEY_REGISTRY_OWNER_PRIVATE_KEY not set" | ||
| ISSUES=$((ISSUES + 1)) | ||
| else | ||
| echo " ✅ KEY_REGISTRY_OWNER_PRIVATE_KEY set" | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 2: Cast CLI installed | ||
| echo "2. Checking for cast CLI..." | ||
| if command -v cast &> /dev/null; then | ||
| echo " ✅ cast installed ($(cast --version | head -n1))" | ||
| else | ||
| echo " ❌ cast not installed" | ||
| echo " Install with: curl -L https://foundry.paradigm.xyz | bash && foundryup" | ||
| ISSUES=$((ISSUES + 1)) | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 3: pnpm installed | ||
| echo "3. Checking for pnpm..." | ||
| if command -v pnpm &> /dev/null; then | ||
| echo " ✅ pnpm installed ($(pnpm --version))" | ||
| else | ||
| echo " ❌ pnpm not installed" | ||
| echo " Install with: npm install -g pnpm" | ||
| ISSUES=$((ISSUES + 1)) | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 4: Network connectivity | ||
| echo "4. Checking Dawn Mainnet connectivity..." | ||
| if curl -s -X POST -H "Content-Type: application/json" \ | ||
| --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \ | ||
| https://zksync-os-mainnet-dawn.zksync.io | grep -q "result"; then | ||
| echo " ✅ Dawn Mainnet RPC accessible" | ||
| else | ||
| echo " ❌ Cannot connect to Dawn Mainnet RPC" | ||
| ISSUES=$((ISSUES + 1)) | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 5: Deployer balance | ||
| if [ ! -z "$WALLET_PRIVATE_KEY" ]; then | ||
| echo "5. Checking deployer wallet balance..." | ||
| DEPLOYER_ADDRESS=$(cast wallet address --private-key $WALLET_PRIVATE_KEY 2>/dev/null || echo "") | ||
cpb8010 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if [ ! -z "$DEPLOYER_ADDRESS" ]; then | ||
| echo " 📍 Deployer address: $DEPLOYER_ADDRESS" | ||
|
|
||
| BALANCE=$(cast balance $DEPLOYER_ADDRESS --rpc-url https://zksync-os-mainnet-dawn.zksync.io 2>/dev/null || echo "0") | ||
| BALANCE_ETH=$(cast --to-unit $BALANCE ether 2>/dev/null || echo "0") | ||
|
|
||
| echo " 💰 Balance: $BALANCE_ETH ETH" | ||
|
|
||
| # Check if balance is sufficient (at least 0.5 ETH recommended) | ||
| BALANCE_GWEI=$(cast --to-unit $BALANCE gwei 2>/dev/null | cut -d. -f1) | ||
| if [ "$BALANCE_GWEI" -lt 500000000 ]; then | ||
| echo " ⚠️ Low balance. Recommended: at least 1 ETH" | ||
| echo " Transfer ETH to: $DEPLOYER_ADDRESS" | ||
| ISSUES=$((ISSUES + 1)) | ||
| else | ||
| echo " ✅ Sufficient balance for deployment" | ||
| fi | ||
| else | ||
| echo " ❌ Invalid WALLET_PRIVATE_KEY" | ||
| ISSUES=$((ISSUES + 1)) | ||
| fi | ||
| else | ||
| echo "5. Skipping balance check (WALLET_PRIVATE_KEY not set)" | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 6: Key registry owner balance | ||
| if [ ! -z "$KEY_REGISTRY_OWNER_PRIVATE_KEY" ]; then | ||
| echo "6. Checking key registry owner wallet balance..." | ||
| OWNER_ADDRESS=$(cast wallet address --private-key $KEY_REGISTRY_OWNER_PRIVATE_KEY 2>/dev/null || echo "") | ||
cpb8010 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| if [ ! -z "$OWNER_ADDRESS" ]; then | ||
| echo " 📍 Owner address: $OWNER_ADDRESS" | ||
|
|
||
| BALANCE=$(cast balance $OWNER_ADDRESS --rpc-url https://zksync-os-mainnet-dawn.zksync.io 2>/dev/null || echo "0") | ||
| BALANCE_ETH=$(cast --to-unit $BALANCE ether 2>/dev/null || echo "0") | ||
|
|
||
| echo " 💰 Balance: $BALANCE_ETH ETH" | ||
|
|
||
| # Check if balance is sufficient (at least 0.01 ETH recommended) | ||
| BALANCE_GWEI=$(cast --to-unit $BALANCE gwei 2>/dev/null | cut -d. -f1) | ||
| if [ "$BALANCE_GWEI" -lt 10000000 ]; then | ||
| echo " ⚠️ Low balance. Recommended: at least 0.1 ETH" | ||
| echo " Transfer ETH to: $OWNER_ADDRESS" | ||
| ISSUES=$((ISSUES + 1)) | ||
| else | ||
| echo " ✅ Sufficient balance" | ||
| fi | ||
| else | ||
| echo " ❌ Invalid KEY_REGISTRY_OWNER_PRIVATE_KEY" | ||
| ISSUES=$((ISSUES + 1)) | ||
| fi | ||
| else | ||
| echo "6. Skipping owner balance check (KEY_REGISTRY_OWNER_PRIVATE_KEY not set)" | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 7: Contracts build | ||
| echo "7. Checking if contracts are built..." | ||
| if [ -d "packages/contracts/artifacts-zk" ]; then | ||
| echo " ✅ Contracts appear to be built" | ||
| else | ||
| echo " ⚠️ Contracts not built yet" | ||
| echo " Run: cd packages/contracts && pnpm build" | ||
| fi | ||
| echo "" | ||
|
|
||
| # Check 8: Dependencies installed | ||
| echo "8. Checking if dependencies are installed..." | ||
| if [ -d "node_modules" ] && [ -d "packages/contracts/node_modules" ]; then | ||
| echo " ✅ Dependencies installed" | ||
| else | ||
| echo " ⚠️ Dependencies not fully installed" | ||
| echo " Run: pnpm install -r" | ||
| fi | ||
| echo "" | ||
|
|
||
| # Summary | ||
| echo "=========================================" | ||
| if [ $ISSUES -eq 0 ]; then | ||
| echo "✅ All checks passed! Ready for deployment." | ||
| echo "" | ||
| echo "To deploy, run:" | ||
| echo " ./scripts/deploy-dawn-mainnet.sh" | ||
| exit 0 | ||
| else | ||
| echo "❌ Found $ISSUES issue(s). Please fix them before deploying." | ||
| echo "" | ||
| echo "Need help? See: docs/DAWN_MAINNET_DEPLOYMENT.md" | ||
| exit 1 | ||
| fi | ||
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.