1 |
|
2 | export interface SrcIfc {
|
3 | [key: string]: {
|
4 | content: string
|
5 | }
|
6 | }
|
7 |
|
8 | export interface FinalResult {
|
9 | totalPassing: number,
|
10 | totalFailing: number,
|
11 | totalTime: number,
|
12 | errors: any[],
|
13 | }
|
14 |
|
15 | export interface RunListInterface {
|
16 | name: string,
|
17 | type: string,
|
18 | constant: boolean,
|
19 | payable: boolean,
|
20 | signature?: any
|
21 | }
|
22 | export interface ResultsInterface {
|
23 | passingNum: number,
|
24 | failureNum: number,
|
25 | timePassed: number
|
26 | }
|
27 | export interface TestResultInterface {
|
28 | type: string,
|
29 | value: any,
|
30 | time?: number,
|
31 | context?: string,
|
32 | errMsg?: string
|
33 | filename?: string
|
34 | }
|
35 | export interface TestCbInterface {
|
36 | (error: Error | null | undefined, result: TestResultInterface) : void;
|
37 | }
|
38 | export interface ResultCbInterface {
|
39 | (error: Error | null | undefined, result: ResultsInterface) : void;
|
40 | }
|
41 |
|
42 | export interface Options {
|
43 | accounts?: string[] | null,
|
44 | web3?: any
|
45 | }
|
46 |
|
47 | export interface CompilerConfiguration {
|
48 | currentCompilerUrl: string,
|
49 | evmVersion: string,
|
50 | optimize: boolean,
|
51 | usingWorker: boolean
|
52 | }
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | export interface CompilationSource {
|
60 |
|
61 | id: number
|
62 |
|
63 | ast: AstNode
|
64 |
|
65 | legacyAST: AstNodeLegacy
|
66 | }
|
67 |
|
68 | export interface AstNodeLegacy {
|
69 | id: number
|
70 | name: string
|
71 | src: string
|
72 | children?: Array<AstNodeLegacy>
|
73 | attributes?: AstNodeAtt
|
74 | }
|
75 |
|
76 | export interface AstNodeAtt {
|
77 | operator?: string
|
78 | string?: null
|
79 | type?: string
|
80 | value?: string
|
81 | constant?: boolean
|
82 | name?: string
|
83 | public?: boolean
|
84 | exportedSymbols?: Object
|
85 | argumentTypes?: null
|
86 | absolutePath?: string
|
87 | [x: string]: any
|
88 | }
|
89 |
|
90 | export interface AstNode {
|
91 | absolutePath?: string
|
92 | exportedSymbols?: Object
|
93 | id: number
|
94 | nodeType: string
|
95 | nodes?: Array<AstNode>
|
96 | src: string
|
97 | literals?: Array<string>
|
98 | file?: string
|
99 | scope?: number
|
100 | sourceUnit?: number
|
101 | symbolAliases?: Array<string>
|
102 | [x: string]: any
|
103 | }
|
104 |
|
105 | export interface compilationInterface {
|
106 | [fileName: string]: {
|
107 | [contract: string]: CompiledContract
|
108 | }
|
109 | }
|
110 |
|
111 | export interface ASTInterface {
|
112 | [contractName: string]: CompilationSource
|
113 | }
|
114 |
|
115 | export interface CompiledContract {
|
116 |
|
117 | abi: ABIDescription[]
|
118 |
|
119 | metadata: string
|
120 |
|
121 | userdoc: UserDocumentation
|
122 |
|
123 | devdoc: DeveloperDocumentation
|
124 |
|
125 | ir: string
|
126 |
|
127 | evm: {
|
128 | assembly: string
|
129 | legacyAssembly: {}
|
130 |
|
131 | bytecode: BytecodeObject
|
132 | deployedBytecode: BytecodeObject
|
133 |
|
134 | methodIdentifiers: {
|
135 | [functionIdentifier: string]: string
|
136 | }
|
137 | // Function gas estimates
|
138 | gasEstimates: {
|
139 | creation: {
|
140 | codeDepositCost: string
|
141 | executionCost: 'infinite' | string
|
142 | totalCost: 'infinite' | string
|
143 | }
|
144 | external: {
|
145 | [functionIdentifier: string]: string
|
146 | }
|
147 | internal: {
|
148 | [functionIdentifier: string]: 'infinite' | string
|
149 | }
|
150 | }
|
151 | }
|
152 | }
|
153 |
|
154 | /////////
|
155 | // ABI //
|
156 | /////////
|
157 | export type ABIDescription = FunctionDescription | EventDescription
|
158 |
|
159 | export interface FunctionDescription {
|
160 |
|
161 | type?: 'function' | 'constructor' | 'fallback' | 'receive'
|
162 |
|
163 | name?: string
|
164 |
|
165 | inputs?: ABIParameter[]
|
166 |
|
167 | outputs?: ABIParameter[]
|
168 |
|
169 | stateMutability: 'pure' | 'view' | 'nonpayable' | 'payable'
|
170 |
|
171 | payable?: boolean
|
172 |
|
173 | constant?: boolean
|
174 | signature?: string
|
175 | }
|
176 |
|
177 | export interface EventDescription {
|
178 | type: 'event'
|
179 | name: string
|
180 | inputs: ABIParameter &
|
181 | {
|
182 |
|
183 | indexed: boolean
|
184 | }[]
|
185 |
|
186 | anonymous: boolean
|
187 | }
|
188 |
|
189 | export interface ABIParameter {
|
190 |
|
191 | name: string
|
192 |
|
193 | type: ABITypeParameter
|
194 |
|
195 | components?: ABIParameter[]
|
196 | }
|
197 |
|
198 | export type ABITypeParameter =
|
199 | | 'uint'
|
200 | | 'uint[]'
|
201 | | 'int'
|
202 | | 'int[]'
|
203 | | 'address'
|
204 | | 'address[]'
|
205 | | 'bool'
|
206 | | 'bool[]'
|
207 | | 'fixed'
|
208 | | 'fixed[]'
|
209 | | 'ufixed'
|
210 | | 'ufixed[]'
|
211 | | 'bytes'
|
212 | | 'bytes[]'
|
213 | | 'function'
|
214 | | 'function[]'
|
215 | | 'tuple'
|
216 | | 'tuple[]'
|
217 | | string
|
218 |
|
219 |
|
220 |
|
221 |
|
222 |
|
223 |
|
224 | export interface UserDocumentation {
|
225 | methods: UserMethodList
|
226 | notice: string
|
227 | }
|
228 |
|
229 | export type UserMethodList = {
|
230 | [functionIdentifier: string]: UserMethodDoc
|
231 | } & {
|
232 | 'constructor'?: string
|
233 | }
|
234 | export interface UserMethodDoc {
|
235 | notice: string
|
236 | }
|
237 |
|
238 |
|
239 | export interface DeveloperDocumentation {
|
240 | author: string
|
241 | title: string
|
242 | details: string
|
243 | methods: DevMethodList
|
244 | }
|
245 |
|
246 | export interface DevMethodList {
|
247 | [functionIdentifier: string]: DevMethodDoc
|
248 | }
|
249 |
|
250 | export interface DevMethodDoc {
|
251 | author: string
|
252 | details: string
|
253 | return: string
|
254 | params: {
|
255 | [param: string]: string
|
256 | }
|
257 | }
|
258 |
|
259 |
|
260 |
|
261 |
|
262 | export interface BytecodeObject {
|
263 |
|
264 | object: string
|
265 |
|
266 | opcodes: string
|
267 |
|
268 | sourceMap: string
|
269 |
|
270 | linkReferences?: {
|
271 | [contractName: string]: {
|
272 |
|
273 | [library: string]: { start: number; length: number }[]
|
274 | }
|
275 | }
|
276 | }
|