You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# eWASM Contract Interface (ECI) Specification; Version 0
2
+
3
+
The eWASM Contract Interface (ECI) specifies the structure of a contract module.
4
+
5
+
### Wire format
6
+
7
+
Every contract must be stored in the [WebAssembly Binary Encoding](https://github.com/WebAssembly/design/blob/master/BinaryEncoding.md) format (in short, WASM bytecode).
8
+
9
+
### Imports
10
+
11
+
A contract can only import symbols specified in the [Ethereum Environment Interface](./eth_interface.md).
12
+
13
+
### Exports
14
+
15
+
A contract must have exactly two exported symbols:
16
+
-`memory`: the shared memory space available for the EEI to write into.
17
+
-`main`: a function with no parameters and no result value.
18
+
19
+
### Entry point
20
+
21
+
The method exported as `main` will be executed by the VM.
22
+
23
+
### Debug-mode
24
+
25
+
Debug-mode is a special VM option, where an additional set of debugging interfaces are available to contracts. On a live VM, any bytecode trying to import these
26
+
symbols should be rejected.
27
+
28
+
The imports are available under the `debug` namespace:
29
+
-`print(i32 offset, i32 length)`: print a string as pointed by `offset`
30
+
-`printHex(i32 offset, i32 length)`: print a hex representation of the memory pointed to by `offset`
0 commit comments