diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..7f70a886 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,29 @@ +name: CI +on: [push] + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set Node.js 18.x + uses: actions/setup-node@v4 + with: + node-version: 18.x + + - name: Run npm install + run: npm ci + + - name: Run Build Command + run: | + if [[ ${{ github.ref }} == 'refs/heads/main' ]]; then + npm run generate:node:nexus + elif [[ ${{ github.ref }} == 'refs/heads/preview' ]]; then + npm run generate:node:nexus + elif [[ ${{ github.ref }} == 'refs/heads/dev' ]]; then + npm run generate:node:nexus-sepolia + else + echo "No specific build command for this branch." + fi diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml deleted file mode 100644 index ca2f9afd..00000000 --- a/.github/workflows/e2e.yml +++ /dev/null @@ -1,164 +0,0 @@ -name: Testing Portal using e2e -on: - workflow_call: - secrets: - ALLURE_TOKEN: - description: 'A token passed from the caller workflow' - required: true - inputs: - environmentTags: - type: string - default: '' - required: false - targetUrl: - type: string - default: 'https://staging-portal.zksync.dev/' - required: true - network: - type: string - default: 'Goerli' - required: true - publish_to_allure: #Here we define the variable that can be overwritten by caller workflow - type: boolean - description: "Publish test results to allure" - default: true - required: false - -env: - ALLURE_TOKEN: ${{ secrets.ALLURE_TOKEN }} - ALLURE_SEARCH_REQUEST: '[{"id":"name","type":"string","value":"#${{ github.run_number }}"}]' - ALLURE_BASIC_TAGS: "${{ github.head_ref }}, #${{ github.run_number }}, ${{ github.event.pull_request.title }}" - ALLURE_PROJECT_ID: ${{ vars.ALLURE_PROJECT_ID }} - ALLURE_ENDPOINT: ${{ vars.ALLURE_ENDPOINT }} - - E2E_WALLET_SECRET_PK: ${{ secrets.E2E_WALLET_SECRET_PK }} - E2E_WALLET_SALT_IV: ${{ secrets.E2E_WALLET_SALT_IV }} - E2E_WALLET_PASSWORD_MM: ${{ secrets.E2E_WALLET_PASSWORD_MM }} - - E2E_WALLET_1_MAIN: ${{ vars.E2E_WALLET_1_MAIN }} - E2E_WALLET_2_SECOND: ${{ vars.E2E_WALLET_2_SECOND }} - E2E_WALLET_0_EMPTY: ${{ vars.E2E_WALLET_0_EMPTY }} - - E2E_WALLET_1_MAIN_PUB_KEY: ${{ vars.E2E_WALLET_1_MAIN_PUB_KEY }} - E2E_WALLET_2_SECOND_PUB_KEY: ${{ vars.E2E_WALLET_2_SECOND_PUB_KEY }} - E2E_WALLET_0_EMPTY_PUB_KEY: ${{ vars.E2E_WALLET_0_EMPTY_PUB_KEY }} - - -jobs: - e2e: - runs-on: [ matterlabs-ci-runner ] - strategy: - fail-fast: false - max-parallel: 20 - matrix: - command: ["xvfb-run --auto-servernum --server-args '-screen 0 1920x1080x24' npx cucumber-js --tags "] - tags: [ - "@artifacts and @bridge", - "@artifacts and @contactsPage", - "@artifacts and @depositPage", - "@artifacts and @transferPage", - "@artifacts and @header", - "@artifacts and @menuItems", - "@artifacts and @upperNavigationMenu", - "@artifacts and @contactsPage", - "@artifacts and @withdraw", - "@navigation and not @emptyWallet", - "@redirection and @resetAllowance", - "@artifacts and @various", - "@artifacts and @transactionsItems", - "@transactions and @deposit and @blockchain", - "@transactions and @deposit and @noblockchain", - "@transactions and @deposit and @emptyWallet", - "@transactions and @deposit and @resetAllowance", - "@transactions and @withdraw", - "@various and @emptyWallet", - "@actions and @contacts" - ] - - name: '${{ matrix.tags }}' - - container: - image: mcr.microsoft.com/playwright:v1.35.1-focal - options: --user root - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Create metamask extension folder - run: | - mkdir -p ./tests/e2e/src/support/extension - chown -R root ./ - chmod 777 -R ./tests/e2e/src/support/extension - - - name: Install Dependencies - run: | - npm i --no-audit - - - name: Install Metamask extension - run: | - echo "cd to tests/e2e/ dir" - cd tests/e2e/ - echo "Postinstall" - npm run postinstall - - - name: Download allurectl - run: | - wget https://github.com/allure-framework/allurectl/releases/latest/download/allurectl_linux_386 -O ./allurectl - - - name: Change permission for allurectl - run: | - chmod +x ./allurectl - - - name: Launch tests - id: launch - env: - CI: 'true' - TARGET_ENV: ${{ inputs.targetUrl }} - DAPP_NETWORK: ${{ inputs.network }} - run: | - echo "Run tests" - cd tests/e2e/ - ${{ matrix.command }}'${{ matrix.tags }} ${{ inputs.environmentTags }}' - - - name: Reset tags quotes - if: always() - run: | - echo "MATRIX_TAG_WITHOUT_QUOTES=$(echo ${{ matrix.tags }} | sed -e 's/@//g' )" >> $GITHUB_ENV - - - name: Create launch ID - if: always() - env: - ALLURE_LAUNCH_NAME: "#${{ github.run_number }} ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}" - ALLURE_LAUNCH_TAGS: "${{ env.ALLURE_BASIC_TAGS }}, ${{ env.MATRIX_TAG_WITHOUT_QUOTES }}" - run: | - echo "ALLURE_LAUNCH_ID=$(./allurectl launch create --launch-name '${{ env.ALLURE_LAUNCH_NAME }}' --no-header --format ID | tail -n1)" >> $GITHUB_ENV - - - name: Upload tests to the Allure proj - if: always() && inputs.publish_to_allure == true # <-- no brackets, 'true' does not work here: https://github.com/actions/runner/issues/1483#issuecomment-1090972149 - run: | - ./allurectl upload tests/e2e/allure-results --launch-id ${{ env.ALLURE_LAUNCH_ID }} - ./allurectl launch close ${{ env.ALLURE_LAUNCH_ID }} - - - - if: failure() - name: Save artifacts - uses: actions/upload-artifact@v2 - with: - name: portal_e2e_${{ github.run_number }}_artifacts - path: tests/e2e/artifacts/* - - publish: - name: Publish Allure link to GIT - runs-on: ubuntu-latest - needs: e2e - if: always() - steps: - - name: Prepare a link - run: | - echo "BASE64_SEARCH_REQUEST=$(echo '${{ env.ALLURE_SEARCH_REQUEST }}' | base64)" >> $GITHUB_ENV - - - name: Publish Allure link to GIT Summary - run: | - LINK="${{ vars.ALLURE_ENDPOINT }}project/${{ vars.ALLURE_PROJECT_ID }}/launches?search=${{ env.BASE64_SEARCH_REQUEST }}" - echo "Allure [e2e tests]($LINK) :rocket: in git run #${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/feature.yml b/.github/workflows/feature.yml deleted file mode 100644 index 20a5c9fb..00000000 --- a/.github/workflows/feature.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Deploy To Feature Branch -on: - pull_request: - -jobs: - build: - name: Build - runs-on: ubuntu-latest - outputs: - dappUrl: ${{ steps.deploy.outputs.details_url }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'npm' - - - name: Install dependencies - run: | - npm ci --force - - - name: Lint - run: | - npm run lint - - - name: Setup .env - run: | - echo "WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}" > .env - echo "ANKR_TOKEN=${{ secrets.ANKR_TOKEN }}" >> .env - echo "SCREENING_API_URL=${{ secrets.SCREENING_API_URL }}" >> .env - echo "DATAPLANE_URL=${{ secrets.DATAPLANE_URL }}" >> .env - echo "RUDDER_KEY=${{ secrets.RUDDER_KEY }}" >> .env - - - name: Build - run: | - npm run generate - - - name: Reorganize Files - run: | - mkdir -p dist - mv dist/_nuxt dist/_nuxt - - - name: Deploy - uses: matter-labs/action-hosting-deploy@main - id: deploy - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAGING_ZKSYNC_DAPP_WALLET_V2 }}" - projectId: staging-zksync-dapp-wallet-v2 - expires: 7d diff --git a/.github/workflows/lint-pr-title.yml b/.github/workflows/lint-pr-title.yml deleted file mode 100644 index 396ca8d9..00000000 --- a/.github/workflows/lint-pr-title.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: "Lint PR" - -on: - pull_request: - types: - - opened - - edited - - synchronize - -jobs: - label: - name: Validate PR title - runs-on: ubuntu-latest - steps: - - uses: amannn/action-semantic-pull-request@v4 - with: - subjectPattern: ^(?![A-Z]).+$ - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml deleted file mode 100644 index 83770ce0..00000000 --- a/.github/workflows/production.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Deploy Package to Production -"on": - workflow_dispatch: - inputs: - version: - type: string - description: "A release version to deploy, e.g. v1.0.0" - required: true - default: "v1.0.0" - -jobs: - build_and_deploy: - name: Build and Deploy - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - fetch-tags: true - ref: refs/tags/${{ github.event.inputs.version }} - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'npm' - - - name: Install dependencies - run: | - npm ci --force - - - name: Setup .env - run: | - echo "WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}" > .env - echo "ANKR_TOKEN=${{ secrets.ANKR_TOKEN }}" >> .env - echo "SCREENING_API_URL=${{ secrets.SCREENING_API_URL }}" >> .env - echo "DATAPLANE_URL=${{ secrets.DATAPLANE_URL }}" >> .env - echo "RUDDER_KEY=${{ secrets.RUDDER_KEY }}" >> .env - - - name: Build - run: | - npm run generate - - - name: Reorganize Files - run: | - mkdir -p dist - mv dist/_nuxt dist/_nuxt - - - name: Deploy to Production - uses: matter-labs/action-hosting-deploy@main - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_DAPP_WALLET_V2 }}" - projectId: zksync-dapp-wallet-v2 - channelID: live diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 33f7c7c7..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Publish Release -"on": - push: - branches: - - main - - '[0-9]+.*' - -jobs: - publish: - name: Publish - runs-on: ubuntu-latest - outputs: - releaseVersion: ${{ steps.release.outputs.releaseVersion }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'npm' - - - name: Install dependencies - run: | - npm ci --force - - - name: Lint - run: | - npm run lint - - - name: Release - id: release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - VITE_FIREBASE_PROJECT_ID=zksync-dapp-wallet-v2 \ - npx semantic-release || true - - - staging: - name: Deploy to Staging - runs-on: ubuntu-latest - needs: publish - if: ${{ github.ref == 'refs/heads/main' && needs.publish.outputs.releaseVersion != '' }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Setup Node.js - uses: actions/setup-node@v3 - with: - node-version: '18' - cache: 'npm' - - - name: Install dependencies - run: | - npm ci --force - - - name: Setup .env - run: | - echo "WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}" > .env - echo "ANKR_TOKEN=${{ secrets.ANKR_TOKEN }}" >> .env - echo "SCREENING_API_URL=${{ secrets.SCREENING_API_URL }}" >> .env - echo "DATAPLANE_URL=${{ secrets.DATAPLANE_URL }}" >> .env - echo "RUDDER_KEY=${{ secrets.RUDDER_KEY }}" >> .env - - - name: Build - run: | - npm run generate - - - name: Reorganize Files - run: | - mkdir -p dist - mv dist/_nuxt dist/_nuxt - - - name: Deploy - uses: matter-labs/action-hosting-deploy@main - id: deploy - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_STAGING_ZKSYNC_DAPP_WALLET_V2 }}" - projectId: staging-zksync-dapp-wallet-v2 - channelID: live diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml deleted file mode 100644 index 280a43e9..00000000 --- a/.github/workflows/version.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Deploy Package to Preview -"on": - workflow_dispatch: - inputs: - version: - type: string - description: "A release version to deploy, e.g. v1.0.0" - required: true - default: "v1.0.0" - -jobs: - deploy: - name: Deploy - runs-on: ubuntu-latest - outputs: - dappUrl: ${{ steps.deploy.outputs.details_url }} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Download Dist package - uses: dsaltares/fetch-gh-release-asset@master - with: - version: "tags/${{ github.event.inputs.version }}" - file: "dist.zip" - target: "dist.zip" - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Unzip Dist package - run: | - unzip dist.zip - - - name: Deploy - id: deploy - uses: matter-labs/action-hosting-deploy@main - with: - repoToken: "${{ secrets.GITHUB_TOKEN }}" - firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ZKSYNC_DAPP_WALLET_V2 }}" - expires: 7d - projectId: zksync-dapp-wallet-v2 - channelID: ${{ github.event.inputs.version }} - - e2e: - needs: deploy - uses: ./.github/workflows/e2e.yml - name: E2E - secrets: inherit - with: - targetUrl: ${{ needs.deploy.outputs.dappUrl }} - network: Goerli - publish_to_allure: true - environmentTags: "" diff --git a/Dockerfile-dev b/Dockerfile-dev index c5a62571..399c958a 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -4,7 +4,7 @@ WORKDIR /dapp-portal ADD . /dapp-portal -RUN npm install && npm run generate:node:nexus-goerli +RUN npm install && npm run generate:node:nexus-sepolia FROM 475911326710.dkr.ecr.ap-northeast-1.amazonaws.com/nginx:alpine3.18 diff --git a/data/networks.ts b/data/networks.ts index 0f66ecf3..aab809c4 100644 --- a/data/networks.ts +++ b/data/networks.ts @@ -2,16 +2,20 @@ import { arbitrum, arbitrumSepolia, base, + baseSepolia, + blast, + blastSepolia, goerli, linea, - lineaTestnet, + lineaGoerli, + lineaSepolia, mainnet, manta, mantaTestnet, mantle, mantleTestnet, optimism, - scrollSepolia, + optimismSepolia, sepolia, zkSync, zkSyncSepoliaTestnet, @@ -26,27 +30,28 @@ import type { Address } from "viem"; import { PRIMARY_CHAIN_KEY } from "@/zksync-web3-nova/src/utils"; -export const blast = /*#__PURE__*/ defineChain({ - id: 81457, - name: "Blast Mainnet", - network: "blast", +export const mantaSepolia = /*#__PURE__*/ defineChain({ + id: 3441006, + name: "Manta Pacific Sepolia Testnet", + network: "manta-sepolia", nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH", }, rpcUrls: { - default: { http: ["https://rpc.blast.io"] }, - public: { http: ["https://rpc.blast.io"] }, + default: { http: ["https://pacific-rpc.sepolia-testnet.manta.network/http"] }, }, blockExplorers: { - etherscan: { - name: "Blast Explorer", - url: "https://blastscan.io/", - }, default: { - name: "Blast Explorer", - url: "https://blastscan.io/", + name: "Manta Pacific Sepolia", + url: "https://pacific-explorer.sepolia-testnet.manta.network", + }, + }, + contracts: { + multicall3: { + address: "0x5Be4F807e0ae836Fc754dDEDDd72c0F4A28C8d43", + blockCreated: 468626, }, }, }); @@ -69,10 +74,34 @@ export const l1Networks = { ...linea, name: "Linea Mainnet", }, + lineaGoerliTestnet: { + ...lineaGoerli, + name: "Linea Goerli Testnet", + }, + lineaSepoliaTestnet: { + ...lineaSepolia, + name: "Linea Sepolia Testnet", + }, mantle: { ...mantle, name: "Mantle Mainnet", }, + mantleGoerliTestnet: { + ...mantleTestnet, + name: "Mantle Goerli Testnet", + }, + manta: { + ...manta, + name: "Manta Mainnet", + }, + mantaGoerliTestnet: { + ...mantaTestnet, + name: "Manta Goerli Testnet", + }, + mantaSepoliaTestnet: { + ...mantaSepolia, + name: "Manta Sepolia Testnet", + }, arbitrum: { ...arbitrum, name: "Arbitrum Mainnet", @@ -87,10 +116,6 @@ export const l1Networks = { }, }, }, - scrollSepolia: { - ...scrollSepolia, - name: "Scroll Sepolia Testnet", - }, zkSync: { ...zkSync, name: "zkSync Mainnet", @@ -99,34 +124,30 @@ export const l1Networks = { ...zkSyncSepoliaTestnet, name: "zkSync Sepolia Testnet", }, - lineaGoerliTestnet: { - ...lineaTestnet, - name: "Linea Goerli Testnet", - }, - mantleGoerliTestnet: { - ...mantleTestnet, - name: "Mantle Goerli Testnet", - }, - mantaGoerliTestnet: { - ...mantaTestnet, - name: "Manta Goerli Testnet", - }, - manta: { - ...manta, - name: "Manta Mainnet", - }, blast: { ...blast, name: "Blast Mainnet", }, + blastSepoliaTestnet: { + ...blastSepolia, + name: "Blast Sepolia Testnet", + }, optimism: { ...optimism, name: "Optimism Mainnet", }, + optimismSepoliaTestnet: { + ...optimismSepolia, + name: "Optimism Sepolia Testnet", + }, base: { ...base, name: "Base Mainnet", }, + baseSepoliaTestnet: { + ...baseSepolia, + name: "Base Sepolia Testnet", + }, } as const; export type L1Network = Chain; export type ZkSyncNetwork = { @@ -368,62 +389,128 @@ export const nexusSepoliaNode: ZkSyncNetwork[] = [ id: 810181, key: "sepolia", name: "zkLink Nova Testnet", - rpcUrl: "https://sepolia.rpc.zklink.network", + rpcUrl: "https://sepolia.rpc.zklink.io", logoUrl: "/img/ethereum.svg", - blockExplorerUrl: "https://sepolia.explorer.zklink.network", - blockExplorerApi: "https://sepolia.explorer-api.zklink.network", - withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.network", - mainContract: "0x53438eddeB3d3fD39c99150acA2575f73cE14198", - erc20BridgeL1: "0x9FF541E9de225157d245Ca46cFF6868e5c289C8F", - erc20BridgeL2: "0x3247575b4336C79956C5Df667A19C0AcBA9C62D6", - l1Gateway: "0xABE785340e1C1ed3228BC7ec460d2fEdD82260a0", - //TODO + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0x9719cD314BBf84B18aAEDEF56DF88E2267aA01e3", + erc20BridgeL1: "0x63e059BDEDeA829c22EfA31CbaDb9bea5E86c3Cd", + erc20BridgeL2: "0xcc43208B28B1eC25F000EfC0D2c2aF044715F888", + l1Gateway: "0xc6EbbD78E8f81626Bc62570f3C5949221F87b3Ee", + isEthGasToken: true, l1Network: l1Networks.sepolia, }, { id: 810181, key: PRIMARY_CHAIN_KEY, //"primary" name: "zkLink Nova Testnet", - rpcUrl: "https://sepolia.rpc.zklink.network", + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/linea.svg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0x16393A77e1d5C2D285BDad9079afC5942f255407", + erc20BridgeL1: "0xea05Fad671D93aF9472D747866019991DF183F0f", + erc20BridgeL2: "0x6336D1DfE362a84933e526588A0fa20dd87736aE", + isEthGasToken: true, + l1Network: l1Networks.lineaSepoliaTestnet, + }, + { + id: 810181, + key: "zksync", + name: "zkLink Nova Testnet", + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/zksync.svg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0x02627EFACfc2B000E77132fE9346C543eB980bAb", + erc20BridgeL1: "0xBf145DfdE964213246A4fcB8003621E8b0F11ffc", + erc20BridgeL2: "0xEbEAf62E4bCb4FdeC35100838c86c84B8134ADE0", + l1Gateway: "0x67ba43eD3860D155D16f82D12cA93A7B2e77bF2F", + isEthGasToken: true, + l1Network: l1Networks.zkSyncSepoliaTestnet, + }, + { + id: 810181, + key: "arbitrum", + name: "zkLink Nova Testnet", + rpcUrl: "https://sepolia.rpc.zklink.io", logoUrl: "/img/arbitrum-arb-logo.svg", - blockExplorerUrl: "https://sepolia.explorer.zklink.network", - blockExplorerApi: "https://sepolia.explorer-api.zklink.network", - withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.network", - mainContract: "0x788269f9353D7cbfE33c0889B7Dd1CAe833636E6", - erc20BridgeL1: "0x72de6d167ded1ee5fba17334bdcce686f3204d38", - erc20BridgeL2: "0x1895de0bea0eb8d8c7e6997c9be7649bb402d9e6", - //TODO + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0xaE1875112Ae010A9fe755418B206AfB33Ee0b1fA", + erc20BridgeL1: "0xFC31fF38e24901052b813DcEBEF5A9A10EaF25Ec", + erc20BridgeL2: "0x7e1B152f25D2ff0771026067B5c8B5A1C8457478", + l1Gateway: "0xd75F08D0E513a072799C510d04D9AddC3a28Bd9A", + isEthGasToken: true, l1Network: l1Networks.arbitrumSepolia, }, { id: 810181, - key: "zksyncsepolia", + key: "optimism", name: "zkLink Nova Testnet", - rpcUrl: "https://sepolia.rpc.zklink.network", - logoUrl: "/img/era.svg", - blockExplorerUrl: "https://sepolia.explorer.zklink.network", - blockExplorerApi: "http://localhost:3020", - withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.network", - mainContract: "0x916aa29B23DBC0f143e1cEaE0460C874FCEc0f58", - erc20BridgeL1: "0x", - erc20BridgeL2: "0x", - // TODO - l1Network: l1Networks.zkSyncSepoliaTestnet, + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/optimism.svg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0xbaC8EF345C684B0871dF390f44273160Ba3E6bc1", + erc20BridgeL1: "0x70194e2400eb89fA22E3bd0DaFa097CA09DAE76C", + erc20BridgeL2: "0x07476D10A8B3c614DC92a698cCeC34Aa9B844B92", + l1Gateway: "0x2f24331ddFB2D582079C200d1c233F168901a4e1", + isEthGasToken: true, + l1Network: l1Networks.optimismSepoliaTestnet, + }, + { + id: 810181, + key: "base", + name: "zkLink Nova Testnet", + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/base.svg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0x8c4b80A5D5374Ff2Dc07310EF9Fdbc44e487b6C2", + erc20BridgeL1: "0xeA6232604C847d14638a30c1D261AF6C321AAB05", + erc20BridgeL2: "0x7c3c5C8528D55Af0C641846fF4756200DEFDC513", + l1Gateway: "0x4E2d5bAaF470028fE48a23bd5b680f4EC7A06f85", + isEthGasToken: true, + l1Network: l1Networks.baseSepoliaTestnet, }, { id: 810181, - key: "scrollsepolia", - name: "zkLink Nova Testne", - rpcUrl: "https://sepolia.rpc.zklink.network", - logoUrl: "/img/sepolia.jpg", - blockExplorerUrl: "https://sepolia.explorer.zklink.network", - blockExplorerApi: "http://localhost:3020", - withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.network", - mainContract: "0x939016af6140141d89C4252b0c0013F4e5F1f4D7", - erc20BridgeL1: "0x", - erc20BridgeL2: "0x", - //TODO - l1Network: l1Networks.scrollSepolia, + key: "manta", + name: "zkLink Nova Testnet", + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/manta.jpg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0xEe5aFbd53D661968d13315f6960BBb103C2a1eCc", + erc20BridgeL1: "0x4C58CbF4e9594898e2cC66FdA3F435Cd3622Fe9f", + erc20BridgeL2: "0x1F282e46d75622C5B26921094b4ebF7D58D83CE2", + l1Gateway: "0xC8a31aA097c8D1dCF588C425415E4e5A0E250e67", + isEthGasToken: true, + l1Network: l1Networks.mantaSepoliaTestnet, + }, + { + id: 810181, + key: "blast", + name: "zkLink Nova Testnet", + rpcUrl: "https://sepolia.rpc.zklink.io", + logoUrl: "/img/blast.svg", + blockExplorerUrl: "https://sepolia.explorer.zklink.io", + blockExplorerApi: "https://sepolia.explorer-api.zklink.io", + withdrawalFinalizerApi: "https://sepolia.withdrawal-api.zklink.io", + mainContract: "0x27CBbE82447a0C188eBD7Bc5fd706d140c7B0642", + erc20BridgeL1: "0xD74c6452Ec4c73E4E2050C6B3f4e675B96dFFC15", + erc20BridgeL2: "0x4E5622E4A41985C29028d92e1Cc2EdF02012c82E", + l1Gateway: "0x83d3f5Db3eea3dD7a30aAF71A32D244386d00C53", + isEthGasToken: true, + l1Network: l1Networks.blastSepoliaTestnet, }, ]; @@ -482,10 +569,10 @@ export const zkSyncNetworks: ZkSyncNetwork[] = [ export const getWaitTime = (id: any) => { const nodeType = process.env.NODE_TYPE; const responseTime = 2; - if (id === (nodeType === "nexus" ? mainnet.id : goerli.id)) { + if (id === (nodeType === "nexus" ? mainnet.id : sepolia.id)) { return [(12.8 + responseTime) * 60 * 1000 + responseTime, 12.8 + responseTime]; } - if (id === (nodeType === "nexus" ? linea.id : lineaTestnet.id)) { + if (id === (nodeType === "nexus" ? linea.id : lineaSepolia.id)) { return [1 * 60 * 1000, 1]; } if (id === (nodeType === "nexus" ? zkSync.id : zkSyncSepoliaTestnet.id)) { @@ -497,10 +584,10 @@ export const getWaitTime = (id: any) => { if (id === (nodeType === "nexus" ? mantle.id : mantleTestnet.id)) { return [(1 + responseTime) * 60 * 1000, 1 + responseTime]; } - if (id === (nodeType === "nexus" ? manta.id : mantaTestnet.id)) { + if (id === (nodeType === "nexus" ? manta.id : mantaSepolia.id)) { return [(1 + responseTime) * 60 * 1000, 1 + responseTime]; } - if (id === blast.id) { + if (id === (nodeType === "nexus" ? blast.id : blastSepolia.id)) { return [(1 + responseTime) * 60 * 1000, 1 + responseTime]; } return [(2 + responseTime) * 60 * 1000, 2 + responseTime]; diff --git a/package-lock.json b/package-lock.json index 2dd2b8eb..9fb1bd4b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,7 +33,7 @@ "sass": "^1.57.1", "ts-node": "^10.0.0", "typescript": "^4.3.5", - "viem": "^2.9.5", + "viem": "^2.9.16", "vite": "^3.0.0", "vue-tippy": "^6.0.0", "web3-avatar-vue": "^1.0.0" @@ -26826,9 +26826,9 @@ "dev": true }, "node_modules/viem": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.9.5.tgz", - "integrity": "sha512-IKLmGZJEQkdt9fqvryjR+W1FsPZM+dhALT0pwR8xhBOLvVHM0/lEViGRWDpm2ArNsFszipFhc2EpKp80/PnXkw==", + "version": "2.9.16", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.9.16.tgz", + "integrity": "sha512-FQRfN4G7uKEUs5DYvVrH/kZmTkwcSDpTBxnadpwG1EEP8nHm57WDpSaGN7PwSPVgJ6rMo5MENT5hgnqaNTlb2w==", "funding": [ { "type": "github", diff --git a/package.json b/package.json index 3c4ddc0d..336fe966 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "dev:node:memory": "cross-env NODE_TYPE=memory npm run dev", "dev:node:docker": "cross-env NODE_TYPE=dockerized npm run dev", "dev:node:nexus-goerli": "cross-env NODE_TYPE=nexus-goerli npm run dev", + "dev:node:nexus-sepolia": "cross-env NODE_TYPE=nexus-sepolia npm run dev", "dev:node:nexus": "cross-env NODE_TYPE=nexus npm run dev", "dev:node:hyperchain": "ts-node --transpile-only scripts/hyperchains/empty-check.ts && cross-env NODE_TYPE=hyperchain npm run dev", "generate": "nuxt generate && npm run generate-meta", @@ -90,7 +91,7 @@ "sass": "^1.57.1", "ts-node": "^10.0.0", "typescript": "^4.3.5", - "viem": "^2.9.5", + "viem": "^2.9.16", "vite": "^3.0.0", "vue-tippy": "^6.0.0", "web3-avatar-vue": "^1.0.0" diff --git a/store/zksync/transactionStatus.ts b/store/zksync/transactionStatus.ts index 1e845dfc..6f85919e 100644 --- a/store/zksync/transactionStatus.ts +++ b/store/zksync/transactionStatus.ts @@ -45,7 +45,7 @@ export const getEstmatdDepositDelay = (networkKey: string): number => { return ESTIMATED_DEPOSIT_DELAY_SECONDARY; } }; -export const WITHDRAWAL_DELAY = 7 * 24 * 60 * 60 * 1000; // 7 * 24 hours +export const WITHDRAWAL_DELAY = 12 * 24 * 60 * 60 * 1000; // 7 * 24 hours export type Address = Hash; export type ForwardL2Request = { gateway: Address; diff --git a/utils/constants.ts b/utils/constants.ts index f87ca221..bcaeb8bf 100644 --- a/utils/constants.ts +++ b/utils/constants.ts @@ -1,3 +1,4 @@ +import { WITHDRAWAL_DELAY } from './../store/zksync/transactionStatus'; import type { Token } from "@/types"; export const ETH_TOKEN: Token = { @@ -8,3 +9,5 @@ export const ETH_TOKEN: Token = { decimals: 18, iconUrl: "/img/eth.svg", }; + +export const WITHDRAWAL_DELAY_DAYS = 12 \ No newline at end of file diff --git a/views/transactions/Deposit.vue b/views/transactions/Deposit.vue index cc079e4d..9aefd643 100644 --- a/views/transactions/Deposit.vue +++ b/views/transactions/Deposit.vue @@ -136,7 +136,7 @@

