Files
protocol/packages/website/mdx/tools/@0x/sol-compiler/v3.1.12/reference.mdx
2019-08-24 00:04:47 +02:00

297 lines
5.6 KiB
Plaintext

# Class: Compiler
The Compiler facilitates compiling Solidity smart contracts and saves the results
to artifact files.
### Hierarchy
* **Compiler**
### Constructors
## constructer
\+ **new Compiler**(`opts?`: `CompilerOptions`): *[Compiler](#class-compiler)*
*Defined in [compiler.ts:94](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L94)*
Instantiates a new instance of the Compiler class.
**Parameters:**
Name | Type | Description |
------ | ------ | ------ |
`opts?` | `CompilerOptions` | Optional compiler options |
**Returns:** *[Compiler](#class-compiler)*
An instance of the Compiler class.
### Methods
## compileAsync
▸ **compileAsync**(): *`Promise<void>`*
*Defined in [compiler.ts:132](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L132)*
Compiles selected Solidity files found in `contractsDir` and writes JSON artifacts to `artifactsDir`.
**Returns:** *`Promise<void>`*
___
## getCompilerOutputsAsync
▸ **getCompilerOutputsAsync**(): *`Promise<StandardOutput[]>`*
*Defined in [compiler.ts:145](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L145)*
Compiles Solidity files specified during instantiation, and returns the
compiler output given by solc. Return value is an array of outputs:
Solidity modules are batched together by version required, and each
element of the returned array corresponds to a compiler version, and
each element contains the output for all of the modules compiled with
that version.
**Returns:** *`Promise<StandardOutput[]>`*
___
## watchAsync
▸ **watchAsync**(): *`Promise<void>`*
*Defined in [compiler.ts:149](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/compiler.ts#L149)*
**Returns:** *`Promise<void>`*
<hr />
# Class: CompilationError
### Hierarchy
* `Error`
* **CompilationError**
### Constructors
## constructer
\+ **new CompilationError**(`errorsCount`: number): *[CompilationError](#class-compilationerror)*
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L39)*
**Parameters:**
Name | Type |
------ | ------ |
`errorsCount` | number |
**Returns:** *[CompilationError](#class-compilationerror)*
### Properties
## errorsCount
• **errorsCount**: *number*
*Defined in [utils/types.ts:38](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L38)*
___
## message
• **message**: *string*
___
## name
• **name**: *string*
___
## `Optional` stack
• **stack**? : *undefined | string*
*Overrides void*
___
## typeName
• **typeName**: *string* = "CompilationError"
*Defined in [utils/types.ts:39](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L39)*
___
## `Static` Error
▪ **Error**: *`ErrorConstructor`*
<hr />
# Enumeration: AbiType
### Enumeration members
## Constructor
• **Constructor**: = "constructor"
*Defined in [utils/types.ts:3](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L3)*
___
## Event
• **Event**: = "event"
*Defined in [utils/types.ts:4](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L4)*
___
## Fallback
• **Fallback**: = "fallback"
*Defined in [utils/types.ts:5](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L5)*
___
## Function
• **Function**: = "function"
*Defined in [utils/types.ts:2](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L2)*
<hr />
# Interface: BinaryPaths
### Hierarchy
* **BinaryPaths**
### Hierarchy
* **ContractSourceData**
### Hierarchy
* **ContractSpecificSourceData**
### Properties
## solcVersionRange
• **solcVersionRange**: *string*
*Defined in [utils/types.ts:21](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L21)*
___
## sourceHash
• **sourceHash**: *`Buffer`*
*Defined in [utils/types.ts:22](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L22)*
___
## sourceTreeHash
• **sourceTreeHash**: *`Buffer`*
*Defined in [utils/types.ts:23](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L23)*
<hr />
# Interface: SolcErrors
### Hierarchy
* **SolcErrors**
### Hierarchy
* **Token**
### Properties
## `Optional` address
• **address**? : *undefined | string*
*Defined in [utils/types.ts:27](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L27)*
___
## decimals
• **decimals**: *number*
*Defined in [utils/types.ts:30](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L30)*
___
## ipfsHash
• **ipfsHash**: *string*
*Defined in [utils/types.ts:31](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L31)*
___
## name
• **name**: *string*
*Defined in [utils/types.ts:28](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L28)*
___
## swarmHash
• **swarmHash**: *string*
*Defined in [utils/types.ts:32](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L32)*
___
## symbol
• **symbol**: *string*
*Defined in [utils/types.ts:29](https://github.com/0xProject/0x-monorepo/blob/a6f43f536/packages/sol-compiler/src/utils/types.ts#L29)*
<hr />