Skip to content

Commit

Permalink
added error potential logs (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
YohanTz authored Apr 3, 2024
1 parent de82d7b commit c994645
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 c994645

Please sign in to comment.