How to use the hardhat/internal/core/params/argumentTypes.string function in hardhat

To help you get started, we’ve selected a few hardhat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethereum-optimism / optimism / packages / contracts / tasks / chugsplash-deploy.ts View on Github external
/* Imports: External */
import { ethers } from 'ethers'
import { LedgerSigner } from '@ethersproject/hardware-wallets'
import { task } from 'hardhat/config'
import * as types from 'hardhat/internal/core/params/argumentTypes'

/* Imports: Internal */
import { executeActionsFromConfig } from '../src'

task('chugsplash-deploy', 'Deploys an action bundle to L2')
  .addParam('l2NodeUrl', 'Url to L2 node', types.string)
  .addParam('ledgerHdPath', 'HD path to Ledger for signing executeAction txs', types.string)
  .addParam('chugsplashDeployerAddress', 'Address of the ChugSplash deployer contract', types.string)
  .addParam('upgradeConfigPath', 'Path to upgrade configuration JSON file', types.inputFile)
  .addOptionalParam('timeoutInMs', 'Amount of time to wait before timing out of deploy in milliseconds', types.int)
  .addOptionalParam('retryIntervalInMs', 'Amount of time to wait before checking for new action bundle', types.int)
  .setAction(async (args, hre: any) => {
    const l2Provider = new ethers.providers.JsonRpcProvider(args.l2NodeUrl)
    const signer = new LedgerSigner(
      l2Provider,
      'default',
      args.ledgerHdPath
    )

    return await executeActionsFromConfig({
      hre,
      signer,
      chugsplashDeployerAddress: args.chugsplashDeployerAddress,
      upgradeConfigPath: args.upgradeConfigPath,
github ethereum-optimism / optimism / packages / contracts / tasks / deploy.ts View on Github external
'ovmProposerAddress',
    'Address of the account that will propose state roots. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'ovmRelayerAddress',
    'Address of the message relayer. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'ovmAddressManagerOwner',
    'Address that will own the Lib_AddressManager. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'initialGasPriceOracleGasPrice',
    'The initial execution price for the gas price oracle.',
    undefined,
    types.int
  )
  .setAction(async (args, hre: any, runSuper) => {
    // Necessary because hardhat doesn't let us attach non-optional parameters to existing tasks.
    const validateAddressArg = (argName: string) => {
      if (args[argName] === undefined) {
        throw new Error(
          `argument for ${argName} is required but was not provided`
        )
      }
      if (!ethers.utils.isAddress(args[argName])) {
github ethereum-optimism / optimism / packages / contracts / tasks / chugsplash-deploy.ts View on Github external
/* Imports: External */
import { ethers } from 'ethers'
import { LedgerSigner } from '@ethersproject/hardware-wallets'
import { task } from 'hardhat/config'
import * as types from 'hardhat/internal/core/params/argumentTypes'

/* Imports: Internal */
import { executeActionsFromConfig } from '../src'

task('chugsplash-deploy', 'Deploys an action bundle to L2')
  .addParam('l2NodeUrl', 'Url to L2 node', types.string)
  .addParam('ledgerHdPath', 'HD path to Ledger for signing executeAction txs', types.string)
  .addParam('chugsplashDeployerAddress', 'Address of the ChugSplash deployer contract', types.string)
  .addParam('upgradeConfigPath', 'Path to upgrade configuration JSON file', types.inputFile)
  .addOptionalParam('timeoutInMs', 'Amount of time to wait before timing out of deploy in milliseconds', types.int)
  .addOptionalParam('retryIntervalInMs', 'Amount of time to wait before checking for new action bundle', types.int)
  .setAction(async (args, hre: any) => {
    const l2Provider = new ethers.providers.JsonRpcProvider(args.l2NodeUrl)
    const signer = new LedgerSigner(
      l2Provider,
      'default',
      args.ledgerHdPath
    )

    return await executeActionsFromConfig({
      hre,
      signer,
github ethereum-optimism / optimism / packages / contracts / tasks / deploy.ts View on Github external
'sccFraudProofWindow',
    'Number of seconds until a transaction is considered finalized.',
    DEFAULT_SCC_FRAUD_PROOF_WINDOW,
    types.int
  )
  .addOptionalParam(
    'sccSequencerPublishWindow',
    'Number of seconds that the sequencer is exclusively allowed to post state roots.',
    DEFAULT_SCC_SEQUENCER_PUBLISH_WINDOW,
    types.int
  )
  .addOptionalParam(
    'ovmSequencerAddress',
    'Address of the sequencer. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'ovmProposerAddress',
    'Address of the account that will propose state roots. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'ovmRelayerAddress',
    'Address of the message relayer. Must be provided or this deployment will fail.',
    undefined,
    types.string
  )
  .addOptionalParam(
    'ovmAddressManagerOwner',
    'Address that will own the Lib_AddressManager. Must be provided or this deployment will fail.',