@@ -2,50 +2,74 @@ import type { VerificationJobStatus } from "./sourcifyApi";
2
2
import type { Chain } from "../types/chains" ;
3
3
import { getChainName } from "./chains" ;
4
4
5
- export function generateGitHubIssueUrl (
6
- jobData : VerificationJobStatus ,
7
- chains : Chain [ ] ,
8
- serverUrl : string
9
- ) : string {
10
- if ( ! jobData . error || ! jobData . contract ) return '' ;
11
-
5
+ export function generateGitHubIssueUrl ( jobData : VerificationJobStatus , chains : Chain [ ] , serverUrl : string ) : string {
6
+ if ( ! jobData . error || ! jobData . contract ) return "" ;
7
+
12
8
const chainName = getChainName ( chains , parseInt ( jobData . contract . chainId ) ) ;
13
9
const shortAddress = `${ jobData . contract . address . slice ( 0 , 6 ) } ...${ jobData . contract . address . slice ( - 4 ) } ` ;
14
-
15
- const title = `Verification Failed: ${ jobData . error . customCode || 'Unknown Error' } - ${ chainName } (${ jobData . contract . chainId } ) ${ shortAddress } ` ;
16
-
10
+
11
+ const title = `Verification Failed: ${ jobData . error . customCode || "Unknown Error" } - ${ chainName } (${
12
+ jobData . contract . chainId
13
+ } ) ${ shortAddress } `;
14
+
17
15
const body = `<!--- Please fill the section in the end of this issue and explain why you expect this job to not fail. If possible, please provide the JSON input you used. --->
18
16
19
17
## Verification Job Failed
20
18
21
19
**Job ID:** \`${ jobData . verificationId } \`
22
20
**Chain:** ${ getChainName ( chains , parseInt ( jobData . contract . chainId ) ) } (${ jobData . contract . chainId } )
23
21
**Contract Address:** \`${ jobData . contract . address } \`
24
- **Error Code:** \`${ jobData . error . customCode || ' N/A' } \`
22
+ **Error Code:** \`${ jobData . error . customCode || " N/A" } \`
25
23
**Server URL:** \`${ serverUrl } \`
26
24
27
25
### Error Details
28
26
\`\`\`
29
27
${ jobData . error . message }
30
28
\`\`\`
31
29
32
- ${ jobData . error . errorData ?. compilerErrors ?. length ? `
30
+ ${
31
+ jobData . error . errorData ?. compilerErrors ?. length
32
+ ? `
33
33
### Compiler Errors (${ jobData . error . errorData . compilerErrors . length } )
34
34
\`\`\`
35
- ${ jobData . error . errorData . compilerErrors . slice ( 0 , 3 ) . map ( err => err . formattedMessage || err . message ) . join ( '\n\n' ) }
35
+ ${ jobData . error . errorData . compilerErrors
36
+ . slice ( 0 , 3 )
37
+ . map ( ( err ) => err . formattedMessage || err . message )
38
+ . join ( "\n\n" ) }
36
39
\`\`\`
37
- ${ jobData . error . errorData . compilerErrors . length > 3 ? `\n... and ${ jobData . error . errorData . compilerErrors . length - 3 } more errors` : '' }
38
- ` : '' }
40
+ ${
41
+ jobData . error . errorData . compilerErrors . length > 3
42
+ ? `\n... and ${ jobData . error . errorData . compilerErrors . length - 3 } more errors`
43
+ : ""
44
+ }
45
+ `
46
+ : ""
47
+ }
39
48
40
49
### Additional Information
41
50
- **Job Started:** ${ new Date ( jobData . jobStartTime ) . toISOString ( ) }
42
- ${ jobData . jobFinishTime ? `- **Job Finished:** ${ new Date ( jobData . jobFinishTime ) . toISOString ( ) } ` : '' }
43
- ${ jobData . compilationTime ? `- **Compilation Time:** ${ jobData . compilationTime } ms` : '' }
51
+ ${ jobData . jobFinishTime ? `- **Job Finished:** ${ new Date ( jobData . jobFinishTime ) . toISOString ( ) } ` : "" }
52
+ ${ jobData . compilationTime ? `- **Compilation Time:** ${ jobData . compilationTime } ms` : "" }
44
53
45
54
### User Input and Expectation
46
55
**Why do you expect this verification to succeed?**
47
56
<!-- Please explain why you believe this verification should work -->
48
57
58
+ **Language:**
59
+ <!-- Solidity or Vyper -->
60
+
61
+ **Compiler Version:**
62
+ <!-- e.g., 0.8.19, 0.7.6+commit.7338295f -->
63
+
64
+ **EVM Version:**
65
+ <!-- e.g., london, paris, shanghai, cancun -->
66
+
67
+ **Optimizer Settings:**
68
+ <!-- e.g., enabled: true, runs: 200 -->
69
+
70
+ **Contract Identifier:**
71
+ <!-- e.g., contracts/MyContract.sol:MyContract -->
72
+
49
73
**Files Used:**
50
74
<!-- Please upload the files you submitted for verification (source code, metadata, etc.) by dragging and dropping them here or sharing them via a link -->
51
75
\`\`\`
@@ -58,10 +82,10 @@ ${jobData.compilationTime ? `- **Compilation Time:** ${jobData.compilationTime}m
58
82
---
59
83
*This issue was automatically generated from the Sourcify verification UI.*` ;
60
84
61
- const issueUrl = new URL ( ' https://github.com/ethereum/sourcify/issues/new' ) ;
62
- issueUrl . searchParams . set ( ' title' , title ) ;
63
- issueUrl . searchParams . set ( ' body' , body ) ;
64
- issueUrl . searchParams . set ( ' labels' , ' bug,verification-failure' ) ;
65
-
85
+ const issueUrl = new URL ( " https://github.com/ethereum/sourcify/issues/new" ) ;
86
+ issueUrl . searchParams . set ( " title" , title ) ;
87
+ issueUrl . searchParams . set ( " body" , body ) ;
88
+ issueUrl . searchParams . set ( " labels" , " bug,verification-failure" ) ;
89
+
66
90
return issueUrl . toString ( ) ;
67
- }
91
+ }
0 commit comments