aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-compiler/src/utils/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/sol-compiler/src/utils/types.ts')
-rw-r--r--packages/sol-compiler/src/utils/types.ts79
1 files changed, 79 insertions, 0 deletions
diff --git a/packages/sol-compiler/src/utils/types.ts b/packages/sol-compiler/src/utils/types.ts
new file mode 100644
index 000000000..b12a11b79
--- /dev/null
+++ b/packages/sol-compiler/src/utils/types.ts
@@ -0,0 +1,79 @@
+import { ContractAbi, Provider, TxData } from '@0xproject/types';
+import * as solc from 'solc';
+import * as Web3 from 'web3';
+import * as yargs from 'yargs';
+
+export enum AbiType {
+ Function = 'function',
+ Constructor = 'constructor',
+ Event = 'event',
+ Fallback = 'fallback',
+}
+
+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 {
+ [networkId: number]: ContractNetworkData;
+}
+
+export interface ContractNetworkData {
+ address: string;
+ links: {
+ [linkName: string]: string;
+ };
+ constructorArgs: string;
+}
+
+export interface SolcErrors {
+ [key: string]: boolean;
+}
+
+export interface CompilerOptions {
+ contractsDir?: string;
+ artifactsDir?: string;
+ compilerSettings?: solc.CompilerSettings;
+ contracts?: string[] | '*';
+}
+
+export interface ContractSourceData {
+ [contractName: string]: ContractSpecificSourceData;
+}
+
+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;