diff --git a/bun.lockb b/bun.lockb index 50772376..d38b0653 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/input/function-params-form.tsx b/components/input/function-params-form.tsx index 895cc692..4353de10 100644 --- a/components/input/function-params-form.tsx +++ b/components/input/function-params-form.tsx @@ -70,7 +70,7 @@ export const FunctionParamsForm = ({ }; return ( -
+
0}>

Parameters

diff --git a/hooks/useAbi.ts b/hooks/useAbi.ts index f9b4ef49..2500ced2 100644 --- a/hooks/useAbi.ts +++ b/hooks/useAbi.ts @@ -3,10 +3,10 @@ import { whatsabi } from "@shazow/whatsabi"; import { usePublicClient } from "wagmi"; import { AbiFunction } from "abitype"; import { useQuery } from "@tanstack/react-query"; -import { isAddress, isContract } from "@/utils/evm"; +import { ADDRESS_ZERO, isAddress, isContract } from "@/utils/evm"; import { PUB_CHAIN, PUB_ETHERSCAN_API_KEY } from "@/constants"; import { useAlerts } from "@/context/Alerts"; -import { getImplementation, isProxyContract } from "@/utils/proxies"; +import { getImplementation } from "@/utils/proxies"; import { ChainName } from "@/utils/chains"; const CHAIN_NAME = PUB_CHAIN.name.toLowerCase() as ChainName; @@ -23,14 +23,13 @@ export const useAbi = (contractAddress: Address) => { return null; } - return isProxyContract(publicClient, contractAddress) - .then((isProxy) => { - if (!isProxy) return null; - return getImplementation(publicClient, contractAddress); + return getImplementation(publicClient, contractAddress) + .then((address) => { + if (!address || address === ADDRESS_ZERO) return null; + return address; }) .catch(() => null); }, - initialData: null, retry: 6, refetchOnMount: false, refetchOnReconnect: false, diff --git a/package.json b/package.json index 505f5356..e3d1e93a 100644 --- a/package.json +++ b/package.json @@ -36,10 +36,10 @@ "dompurify": "^3.1.6", "libsodium-wrappers": "^0.7.15", "multiformats": "^13.2.2", - "next": "14.2.6", - "react": "^18.3.1", + "next": "14.1.4", + "react": "18.2.0", "react-blockies": "^1.4.1", - "react-dom": "^18.3.1", + "react-dom": "18.2.0", "react-hook-form": "^7.52.1", "viem": "^2.19.8", "wagmi": "2.12.7" @@ -57,7 +57,7 @@ "autoprefixer": "^10.4.19", "dotenv": "^16.4.5", "eslint": "^8.57.0", - "eslint-config-next": "14.2.6", + "eslint-config-next": "14.1.4", "eslint-config-prettier": "^9.1.0", "husky": "^9.0.11", "lint-staged": "^15.2.2", diff --git a/pages/index.tsx b/pages/index.tsx index e1dfb4ed..48f58c7a 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -25,7 +25,7 @@ export default function StandardHome() {
- diff --git a/utils/proxies.ts b/utils/proxies.ts index cbb5d242..139515de 100644 --- a/utils/proxies.ts +++ b/utils/proxies.ts @@ -1,7 +1,7 @@ import { Address, BaseError, ContractFunctionRevertedError, Hex, PublicClient, keccak256, parseAbi, toHex } from "viem"; import { PUB_CHAIN } from "@/constants"; -const proxyAbi1 = parseAbi([ +const proxyAbi = parseAbi([ "function implementation() external view returns (address)", "function proxiableUUID() external view returns (bytes32)", ]); @@ -14,7 +14,7 @@ export function isProxyContract(publicClient: PublicClient, contractAddress: Add return publicClient .simulateContract({ address: contractAddress, - abi: proxyAbi1, + abi: proxyAbi, functionName: "implementation", args: [], chain: PUB_CHAIN,