From 3510cf43db2db7009dd7a89912ea4948e17bae53 Mon Sep 17 00:00:00 2001 From: jaybuidl Date: Fri, 25 Aug 2023 14:55:06 +0800 Subject: [PATCH] refactor: no more hardcoded contract address nor network config, rely on wagmi and viem --- cspell.json | 2 ++ web/src/components/ConnectWallet/index.tsx | 2 +- web/src/consts/chains.ts | 28 ++++++------------- web/src/consts/index.ts | 4 --- web/src/hooks/useContractAddress.tsx | 27 ++++++++++++++++++ web/src/pages/Courts/CourtDetails/Stats.tsx | 10 ++----- web/src/pages/Courts/CourtDetails/index.tsx | 5 ++-- .../Dashboard/JurorInfo/JurorRewards.tsx | 10 ++----- web/src/pages/Home/CourtOverview/Stats.tsx | 10 ++----- 9 files changed, 51 insertions(+), 47 deletions(-) create mode 100644 web/src/hooks/useContractAddress.tsx diff --git a/cspell.json b/cspell.json index a1f4e8bf3..395e0e01e 100644 --- a/cspell.json +++ b/cspell.json @@ -14,6 +14,7 @@ "codegen", "commify", "commitlint", + "consts", "COOLDOWN", "datetime", "devnet", @@ -33,6 +34,7 @@ "solhint", "typechain", "Unslashed", + "viem", "wagmi" ], "ignoreWords": [], diff --git a/web/src/components/ConnectWallet/index.tsx b/web/src/components/ConnectWallet/index.tsx index 89e44bd03..f1c30a007 100644 --- a/web/src/components/ConnectWallet/index.tsx +++ b/web/src/components/ConnectWallet/index.tsx @@ -22,7 +22,7 @@ export const SwitchChainButton: React.FC = () => {