Skip to content

Commit

Permalink
scroll mainnet added
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Nov 23, 2023
1 parent cbe7907 commit 43dfd95
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/abi/tlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
"421613": {
".testoasis": "0xBDACF94dDCAB51c39c2dD50BffEe60Bb8021949a"
},
"534352": {
".alscroll": "0x4087fb91A1fBdef05761C02714335D232a2Bf3a1"
},
"1313161555": {
".testrora": "0x4087fb91a1fbdef05761c02714335d232a2bf3a1"
}
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/useChainHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default function useChainHelpers() {
return "Polygon Testnet";
} else if (chainId === 421611) {
return "Arbitrum Testnet";
} else if (chainId === 534352) {
return "Scroll Mainnet";
} else if (chainId === 1313161555) {
return "Aurora Testnet";
} else {
Expand Down Expand Up @@ -120,6 +122,11 @@ export default function useChainHelpers() {
urls = [
"https://rinkeby.arbitrum.io/rpc"
];
} else if (networkId === 534352) {
// Scroll mainnet
urls = [
"https://rpc.scroll.io/"
];
} else if (networkId === 1313161555) {
// Aurora testnet
urls = [
Expand Down Expand Up @@ -286,6 +293,15 @@ export default function useChainHelpers() {
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://mainnet.era.zksync.io"]
}]
} else if (networkName == "Scroll") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://scrollscan.com/" ],
chainId: "0x82750",
chainName: "Scroll",
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://rpc.scroll.io/"]
}]
}

return {
Expand Down
13 changes: 13 additions & 0 deletions src/store/modules/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default {
100: "Gnosis Chain",
137: "Polygon",
42161: "Arbitrum",
534352: "Scroll",
56: "BNB Smart Chain"
}
}),
Expand Down Expand Up @@ -53,6 +54,8 @@ export default {
return "https://testnet.arbiscan.io";
} else if (chainId.value === 1313161555) {
return "https://testnet.aurorascan.dev";
} else if (chainId.value === 534352) {
return "https://rpc.scroll.io/";
}
},

Expand Down Expand Up @@ -89,6 +92,8 @@ export default {
return "https://testnet.arbiscan.io";
} else if (netId === 1313161555) {
return "https://testnet.aurorascan.dev";
} else if (netId === 534352) {
return "https://rpc.scroll.io/";
}
},

Expand Down Expand Up @@ -180,6 +185,11 @@ export default {
urls = [
"https://testnet.aurora.dev"
];
}else if (networkId === 534352) {
// Scroll
urls = [
"https://rpc.scroll.io/"
];
}

if (urls) {
Expand Down Expand Up @@ -284,6 +294,9 @@ export default {
} else if (chainId.value === 1313161555) {
state.networkName = "Aurora Testnet";
state.networkCurrency = "ETH";
} else if (chainId.value === 534352) {
state.networkName = "Scroll";
state.networkCurrency = "ETH";
} else {
state.networkName = "Unsupported Network";
state.networkCurrency = "ETH";
Expand Down

0 comments on commit 43dfd95

Please sign in to comment.