Skip to content

Commit

Permalink
scroll and kroma addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Dec 5, 2023
1 parent 43dfd95 commit 08c795b
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
2 changes: 2 additions & 0 deletions src/abi/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
"100": "0xA8221890768603210c1a32d88374111084E46E6d",
"137": "0xB6cf67a0aCE92F357908C6eF716a34c9b196c1DC",
"250": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"255": "0xbbA4dB63DA448C124ee38EeC636b697CA9bdf9e1",
"4002": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"80001": "0xC74f279E5A7FDAd6624054518773ae4EC77E78D3",
"42161": "0x4bD57a848c56E6241296a1256FB2bDEbCdbb9dB0",
"421611": "0x844d982FDc1F5C8eaD82E95d522F2486a7CBb3EE",
"534352": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1",
"1313161555": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1"
}
}
2 changes: 2 additions & 0 deletions src/abi/resolver.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
"100": "0x7Df67B2ef4eEDf49Fc53Bb6E94e90e9546FC6c6B",
"137": "0x07884566cdED43eDaec7813C1523624202b060D3",
"250": "0xa97c7AF10ee564EBf452A9347bB9653454Ba69C0",
"255": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1",
"4002": "0xa97c7AF10ee564EBf452A9347bB9653454Ba69C0",
"80001": "0xC17E9347Ce26D7630A98eC4158Bd7200E54bf4Cd",
"42161": "0xd64A2DF9d73CD1Cb50139A3eC3176070e00C67cA",
"421611": "0xe2b9bC4c1d65B5F5583144d9d5c5F0683158C372",
"534352": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"1313161555": "0x4aBf8b364ac4aF048Ea077AAA2EDF3e1e1EC0f9c"
}
3 changes: 3 additions & 0 deletions src/abi/tlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"250": {
".fantom": "0xbdacf94ddcab51c39c2dd50bffee60bb8021949a"
},
"255": {
".alkroma": "0x6c66f1d5684630fb69350a7a88bcca60629d7252"
},
"324": {
".zksoul": "0xe36507aD67Ac0aE6D27D22b407A9338b136315df"
},
Expand Down
6 changes: 6 additions & 0 deletions src/abi/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"250": {
"FTM": "0x0"
},
"255": {
"ETH": "0x0"
},
"4002": {
"FTM": "0x0"
},
Expand All @@ -72,5 +75,8 @@
},
"421611": {
"ETH": "0x0"
},
"534352": {
"ETH": "0x0"
}
}
16 changes: 16 additions & 0 deletions src/hooks/useChainHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export default function useChainHelpers() {
return "Polygon";
} else if (chainId === 250) {
return "Fantom";
} else if (chainId === 255) {
return "Kroma";
} else if (chainId === 324) {
return "zkSync Era";
} else if (chainId === 4002) {
Expand Down Expand Up @@ -95,6 +97,11 @@ export default function useChainHelpers() {
urls = [
"https://rpc.ankr.com/fantom",
];
} else if (networkId === 255) {
// Kroma Mainnet
urls = [
"https://api.kroma.network/",
];
} else if (networkId === 324) {
// zkSync Era Mainnet
urls = [
Expand Down Expand Up @@ -302,6 +309,15 @@ export default function useChainHelpers() {
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://rpc.scroll.io/"]
}]
} else if (networkName == "Kroma") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://blockscout.kroma.network/" ],
chainId: "0xff",
chainName: "Kroma",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://api.kroma.network/"]
}]
}

return {
Expand Down
27 changes: 20 additions & 7 deletions src/store/modules/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default {
10: "Optimism",
100: "Gnosis Chain",
137: "Polygon",
255: "Kroma",
42161: "Arbitrum",
534352: "Scroll",
56: "BNB Smart Chain"
Expand Down Expand Up @@ -44,6 +45,8 @@ export default {
return "https://polygonscan.com";
} else if (chainId.value === 250) {
return "https://ftmscan.com";
} else if (chainId.value === 255) {
return "https://blockscout.kroma.network";
} else if (chainId.value === 4002) {
return "https://testnet.ftmscan.com";
} else if (chainId.value === 42161) {
Expand All @@ -55,7 +58,7 @@ export default {
} else if (chainId.value === 1313161555) {
return "https://testnet.aurorascan.dev";
} else if (chainId.value === 534352) {
return "https://rpc.scroll.io/";
return "https://scrollscan.com";
}
},

Expand All @@ -82,6 +85,8 @@ export default {
return "https://polygonscan.com";
} else if (netId === 250) {
return "https://ftmscan.com";
} else if (netId === 255) {
return "https://blockscout.kroma.network";
} else if (netId === 4002) {
return "https://testnet.ftmscan.com";
} else if (netId === 42161) {
Expand All @@ -93,7 +98,7 @@ export default {
} else if (netId === 1313161555) {
return "https://testnet.aurorascan.dev";
} else if (netId === 534352) {
return "https://rpc.scroll.io/";
return "https://scrollscan.com";
}
},

Expand Down Expand Up @@ -153,6 +158,11 @@ export default {
urls = [
"https://rpc.ankr.com/fantom"
];
} else if (networkId === 255) {
// Kroma Mainnet
urls = [
"https://api.kroma.network/"
];
} else if (networkId === 4002) {
// Fantom Testnet
urls = [
Expand Down Expand Up @@ -180,16 +190,16 @@ export default {
urls = [
"https://goerli-rollup.arbitrum.io/rpc"
];
} else if (networkId === 534352) {
// Scroll
urls = [
"https://rpc.scroll.io/"
];
} else if (networkId === 1313161555) {
// Aurora testnet
urls = [
"https://testnet.aurora.dev"
];
}else if (networkId === 534352) {
// Scroll
urls = [
"https://rpc.scroll.io/"
];
}

if (urls) {
Expand Down Expand Up @@ -270,6 +280,9 @@ export default {
} else if (chainId.value === 250) {
state.networkName = "Fantom";
state.networkCurrency = "FTM";
} else if (chainId.value === 255) {
state.networkName = "Kroma";
state.networkCurrency = "ETH";
} else if (chainId.value === 4002) {
state.networkName = "Fantom Testnet";
state.networkCurrency = "FTM";
Expand Down

0 comments on commit 08c795b

Please sign in to comment.