Skip to content

Commit

Permalink
ZKFair chain added with the .fairchat TLD
Browse files Browse the repository at this point in the history
  • Loading branch information
tempe-techie committed Dec 21, 2023
1 parent 4149302 commit 015b877
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/abi/addresses.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"4002": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"80001": "0xC74f279E5A7FDAd6624054518773ae4EC77E78D3",
"42161": "0x4bD57a848c56E6241296a1256FB2bDEbCdbb9dB0",
"42766": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1",
"59144": "0xbbA4dB63DA448C124ee38EeC636b697CA9bdf9e1",
"167007": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1",
"421611": "0x844d982FDc1F5C8eaD82E95d522F2486a7CBb3EE",
Expand Down
1 change: 1 addition & 0 deletions src/abi/resolver.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"4002": "0xa97c7AF10ee564EBf452A9347bB9653454Ba69C0",
"80001": "0xC17E9347Ce26D7630A98eC4158Bd7200E54bf4Cd",
"42161": "0xd64A2DF9d73CD1Cb50139A3eC3176070e00C67cA",
"42766": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"59144": "0x2f5cd4366c16AFC3b04A4b2327BbFf9e3955dbC1",
"167007": "0xeA2f99fE93E5D07F61334C5Eb9c54c5D5C957a6a",
"421611": "0xe2b9bC4c1d65B5F5583144d9d5c5F0683158C372",
Expand Down
3 changes: 3 additions & 0 deletions src/abi/tlds.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
".misie": "0x526Ff108F5d422d0e1d6650E2Bc015BBE1fdb058",
".ppl": "0xbC9d19e5f97a572f428F7292DBf3dc182Cc05C82"
},
"42766": {
".fairchat": "0x4087fb91A1fBdef05761C02714335D232a2Bf3a1"
},
"59144": {
".alinea": "0x6c66f1d5684630fb69350a7a88bcca60629d7252"
},
Expand Down
3 changes: 3 additions & 0 deletions src/abi/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"LINK": "0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",
"UNI": "0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0"
},
"42766": {
"USDC": "0x0"
},
"59144": {
"ETH": "0x0"
},
Expand Down
16 changes: 16 additions & 0 deletions src/hooks/useChainHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export default function useChainHelpers() {
return "Fantom Testnet";
} else if (chainId === 42161) {
return "Arbitrum";
} else if (chainId === 42766) {
return "ZKFair";
} else if (chainId === 59144) {
return "Linea";
} else if (chainId === 80001) {
Expand Down Expand Up @@ -123,6 +125,11 @@ export default function useChainHelpers() {
urls = [
"https://rpc.ankr.com/arbitrum"
];
} else if (networkId === 42766) {
// zkFair
urls = [
"https://rpc.zkfair.io"
];
} else if (networkId === 59144) {
// Linea
urls = [
Expand Down Expand Up @@ -350,6 +357,15 @@ export default function useChainHelpers() {
nativeCurrency: { decimals: 18, name: "ETH", symbol: "ETH" },
rpcUrls: ["https://rpc.jolnir.taiko.xyz"]
}]
} else if (networkName == "ZKFair") {
method = "wallet_addEthereumChain"
params = [{
blockExplorerUrls: [ "https://scan.zkfair.io/" ],
chainId: "0xa70e",
chainName: "ZKFair",
nativeCurrency: { decimals: 18, name: "USDC", symbol: "USDC" },
rpcUrls: ["https://rpc.zkfair.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 @@ -16,6 +16,7 @@ export default {
137: "Polygon",
255: "Kroma",
42161: "Arbitrum",
42766: "ZKFair",
59144: "Linea",
534352: "Scroll",
56: "BNB Smart Chain",
Expand Down Expand Up @@ -53,6 +54,8 @@ export default {
return "https://testnet.ftmscan.com";
} else if (chainId.value === 42161) {
return "https://arbiscan.io";
} else if (chainId.value === 42766) {
return "https://scan.zkfair.io";
} else if (chainId.value === 59144) {
return "https://lineascan.build";
} else if (chainId.value === 80001) {
Expand Down Expand Up @@ -97,6 +100,8 @@ export default {
return "https://testnet.ftmscan.com";
} else if (netId === 42161) {
return "https://arbiscan.io";
} else if (netId === 42766) {
return "https://scan.zkfair.io";
} else if (netId === 59144) {
return "https://lineascan.build";
} else if (netId === 80001) {
Expand Down Expand Up @@ -185,6 +190,11 @@ export default {
urls = [
"https://rpc.ankr.com/arbitrum",
];
} else if (networkId === 42766) {
// ZKFair
urls = [
"https://rpc.zkfair.io",
];
} else if (networkId === 59144) {
// Linea
urls = [
Expand Down Expand Up @@ -309,6 +319,9 @@ export default {
} else if (chainId.value === 42161) {
state.networkName = "Arbitrum";
state.networkCurrency = "ETH";
} else if (chainId.value === 42766) {
state.networkName = "ZKFair";
state.networkCurrency = "USDC";
} else if (chainId.value === 59144) {
state.networkName = "Linea";
state.networkCurrency = "ETH";
Expand Down

0 comments on commit 015b877

Please sign in to comment.