@nomicfoundation/hardhat-verify
Version:
Hardhat plugin for verifying contracts
51 lines • 1.78 kB
JavaScript
import { ArgumentType } from "hardhat/types/arguments";
export function extendWithVerificationArgs(task) {
return task
.addPositionalArgument({
name: "address",
description: "The address of the contract to verify",
})
.addVariadicArgument({
name: "constructorArgs",
description: "The constructor arguments",
defaultValue: [],
})
.addOption({
name: "constructorArgsPath",
type: ArgumentType.FILE_WITHOUT_DEFAULT,
description: "A relative path to a module that exports the constructor arguments",
defaultValue: undefined,
})
.addOption({
name: "contract",
type: ArgumentType.STRING_WITHOUT_DEFAULT,
description: "The name of the contract to verify, in the format <path>:<contractName>",
defaultValue: undefined,
})
.addOption({
name: "librariesPath",
type: ArgumentType.FILE_WITHOUT_DEFAULT,
description: "A relative path to a module that exports a mapping of library names to addresses",
defaultValue: undefined,
})
.addFlag({
name: "force",
description: "Force the verification even if the contract is already verified",
});
/* TODO: M5
.addFlag({
name: "listNetworks",
description: "List the networks that are supported by Etherscan",
});
*/
}
export function extendWithSourcifyArgs(task, isMainTask = true) {
return task.addOption({
name: "creationTxHash",
type: ArgumentType.STRING_WITHOUT_DEFAULT,
description: "The hash of the contract creation transaction" +
(isMainTask ? " (Sourcify only)" : ""),
defaultValue: undefined,
});
}
//# sourceMappingURL=utils.js.map