diff --git a/packages/web/components/QuestChain/MintNFTTile.tsx b/packages/web/components/QuestChain/MintNFTTile.tsx index 4aecec23f..84e6bd414 100644 --- a/packages/web/components/QuestChain/MintNFTTile.tsx +++ b/packages/web/components/QuestChain/MintNFTTile.tsx @@ -72,7 +72,7 @@ export const MintNFTTile: React.FC = ({ duration: null, }); - const txHash = await contract.write.mintToken(); + const txHash = await contract.write.mintToken([], { account: address }); addToast({ description: 'Transaction submitted. Waiting for 1 block confirmation.', duration: null, diff --git a/packages/web/components/QuestChain/QuestChainDisplay.tsx b/packages/web/components/QuestChain/QuestChainDisplay.tsx index b879b5ad9..991b19bc9 100644 --- a/packages/web/components/QuestChain/QuestChainDisplay.tsx +++ b/packages/web/components/QuestChain/QuestChainDisplay.tsx @@ -254,7 +254,7 @@ const QuestChainDisplay: React.FC = ({ rel="noreferrer" color="purple.200" > - {`${creatorAddress?.slice(0, 5)}…${creatorAddress?.slice(-3)}`} + {creatorName ? creatorName : `${creatorAddress?.slice(0, 5)}…${creatorAddress?.slice(-3)}`} diff --git a/packages/web/components/QuestChain/UploadProof.tsx b/packages/web/components/QuestChain/UploadProof.tsx index 1c843af0a..b188d50ab 100644 --- a/packages/web/components/QuestChain/UploadProof.tsx +++ b/packages/web/components/QuestChain/UploadProof.tsx @@ -26,6 +26,7 @@ import { useViemClients } from '#lib/hooks/useEthersProvider'; import { useInputText } from '#lib/hooks/useInputText'; import { errorHandler } from '#utils/errorHandler'; import { getHexChainId, NETWORK_INFO } from '#utils/networks'; +import { a } from '@react-spring/web'; export type ToastInfo = { close: boolean; @@ -119,14 +120,17 @@ export const UploadProof: React.FC<{ addToast({ description: ( - - Wrote metadata to{' '} - - {details} - - .{'\n\n'} - Waiting for Confirmation: Confirm the transaction in your wallet.' - + + + Wrote metadata to{' '} + + {details} + . + + + Simulating Mint: Confirm the transaction in your wallet. + + ), duration: 3_000, }); @@ -134,10 +138,18 @@ export const UploadProof: React.FC<{ // eslint-disable-next-line no-console if (debug) console.debug({ quest }); - const txHash = await contract.write.submitProofs( + if(!address) throw new Error('Missing address.') + + const { request } = await contract.simulate.submitProofs( [[BigInt(quest.questId)], [details]], { account: address }, ); + + // eslint-disable-next-line no-console + if(debug) console.debug({ request }) + + const txHash = await viemClients.wallet.writeContract(request); + addToast({ description: `Transaction ${txHash} submitted. Waiting for 1 block confirmation.`, duration: null, @@ -149,7 +161,7 @@ export const UploadProof: React.FC<{ ), duration: null, }); - await helpers.waitUntilSubgraphIndexed(`${chainId}`, Number(receipt.blockNumber)); + await helpers.waitUntilSubgraphIndexed(`0x${chainId.toString(16)}`, Number(receipt.blockNumber)); addToast({ description: `Successfully submitted proof.`, duration: 5_000,