diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-04-19 04:22:39 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-05-07 16:23:08 +0800 |
commit | 72b2a1c66fa9fb85ea8515645b97332eee204550 (patch) | |
tree | 8a4504ea2fdbc554f5b62f2b46088bea3e5b6324 /packages/deployer/src/utils | |
parent | 69a6166b6a1d39afc24b8dd950ec5d8539a03420 (diff) | |
download | dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar.gz dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar.bz2 dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar.lz dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar.xz dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.tar.zst dexon-sol-tools-72b2a1c66fa9fb85ea8515645b97332eee204550.zip |
Implement new artifacts format
Diffstat (limited to 'packages/deployer/src/utils')
-rw-r--r-- | packages/deployer/src/utils/types.ts | 53 |
1 files changed, 32 insertions, 21 deletions
diff --git a/packages/deployer/src/utils/types.ts b/packages/deployer/src/utils/types.ts index a20d0f627..c4af5ac87 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: '2.0.0'; + 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 { |