@@ -15,6 +15,9 @@ We also define the following WebAssembly data types:
15
15
- ` i32ptr ` : same as ` i32 ` in WebAssembly, but treated as a pointer to a WebAssembly memory offset
16
16
- ` i64 ` : same as ` i64 ` in WebAssembly
17
17
18
+ # Tables
19
+ A table named 'callbacks' must be exported if any callbacks are used
20
+
18
21
# API
19
22
20
23
## useGas
@@ -82,10 +85,11 @@ Sends a message with arbitrary date to a given address path
82
85
- ` dataLength ` ** i32** the length of data
83
86
- ` resultOffset ` ** i32ptr** the memory offset to store the result data at (` bytes ` )
84
87
- ` resultLength ` ** i32** the maximal length of result data
88
+ - ` callBackIndex ` ** i32** an index of the callback function
85
89
86
- ** Returns **
90
+ ** Callback Index **
87
91
88
- ` result ` ** i32** Returns 1 or 0 depending on if the VM trapped on the message or not
92
+ - ` result ` ** i32** 1 or 0 depending on if the VM trapped on the message or not
89
93
90
94
## callDataCopy
91
95
@@ -128,10 +132,11 @@ data passed with the message call instruction or transaction.
128
132
- ` dataLength ` ** i32** the length of data
129
133
- ` resultOffset ` ** i32ptr** the memory offset to store the result data at (` bytes ` )
130
134
- ` resultLength ` ** i32** the maximal length of result data
135
+ - ` callBackIndex ` ** i32** an index of the callback function
131
136
132
- ** Returns **
137
+ ** Callback Index **
133
138
134
- ` result ` ** i32** Returns 1 or 0 depending on if the VM trapped on the message or not
139
+ - ` result ` ** i32** 1 or 0 depending on if the VM trapped on the message or not
135
140
136
141
## callDelegate
137
142
@@ -146,10 +151,10 @@ persisting the current values for sender and value.
146
151
- ` dataLength ` ** i32** the length of data
147
152
- ` resultOffset ` ** i32ptr** the memory offset to store the result data at (` bytes ` )
148
153
- ` resultLength ` ** i32** the maximal length of result data
154
+ - ` callBackIndex ` ** i32** an index of the callback function
149
155
150
- ** Returns**
151
-
152
- ` result ` ** i32** Returns 1 or 0 depending on if the VM trapped on the message or not
156
+ ** Callback Index**
157
+ - ` result ` ** i32** Returns 1 or 0 depending on if the VM trapped on the message or not
153
158
154
159
## storageStore
155
160
@@ -159,8 +164,9 @@ Store 256-bit a value in memory to persistent storage
159
164
160
165
- ` pathOffest ` ** i32ptr** the memory offset to load the path from (` u256 ` )
161
166
- ` valueOffset ` ** i32ptr** the memory offset to load the value from (` u256 ` )
167
+ - ` callBackIndex ` ** i32** an index of the callback function
162
168
163
- ** Returns **
169
+ ** Callback Signature **
164
170
165
171
* nothing*
166
172
@@ -172,8 +178,9 @@ Loads a 256-bit a value to memory from persistent storage
172
178
173
179
- ` pathOffest ` ** i32ptr** the memory offset to load the path from (` u256 ` )
174
180
- ` resultOffset ` ** i32ptr** the memory offset to store the result at (` u256 ` )
181
+ - ` callBackIndex ` ** i32** an index of the callback function
175
182
176
- ** Returns **
183
+ ** Callback Index **
177
184
178
185
* nothing*
179
186
@@ -251,10 +258,11 @@ Creates a new contract with a given value.
251
258
- ` dataOffset ` ** i32ptr** the memory offset to load the code for the new contract from (` bytes ` )
252
259
- ` length ` ** i32** the data length
253
260
- ` resultOffset ` ** i32ptr** the memory offset to write the new contract address to (` address ` )
261
+ - ` callBackIndex ` ** i32** an index of the callback function
254
262
255
- ** Returns**
263
+ ** Callback Index**
264
+ - ` result ` ** i32** 1 or 0 depending on if the VM trapped on the message or not
256
265
257
- ` result ` ** i32** Returns 1 or 0 depending on if the VM trapped on the message or not
258
266
259
267
## getBlockDifficulty
260
268
@@ -278,8 +286,9 @@ Copies the code of an account to memory.
278
286
- ` resultOffset ` ** i32ptr** the memory offset to load the result into (` bytes ` )
279
287
- ` codeOffset ` ** i32** the offset within the code
280
288
- ` length ` ** i32** the length of code to copy
289
+ - ` callBackIndex ` ** i32** an index of the callback function
281
290
282
- ** Returns **
291
+ ** Callback Signature **
283
292
284
293
* nothing*
285
294
@@ -290,10 +299,11 @@ Get size of an account’s code.
290
299
** Parameters**
291
300
292
301
- ` addressOffset ` ** i32ptr** the memory offset to load the address from (` address ` )
302
+ - ` callBackIndex ` ** i32** an index of the callback function
293
303
294
- ** Returns **
304
+ ** Callback Index **
295
305
296
- ` extCodeSize ` ** i32**
306
+ - ` extCodeSize ` ** i32**
297
307
298
308
## getGasLeft
299
309
0 commit comments