@@ -42,6 +42,10 @@ offset.
42
42
43
43
* nothing*
44
44
45
+ ** Trap conditions**
46
+
47
+ - store to memory at ` resultOffset ` results in out of bounds access.
48
+
45
49
## getExternalBalance
46
50
47
51
Gets balance of the given account and loads it into memory at the given
@@ -56,6 +60,11 @@ offset.
56
60
57
61
* nothing*
58
62
63
+ ** Trap conditions**
64
+
65
+ - load from memory at ` addressOffset ` results in out of bounds access,
66
+ - store to memory at ` resultOffset ` results in out of bounds access.
67
+
59
68
## getBlockHash
60
69
61
70
Gets the hash of one of the 256 most recent complete blocks.
@@ -71,6 +80,10 @@ Gets the hash of one of the 256 most recent complete blocks.
71
80
72
81
* Note:* in case of failure, the output memory pointed by ` resultOffset ` is unchanged.
73
82
83
+ ** Trap conditions**
84
+
85
+ - store to memory at ` resultOffset ` results in out of bounds access (also checked on failure).
86
+
74
87
## call
75
88
76
89
Sends a message with arbitrary data to a given address path
@@ -87,6 +100,12 @@ Sends a message with arbitrary data to a given address path
87
100
88
101
` result ` ** i32** Returns 0 on success, 1 on failure and 2 on ` revert `
89
102
103
+ ** Trap conditions**
104
+
105
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access,
106
+ - load ` u128 ` from memory at ` valueOffset ` results in out of bounds access,
107
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
108
+
90
109
## callDataCopy
91
110
92
111
Copies the input data in current environment to memory. This pertains to
@@ -102,6 +121,11 @@ the input data passed with the message call instruction or transaction.
102
121
103
122
* nothing*
104
123
124
+ ** Trap conditions**
125
+
126
+ - load ` length ` number of bytes from input data buffer at ` dataOffset ` results in out of bounds access,
127
+ - store ` length ` number of bytes to memory at ` resultOffset ` results in out of bounds access.
128
+
105
129
## getCallDataSize
106
130
107
131
Get size of input data in current environment. This pertains to the input
@@ -131,6 +155,12 @@ data passed with the message call instruction or transaction.
131
155
132
156
` result ` ** i32** Returns 0 on success, 1 on failure and 2 on ` revert `
133
157
158
+ ** Trap conditions**
159
+
160
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access,
161
+ - load ` u128 ` from memory at ` valueOffset ` results in out of bounds access,
162
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
163
+
134
164
## callDelegate
135
165
136
166
Message-call into this account with an alternative account’s code, but
@@ -147,6 +177,11 @@ persisting the current values for sender and value.
147
177
148
178
` result ` ** i32** Returns 0 on success, 1 on failure and 2 on ` revert `
149
179
180
+ ** Trap conditions**
181
+
182
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access,
183
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
184
+
150
185
## callStatic
151
186
152
187
Sends a message with arbitrary data to a given address path, but disallow state
@@ -164,6 +199,11 @@ value.
164
199
165
200
` result ` ** i32** Returns 0 on success, 1 on failure and 2 on ` revert `
166
201
202
+ ** Trap conditions**
203
+
204
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access,
205
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
206
+
167
207
## storageStore
168
208
169
209
Store 256-bit a value in memory to persistent storage
@@ -177,6 +217,11 @@ Store 256-bit a value in memory to persistent storage
177
217
178
218
* nothing*
179
219
220
+ ** Trap conditions**
221
+
222
+ - load ` u256 ` from memory at ` pathOffset ` results in out of bounds access,
223
+ - load ` u256 ` from memory at ` valueOffset ` results in out of bounds access.
224
+
180
225
## storageLoad
181
226
182
227
Loads a 256-bit a value to memory from persistent storage
@@ -190,6 +235,11 @@ Loads a 256-bit a value to memory from persistent storage
190
235
191
236
* nothing*
192
237
238
+ ** Trap conditions**
239
+
240
+ - load ` u256 ` from memory at ` pathOffset ` results in out of bounds access,
241
+ - store ` u256 ` to memory at ` resultOffset ` results in out of bounds access.
242
+
193
243
## getCaller
194
244
195
245
Gets caller address and loads it into memory at the given offset. This is
@@ -203,6 +253,10 @@ the address of the account that is directly responsible for this execution.
203
253
204
254
* nothing*
205
255
256
+ ** Trap conditions**
257
+
258
+ - store ` address ` to memory at ` resultOffset ` results in out of bounds access.
259
+
206
260
## getCallValue
207
261
208
262
Gets the deposited value by the instruction/transaction responsible for
@@ -216,6 +270,10 @@ this execution and loads it into memory at the given location.
216
270
217
271
* nothing*
218
272
273
+ ** Trap conditions**
274
+
275
+ - store ` u128 ` to memory at ` resultOffset ` results in out of bounds access.
276
+
219
277
## codeCopy
220
278
221
279
Copies the code running in current environment to memory.
@@ -230,6 +288,11 @@ Copies the code running in current environment to memory.
230
288
231
289
* nothing*
232
290
291
+ ** Trap conditions**
292
+
293
+ - load ` length ` number of bytes from the current code buffer at ` codeOffset ` results in out of bounds access,
294
+ - store ` length ` number of bytes to memory at ` resultOffset ` results in out of bounds access.
295
+
233
296
## getCodeSize
234
297
235
298
Gets the size of code running in current environment.
@@ -254,6 +317,10 @@ Gets the block’s beneficiary address and loads into memory.
254
317
255
318
* nothing*
256
319
320
+ ** Trap conditions**
321
+
322
+ - store ` address ` to memory at ` resultOffset ` results in out of bounds access.
323
+
257
324
## create
258
325
259
326
Creates a new contract with a given value.
@@ -262,7 +329,7 @@ Creates a new contract with a given value.
262
329
263
330
- ` valueOffset ` ** i32ptr** the memory offset to load the value from (` u128 ` )
264
331
- ` dataOffset ` ** i32ptr** the memory offset to load the code for the new contract from (` bytes ` )
265
- - ` length ` ** i32** the data length
332
+ - ` dataLength ` ** i32** the data length
266
333
- ` resultOffset ` ** i32ptr** the memory offset to write the new contract address to (` address ` )
267
334
268
335
* Note* : ` create ` will clear the return buffer in case of success or may fill it with data coming from ` revert ` .
@@ -271,6 +338,12 @@ Creates a new contract with a given value.
271
338
272
339
` result ` ** i32** Returns 0 on success, 1 on failure and 2 on ` revert `
273
340
341
+ ** Trap conditions**
342
+
343
+ - load ` u128 ` from memory at ` valueOffset ` results in out of bounds access,
344
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
345
+ - store ` address ` to memory at ` resultOffset ` results in out of bounds access.
346
+
274
347
## getBlockDifficulty
275
348
276
349
Get the block’s difficulty.
@@ -283,6 +356,10 @@ Get the block’s difficulty.
283
356
284
357
* nothing*
285
358
359
+ ** Trap conditions**
360
+
361
+ - store ` u256 ` to memory at ` resultOffset ` results in out of bounds access.
362
+
286
363
## externalCodeCopy
287
364
288
365
Copies the code of an account to memory.
@@ -298,6 +375,12 @@ Copies the code of an account to memory.
298
375
299
376
* nothing*
300
377
378
+ ** Trap conditions**
379
+
380
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access,
381
+ - load ` length ` number of bytes from the account code buffer at ` codeOffset ` results in out of bounds access,
382
+ - store ` length ` number of bytes to memory at ` resultOffset ` results in out of bounds access.
383
+
301
384
## getExternalCodeSize
302
385
303
386
Get size of an account’s code.
@@ -310,6 +393,10 @@ Get size of an account’s code.
310
393
311
394
` extCodeSize ` ** i32**
312
395
396
+ ** Trap conditions**
397
+
398
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access.
399
+
313
400
## getGasLeft
314
401
315
402
Returns the current gasCounter
@@ -340,20 +427,24 @@ Gets price of gas in current environment.
340
427
341
428
** Parameters**
342
429
343
- - ` valueOffset ` ** i32ptr** the memory offset to write the value to (` u128 ` )
430
+ - ` resultOffset ` ** i32ptr** the memory offset to write the value to (` u128 ` )
344
431
345
432
** Returns**
346
433
347
434
* nothing*
348
435
436
+ ** Trap conditions**
437
+
438
+ - store ` u128 ` to memory at ` resultOffset ` results in out of bounds access.
439
+
349
440
## log
350
441
351
442
Creates a new log in the current environment
352
443
353
444
** Parameters**
354
445
355
446
- ` dataOffset ` ** i32ptr** the memory offset to load data from (` bytes ` )
356
- - ` length ` ** i32** the data length
447
+ - ` dataLength ` ** i32** the data length
357
448
- ` numberOfTopics ` ** i32** the number of topics following (0 to 4)
358
449
- ` topic1 ` ** i32ptr** the memory offset to load topic1 from (` u256 ` )
359
450
- ` topic2 ` ** i32ptr** the memory offset to load topic2 from (` u256 ` )
@@ -364,6 +455,15 @@ Creates a new log in the current environment
364
455
365
456
* nothing*
366
457
458
+ ** Trap conditions**
459
+
460
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access,
461
+ - ` numberOfTopics ` is negative or greater than 4,
462
+ - load ` u256 ` from memory at ` topic1 ` results in out of bounds access,
463
+ - load ` u256 ` from memory at ` topic2 ` results in out of bounds access,
464
+ - load ` u256 ` from memory at ` topic3 ` results in out of bounds access,
465
+ - load ` u256 ` from memory at ` topic4 ` results in out of bounds access.
466
+
367
467
## getBlockNumber
368
468
369
469
Get the block’s number.
@@ -390,32 +490,44 @@ account with non-empty associated code.
390
490
391
491
* nothing*
392
492
493
+ ** Trap conditions**
494
+
495
+ - store ` address ` to memory at ` resultOffset ` results in out of bounds access.
496
+
393
497
## finish
394
498
395
499
Set the returning output data for the execution. This will cause a trap and the execution will be aborted immediately.
396
500
397
501
** Parameters**
398
502
399
503
- ` dataOffset ` ** i32ptr** the memory offset of the output data (` bytes ` )
400
- - ` length ` ** i32** the length of the output data
504
+ - ` dataLength ` ** i32** the length of the output data
401
505
402
506
** Returns**
403
507
404
508
* doesn't return*
405
509
510
+ ** Trap conditions**
511
+
512
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
513
+
406
514
## revert
407
515
408
516
Set the returning output data for the execution. This will cause a trap and the execution will be aborted immediately.
409
517
410
518
** Parameters**
411
519
412
520
- ` dataOffset ` ** i32ptr** the memory offset of the output data (` bytes ` )
413
- - ` length ` ** i32** the length of the output data
521
+ - ` dataLength ` ** i32** the length of the output data
414
522
415
523
** Returns**
416
524
417
525
* doesn't return*
418
526
527
+ ** Trap conditions**
528
+
529
+ - load ` dataLength ` number of bytes from memory at ` dataOffset ` results in out of bounds access.
530
+
419
531
## getReturnDataSize
420
532
421
533
Get size of current return data buffer to memory. This contains the return data
@@ -446,6 +558,11 @@ from last executed `call`, `callCode`, `callDelegate`, `callStatic` or `create`.
446
558
447
559
** Returns**
448
560
561
+ ** Trap conditions**
562
+
563
+ - load ` length ` number of bytes from input data buffer at ` dataOffset ` results in out of bounds access,
564
+ - store ` length ` number of bytes to memory at ` resultOffset ` results in out of bounds access.
565
+
449
566
* nothing*
450
567
451
568
## selfDestruct
@@ -461,6 +578,10 @@ beneficiary address. This will cause a trap and the execution will be aborted im
461
578
462
579
* doesn't return*
463
580
581
+ ** Trap conditions**
582
+
583
+ - load ` address ` from memory at ` addressOffset ` results in out of bounds access.
584
+
464
585
## getBlockTimestamp
465
586
466
587
Get the block’s timestamp.
0 commit comments