- You will be able to claim your withdrawal only after a 7-day withdrawal delay. + You will be able to claim your withdrawal only after a {{WITHDRAWAL_DELAY_DAYS}}-day withdrawal delay. Learn more

@@ -353,7 +353,7 @@ import { WITHDRAWAL_DELAY } from "@/store/zksync/transactionStatus"; import { useZkSyncTransactionStatusStore } from "@/store/zksync/transactionStatus"; import { useZkSyncTransfersHistoryStore } from "@/store/zksync/transfersHistory"; import { useZkSyncWalletStore } from "@/store/zksync/wallet"; -import { ETH_TOKEN } from "@/utils/constants"; +import { ETH_TOKEN, WITHDRAWAL_DELAY_DAYS } from "@/utils/constants"; import { ZKSYNC_WITHDRAWAL_DELAY } from "@/utils/doc-links"; import { checksumAddress, decimalToBigNumber, formatRawTokenPrice } from "@/utils/formatters"; import { calculateFee } from "@/utils/helpers"; @@ -364,7 +364,7 @@ import WithdrawalSubmitted from "@/views/transactions/WithdrawalSubmitted.vue"; import { ETH_ADDRESS } from "~/zksync-web3-nova/src/utils"; import { useNetworkStore } from "@/store/network"; import type { FunctionalComponent } from "vue"; -const showBridge = false; +const showBridge = true; const chainList = [ // { // "name": "Symbiosis", @@ -479,6 +479,7 @@ const availableBalances = computed(() => { } return balance.value; }); +console.log('availableTokens: ',availableTokens.value) const routeTokenAddress = computed(() => { if (!route.query.token || Array.isArray(route.query.token) || !isAddress(route.query.token)) { return; diff --git a/views/transactions/WithdrawalSubmitted.vue b/views/transactions/WithdrawalSubmitted.vue index 5f5253d1..95988be7 100644 --- a/views/transactions/WithdrawalSubmitted.vue +++ b/views/transactions/WithdrawalSubmitted.vue @@ -11,7 +11,7 @@