Skip to content

Commit

Permalink
Merge branch 'main' of github.com:TheArkProjekt/Starklane into yohan/…
Browse files Browse the repository at this point in the history
…mainnet-fix-2
  • Loading branch information
YohanTz committed Apr 4, 2024
2 parents 313ebff + ba6c6b2 commit 1213f9c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"superjson": "1.12.2",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^2.9.1",
"viem": "^2.7.6",
"viem": "^2.9.9",
"wagmi": "^2.5.5",
"zod": "^3.21.4"
},
Expand Down
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
32 changes: 16 additions & 16 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1213f9c

Please sign in to comment.