Implement new artifacts format

This commit is contained in:
Leonid Logvinov
2018-04-18 22:22:39 +02:00
parent 69a6166b6a
commit 72b2a1c66f
24 changed files with 314 additions and 272 deletions

View File

@@ -59,32 +59,33 @@ declare module 'solc' {
| 'evm.gasEstimates'
| 'ewasm.wast'
| 'ewasm.wasm';
export interface CompilerSettings {
remappings?: string[];
optimizer?: {
enabled: boolean;
runs?: number;
};
evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
metadata?: {
useLiteralContent: true;
};
libraries?: {
[fileName: string]: {
[libName: string]: string;
};
};
outputSelection: {
[fileName: string]: {
[contractName: string]: OutputField[];
};
};
}
export interface StandardInput {
language: 'Solidity' | 'serpent' | 'lll' | 'assembly';
sources: {
[fileName: string]: Source;
};
settings: {
remappings?: string[];
optimizer?: {
enabled: boolean;
runs?: number;
};
evmVersion?: 'homestead' | 'tangerineWhistle' | 'spuriousDragon' | 'byzantium' | 'constantinople';
metadata?: {
useLiteralContent: true;
};
libraries?: {
[fileName: string]: {
[libName: string]: string;
};
};
outputSelection: {
[fileName: string]: {
[contractName: string]: OutputField[];
};
};
};
settings: CompilerSettings;
}
export type ErrorType =
| 'JSONError'
@@ -114,6 +115,19 @@ declare module 'solc' {
formattedMessage?: string;
}
import { ContractAbi } from '@0xproject/types';
export interface StandardContractOutput {
abi: ContractAbi;
evm: {
bytecode: {
object: string;
sourceMap: string;
};
deployedBytecode: {
object: string;
sourceMap: string;
};
};
}
export interface StandardOutput {
errors: Error[];
sources: {
@@ -125,19 +139,7 @@ declare module 'solc' {
};
contracts: {
[fileName: string]: {
[contractName: string]: {
abi: ContractAbi;
evm: {
bytecode: {
object: string;
sourceMap: string;
};
deployedBytecode: {
object: string;
sourceMap: string;
};
};
};
[contractName: string]: StandardContractOutput;
};
};
}