From a2ec72479dad7018e9dea56fbd73b5c1d2c219ac Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:54:21 -0600 Subject: [PATCH] Ink testnet and Worldchain mainnet support (#737) --- core/base/src/constants/chains.ts | 1 + core/base/src/constants/contracts/core.ts | 2 ++ core/base/src/constants/contracts/tokenBridge.ts | 2 ++ core/base/src/constants/finality.ts | 1 + core/base/src/constants/nativeChainIds.ts | 2 ++ core/base/src/constants/platforms.ts | 1 + core/base/src/constants/rpc.ts | 2 ++ core/icons/src/constants/chainIcons.ts | 5 +++++ core/icons/src/images/chains/Ink.svg | 3 +++ 9 files changed, 19 insertions(+) create mode 100644 core/icons/src/images/chains/Ink.svg diff --git a/core/base/src/constants/chains.ts b/core/base/src/constants/chains.ts index dffca0d0a..6cb8ce014 100644 --- a/core/base/src/constants/chains.ts +++ b/core/base/src/constants/chains.ts @@ -50,6 +50,7 @@ const chainIdAndChainEntries = [ [ 43, "Snaxchain" ], [ 44, "Unichain" ], [ 45, "Worldchain" ], + [ 46, "Ink" ], [ 3104, "Wormchain" ], [ 4000, "Cosmoshub" ], [ 4001, "Evmos" ], diff --git a/core/base/src/constants/contracts/core.ts b/core/base/src/constants/contracts/core.ts index fb0a120b6..aa8201681 100644 --- a/core/base/src/constants/contracts/core.ts +++ b/core/base/src/constants/contracts/core.ts @@ -40,6 +40,7 @@ export const coreBridgeContracts = [[ ["Scroll", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], ["Mantle", "0xbebdb6C8ddC678FfA9f8748f85C815C556Dd8ac6"], ["Snaxchain", "0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"], + ["Worldchain","0xcbcEe4e081464A15d8Ad5f58BB493954421eB506"], ]], [ "Testnet", [ ["Solana", "3u8hJUVTA4jH1wYAyUur7FFZVQ8H635K3tSHHF4ssjQ5"], @@ -87,6 +88,7 @@ export const coreBridgeContracts = [[ ["Snaxchain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Unichain", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Worldchain", "0xe5E02cD12B6FcA153b0d7fF4bF55730AE7B3C93A"], + ["Ink", "0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"], ["Xlayer", "0xA31aa3FDb7aF7Db93d18DDA4e19F811342EDF780"], ["Linea", "0x79A1027a6A159502049F10906D333EC57E95F083"], ["MonadDevnet", "0x376428e7f26D5867e69201b275553C45B09EE090"], diff --git a/core/base/src/constants/contracts/tokenBridge.ts b/core/base/src/constants/contracts/tokenBridge.ts index a4ca4ffad..5f48ab2fb 100644 --- a/core/base/src/constants/contracts/tokenBridge.ts +++ b/core/base/src/constants/contracts/tokenBridge.ts @@ -36,6 +36,7 @@ export const tokenBridgeContracts = [[ ["Scroll", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Mantle", "0x24850c6f61C438823F01B7A3BF2B89B72174Fa9d"], ["Snaxchain", "0x8B94bfE456B48a6025b92E11Be393BAa86e68410"], + ["Worldchain","0xc309275443519adca74c9136b02A38eF96E3a1f6"], ]], [ "Testnet", [ ["Solana", "DZnkkTmCiFWfYTfT41X3Rd1kDgozqzxWaHqsw6W4x2oe"], @@ -79,6 +80,7 @@ export const tokenBridgeContracts = [[ ["Snaxchain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Unichain", "0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a"], ["Worldchain", "0x430855B4D43b8AEB9D2B9869B74d58dda79C0dB2"], + ["Ink", "0x376428e7f26D5867e69201b275553C45B09EE090"], ["Linea", "0xC7A204bDBFe983FCD8d8E61D02b475D4073fF97e"], ]], [ "Devnet", [ diff --git a/core/base/src/constants/finality.ts b/core/base/src/constants/finality.ts index 94e0360c1..a1640aa9a 100644 --- a/core/base/src/constants/finality.ts +++ b/core/base/src/constants/finality.ts @@ -62,6 +62,7 @@ const finalityThresholds = [ ["Snaxchain", 512], ["Unichain", 512], ["Worldchain",512], + ["Ink", 512], ["Cosmoshub", 0], ["Evmos", 0], ["Kujira", 0], diff --git a/core/base/src/constants/nativeChainIds.ts b/core/base/src/constants/nativeChainIds.ts index 84d6b1a8a..dabb83b03 100644 --- a/core/base/src/constants/nativeChainIds.ts +++ b/core/base/src/constants/nativeChainIds.ts @@ -54,6 +54,7 @@ const chainNetworkNativeChainIdEntries = [ ["Blast", 81457n], ["Linea", 59144n], ["Snaxchain", 2192n], + ["Worldchain",480n], ], ], [ @@ -108,6 +109,7 @@ const chainNetworkNativeChainIdEntries = [ ["Snaxchain", 13001n], ["Unichain", 1301n], ["Worldchain", 4801n], + ["Ink", 763373n], ["Xlayer", 195n], ["Linea", 59141n], // Sepolia ["MonadDevnet", 41454n], diff --git a/core/base/src/constants/platforms.ts b/core/base/src/constants/platforms.ts index af5419e83..919b7598b 100644 --- a/core/base/src/constants/platforms.ts +++ b/core/base/src/constants/platforms.ts @@ -39,6 +39,7 @@ const platformAndChainsEntries = [[ "Snaxchain", "Unichain", "Worldchain", + "Ink", "MonadDevnet", ]], [ "Solana", [ diff --git a/core/base/src/constants/rpc.ts b/core/base/src/constants/rpc.ts index cff7a9bd9..30aa6bcc1 100644 --- a/core/base/src/constants/rpc.ts +++ b/core/base/src/constants/rpc.ts @@ -46,6 +46,7 @@ const rpcConfig = [[ ["Mantle", "https://rpc.mantle.xyz"], ["Klaytn", "https://rpc.ankr.com/klaytn"], ["Snaxchain", "https://mainnet.snaxchain.io"], + ["Worldchain","https://worldchain-mainnet.g.alchemy.com/public"], ]], [ "Testnet", [ ["Ethereum", "https://eth-goerli.public.blastapi.io"], @@ -91,6 +92,7 @@ const rpcConfig = [[ ["Snaxchain", "https://testnet.snaxchain.io"], ["Unichain", "https://sepolia.unichain.org"], ["Worldchain", "https://worldchain-sepolia.g.alchemy.com/public"], + ["Ink", "https://rpc-qnd-sepolia.inkonchain.com"], ["MonadDevnet", ""], // TODO: No public rpc is currently available, override with a custom rpc for now. ]], [ "Devnet", [ diff --git a/core/icons/src/constants/chainIcons.ts b/core/icons/src/constants/chainIcons.ts index 026fb98a6..fe7acbae6 100644 --- a/core/icons/src/constants/chainIcons.ts +++ b/core/icons/src/constants/chainIcons.ts @@ -205,6 +205,11 @@ export function chainToIcon(chain: Chain): string { PREFIX + "PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIj4gIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9IiMwMDAiIHJ4PSIyNTYiIC8+ICA8ZyBjbGlwLXBhdGg9InVybCgjd29ybGQtY2hhaW4tYSkiPiAgICA8bWFzayAgICAgIGlkPSJ3b3JsZC1jaGFpbi1iIiAgICAgIHdpZHRoPSIzMjkiICAgICAgaGVpZ2h0PSIzMjkiICAgICAgeD0iOTIiICAgICAgeT0iOTEiICAgICAgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSIgICAgPiAgICAgIDxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik05MiA5MWgzMjl2MzI5SDkyVjkxWiIgLz4gICAgPC9tYXNrPiAgICA8ZyBtYXNrPSJ1cmwoI3dvcmxkLWNoYWluLWIpIj4gICAgICA8cGF0aCAgICAgICAgZmlsbD0iI2ZmZiIgICAgICAgIGQ9Ik00MDguMDQ5IDE5MS40NzJjLTguMjk0LTE5LjYwMS0yMC4xNDktMzcuMTY4LTM1LjI1MS01Mi4yNy0xNS4xMDItMTUuMTAzLTMyLjcwOC0yNi45NTctNTIuMjctMzUuMjUyQzMwMC4yMjIgOTUuMzQzIDI3OC43MDMgOTEgMjU2LjQ4MSA5MWMtMjIuMTg0IDAtNDMuNzQyIDQuMzQzLTY0LjA0OCAxMi45NTEtMTkuNjAxIDguMjk0LTM3LjE2OSAyMC4xNDktNTIuMjcgMzUuMjUxLTE1LjEwMiAxNS4xMDIt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M5Ljg0M0MxNDkuMzkxIDE1NC42NjEgMTU3LjEyNSAxNjIuMzI4IDE1Ny4xMjUgMTcxLjgyMUMxNTcuMTI1IDE4MS4yODYgMTQ5LjM5MSAxODguOTU0IDEzOS44NDMgMTg4Ljk1NEgxMjIuMDA2QzExMi40MyAxODguOTU0IDEwNC42OTUgMTk2LjYyMSAxMDQuNjk1IDIwNi4wODZDMTA0LjY5NSAyMTUuNTc5IDExMi42MjIgMjIyLjUwOSAxMjIuMDA2IDIyMy4yMTlDMTIyLjc0NSAyMjMuMjc1IDEyMy40MjIgMjIzLjMyNiAxMjQuMDQ1IDIyMy4zNzRDMTI3LjM0NyAyMjMuNjI1IDEyOS4xNTEgMjIzLjc2MyAxMzAuOTU4IDIyMy44MzhDMTMzLjEzNCAyMjMuOTI5IDEzNS4zMTQgMjIzLjkyOSAxNDAuMTE5IDIyMy45MjlDMTQ5LjY2NyAyMjMuOTI5IDE1Ny4xMjUgMjMwLjk0MiAxNTcuMTI1IDI0MC40MDdaIiBmaWxsPSIjNzEzMkY1Ii8+PC9zdmc+" + ); } else if (chain === "Wormchain") { return ( PREFIX + diff --git a/core/icons/src/images/chains/Ink.svg b/core/icons/src/images/chains/Ink.svg new file mode 100644 index 000000000..6859ec928 --- /dev/null +++ b/core/icons/src/images/chains/Ink.svg @@ -0,0 +1,3 @@ + + +