Skip to content

Commit

Permalink
added error potential logs
Browse files Browse the repository at this point in the history
  • Loading branch information
YohanTz committed Apr 3, 2024
1 parent 10c49df commit 3695679
Showing 1 changed file with 17 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,28 @@ export default function useEthereumCollectionApproval() {

const {
data: approveHash,
error,
failureReason,
isLoading: isSigning,
writeContract: writeContractApprove,
} = useWriteContract();
console.error("error: ", error);
console.error("failureReason: ", failureReason);

function approveForAll() {
writeContractApprove({
abi: erc721Abi,
address: selectedCollectionAddress as `0x${string}`,
args: [process.env.NEXT_PUBLIC_L1_BRIDGE_ADDRESS as `0x${string}`, true],
functionName: "setApprovalForAll",
});
try {
writeContractApprove({
abi: erc721Abi,
address: selectedCollectionAddress as `0x${string}`,
args: [
process.env.NEXT_PUBLIC_L1_BRIDGE_ADDRESS as `0x${string}`,
true,
],
functionName: "setApprovalForAll",
});
} catch (e) {
console.error(e);
}
}

const { isLoading: isApproveLoading } = useWaitForTransactionReceipt({
Expand Down

0 comments on commit 3695679

Please sign in to comment.