@@ -14,38 +14,42 @@ const help = "Submits all unverified contracts to Etherscan for a given deployme
14
14
"Uses settings in '.env': <DEPLOYMENT_NETWORK_ID>, <DEPLOYMENT_CONSTANT> " +
15
15
"which select the relevant deployments/output file (ex: 1-staging.json)." ;
16
16
17
- task ( "set:etherscan:verify" , help ) . setAction ( async ( _ , hre : HRE ) => {
18
- const outputs = await returnOutputs ( ) ;
19
-
20
- log ( `> Etherscan verifying new deployment(s) for: ${ getDeploymentNetworkKey ( ) } ` ) ;
21
-
22
- for ( const [ index , deployment ] of < [ string , Data ] [ ] > Object . entries ( outputs . transactions ) ) {
23
- if ( deployment . contractAddress && deployment . verified === false ) {
24
- try {
25
-
26
- await hre . run ( "verify:verify" , {
27
- address : deployment . contractAddress ,
28
- constructorArguments : deployment . constructorArgs ,
29
- libraries : deployment . libraries ,
30
- } ) ;
31
-
32
- deployment . verified = true ;
33
- outputs . transactions [ index ] = deployment ;
34
-
35
- // Continue on failure
36
- } catch ( err ) {
37
- log ( `Errored on ${ deployment . name } with:` ) ;
38
- log ( err ) ;
39
- log ( ) ;
17
+ // NOTE: if you have a single verification to perform for a contract whose name shadows another
18
+ // contract you can specify the fully qualified contract name as an argument for the command,
19
+ // ex: yarn etherscan:kovan contracts/protocol/modules/IssuanceModule.sol:IssuanceModule
20
+ task ( "set:etherscan:verify" , help )
21
+ . addOptionalPositionalParam ( "fullyQualifiedContractName" )
22
+ . setAction ( async ( taskArgs , hre : HRE ) => {
23
+ const outputs = await returnOutputs ( ) ;
24
+
25
+ log ( `> Etherscan verifying new deployment(s) for: ${ getDeploymentNetworkKey ( ) } ` ) ;
26
+
27
+ for ( const [ index , deployment ] of < [ string , Data ] [ ] > Object . entries ( outputs . transactions ) ) {
28
+ if ( deployment . contractAddress && deployment . verified === false ) {
29
+ try {
30
+
31
+ await hre . run ( "verify:verify" , {
32
+ address : deployment . contractAddress ,
33
+ constructorArguments : deployment . constructorArgs ,
34
+ libraries : deployment . libraries ,
35
+ contract : taskArgs . fullyQualifiedContractName
36
+ } ) ;
37
+
38
+ deployment . verified = true ;
39
+ outputs . transactions [ index ] = deployment ;
40
+
41
+ // Continue on failure
42
+ } catch ( err ) {
43
+ log ( `Errored on ${ deployment . name } with:` ) ;
44
+ log ( err ) ;
45
+ log ( ) ;
46
+ }
47
+ // Etherscan rate limit is 5 API calls/sec
48
+ await waitMs ( 250 ) ;
40
49
}
41
- // Etherscan rate limit is 5 API calls/sec
42
- await waitMs ( 250 ) ;
43
50
}
44
- }
45
-
46
- await fs . outputFile ( OUTPUTS_PATH , JSON . stringify ( outputs , undefined , 2 ) ) ;
47
- } ) ;
48
-
49
- exports = { } ;
50
51
52
+ await fs . outputFile ( OUTPUTS_PATH , JSON . stringify ( outputs , undefined , 2 ) ) ;
53
+ } ) ;
51
54
55
+ exports = { } ;
0 commit comments