File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ Every contract must be stored in the [WebAssembly Binary Encoding](https://githu
8
8
9
9
### Imports
10
10
11
- A contract can only import symbols specified in the [ Ethereum Environment Interface] ( ./eth_interface.md ) .
11
+ A contract can only import symbols specified in the [ Ethereum Environment Interface or EEI] ( ./eth_interface.md ) .
12
+
13
+ In practice, this means that all imports specified by an eWASM module must be from the ` ethereum ` namespace,
14
+ and having a function signature and name directly correspondent to a function specified in the EEI.
12
15
13
16
As mentioned below, there is a ` debug ` namespace as well, but that is disallowed in production systems.
14
17
@@ -38,3 +41,13 @@ The method exported as `main` will be executed by the VM.
38
41
On successful execution, the code should return via a normal code path.
39
42
40
43
If it needs to abort due to a failure, an * unreachable* instruction should be executed.
44
+
45
+ ### Start function
46
+
47
+ The use of a [ start function] ( https://webassembly.github.io/spec/core/syntax/modules.html#start-function ) is disallowed.
48
+
49
+ The reason for this is that an eWASM VM would need to have access to the memory space of a contract and that must be acquired prior to executing it.
50
+ In the [ WebAssembly Javascript API] ( https://webassembly.org/docs/js/ ) however the start function is executed right during instantiation, which
51
+ leaves no time for the client to acquire the memory area.
52
+
53
+ * Note:* This decision was made on WebAssembly version 0xb (pre version 1) and should be revisited.
You can’t perform that action at this time.
0 commit comments