Skip to content

Commit

Permalink
refactor: Add an ERC-165 identifiers file and using the first for bot…
Browse files Browse the repository at this point in the history
…h single and batch ERC-1155 deposits.
  • Loading branch information
brunomenezes committed May 7, 2024
1 parent 0ad2fee commit c6d0f34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/ui/src/ERC1155DepositForm/DepositFormBatch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import {
zeroAddress,
} from "viem";
import { useAccount, useWaitForTransactionReceipt } from "wagmi";
import { interfaceIdForERC1155 } from "../ERC165Identifiers";
import { TransactionProgress } from "../TransactionProgress";
import { transactionState } from "../TransactionState";
import useWatchQueryOnBlockChange from "../hooks/useWatchQueryOnBlockChange";
Expand Down Expand Up @@ -158,7 +159,7 @@ const DepositFormBatch: FC<Props> = (props) => {

const supportsInterface = useReadErc1155SupportsInterface({
address: erc1155Contract.address,
args: ["0xd9b67a26"],
args: [interfaceIdForERC1155],
query: {
enabled: erc1155Contract.address !== undefined,
},
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/ERC1155DepositForm/DepositFormSingle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import {
zeroAddress,
} from "viem";
import { useAccount, useWaitForTransactionReceipt } from "wagmi";
import { interfaceIdForERC1155 } from "../ERC165Identifiers";
import { TransactionProgress } from "../TransactionProgress";
import { transactionState } from "../TransactionState";
import useWatchQueryOnBlockChange from "../hooks/useWatchQueryOnBlockChange";
Expand Down Expand Up @@ -135,7 +136,7 @@ const DepositFormSingle: FC<Props> = (props) => {

const supportsInterface = useReadErc1155SupportsInterface({
address: erc1155Contract.address,
args: ["0xd9b67a26"],
args: [interfaceIdForERC1155],
query: {
enabled: erc1155Contract.address !== undefined,
},
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/ERC165Identifiers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const interfaceIdForERC1155 = "0xd9b67a26" as const;

0 comments on commit c6d0f34

Please sign in to comment.