protocol/packages/sol-compiler/src/solc_wrapper.ts
2020-04-01 13:42:48 -04:00

36 lines
867 B
TypeScript

import { StandardOutput } from 'ethereum-types';
import { StandardInput } from 'solc';
export interface ContractContentsByPath {
[path: string]: string;
}
export interface ImportPrefixRemappings {
[prefix: string]: string;
}
export interface CompilationResult {
input: StandardInput;
output: StandardOutput;
}
export abstract class SolcWrapper {
/**
* Get the solc version.
*/
public abstract get version(): string;
/**
* Check if the configured compiler settings is different from another.
*/
public abstract areCompilerSettingsDifferent(settings: any): boolean;
/**
* Compile contracts, returning standard input and output.
*/
public abstract compileAsync(
contractsByPath: ContractContentsByPath,
dependencies: ImportPrefixRemappings,
): Promise<CompilationResult>;
}