• smartcontracts's avatar
    feat: introduce hardhat-deploy-config (#2755) · 27234f68
    smartcontracts authored
    * feat: introduce hardhat-deploy-config
    
    Creates a new package hardhat-deploy-config. We're using the same
    configuration system for all of our contracts package, so might as well
    turn it into a hardhat plugin to avoid duplicating code.
    
    * feat(ct): use hardhat-deploy-config
    
    * plugin: don't validate if spec not passed
    
    * contracts: update deps
    
    * contracts-bedrock: use deploy config plugin
    
    * contracts-bedrock: deploy instructions
    
    * contracts-bedrock: modularize deployment
    
    * contracts-bedrock: add deploy-config
    
    * contracts-bedrock: add in deploy config spec
    
    * lint: fix
    Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
    Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
    27234f68
type-extensions.ts 702 Bytes
import 'hardhat/types/runtime'
import 'hardhat/types/config'

interface DeployConfigSpec {
  [key: string]: {
    type: 'address' | 'number' | 'string' | 'boolean'
    default?: any
  }
}

declare module 'hardhat/types/config' {
  interface HardhatUserConfig {
    deployConfigSpec?: DeployConfigSpec
  }

  interface HardhatConfig {
    deployConfigSpec?: DeployConfigSpec
  }

  interface ProjectPathsUserConfig {
    deployConfig?: string
  }

  interface ProjectPathsConfig {
    deployConfig?: string
  }
}

declare module 'hardhat/types/runtime' {
  interface HardhatRuntimeEnvironment {
    deployConfig: {
      // TODO: Is there any good way to type this?
      [key: string]: any
    }
  }
}