Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing the Quest Chains minting process #1781

Merged
merged 4 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/web/components/QuestChain/MintNFTTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const MintNFTTile: React.FC<MintNFTTileProps> = ({
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,
Expand Down
2 changes: 1 addition & 1 deletion packages/web/components/QuestChain/QuestChainDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ const QuestChainDisplay: React.FC<Props> = ({
rel="noreferrer"
color="purple.200"
>
{`${creatorAddress?.slice(0, 5)}…${creatorAddress?.slice(-3)}`}
{creatorName ? creatorName : `${creatorAddress?.slice(0, 5)}…${creatorAddress?.slice(-3)}`}
</chakra.a>
</Tooltip>
</Box>
Expand Down
6 changes: 2 additions & 4 deletions packages/web/components/QuestChain/QuestHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ export const ChainStats: React.FC<{
<Box
bg="cyan"
w={`${
(progress.total ? progress.completeCount / progress.total : 0) *
100
(progress.total ? progress.completeCount / progress.total : 0) * 100
}%`}
/>
<Box
bgColor="#EFFF8F"
w={`${
(progress.total ? progress.inReviewCount / progress.total : 0) *
100
(progress.total ? progress.inReviewCount / progress.total : 0) * 100
}%`}
/>
<Box h={2} />
Expand Down
33 changes: 23 additions & 10 deletions packages/web/components/QuestChain/UploadProof.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,38 @@ export const UploadProof: React.FC<{

addToast({
description: (
<Text>
Wrote metadata to{' '}
<chakra.a href={details} color="purple.600" target="_blank">
{details}
</chakra.a>
.{'\n\n'}
Waiting for Confirmation: Confirm the transaction in your wallet.'
</Text>
<Stack>
<Text>
Wrote metadata to{' '}
<chakra.a href={details} color="purple.600" target="_blank">
{details}
</chakra.a>.
</Text>
<Text>
Simulating Mint: Confirm the transaction in your wallet.
</Text>
</Stack>
),
duration: 3_000,
});

// 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 as typeof request & { account: string }
);

addToast({
description: `Transaction ${txHash} submitted. Waiting for 1 block confirmation.`,
duration: null,
Expand All @@ -149,7 +162,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,
Expand Down
Loading