From 2237ddee8c4db84dd803e022868c7abae8380ed5 Mon Sep 17 00:00:00 2001 From: Willian Mitsuda Date: Sat, 5 Mar 2022 21:08:55 -0300 Subject: [PATCH] Assume immutable by default --- src/useErigonHooks.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/useErigonHooks.ts b/src/useErigonHooks.ts index b918230..c949481 100644 --- a/src/useErigonHooks.ts +++ b/src/useErigonHooks.ts @@ -11,6 +11,7 @@ import { defaultAbiCoder } from "@ethersproject/abi"; import { BigNumber } from "@ethersproject/bignumber"; import { arrayify, hexDataSlice, isHexString } from "@ethersproject/bytes"; import useSWR, { useSWRConfig } from "swr"; +import useSWRImmutable from "swr/immutable"; import { getInternalOperations } from "./nodeFunctions"; import { TokenMetas, @@ -714,7 +715,10 @@ export const useHasCode = ( blockTag: BlockTag = "latest" ): boolean | undefined => { const fetcher = providerFetcher(provider); - const { data, error } = useSWR(["ots_hasCode", address, blockTag], fetcher); + const { data, error } = useSWRImmutable( + ["ots_hasCode", address, blockTag], + fetcher + ); if (error) { return undefined; }