1- import type { VerifyActionArgs } from "./types.js" ;
1+ import type { BaseVerifyActionArgs , VerifyActionArgs } from "./types.js" ;
22import type { NewTaskDefinitionBuilder } from "hardhat/types/tasks" ;
33
44import { ArgumentType } from "hardhat/types/arguments" ;
55
66export function extendWithVerificationArgs (
77 task : NewTaskDefinitionBuilder ,
8- ) : NewTaskDefinitionBuilder < VerifyActionArgs > {
8+ ) : NewTaskDefinitionBuilder < BaseVerifyActionArgs > {
99 return task
1010 . addPositionalArgument ( {
1111 name : "address" ,
@@ -41,13 +41,6 @@ export function extendWithVerificationArgs(
4141 name : "force" ,
4242 description :
4343 "Force the verification even if the contract is already verified" ,
44- } )
45- . addOption ( {
46- name : "creationTxHash" ,
47- type : ArgumentType . STRING_WITHOUT_DEFAULT ,
48- description :
49- "The hash of the contract creation transaction (optional, used by Sourcify)" ,
50- defaultValue : undefined ,
5144 } ) ;
5245 /* TODO: M5
5346 .addFlag({
@@ -56,3 +49,17 @@ export function extendWithVerificationArgs(
5649 });
5750 */
5851}
52+
53+ export function extendWithSourcifyArgs (
54+ task : NewTaskDefinitionBuilder < BaseVerifyActionArgs > ,
55+ isMainTask : boolean = true ,
56+ ) : NewTaskDefinitionBuilder < VerifyActionArgs > {
57+ return task . addOption ( {
58+ name : "creationTxHash" ,
59+ type : ArgumentType . STRING_WITHOUT_DEFAULT ,
60+ description :
61+ "The hash of the contract creation transaction" +
62+ ( isMainTask ? " (Sourcify only)" : "" ) ,
63+ defaultValue : undefined ,
64+ } ) ;
65+ }
0 commit comments