@@ -32,6 +32,7 @@ type Token = {
3232 caipAddress : string ;
3333 name : string ;
3434 symbol : string ;
35+ website ?: string ;
3536} ;
3637
3738type CuratedInfo = {
@@ -42,7 +43,10 @@ type CuratedInfo = {
4243
4344const parseMetadata = ( metadata : any , keys : string [ ] ) => {
4445 return keys . reduce ( ( acc , key , index ) => {
45- acc [ key ] = mdEscape ( metadata [ `key${ index } ` ] ) ;
46+ const value = metadata [ `key${ index } ` ] ;
47+ if ( value !== undefined && value !== null && value !== '' ) {
48+ acc [ key ] = mdEscape ( value ) ;
49+ }
4650 return acc ;
4751 } , { } as any ) ;
4852} ;
@@ -99,7 +103,7 @@ const fetchGraphQLData = async (variables: {
99103 }
100104 }
101105 tokens: litems(where:{
102- registry:"0x70533554fe5c17caf77fe530f77eab933b92af60 ",
106+ registry:"0xee1502e29795ef6c2d60f8d7120596abe3bad990 ",
103107 metadata_: {
104108 key0_starts_with_nocase: $targetAddress,
105109 key0_ends_with_nocase: $targetAddress,
@@ -110,6 +114,7 @@ const fetchGraphQLData = async (variables: {
110114 key0
111115 key1
112116 key2
117+ key3
113118 }
114119 }
115120 }
@@ -146,10 +151,14 @@ const fetchGraphQLData = async (variables: {
146151 : undefined ;
147152
148153 const parsedToken = result . data . tokens [ 0 ]
149- ? parseMetadata ( result . data . tokens [ 0 ] . metadata , [ 'caipAddress' , 'name' , 'symbol' ] )
154+ ? parseMetadata ( result . data . tokens [ 0 ] . metadata , [ 'caipAddress' , 'name' , 'symbol' , 'website' ] )
150155 : undefined ;
151156
152- return { addressTag : parsedAddressTag , contractDomain : parsedContractDomain , token : parsedToken } ;
157+ return {
158+ addressTag : parsedAddressTag ,
159+ contractDomain : parsedContractDomain ,
160+ token : parsedToken ,
161+ } ;
153162 } catch ( error ) {
154163 console . error ( 'GraphQL fetch error:' , error ) ;
155164 return null ;
@@ -181,6 +190,7 @@ const getInsights = async (
181190 const insights : string [ ] = [ ] ;
182191
183192 if ( result . addressTag ) {
193+ insights . push ( `✅ **Verified contract**` ) ;
184194 // key2 is projectName, which is optional. No project name === "", which is falsy.
185195 const projectNameLabel = result . addressTag . projectName
186196 ? result . addressTag . infoLink
@@ -191,15 +201,20 @@ const getInsights = async (
191201 // Contract tag is a mandatory field.
192202 const contractTag = result . addressTag . publicName ;
193203 insights . push ( `**Project:** ${ projectNameLabel } ` ) ;
194- insights . push ( `**Contract Tag:** ${ contractTag } ` ) ;
204+ insights . push ( `**Tag:** ${ contractTag } ` ) ;
195205 }
196206
197207 if ( result . contractDomain ) {
208+ insights . push ( `✅ **Verified domain**` ) ;
198209 insights . push ( `**Domain:** _${ domain } _ is **verified** for this contract` ) ;
199210 }
200211
201212 if ( result . token ) {
202- insights . push ( `**Token:** ${ result . token . name } (${ result . token . symbol } )` ) ;
213+ insights . push ( `✅ **Verified token**` ) ;
214+ const tokenName = result . token . website
215+ ? `[${ result . token . name } ](${ result . token . website } )`
216+ : result . token . name ;
217+ insights . push ( `**Token:** ${ tokenName } (${ result . token . symbol } )` ) ;
203218 }
204219
205220 return insights ;
@@ -265,7 +280,7 @@ export const onTransaction: OnTransactionHandler = async ({
265280 console . error ( 'Invalid transaction origin:' , error ) ;
266281 }
267282 }
268- const numericChainId = parseInt ( chainId . split ( ':' ) [ 1 ] , 16 ) ;
283+ const numericChainId = parseInt ( chainId . split ( ':' ) [ 1 ] , 10 ) ;
269284 const caipAddress = `eip155:${ numericChainId } :${ transaction . to as string } ` ;
270285
271286 const result = await getInsights ( caipAddress , domain ) ;
@@ -281,18 +296,24 @@ export const onTransaction: OnTransactionHandler = async ({
281296 'mempool.space' , 'explorer.solana.com' , 'basescan.org' , 'arbiscan.io' ,
282297 'moonscan.io' , 'lineascan.build' , 'optimistic.etherscan.io' , 'ftmscan.com' ,
283298 'moonriver.moonscan.io' , 'snowscan.xyz' , 'cronoscan.com' , 'bttcscan.com' ,
284- 'zkevm.polygonscan.com' , 'wemixscan.com' , 'scrollscan.com' , 'era.zksync.network' , 'celoscan.io'
299+ 'zkevm.polygonscan.com' , 'wemixscan.com' , 'scrollscan.com' , 'era.zksync.network' ,
300+ 'celoscan.io' , 'avascan.info' , 'blastscan.io' , 'mantlescan.xyz' , 'sepolia.etherscan.io' ,
301+ 'goerli.etherscan.io' , 'holesky.etherscan.io' , 'testnet.bscscan.com' , 'testnet.ftmscan.com' ,
302+ 'mumbai.polygonscan.com' , 'goerli.arbiscan.io' , 'sepolia.arbiscan.io' , 'testnet.snowtrace.io' ,
303+ 'explorer.testnet.mantle.xyz' , 'sepolia.basescan.org' , 'goerli.basescan.org' , 'alfajores.celoscan.io' ,
304+ 'blockscout.com' , 'explorer.zksync.io' , 'layerzeroscan.com' , 'routescan.io' ,
305+ 'moonbeam.moonscan.io' , 'subscan.io' , 'solscan.io' , 'explorer.near.org' ,
306+ 'cardanoscan.io' , 'astar.subscan.io' , 'polkadot.subscan.io' , 'kusama.subscan.io'
285307 ] ;
286308
287309 if ( ! excludedDomains . includes ( domain ) && ! insights . some ( insight => insight . includes ( 'Domain' ) ) ) {
288310 const cdnPathURL = `https://app.klerosscout.eth.limo/#/?registry=CDN&network=1&network=100&network=137&network=56&network=42161&network=10&network=43114&network=534352&network=42220&network=8453&network=250&network=324&status=Registered&status=RegistrationRequested&status=ClearingRequested&status=Absent&disputed=true&disputed=false&page=1&orderDirection=desc&&additem=CDN&caip10Address=${ caipAddress } &domain=${ domain } ` ;
289311
290- insights . push ( `Is this contract linked to this domain? If so, submit the info at [Scout App](${ cdnPathURL } ) to verify it for all users!` ) ;
312+ insights . push ( `Is this contract officially linked to ** ${ domain } ** ? If so, submit the info at [Scout App](${ cdnPathURL } ) to verify it for all users!` ) ;
291313 }
292314
293315 return {
294316 content : panel ( [
295- heading ( 'Contract insights' ) ,
296317 ...insights . map ( ( insight ) => text ( insight ) ) ,
297318 ] ) ,
298319 } ;
0 commit comments