aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/utils/types.ts
blob: f756c51bb54d101ebfd762cecda4a5feb79e1afb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
export enum AbiType {
    Function = 'function',
    Constructor = 'constructor',
    Event = 'event',
    Fallback = 'fallback',
}

export interface SolcErrors {
    [key: string]: boolean;
}

export interface ContractSourceData {
    [contractName: string]: ContractSpecificSourceData;
}

export interface BinaryPaths {
    [key: string]: string;
}

export interface ContractSpecificSourceData {
    solcVersionRange: string;
    sourceHash: Buffer;
    sourceTreeHash: Buffer;
}

export interface Token {
    address?: string;
    name: string;
    symbol: string;
    decimals: number;
    ipfsHash: string;
    swarmHash: string;
}

export type DoneCallback = (err?: Error) => void;

export class CompilationError extends Error {
    public errorsCount: number;
    public typeName = 'CompilationError';
    constructor(errorsCount: number) {
        super('Compilation errors encountered');
        this.errorsCount = errorsCount;
    }
}