Assume immutable by default

This commit is contained in:
Willian Mitsuda 2022-03-05 21:08:55 -03:00
parent fe30e7e7d8
commit 2237ddee8c
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}