From a5d6089bf559264eb07d42dcbd81999ec6ae4e83 Mon Sep 17 00:00:00 2001 From: Jack Hamer Date: Sun, 31 Mar 2024 18:31:58 +0300 Subject: [PATCH] fix: make finalization required, update ecosystem links, update web3modal --- composables/zksync/useTransaction.ts | 11 +- package-lock.json | 221 ++++++++++++--------------- package.json | 2 +- pages/assets.vue | 4 +- pages/receive-methods.vue | 4 +- pages/send-methods.vue | 2 +- views/transactions/Deposit.vue | 4 +- views/transactions/Transfer.vue | 52 ++----- 8 files changed, 126 insertions(+), 174 deletions(-) diff --git a/composables/zksync/useTransaction.ts b/composables/zksync/useTransaction.ts index 1d107137b..19ca672aa 100644 --- a/composables/zksync/useTransaction.ts +++ b/composables/zksync/useTransaction.ts @@ -1,6 +1,7 @@ import { useMemoize } from "@vueuse/core"; -import { BigNumber, type BigNumberish } from "ethers"; -import { parseEther } from "ethers/lib/utils"; +import { type BigNumberish } from "ethers"; + +import { isCustomNode } from "@/data/networks"; import type { TokenAmount } from "@/types"; import type { Provider, Signer } from "zksync-ethers"; @@ -12,10 +13,8 @@ type TransactionParams = { amount: BigNumberish; }; -export const isWithdrawalManualFinalizationRequired = (token: TokenAmount, l1NetworkId: number) => { - return ( - token.address === ETH_TOKEN.address && BigNumber.from(token.amount).lt(parseEther("0.01")) && l1NetworkId === 1 - ); +export const isWithdrawalManualFinalizationRequired = (_token: TokenAmount, l1NetworkId: number) => { + return l1NetworkId === 1 || isCustomNode; }; export default (getSigner: () => Promise, getProvider: () => Provider) => { diff --git a/package-lock.json b/package-lock.json index f8d0a1320..c4d5608cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@vueuse/router": "^10.9.0", "@wagmi/connectors": "^4.1.14", "@wagmi/core": "^2.6.5", - "@web3modal/wagmi": "^4.0.11", + "@web3modal/wagmi": "^4.1.3", "crypto-js": "^4.1.1", "dotenv": "^16.0.3", "ethers": "^5.7.2", @@ -11399,46 +11399,47 @@ } }, "node_modules/@web3modal/common": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-4.0.11.tgz", - "integrity": "sha512-R/hRyzMsiZt9taxL4S0bc8F78xgqRE4IMwedJDJyrXKMSoQ0Z6Bz4YTyWPafH2S545ho5yg2TxaQPTkP9Sm3+w==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-4.1.3.tgz", + "integrity": "sha512-xxNS0+J88TQHNKxHk57uEIb1J03OI9n9CulaOexHv7oPp2x6D+vb5FYdJj/Oxskq6osYKg+LVupCSEaJEr6bQw==", "dependencies": { "dayjs": "1.11.10" } }, "node_modules/@web3modal/core": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-4.0.11.tgz", - "integrity": "sha512-ffn8yE3YreOSn4f84JYbN5HB0rjlQA9SCADgUANeOskpq4hC1mghn9GqeYeRhz3YzGSjMBPXSM7CQshray2RdQ==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-4.1.3.tgz", + "integrity": "sha512-T8J9vfxiDrnRQxuqRQtfE1siBSf7WQxgyfvgPfUmAtnzAYVpQ5eAL4JEUTp6KrOyB070ujT5fmfBjz8di8agQg==", "dependencies": { - "@web3modal/common": "4.0.11", - "@web3modal/wallet": "4.0.11", + "@web3modal/common": "4.1.3", + "@web3modal/wallet": "4.1.3", "valtio": "1.11.2" } }, "node_modules/@web3modal/polyfills": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-4.0.11.tgz", - "integrity": "sha512-D11sG7cMEtzIaFDnTeG2n7im5LGP4/4huaFYK+SkcyhiR18CCE+Soci8faGGVbe1BPswC+gZkR6NKtVSRH+Gzg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-4.1.3.tgz", + "integrity": "sha512-CTT1A0B43Ae4uSm8GW4F6Qamhx3tcIC0/yyOSW40BaRvd10K2Imm50K3I8jLFS8HG1ZzqZe+pOV2P/OyOwPU4g==", "dependencies": { "buffer": "6.0.3" } }, "node_modules/@web3modal/scaffold": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold/-/scaffold-4.0.11.tgz", - "integrity": "sha512-EjE7R6KYlSoE38dlevJsPIG1eAydOzx1P7E0mHGlUNXqGBb/d2Wk/yz30iJKFoO2ZmjW7dUxXjmbNds2KcshIg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold/-/scaffold-4.1.3.tgz", + "integrity": "sha512-daOCaa8h4AT9BGqbsBAAU0CQL/hFWt9Bs6CK9zjesvhwxK2qQZ2O/t8tU2c68Gsj6VRDim7CcWCKjNYAqtGNyQ==", "dependencies": { - "@web3modal/common": "4.0.11", - "@web3modal/core": "4.0.11", - "@web3modal/ui": "4.0.11", + "@web3modal/common": "4.1.3", + "@web3modal/core": "4.1.3", + "@web3modal/ui": "4.1.3", "lit": "3.1.0" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.11" + "@web3modal/siwe": "4.1.3" }, "peerDependencies": { - "@web3modal/siwe": ">=4.0.11" + "@web3modal/siwe": "4.1.3", + "@web3modal/wallet": "4.1.3" }, "peerDependenciesMeta": { "@web3modal/siwe": { @@ -11447,11 +11448,11 @@ } }, "node_modules/@web3modal/scaffold-react": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold-react/-/scaffold-react-4.0.11.tgz", - "integrity": "sha512-oHTTRA+SsS3OWbYTr0yRQ3MlgGQ72IdR4eiD1Hj85/RE926V5BMXc6ydZHwYa6hlBDjsqEtMiZkEWO+xbVMkHA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-react/-/scaffold-react-4.1.3.tgz", + "integrity": "sha512-zx/jVqY6MFjOZWj/X9RUpSaTZ5Kz+dmH6wuOGSdlyUSYvUV5hJgUGEKGjCr5AVBk67n67lHKFUy1nxS9GXvVdg==", "dependencies": { - "@web3modal/scaffold": "4.0.11" + "@web3modal/scaffold": "4.1.3" }, "peerDependencies": { "react": ">=17", @@ -11459,21 +11460,21 @@ } }, "node_modules/@web3modal/scaffold-utils": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-4.0.11.tgz", - "integrity": "sha512-r5eSIN2mdh3wIiHPNKm6BL7Pjyfao+MJpqZOY22CGyGOAcdHv3vPXxJBER3510ibveaCYlVrZmtb/iqMRtpXrw==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-4.1.3.tgz", + "integrity": "sha512-1rNZkTjhpvVRPXm8RKz51E/T9Ujhjh8DPxT3oQFnTNlws98yU+RLDJYrR8rQoqJfmDK3E5dViLmxjIbrLKh/dw==", "dependencies": { - "@web3modal/core": "4.0.11", - "@web3modal/polyfills": "4.0.11", + "@web3modal/core": "4.1.3", + "@web3modal/polyfills": "4.1.3", "valtio": "1.11.2" } }, "node_modules/@web3modal/scaffold-vue": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/scaffold-vue/-/scaffold-vue-4.0.11.tgz", - "integrity": "sha512-arHPKaOFe4d57whwiq6w4ord7hLvipBMVnj9iQxkl4AUnRA7k6b8b8BglZ2zdZpeHbrNk2A4cmzRv73Qu07xhg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-vue/-/scaffold-vue-4.1.3.tgz", + "integrity": "sha512-xHySyt2A01VYGtQ3qHKEyv5n+JGOnZ41/ZM8glK6yfe4nDNS0c9X/psPoeVwWvLhOYPKWCikkgGvB1TmoyjNiQ==", "dependencies": { - "@web3modal/scaffold": "4.0.11" + "@web3modal/scaffold": "4.1.3" }, "peerDependencies": { "vue": ">=3" @@ -11487,52 +11488,90 @@ "@lit-labs/ssr-dom-shim": "^1.2.0" } }, - "node_modules/@web3modal/scaffold/node_modules/@web3modal/siwe": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-4.0.11.tgz", - "integrity": "sha512-WdwGOBYeRCWkz3orfE7ok27F+2s68e/MiN/6G6EAeUnB7bNmXyarTnzZkCKG+5BhorX1bgXAulUbycvhn4UBzA==", + "node_modules/@web3modal/scaffold/node_modules/lit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", + "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "dependencies": { + "@lit/reactive-element": "^2.0.0", + "lit-element": "^4.0.0", + "lit-html": "^3.1.0" + } + }, + "node_modules/@web3modal/scaffold/node_modules/lit-element": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.4.tgz", + "integrity": "sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.1.2" + } + }, + "node_modules/@web3modal/scaffold/node_modules/lit-html": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.2.tgz", + "integrity": "sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "node_modules/@web3modal/siwe": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-4.1.3.tgz", + "integrity": "sha512-YjCFvoUyjjkTmRLyaDuhCaWpz9/gqQNZRIXwkDg/0AZY92WeVq0jJQJIWmFv6Ag16nakqo73vtHjUGfPC4bbFQ==", "optional": true, "dependencies": { - "@web3modal/core": "4.0.11", - "@web3modal/scaffold-utils": "4.0.11" - }, - "peerDependencies": { - "lit": ">=3", - "valtio": ">=1 <2" + "@web3modal/core": "4.1.3", + "@web3modal/scaffold-utils": "4.1.3", + "lit": "3.1.0", + "valtio": "1.11.2" } }, - "node_modules/@web3modal/scaffold/node_modules/lit": { + "node_modules/@web3modal/siwe/node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "optional": true, + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "node_modules/@web3modal/siwe/node_modules/lit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "optional": true, "dependencies": { "@lit/reactive-element": "^2.0.0", "lit-element": "^4.0.0", "lit-html": "^3.1.0" } }, - "node_modules/@web3modal/scaffold/node_modules/lit-element": { + "node_modules/@web3modal/siwe/node_modules/lit-element": { "version": "4.0.4", "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.4.tgz", "integrity": "sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ==", + "optional": true, "dependencies": { "@lit-labs/ssr-dom-shim": "^1.2.0", "@lit/reactive-element": "^2.0.4", "lit-html": "^3.1.2" } }, - "node_modules/@web3modal/scaffold/node_modules/lit-html": { + "node_modules/@web3modal/siwe/node_modules/lit-html": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.2.tgz", "integrity": "sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg==", + "optional": true, "dependencies": { "@types/trusted-types": "^2.0.2" } }, "node_modules/@web3modal/ui": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-4.0.11.tgz", - "integrity": "sha512-DKCtqzWTCfjytHpm/TUIjR2cHadr73+OZzryReK61IT6cMLvV6XQhvOV4lzeNnwvh4g02HjVeEamvaXFrnvnmg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-4.1.3.tgz", + "integrity": "sha512-gZBkpq186iPC05jYBi58MXYH4b3qxo+LIYBdXz++qvaZRiSV894hvHpVLTjJgJivUiP0Lzt/I+u63/G4dkwSgA==", "dependencies": { "lit": "3.1.0", "qrcode": "1.5.3" @@ -11575,18 +11614,18 @@ } }, "node_modules/@web3modal/wagmi": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/wagmi/-/wagmi-4.0.11.tgz", - "integrity": "sha512-ZYpj2KTsfWsSwpW9DIk6LguNXgJB+OTPUd41cYFR5SMQlOyzjsoNaGfl7PwB7gC7zqIsXFaCrDD5OTMl3z2OlA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/wagmi/-/wagmi-4.1.3.tgz", + "integrity": "sha512-YFYYFmp2HoXIo7mfL/eWc//F9cqIyHdKgUZmSYArDWxNze/MOuCrShnZWarXa1fVl7kY3Cq+bZpExM8TcttQCw==", "dependencies": { - "@web3modal/polyfills": "4.0.11", - "@web3modal/scaffold": "4.0.11", - "@web3modal/scaffold-react": "4.0.11", - "@web3modal/scaffold-utils": "4.0.11", - "@web3modal/scaffold-vue": "4.0.11" + "@web3modal/polyfills": "4.1.3", + "@web3modal/scaffold": "4.1.3", + "@web3modal/scaffold-react": "4.1.3", + "@web3modal/scaffold-utils": "4.1.3", + "@web3modal/scaffold-vue": "4.1.3" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.11", + "@web3modal/siwe": "4.1.3", "react": ">=17", "react-dom": ">=17", "vue": ">=3" @@ -11594,7 +11633,7 @@ "peerDependencies": { "@wagmi/connectors": ">=4.0.0", "@wagmi/core": ">=2.0.0", - "@web3modal/siwe": "4.0.11", + "@web3modal/siwe": "4.1.3", "react": ">=17", "react-dom": ">=17", "viem": ">=2.0.0", @@ -11615,68 +11654,10 @@ } } }, - "node_modules/@web3modal/wagmi/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", - "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", - "optional": true, - "peer": true, - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" - } - }, - "node_modules/@web3modal/wagmi/node_modules/@web3modal/siwe": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-4.0.11.tgz", - "integrity": "sha512-WdwGOBYeRCWkz3orfE7ok27F+2s68e/MiN/6G6EAeUnB7bNmXyarTnzZkCKG+5BhorX1bgXAulUbycvhn4UBzA==", - "optional": true, - "dependencies": { - "@web3modal/core": "4.0.11", - "@web3modal/scaffold-utils": "4.0.11" - }, - "peerDependencies": { - "lit": ">=3", - "valtio": ">=1 <2" - } - }, - "node_modules/@web3modal/wagmi/node_modules/lit": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.2.tgz", - "integrity": "sha512-VZx5iAyMtX7CV4K8iTLdCkMaYZ7ipjJZ0JcSdJ0zIdGxxyurjIn7yuuSxNBD7QmjvcNJwr0JS4cAdAtsy7gZ6w==", - "optional": true, - "peer": true, - "dependencies": { - "@lit/reactive-element": "^2.0.4", - "lit-element": "^4.0.4", - "lit-html": "^3.1.2" - } - }, - "node_modules/@web3modal/wagmi/node_modules/lit-element": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.4.tgz", - "integrity": "sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ==", - "optional": true, - "peer": true, - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.1.2" - } - }, - "node_modules/@web3modal/wagmi/node_modules/lit-html": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.2.tgz", - "integrity": "sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg==", - "optional": true, - "peer": true, - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, "node_modules/@web3modal/wallet": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-4.0.11.tgz", - "integrity": "sha512-jPhaklrNSrOGh7DS0fgA+lDxt/14/o/r9LLoMkGxuPVCldlHn1XKZjwV3YVIEX5Is6I0Y4o1WUmFju4qBTzdEg==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-4.1.3.tgz", + "integrity": "sha512-wcfljBc2c+0VF5d1hfVWRDrnRdlNGGTPz0iky6tjQW57sam9Yg5IKAbrEqyDZZs0zrAz8K03yHgKnP1BbQHc5A==", "dependencies": { "zod": "3.22.4" } diff --git a/package.json b/package.json index 3bcee7f32..bdad0dda3 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "@vueuse/router": "^10.9.0", "@wagmi/connectors": "^4.1.14", "@wagmi/core": "^2.6.5", - "@web3modal/wagmi": "^4.0.11", + "@web3modal/wagmi": "^4.1.3", "crypto-js": "^4.1.1", "dotenv": "^16.0.3", "ethers": "^5.7.2", diff --git a/pages/assets.vue b/pages/assets.vue index ed08eb51b..520138060 100644 --- a/pages/assets.vue +++ b/pages/assets.vue @@ -205,7 +205,7 @@ const depositMethods = computed(() => { label: "Top-up with cash", description: "Buy tokens using a card or another method for fiat", as: "a", - href: "https://zksync.dappradar.com/ecosystem?category-de=gateways", + href: "https://zksync.dappradar.com/ecosystem?category=non_dapps_on_off_ramps", target: "_blank", icon: ArrowTopRightOnSquareIcon, }, @@ -216,7 +216,7 @@ const depositMethods = computed(() => { label: "Bridge from other networks", description: "Explore ecosystem of third party bridges", as: "a", - href: "https://zksync.dappradar.com/ecosystem?category-de=bridges", + href: "https://zksync.dappradar.com/ecosystem?category=defi_bridge", target: "_blank", icon: ArrowTopRightOnSquareIcon, }, diff --git a/pages/receive-methods.vue b/pages/receive-methods.vue index 79bd20daa..b1002670b 100644 --- a/pages/receive-methods.vue +++ b/pages/receive-methods.vue @@ -41,7 +41,7 @@ label="Top-up with cash" description="Buy tokens using a card or another method for fiat" as="a" - href="https://zksync.dappradar.com/ecosystem?category-de=gateways" + href="https://zksync.dappradar.com/ecosystem?category=non_dapps_on_off_ramps" target="_blank" :icon="ArrowTopRightOnSquareIcon" > @@ -57,7 +57,7 @@ label="Bridge from other networks" description="Explore ecosystem of third party bridges" as="a" - href="https://zksync.dappradar.com/ecosystem?category-de=bridges" + href="https://zksync.dappradar.com/ecosystem?category=defi_bridge" target="_blank" :icon="ArrowTopRightOnSquareIcon" > diff --git a/pages/send-methods.vue b/pages/send-methods.vue index a9fbc39be..934945229 100644 --- a/pages/send-methods.vue +++ b/pages/send-methods.vue @@ -27,7 +27,7 @@ :description="`Explore ecosystem of third party bridges`" :icon="ArrowTopRightOnSquareIcon" as="a" - href="https://zksync.dappradar.com/ecosystem?category-de=bridges" + href="https://zksync.dappradar.com/ecosystem?category=defi_bridge" target="_blank" >