diff options
Diffstat (limited to 'packages/deployer/src/utils')
-rw-r--r-- | packages/deployer/src/utils/constants.ts | 1 | ||||
-rw-r--r-- | packages/deployer/src/utils/types.ts | 53 |
2 files changed, 33 insertions, 21 deletions
diff --git a/packages/deployer/src/utils/constants.ts b/packages/deployer/src/utils/constants.ts index 6f9dfb994..df2ddb3b2 100644 --- a/packages/deployer/src/utils/constants.ts +++ b/packages/deployer/src/utils/constants.ts @@ -1,4 +1,5 @@ export const constants = { SOLIDITY_FILE_EXTENSION: '.sol', BASE_COMPILER_URL: 'https://ethereum.github.io/solc-bin/bin/', + LATEST_ARTIFACT_VERSION: '2.0.0', }; diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index a20d0f627..19c27df67 100644 --- a/packages/deployer/src/utils/types.ts +++ b/packages/deployer/src/utils/types.ts @@ -1,4 +1,5 @@ import { ContractAbi, Provider, TxData } from '@0xproject/types'; +import * as solc from 'solc'; import * as Web3 from 'web3'; import * as yargs from 'yargs'; @@ -9,28 +10,40 @@ export enum AbiType { Fallback = 'fallback', } -export interface ContractArtifact { - contract_name: string; +export interface ContractArtifact extends ContractVersionData { + schemaVersion: string; + contractName: string; networks: ContractNetworks; } +export interface ContractVersionData { + compiler: { + name: 'solc'; + version: string; + settings: solc.CompilerSettings; + }; + sources: { + [sourceName: string]: { + id: number; + }; + }; + sourceCodes: { + [sourceName: string]: string; + }; + sourceTreeHashHex: string; + compilerOutput: solc.StandardContractOutput; +} + export interface ContractNetworks { - [key: number]: ContractNetworkData; + [networkId: number]: ContractNetworkData; } export interface ContractNetworkData { - solc_version: string; - optimizer_enabled: boolean; - source_tree_hash: string; - abi: ContractAbi; - bytecode: string; - runtime_bytecode: string; - address?: string; - constructor_args?: string; - updated_at: number; - source_map: string; - source_map_runtime: string; - sources: string[]; + address: string; + links: { + [linkName: string]: string; + }; + constructorArgs: string; } export interface SolcErrors { @@ -42,7 +55,6 @@ export interface CliOptions extends yargs.Arguments { contractsDir: string; jsonrpcUrl: string; networkId: number; - shouldOptimize: boolean; gasPrice: string; account?: string; contract?: string; @@ -50,11 +62,10 @@ export interface CliOptions extends yargs.Arguments { } export interface CompilerOptions { - contractsDir: string; - networkId: number; - optimizerEnabled: boolean; - artifactsDir: string; - specifiedContracts: Set<string>; + contractsDir?: string; + artifactsDir?: string; + compilerSettings?: solc.CompilerSettings; + contracts?: string[] | '*'; } export interface BaseDeployerOptions { |