From 5107c5042ddb625b4b19cba664a37bc34db7666e Mon Sep 17 00:00:00 2001 From: impelcrypto Date: Fri, 27 Dec 2024 22:29:39 +0800 Subject: [PATCH 1/6] feat: added mainnet configuration --- .gitignore | 1 + package.json | 1 + quasar.conf.js | 11 ++++- src/components/bridge/BridgeSelection.vue | 44 +++++++++++++---- src/config/env.ts | 7 +++ src/config/web3/index.ts | 7 +-- src/features.ts | 1 + src/hooks/bridge/useCcipBridge.ts | 3 +- src/hooks/useNetworkInfo.ts | 4 ++ src/i18n/en-US/index.ts | 6 +++ src/modules/ccip-bridge/index.ts | 31 ++++++++---- .../implementations/CcipBridgeRepository.ts | 4 +- yarn.lock | 48 +++---------------- 13 files changed, 102 insertions(+), 66 deletions(-) create mode 100644 src/config/env.ts diff --git a/.gitignore b/.gitignore index b730a6afe..262255a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .DS_Store .thumbs.db node_modules +.env # Quasar core related directories .quasar diff --git a/package.json b/package.json index f05d3fc17..dd9ba2767 100644 --- a/package.json +++ b/package.json @@ -117,6 +117,7 @@ "@types/validator": "^13.7.11", "@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/parser": "^4.16.1", + "dotenv": "^16.4.7", "eslint": "^7.14.0", "eslint-config-prettier": "^8.1.0", "eslint-plugin-jest": "^25.2.2", diff --git a/quasar.conf.js b/quasar.conf.js index 9cbbe728e..2d46e7dcb 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -12,6 +12,8 @@ const { configure } = require('quasar/wrappers'); const NodePolyfillPlugin = require('node-polyfill-webpack-plugin'); const ESLintPlugin = require('eslint-webpack-plugin'); const path = require('path'); +require('dotenv').config() + module.exports = configure(function (ctx) { return { @@ -53,7 +55,14 @@ module.exports = configure(function (ctx) { // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build build: { vueRouterMode: 'history', // available values: 'hash', 'history' - + env: { + SONEIUM_RPC_URL: process.env.SONEIUM_RPC_URL, + SONEIUM_EXPLORER_URL: process.env.SONEIUM_EXPLORER_URL, + SONEIUM_CHAIN_ID:process.env.SONEIUM_CHAIN_ID, + SONEIUM_CCIP_CHAIN_SELECTOR:process.env.SONEIUM_CCIP_CHAIN_SELECTOR, + SONEIUM_CCIP_ROUTER:process.env.SONEIUM_CCIP_ROUTER, + SONEIUM_ASTR_CONTRACT:process.env.SONEIUM_ASTR_CONTRACT, + }, // transpile: false, // Add dependencies for transpiling with Babel (Array of string/regex) diff --git a/src/components/bridge/BridgeSelection.vue b/src/components/bridge/BridgeSelection.vue index 41cb00752..0c47ce999 100644 --- a/src/components/bridge/BridgeSelection.vue +++ b/src/components/bridge/BridgeSelection.vue @@ -6,9 +6,9 @@
- -

- {{ $t('bridge.ccipMinatoBridge.remark') }} +

+ {{ $t('bridge.ccipSoneiumBridge.remark') }}

