Skip to content

Commit

Permalink
💫 Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dysbulic committed Aug 18, 2024
2 parents 40f00a7 + 9c86ffd commit 68aae46
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 17 deletions.
Binary file added packages/web/assets/academy/creatorgame.webp
Binary file not shown.
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
2 changes: 1 addition & 1 deletion packages/web/utils/questChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import team from '#assets/academy/team.webp';
import time from '#assets/academy/time.webp';
import web3builder from '#assets/academy/web3builder.webp';
import buildingonoptimism from '#assets/academy/buildingonop.webp';
import creatorgame from '#assets/academy/creatorgame.png';
import creatorgame from '#assets/academy/creatorgame.webp';
import { useWeb3 } from '#lib/hooks';

export const useQuestChainContract = (address: string) => {
Expand Down

0 comments on commit 68aae46

Please sign in to comment.