File tree Expand file tree Collapse file tree 3 files changed +10
-29
lines changed
packages/grant-explorer/src Expand file tree Collapse file tree 3 files changed +10
-29
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ export function createTwitterShareUrl(props: TwitterButtonParams) {
94
94
}
95
95
96
96
export function createTwitterAttestationShareText ( attestationLink : string ) {
97
- return `Just minted my donation on Gitcoin 🫡\n\nMy impact is now onchain!\n\n${ attestationLink } ` ;
97
+ return `Just minted my donation on @gitcoin 🫡\n\nMy impact is now onchain!\n\n${ attestationLink } ` ;
98
98
}
99
99
100
100
export function createTwitterAttestationShareUrl ( attestationLink : string ) {
@@ -105,11 +105,11 @@ export function createTwitterAttestationShareUrl(attestationLink: string) {
105
105
}
106
106
107
107
export function getFarcasterAttestationShareText ( ) {
108
- const encodedText1 = encodeURIComponent (
109
- `Just minted my donation on Gitcoin 🫡\n\nMy impact is now onchain!`
110
- ) ;
108
+ const encodedText1 = encodeURIComponent ( `Just minted my donation on ` ) ;
109
+ const encodedText2 = encodeURIComponent ( ` 🫡\n\nMy impact is now onchain!`) ;
110
+
111
111
// NB: mentions should not be encoded
112
- return encodedText1 ;
112
+ return ` ${ encodedText1 } @gitcoin ${ encodedText2 } ` ;
113
113
}
114
114
115
115
export function createFarcasterShareUrl (
Original file line number Diff line number Diff line change @@ -57,28 +57,13 @@ export const useAttestMutation = (
57
57
const hash = await walletClient . writeContract ( request ) ;
58
58
await publicClient . waitForTransactionReceipt ( {
59
59
hash,
60
- confirmations : 1 ,
60
+ confirmations : 2 ,
61
61
} ) ;
62
-
63
- const blockNumber = await publicClient . getBlockNumber ( ) ;
64
-
65
- // Get AttestationUID from the hash logs
66
- const events = await publicClient . getContractEvents ( {
67
- address : easAddress as `0x${string } `,
68
- abi : legacyABI ,
69
- fromBlock : blockNumber - 3n ,
70
- toBlock : "latest" ,
71
- eventName : "Attested" ,
72
- } ) ;
73
-
74
- let attestationUID : string = "" ;
75
-
76
- events . forEach ( ( event ) => {
77
- const { args, transactionHash } = event ;
78
- if ( transactionHash === hash ) {
79
- attestationUID = args . uid as string ;
80
- }
62
+ const receipt = await publicClient . getTransactionReceipt ( {
63
+ hash,
81
64
} ) ;
65
+ // TODO make this dynamic when attestation network expands to more networks (Legacy-Proxy) have different logs
66
+ const attestationUID = receipt . logs [ 2 ] . topics [ 1 ] as string ;
82
67
83
68
return attestationUID ;
84
69
} catch ( error ) {
@@ -91,8 +76,6 @@ export const useAttestMutation = (
91
76
console . error ( "Error attesting data:" , error ) ;
92
77
} ,
93
78
onSuccess : ( ) => {
94
- // We need to find out if we are going to close the modal and
95
- // route to a new page or show the success page inside the modal
96
79
handleToggleModal ( ) ;
97
80
updateStatus ( ProgressStatus . IS_SUCCESS ) ;
98
81
} ,
Original file line number Diff line number Diff line change @@ -48,8 +48,6 @@ export const useGetAttestationData = (
48
48
49
49
const data = await response . json ( ) ;
50
50
51
- console . log ( "Attestation data:" , data ) ;
52
-
53
51
return {
54
52
data : data . signedAttestation ,
55
53
impactImageCid : data . impactImageCid ,
You can’t perform that action at this time.
0 commit comments