@@ -241,6 +259,7 @@ import { nativeBridgeEnabled, layerZeroBridgeEnabled, ccipMinatoBridgeEnabled, + ccipSoneiumBridgeEnabled, } from 'src/features'; import { navigateInNewTab } from 'src/util-general'; @@ -257,6 +276,7 @@ export default defineComponent({ isAstar, isH160, isShibuyaEvm, + isAstarEvm, } = useNetworkInfo(); const l1Name = computed(() => { @@ -277,8 +297,11 @@ export default defineComponent({ return isH160.value && (isAstar.value || isAstarZkEvm.value); }); - const isEnableMinatoBridge = computed(() => { - return isShibuyaEvm.value && ccipMinatoBridgeEnabled; + const isEnableCcipBridge = computed(() => { + return ( + (isShibuyaEvm.value && ccipMinatoBridgeEnabled) || + (isAstarEvm.value && ccipSoneiumBridgeEnabled) + ); }); return { @@ -298,8 +321,9 @@ export default defineComponent({ layerSwapBridgeEnabled, nativeBridgeEnabled, layerZeroBridgeEnabled, - isEnableMinatoBridge, + isEnableCcipBridge, isShibuyaEvm, + isAstarEvm, buildEthereumBridgePageLink, buildLzBridgePageLink, navigateInNewTab, diff --git a/src/config/env.ts b/src/config/env.ts new file mode 100644 index 000000000..7829526e0 --- /dev/null +++ b/src/config/env.ts @@ -0,0 +1,7 @@ +// Memo: This is temporary +export const SONEIUM_RPC_URL = String(process.env.SONEIUM_RPC_URL); +export const SONEIUM_EXPLORER_URL = String(process.env.SONEIUM_EXPLORER_URL); +export const SONEIUM_CHAIN_ID = Number(process.env.SONEIUM_CHAIN_ID); +export const SONEIUM_CCIP_CHAIN_SELECTOR = String(process.env.SONEIUM_CCIP_CHAIN_SELECTOR); +export const SONEIUM_CCIP_ROUTER = String(process.env.SONEIUM_CCIP_ROUTER); +export const SONEIUM_ASTR_CONTRACT = String(process.env.SONEIUM_ASTR_CONTRACT); diff --git a/src/config/web3/index.ts b/src/config/web3/index.ts index e39200628..2a2346c62 100644 --- a/src/config/web3/index.ts +++ b/src/config/web3/index.ts @@ -1,4 +1,5 @@ import { providerEndpoints, endpointKey } from 'src/config/chainEndpoints'; +import { SONEIUM_CHAIN_ID, SONEIUM_EXPLORER_URL, SONEIUM_RPC_URL } from '../env'; export { getChainData, setupNetwork, @@ -50,7 +51,7 @@ export enum EVM { MOONBEAM = 1284, SONEIUM_MINATO_TESTNET = 1946, // Todo: update - SONEIUM = 9999, + SONEIUM = SONEIUM_CHAIN_ID, } export const chainName = { @@ -167,7 +168,7 @@ export const rpcUrls = { [EVM.MOONBEAM]: ['https://rpc.api.moonbeam.network'], [EVM.SONEIUM_MINATO_TESTNET]: ['https://rpc.minato.soneium.org'], // Todo: update - [EVM.SONEIUM]: ['https://rpc.minato.soneium.org'], + [EVM.SONEIUM]: [SONEIUM_RPC_URL], }; export const blockExplorerUrls = { @@ -185,7 +186,7 @@ export const blockExplorerUrls = { [EVM.MOONBEAM]: ['https://moonbeam.moonscan.io'], [EVM.SONEIUM_MINATO_TESTNET]: ['https://soneium-minato.blockscout.com'], // Todo: update - [EVM.SONEIUM]: ['https://soneium-minato.blockscout.com'], + [EVM.SONEIUM]: [SONEIUM_EXPLORER_URL], }; export const CHAIN_INFORMATION = { diff --git a/src/features.ts b/src/features.ts index 50afb049f..e2f10f23a 100644 --- a/src/features.ts +++ b/src/features.ts @@ -5,6 +5,7 @@ export const layerSwapBridgeEnabled = true; export const celerBridgeEnabled = true; export const omniBridgeEnabled = true; export const ccipMinatoBridgeEnabled = true; +export const ccipSoneiumBridgeEnabled = true; const stargateBridgeEnabled = true; const stakeStoneBridgeEnabled = true; const arthSwapBridgeEnabled = true; diff --git a/src/hooks/bridge/useCcipBridge.ts b/src/hooks/bridge/useCcipBridge.ts index 903077eea..99c92a1e4 100644 --- a/src/hooks/bridge/useCcipBridge.ts +++ b/src/hooks/bridge/useCcipBridge.ts @@ -8,6 +8,7 @@ import { CCIP_TOKEN, CCIP_SBY, ccipBridgeAddress, + CCIP_ASTR, } from 'src/modules/ccip-bridge'; import { showLoading } from 'src/modules/extrinsic/utils'; import { useStore } from 'src/store'; @@ -24,7 +25,7 @@ import { astarNativeTokenErcAddr } from 'src/modules/xcm'; export const useCcipBridge = () => { const { isShibuya, nativeTokenSymbol } = useNetworkInfo(); - const selectedToken = ref(CCIP_SBY); + const selectedToken = ref(isShibuya.value ? CCIP_SBY : CCIP_ASTR); const bridgeAmt = ref(null); const toBridgeBalance = ref(0); const fromBridgeBalance = ref(0); diff --git a/src/hooks/useNetworkInfo.ts b/src/hooks/useNetworkInfo.ts index f35644518..f3fa5b590 100644 --- a/src/hooks/useNetworkInfo.ts +++ b/src/hooks/useNetworkInfo.ts @@ -39,6 +39,9 @@ export function useNetworkInfo() { const isShibuyaEvm = computed(() => { return isH160.value && isShibuya.value; }); + const isAstarEvm = computed(() => { + return isH160.value && isAstar.value; + }); const currentNetworkChain = computed(() => { if (isZkEvm.value) { @@ -135,5 +138,6 @@ export function useNetworkInfo() { nativeTokenImg, isShibuya, isShibuyaEvm, + isAstarEvm, }; } diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 126bf4689..871479ac3 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -1090,6 +1090,12 @@ export default { text: 'Transfer SBY between Soneium Minato and Shibuya EVM. Powered by CCIP.', remark: 'Available on Shibuya EVM. Switch the network to use it.', }, + ccipSoneiumBridge: { + title: 'Soneium Bridge', + tag: 'ASTR', + text: 'Transfer ASTR between Soneium and Astar EVM. Powered by CCIP.', + remark: 'Available on Astar EVM. Switch the network to use it.', + }, astarBridge: { title: 'LayerZero', tag: 'ASTR', diff --git a/src/modules/ccip-bridge/index.ts b/src/modules/ccip-bridge/index.ts index 2537d78e7..453837d88 100644 --- a/src/modules/ccip-bridge/index.ts +++ b/src/modules/ccip-bridge/index.ts @@ -1,3 +1,9 @@ +import { + SONEIUM_ASTR_CONTRACT, + SONEIUM_CCIP_CHAIN_SELECTOR, + SONEIUM_CCIP_ROUTER, + SONEIUM_CHAIN_ID, +} from 'src/config/env'; import { astarNativeTokenErcAddr } from '../xcm'; export enum CcipNetworkName { @@ -12,7 +18,7 @@ export enum CcipChainId { 'AstarEvm' = 592, 'SoneiumMinato' = 1946, // Todo: update - 'Soneium' = 9999, + 'Soneium' = SONEIUM_CHAIN_ID, } export const ccipChainId = { @@ -25,24 +31,22 @@ export const ccipChainId = { export const ccipChainSelector = { [CcipChainId.ShibuyaEvm]: '6955638871347136141', // Todo: update - [CcipChainId.AstarEvm]: '999999999999999', + [CcipChainId.AstarEvm]: '6422105447186081193', [CcipChainId.SoneiumMinato]: '686603546605904534', // Todo: update - [CcipChainId.Soneium]: '999999999999999', + [CcipChainId.Soneium]: SONEIUM_CCIP_CHAIN_SELECTOR, }; const routerSoneiumMinato = '0x443a1bce545d56E2c3f20ED32eA588395FFce0f4'; -const routerSoneium = '0x443a1bce545d56E2c3f20ED32eA588395FFce0f4'; +const routerSoneium = SONEIUM_CCIP_ROUTER; const etherSenderReceiverShibuya = '0x89cB78A4A3cAD4cA86D3e3fF565f63B4620CB6ea'; -const etherSenderReceiverAstar = '0x89cB78A4A3cAD4cA86D3e3fF565f63B4620CB6ea'; +const etherSenderReceiverAstar = '0x4036a6Ff8C1a29677108Aef299B560f6E4fA5e71'; export const ccipBridgeAddress = { [CcipChainId.ShibuyaEvm]: etherSenderReceiverShibuya, - // Todo: update [CcipChainId.AstarEvm]: etherSenderReceiverAstar, [CcipChainId.SoneiumMinato]: routerSoneiumMinato, - // Todo: update [CcipChainId.Soneium]: routerSoneium, }; @@ -50,7 +54,7 @@ export const ccipBridgeIcon = { [CcipNetworkName.ShibuyaEvm]: require('src/assets/img/chain/astar.png'), [CcipNetworkName.AstarEvm]: require('src/assets/img/chain/astar.png'), [CcipNetworkName.SoneiumMinato]: require('src/assets/img/chain/soneium-black.svg'), - [CcipNetworkName.Soneium]: require('src/assets/img/chain/astar.png'), + [CcipNetworkName.Soneium]: require('src/assets/img/chain/soneium-black.svg'), } as any; export interface CCIP_TOKEN { @@ -72,6 +76,17 @@ export const CCIP_SBY: CCIP_TOKEN = { image: require('/src/assets/img/token/astr.png'), }; +export const CCIP_ASTR: CCIP_TOKEN = { + symbol: 'ASTR', + name: 'Astar Token', + tokenAddress: { + [CcipChainId.AstarEvm]: astarNativeTokenErcAddr, + [CcipChainId.Soneium]: SONEIUM_ASTR_CONTRACT, + }, + decimals: 18, + image: require('/src/assets/img/token/astr.png'), +}; + export const ccipBridgeTime = { [CcipNetworkName.ShibuyaEvm]: 3, [CcipNetworkName.AstarEvm]: 3, diff --git a/src/v2/repositories/implementations/CcipBridgeRepository.ts b/src/v2/repositories/implementations/CcipBridgeRepository.ts index 61facde0d..eb223a1e8 100644 --- a/src/v2/repositories/implementations/CcipBridgeRepository.ts +++ b/src/v2/repositories/implementations/CcipBridgeRepository.ts @@ -86,8 +86,10 @@ export class CcipBridgeRepository implements ICcipBridgeRepository { const contract = new web3.eth.Contract(abi as AbiItem[], contractAddress); const { destinationChainSelector, message } = this.getMessageArgs(param); const fee = await contract.methods.getFee(destinationChainSelector, message).call(); + // Memo: Add 5% of fee for buffer + const feeWithBuffer = ethers.BigNumber.from(fee).mul(105).div(100).toString(); - return fee; + return feeWithBuffer; } public async getBridgeCcipAssetData({ diff --git a/yarn.lock b/yarn.lock index 24e4ab79e..3dad0ff07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6402,7 +6402,7 @@ mini-svg-data-uri "^1.0.3" traverse "^0.6.6" -"@tailwindcss/postcss7-compat@^2.0.3": +"@tailwindcss/postcss7-compat@^2.0.3", "tailwindcss@npm:@tailwindcss/postcss7-compat@^2.0.3": version "2.2.17" resolved "https://registry.yarnpkg.com/@tailwindcss/postcss7-compat/-/postcss7-compat-2.2.17.tgz#dc78f3880a2af84163150ff426a39e42b9ae8922" integrity sha512-3h2svqQAqYHxRZ1KjsJjZOVTQ04m29LjfrLjXyZZEJuvUuJN+BCIF9GI8vhE1s0plS0mogd6E6YLg6mu4Wv/Vw== @@ -10625,6 +10625,11 @@ dot-prop@^5.1.0: dependencies: is-obj "^2.0.0" +dotenv@^16.4.7: + version "16.4.7" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.4.7.tgz#0e20c5b82950140aa99be360a8a5f52335f53c26" + integrity sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ== + duplexer2@~0.1.0: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer2/-/duplexer2-0.1.4.tgz#8b12dab878c0d69e3e7891051662a32fc6bddcc1" @@ -19357,47 +19362,6 @@ tailwindcss-theme-variants@^2.0.0-alpha.2: lodash "^4.17.21" postcss-selector-parser "^6.0.6" -"tailwindcss@npm:@tailwindcss/postcss7-compat@^2.0.3": - version "2.2.17" - resolved "https://registry.yarnpkg.com/@tailwindcss/postcss7-compat/-/postcss7-compat-2.2.17.tgz#dc78f3880a2af84163150ff426a39e42b9ae8922" - integrity sha512-3h2svqQAqYHxRZ1KjsJjZOVTQ04m29LjfrLjXyZZEJuvUuJN+BCIF9GI8vhE1s0plS0mogd6E6YLg6mu4Wv/Vw== - dependencies: - arg "^5.0.1" - autoprefixer "^9" - bytes "^3.0.0" - chalk "^4.1.2" - chokidar "^3.5.2" - color "^4.0.1" - cosmiconfig "^7.0.1" - detective "^5.2.0" - didyoumean "^1.2.2" - dlv "^1.1.3" - fast-glob "^3.2.7" - fs-extra "^10.0.0" - glob-parent "^6.0.1" - html-tags "^3.1.0" - is-color-stop "^1.1.0" - is-glob "^4.0.1" - lodash "^4.17.21" - lodash.topath "^4.5.2" - modern-normalize "^1.1.0" - node-emoji "^1.11.0" - normalize-path "^3.0.0" - object-hash "^2.2.0" - postcss "^7" - postcss-functions "^3" - postcss-js "^2" - postcss-load-config "^3.1.0" - postcss-nested "^4" - postcss-selector-parser "^6.0.6" - postcss-value-parser "^4.1.0" - pretty-hrtime "^1.0.3" - purgecss "^4.0.3" - quick-lru "^5.1.1" - reduce-css-calc "^2.1.8" - resolve "^1.20.0" - tmp "^0.2.1" - tapable@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2" From 15f7b2706500b73366ca93176aedfad4c03e2af3 Mon Sep 17 00:00:00 2001 From: impelcrypto Date: Fri, 27 Dec 2024 23:17:00 +0800 Subject: [PATCH 2/6] feat: updatated EvmNativeToken.vue --- .gitignore | 1 + src/components/assets/EvmNativeToken.vue | 49 +++++++++++++++++++----- src/config/localStorage.ts | 1 + 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 262255a7b..070f9ccbe 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,4 @@ astar-collator # Chopstick binaries db.sqlite* +.vercel diff --git a/src/components/assets/EvmNativeToken.vue b/src/components/assets/EvmNativeToken.vue index 070c15e66..a09170fcf 100644 --- a/src/components/assets/EvmNativeToken.vue +++ b/src/components/assets/EvmNativeToken.vue @@ -45,9 +45,9 @@
+ @@ -78,9 +94,9 @@ :is-disabled="!layerZeroBridgeEnabled" > - {{ $t('assets.bridge') }} + {{ $t('assets.bridgeToZkEvm') }} - {{ $t('assets.bridge') }} + {{ $t('assets.bridgeToZkEvm') }} @@ -192,6 +208,7 @@ export default defineComponent({ const isCcipBalloon = ref(false); const isBalloonClosing = ref(false); + const isSoneiumButtonHover = ref(false); const { currentNetworkName, @@ -306,6 +323,7 @@ export default defineComponent({ isCcipBalloon, isBalloonClosing, isAstarEvm, + isSoneiumButtonHover, closeCcipBalloon, buildCcipBridgePageLink, truncate, diff --git a/src/components/assets/styles/asset-list.scss b/src/components/assets/styles/asset-list.scss index 554d4e6c7..df54bf82d 100644 --- a/src/components/assets/styles/asset-list.scss +++ b/src/components/assets/styles/asset-list.scss @@ -441,6 +441,7 @@ display: block; text-align: center; margin-top: 10px; + width: 80px; @media (min-width: $sm) { display: none; } diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index 871479ac3..8d158e213 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -493,6 +493,7 @@ export default { faucet: 'Faucet', bridge: 'Bridge', bridgeToSoneium: 'Bridge to Soneium', + bridgeToZkEvm: 'Bridge to zkEVM', swap: 'Swap', manage: 'Manage', xcm: 'XCM', From 0432e99d11db9512cf574cc4ffe5c1a0b59f2ea6 Mon Sep 17 00:00:00 2001 From: impelcrypto Date: Mon, 13 Jan 2025 23:03:29 +0800 Subject: [PATCH 5/6] feat: updated chain information --- quasar.conf.js | 12 ++++------- src/config/env.ts | 7 ------- src/config/web3/index.ts | 10 +++------- src/modules/ccip-bridge/index.ts | 20 +++++-------------- .../information/hot-topics/transfer/index.ts | 2 +- 5 files changed, 13 insertions(+), 38 deletions(-) delete mode 100644 src/config/env.ts diff --git a/quasar.conf.js b/quasar.conf.js index 2d46e7dcb..5e1996b36 100644 --- a/quasar.conf.js +++ b/quasar.conf.js @@ -55,14 +55,10 @@ module.exports = configure(function (ctx) { // Full list of options: https://v2.quasar.dev/quasar-cli/quasar-conf-js#Property%3A-build build: { vueRouterMode: 'history', // available values: 'hash', 'history' - env: { - SONEIUM_RPC_URL: process.env.SONEIUM_RPC_URL, - SONEIUM_EXPLORER_URL: process.env.SONEIUM_EXPLORER_URL, - SONEIUM_CHAIN_ID:process.env.SONEIUM_CHAIN_ID, - SONEIUM_CCIP_CHAIN_SELECTOR:process.env.SONEIUM_CCIP_CHAIN_SELECTOR, - SONEIUM_CCIP_ROUTER:process.env.SONEIUM_CCIP_ROUTER, - SONEIUM_ASTR_CONTRACT:process.env.SONEIUM_ASTR_CONTRACT, - }, + // Memo: Create .env file in root directory to set environment variables + // env: { + // SONEIUM_CCIP_ROUTER:process.env.SONEIUM_CCIP_ROUTER, + // }, // transpile: false, // Add dependencies for transpiling with Babel (Array of string/regex) diff --git a/src/config/env.ts b/src/config/env.ts deleted file mode 100644 index 7829526e0..000000000 --- a/src/config/env.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Memo: This is temporary -export const SONEIUM_RPC_URL = String(process.env.SONEIUM_RPC_URL); -export const SONEIUM_EXPLORER_URL = String(process.env.SONEIUM_EXPLORER_URL); -export const SONEIUM_CHAIN_ID = Number(process.env.SONEIUM_CHAIN_ID); -export const SONEIUM_CCIP_CHAIN_SELECTOR = String(process.env.SONEIUM_CCIP_CHAIN_SELECTOR); -export const SONEIUM_CCIP_ROUTER = String(process.env.SONEIUM_CCIP_ROUTER); -export const SONEIUM_ASTR_CONTRACT = String(process.env.SONEIUM_ASTR_CONTRACT); diff --git a/src/config/web3/index.ts b/src/config/web3/index.ts index 2a2346c62..f474b79da 100644 --- a/src/config/web3/index.ts +++ b/src/config/web3/index.ts @@ -1,5 +1,4 @@ import { providerEndpoints, endpointKey } from 'src/config/chainEndpoints'; -import { SONEIUM_CHAIN_ID, SONEIUM_EXPLORER_URL, SONEIUM_RPC_URL } from '../env'; export { getChainData, setupNetwork, @@ -50,8 +49,7 @@ export enum EVM { MOONRIVER = 1285, MOONBEAM = 1284, SONEIUM_MINATO_TESTNET = 1946, - // Todo: update - SONEIUM = SONEIUM_CHAIN_ID, + SONEIUM = 1868, } export const chainName = { @@ -167,8 +165,7 @@ export const rpcUrls = { [EVM.MOONRIVER]: ['https://rpc.api.moonriver.moonbeam.network'], [EVM.MOONBEAM]: ['https://rpc.api.moonbeam.network'], [EVM.SONEIUM_MINATO_TESTNET]: ['https://rpc.minato.soneium.org'], - // Todo: update - [EVM.SONEIUM]: [SONEIUM_RPC_URL], + [EVM.SONEIUM]: ['https://rpc.soneium.org/'], }; export const blockExplorerUrls = { @@ -185,8 +182,7 @@ export const blockExplorerUrls = { [EVM.MOONRIVER]: ['https://moonriver.moonscan.io'], [EVM.MOONBEAM]: ['https://moonbeam.moonscan.io'], [EVM.SONEIUM_MINATO_TESTNET]: ['https://soneium-minato.blockscout.com'], - // Todo: update - [EVM.SONEIUM]: [SONEIUM_EXPLORER_URL], + [EVM.SONEIUM]: ['https://soneium.blockscout.com'], }; export const CHAIN_INFORMATION = { diff --git a/src/modules/ccip-bridge/index.ts b/src/modules/ccip-bridge/index.ts index 5ebeac70e..031fea992 100644 --- a/src/modules/ccip-bridge/index.ts +++ b/src/modules/ccip-bridge/index.ts @@ -1,9 +1,3 @@ -import { - SONEIUM_ASTR_CONTRACT, - SONEIUM_CCIP_CHAIN_SELECTOR, - SONEIUM_CCIP_ROUTER, - SONEIUM_CHAIN_ID, -} from 'src/config/env'; import { astarNativeTokenErcAddr } from '../xcm'; export enum CcipNetworkName { @@ -17,8 +11,7 @@ export enum CcipChainId { 'ShibuyaEvm' = 81, 'AstarEvm' = 592, 'SoneiumMinato' = 1946, - // Todo: update - 'Soneium' = SONEIUM_CHAIN_ID, + 'Soneium' = 1868, } export const ccipChainId = { @@ -30,15 +23,13 @@ export const ccipChainId = { export const ccipChainSelector = { [CcipChainId.ShibuyaEvm]: '6955638871347136141', - // Todo: update [CcipChainId.AstarEvm]: '6422105447186081193', [CcipChainId.SoneiumMinato]: '686603546605904534', - // Todo: update - [CcipChainId.Soneium]: SONEIUM_CCIP_CHAIN_SELECTOR, + [CcipChainId.Soneium]: '12505351618335765396', }; const routerSoneiumMinato = '0x443a1bce545d56E2c3f20ED32eA588395FFce0f4'; -const routerSoneium = SONEIUM_CCIP_ROUTER; +const routerSoneium = '0x8C8B88d827Fe14Df2bc6392947d513C86afD6977'; const etherSenderReceiverShibuya = '0x89cB78A4A3cAD4cA86D3e3fF565f63B4620CB6ea'; const etherSenderReceiverAstar = '0x4036a6Ff8C1a29677108Aef299B560f6E4fA5e71'; @@ -81,7 +72,7 @@ export const CCIP_ASTR: CCIP_TOKEN = { name: 'Astar Token', tokenAddress: { [CcipChainId.AstarEvm]: astarNativeTokenErcAddr, - [CcipChainId.Soneium]: SONEIUM_ASTR_CONTRACT, + [CcipChainId.Soneium]: '0x2CAE934a1e84F693fbb78CA5ED3B0A6893259441', }, decimals: 18, image: require('/src/assets/img/token/astr.png'), @@ -91,6 +82,5 @@ export const ccipBridgeTime = { [CcipNetworkName.ShibuyaEvm]: 3, [CcipNetworkName.AstarEvm]: 3, [CcipNetworkName.SoneiumMinato]: 30, - // Todo: update to 60 - [CcipNetworkName.Soneium]: 90, + [CcipNetworkName.Soneium]: 120, }; diff --git a/src/modules/information/hot-topics/transfer/index.ts b/src/modules/information/hot-topics/transfer/index.ts index 5f94844e4..ea1ce22d9 100644 --- a/src/modules/information/hot-topics/transfer/index.ts +++ b/src/modules/information/hot-topics/transfer/index.ts @@ -2,6 +2,6 @@ import { Faq } from 'src/modules/information'; export const hotTopics: Faq[] = [ { title: 'Find latest news here', - url: 'https://medium.com/astar-network', + url: 'https://astar.network/blog', }, ]; From 23c20c001fefddba97af9fcef572ed5ed61ae604 Mon Sep 17 00:00:00 2001 From: impelcrypto Date: Tue, 14 Jan 2025 09:15:56 +0800 Subject: [PATCH 6/6] fix: updated ccipBridgeEnabled condition --- src/components/bridge/ccip/CcipBridge.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/bridge/ccip/CcipBridge.vue b/src/components/bridge/ccip/CcipBridge.vue index 71bf04d34..1c6d2c616 100644 --- a/src/components/bridge/ccip/CcipBridge.vue +++ b/src/components/bridge/ccip/CcipBridge.vue @@ -162,7 +162,7 @@ import { EthBridgeNetworkName } from 'src/modules/zk-evm-bridge'; import { useStore } from 'src/store'; import { PropType, computed, defineComponent, ref, watch } from 'vue'; import Jazzicon from 'vue3-jazzicon/src/components'; -import { ccipMinatoBridgeEnabled } from 'src/features'; +import { ccipMinatoBridgeEnabled, ccipSoneiumBridgeEnabled } from 'src/features'; import { ccipBridgeIcon, CCIP_TOKEN, @@ -255,7 +255,7 @@ export default defineComponent({ }, setup(props) { const { currentAccount } = useAccount(); - const { nativeTokenSymbol } = useNetworkInfo(); + const { nativeTokenSymbol, isShibuyaEvm, isAstarEvm } = useNetworkInfo(); const store = useStore(); const isHandling = ref(false); const isLoading = computed(() => store.getters['general/isLoading']); @@ -318,9 +318,12 @@ export default defineComponent({ isHandling.value = false; }; - // Todo: update for Soneium const ccipBridgeEnabled = computed(() => { - return ccipMinatoBridgeEnabled; + return isShibuyaEvm.value + ? ccipMinatoBridgeEnabled + : isAstarEvm.value + ? ccipSoneiumBridgeEnabled + : false; }); watch(