Skip to content

Commit

Permalink
fixes shareLinks right after minting
Browse files Browse the repository at this point in the history
  • Loading branch information
nijoe1 committed Oct 23, 2024
1 parent 7f8b7fe commit 635ec6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,28 +57,13 @@ export const useAttestMutation = (
const hash = await walletClient.writeContract(request);
await publicClient.waitForTransactionReceipt({
hash,
confirmations: 1,
confirmations: 2,
});

const blockNumber = await publicClient.getBlockNumber();

// Get AttestationUID from the hash logs
const events = await publicClient.getContractEvents({
address: easAddress as `0x${string}`,
abi: legacyABI,
fromBlock: blockNumber - 3n,
toBlock: "latest",
eventName: "Attested",
});

let attestationUID: string = "";

events.forEach((event) => {
const { args, transactionHash } = event;
if (transactionHash === hash) {
attestationUID = args.uid as string;
}
const receipt = await publicClient.getTransactionReceipt({
hash,
});
// TODO make this dynamic when attestation network expands to more networks (Legacy-Proxy) have different logs
const attestationUID = receipt.logs[2].topics[1] as string;

return attestationUID;
} catch (error) {
Expand All @@ -91,8 +76,6 @@ export const useAttestMutation = (
console.error("Error attesting data:", error);
},
onSuccess: () => {
// We need to find out if we are going to close the modal and
// route to a new page or show the success page inside the modal
handleToggleModal();
updateStatus(ProgressStatus.IS_SUCCESS);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ export const useGetAttestationData = (

const data = await response.json();

console.log("Attestation data:", data);

return {
data: data.signedAttestation,
impactImageCid: data.impactImageCid,
Expand Down

0 comments on commit 635ec6e

Please sign in to comment.