From c6ad91173fee4a9fe7759c1367554816b4b0e9ed Mon Sep 17 00:00:00 2001 From: wanderer Date: Mon, 12 Sep 2016 16:04:21 -0400 Subject: [PATCH 1/5] EEI: include async interface --- eth_interface.md | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index ceeee749..feb50255 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -15,6 +15,9 @@ We also define the following WebAssembly data types: - `i32ptr`: same as `i32` in WebAssembly, but treated as a pointer to a WebAssembly memory offset - `i64`: same as `i64` in WebAssembly +# Tables +A table named 'callbacks' must be exported if any callbacks are used + # API ## useGas @@ -82,10 +85,11 @@ Sends a message with arbitrary date to a given address path - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not ## callDataCopy @@ -128,10 +132,11 @@ data passed with the message call instruction or transaction. - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not ## callDelegate @@ -146,10 +151,10 @@ persisting the current values for sender and value. - `dataLength` **i32** the length of data - `resultOffset` **i32ptr** the memory offset to store the result data at (`bytes`) - `resultLength` **i32** the maximal length of result data +- `callBackIndex` **i32** an index of the callback function -**Returns** - -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not +**Callback Index** +- `result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## storageStore @@ -159,8 +164,9 @@ Store 256-bit a value in memory to persistent storage - `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u256`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Signature** *nothing* @@ -172,8 +178,9 @@ Loads a 256-bit a value to memory from persistent storage - `pathOffest` **i32ptr** the memory offset to load the path from (`u256`) - `resultOffset` **i32ptr** the memory offset to store the result at (`u256`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** *nothing* @@ -251,10 +258,11 @@ Creates a new contract with a given value. - `dataOffset` **i32ptr** the memory offset to load the code for the new contract from (`bytes`) - `length` **i32** the data length - `resultOffset` **i32ptr** the memory offset to write the new contract address to (`address`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** +- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not -`result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not ## getBlockDifficulty @@ -278,8 +286,9 @@ Copies the code of an account to memory. - `resultOffset` **i32ptr** the memory offset to load the result into (`bytes`) - `codeOffset` **i32** the offset within the code - `length` **i32** the length of code to copy +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Signature** *nothing* @@ -290,10 +299,11 @@ Get size of an account’s code. **Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `callBackIndex` **i32** an index of the callback function -**Returns** +**Callback Index** -`extCodeSize` **i32** +- `extCodeSize` **i32** ## getGasLeft From d76d59de9f6bcd4753aa961e7a43075edcbccd92 Mon Sep 17 00:00:00 2001 From: wanderer Date: Thu, 17 Nov 2016 18:17:05 -0500 Subject: [PATCH 2/5] Update eth_interface.md --- eth_interface.md | 198 +++++++++++++++-------------------------------- 1 file changed, 61 insertions(+), 137 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index feb50255..5ba4ef22 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -2,7 +2,7 @@ The Ethereum Environment Interface exposes the core Ethereum API to the eWASM environment. The Ethereum [module](https://github.com/WebAssembly/design/blob/master/Modules.md) will be implemented in the Ethereum client's native language. All parameters and returns are restricted to 32 or 64 bit integers. Floats are disallowed. -# Data types +# Data types We define the following Ethereum data types: - `bytes`: an array of bytes with unrestricted length @@ -15,69 +15,56 @@ We also define the following WebAssembly data types: - `i32ptr`: same as `i32` in WebAssembly, but treated as a pointer to a WebAssembly memory offset - `i64`: same as `i64` in WebAssembly -# Tables -A table named 'callbacks' must be exported if any callbacks are used +# Tables +A table named 'callbacks' must be exported if any callbacks are used. All callbacks functions have a parameter of a single `i32` which will contain the error code of the orginal operation. If there where no errors then the return value will be 0 other wise it will be 1. # API -## useGas - +## useGas Subtracts an amount to the gas counter -**Parameters** - +**Parameters** - `amount` **i64** the amount to subtract to the gas counter -**Returns** - +**Returns** *nothing* -## getAddress - +## getAddress Gets address of currently executing account and loads it into memory at the given offset. -**Parameters** - +**Parameters** - `resultOffset` **i32ptr** the memory offset to load the address into (`address`) -**Returns** - +**Returns** *nothing* -## getBalance - +## getBalance Gets balance of the given account and loads it into memory at the given offset. -**Parameters** - +**Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `resultOffset` **i32ptr** the memory offset to load the balance into (`u128`) +- `callBackIndex` **i32** an index of the callback function -**Returns** - +**Returns** *nothing* -## getBlockHash - +## getBlockHash Gets the hash of one of the 256 most recent complete blocks. -**Parameters** - +**Parameters** - `number` **i64** which block to load - `resultOffset` **i32ptr** the memory offset to load the hash into (`u256`) -**Returns** - +**Returns** *nothing* -## call - +## call Sends a message with arbitrary date to a given address path -**Parameters** - +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -87,44 +74,32 @@ Sends a message with arbitrary date to a given address path - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function -**Callback Index** - -- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not - -## callDataCopy - +## callDataCopy Copies the input data in current environment to memory. This pertains to the input data passed with the message call instruction or transaction. -**Parameters** - +**Parameters** - `resultOffset` **i32ptr** the memory offset to load data into (`bytes`) - `dataOffset` **i32** the offset in the input data - `length` **i32** the length of data to copy -**Returns** - +**Returns** *nothing* -## getCallDataSize - +## getCallDataSize Get size of input data in current environment. This pertains to the input data passed with the message call instruction or transaction. -**Parameters** - +**Parameters** *none* -**Returns** - +**Returns** `callDataSize` **i32** -## callCode - +## callCode Message-call into this account with an alternative account's code. -**Parameters** - +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -134,17 +109,11 @@ data passed with the message call instruction or transaction. - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function -**Callback Index** - -- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not - -## callDelegate - +## callDelegate Message-call into this account with an alternative account’s code, but persisting the current values for sender and value. -**Parameters** - +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) @@ -153,9 +122,6 @@ persisting the current values for sender and value. - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function -**Callback Index** -- `result` **i32** Returns 1 or 0 depending on if the VM trapped on the message or not - ## storageStore Store 256-bit a value in memory to persistent storage @@ -166,10 +132,6 @@ Store 256-bit a value in memory to persistent storage - `valueOffset` **i32ptr** the memory offset to load the value from (`u256`) - `callBackIndex` **i32** an index of the callback function -**Callback Signature** - -*nothing* - ## storageLoad Loads a 256-bit a value to memory from persistent storage @@ -180,10 +142,6 @@ Loads a 256-bit a value to memory from persistent storage - `resultOffset` **i32ptr** the memory offset to store the result at (`u256`) - `callBackIndex` **i32** an index of the callback function -**Callback Index** - -*nothing* - ## getCaller Gets caller address and loads it into memory at the given offset. This is @@ -230,11 +188,12 @@ Gets the size of code running in current environment. **Parameters** -*none* +- `resultOffset` **i32ptr** the memory offset to load the result into (`i32`) +- `callBackIndex` **i32** an index of the callback function **Returns** -`codeSize` **i32** +*nothing* ## getBlockCoinbase @@ -260,10 +219,6 @@ Creates a new contract with a given value. - `resultOffset` **i32ptr** the memory offset to write the new contract address to (`address`) - `callBackIndex` **i32** an index of the callback function -**Callback Index** -- `result` **i32** 1 or 0 depending on if the VM trapped on the message or not - - ## getBlockDifficulty Get the block’s difficulty. @@ -288,10 +243,6 @@ Copies the code of an account to memory. - `length` **i32** the length of code to copy - `callBackIndex` **i32** an index of the callback function -**Callback Signature** - -*nothing* - ## getExternalCodeSize Get size of an account’s code. @@ -299,54 +250,43 @@ Get size of an account’s code. **Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) +- `resultOffset` **i32ptr** the memory offset to load the result into (`i32`) - `callBackIndex` **i32** an index of the callback function -**Callback Index** - -- `extCodeSize` **i32** - -## getGasLeft +**Returns** +*none* +## getGasLeft Returns the current gasCounter -**Parameters** - +**Parameters** *none* -**Returns** - +**Returns** `gasLeft` **i64** -## getBlockGasLimit - +## getBlockGasLimit Get the block’s gas limit. -**Parameters** - +**Parameters** *none* -**Returns** - +**Returns** `blockGasLimit` **i64** -## getTxGasPrice - +## getTxGasPrice Gets price of gas in current environment. -**Parameters** - +**Parameters** - `valueOffset` **i32ptr** the memory offset to write the value to (`u128`) -**Returns** - +**Returns** *nothing* -## log - +## log Creates a new log in the current environment -**Parameters** - +**Parameters** - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `length` **i32** the data length - `numberOfTopics` **i32** the number of topics following (0 to 4) @@ -355,53 +295,42 @@ Creates a new log in the current environment - `topic3` **i32ptr** the memory offset to load topic3 from (`u256`) - `topic4` **i32ptr** the memory offset to load topic4 from (`u256`) -**Returns** - +**Returns** *nothing* -## getBlockNumber - +## getBlockNumber Get the block’s number. -**Parameters** - +**Parameters** *none* -**Returns** - +**Returns** `blockNumber` **i64** -## getTxOrigin - +## getTxOrigin Gets the execution's origination address and loads it into memory at the given offset. This is the sender of original transaction; it is never an account with non-empty associated code. -**Parameters** - +**Parameters** - `resultOffset` **i32ptr** the memory offset to load the origin address from (`address`) -**Returns** - +**Returns** *nothing* -## return - +## return Set the returning output data for the execution. *Note*: multiple invocations will overwrite the previous data. -**Parameters** - +**Parameters** - `dataOffset` **i32ptr** the memory offset of the output data (`bytes`) - `length` **i32** the length of the output data -**Returns** - +**Returns** *nothing* -## selfDestruct - +## selfDestruct Mark account for later deletion and give the remaining balance to the specified beneficiary address. This takes effect once the contract execution terminates. @@ -409,22 +338,17 @@ beneficiary address. This takes effect once the contract execution terminates. *Note*: the contract **shall** halt execution after this call. -**Parameters** - +**Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) -**Returns** - +**Returns** *nothing* -## getBlockTimestamp - +## getBlockTimestamp Get the block’s timestamp. -**Parameters** - +**Parameters** *none* -**Returns** - +**Returns** `blockTimestamp` **i64** From f08979f2066cd0cb1bc1502b91c403b35dc9b4fc Mon Sep 17 00:00:00 2001 From: wanderer Date: Mon, 2 Jan 2017 18:22:15 -0500 Subject: [PATCH 3/5] Update eth_interface.md --- eth_interface.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth_interface.md b/eth_interface.md index 5ba4ef22..76c8a94c 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -16,7 +16,7 @@ We also define the following WebAssembly data types: - `i64`: same as `i64` in WebAssembly # Tables -A table named 'callbacks' must be exported if any callbacks are used. All callbacks functions have a parameter of a single `i32` which will contain the error code of the orginal operation. If there where no errors then the return value will be 0 other wise it will be 1. +A table named 'callback' must be exported if any callbacks are used. All callbacks functions have a parameter of a single `i32` which will contain the error code of the orginal operation. If there where no errors then the return value will be 0 other wise it will be 1. # API From 2bdaed6ae47b79f3968d4f80901e7b1ad33d217a Mon Sep 17 00:00:00 2001 From: cdetrio Date: Wed, 27 Dec 2017 19:54:04 -0500 Subject: [PATCH 4/5] remove trailing whitespace --- eth_interface.md | 108 +++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/eth_interface.md b/eth_interface.md index 76c8a94c..95220d29 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -2,7 +2,7 @@ The Ethereum Environment Interface exposes the core Ethereum API to the eWASM environment. The Ethereum [module](https://github.com/WebAssembly/design/blob/master/Modules.md) will be implemented in the Ethereum client's native language. All parameters and returns are restricted to 32 or 64 bit integers. Floats are disallowed. -# Data types +# Data types We define the following Ethereum data types: - `bytes`: an array of bytes with unrestricted length @@ -15,56 +15,56 @@ We also define the following WebAssembly data types: - `i32ptr`: same as `i32` in WebAssembly, but treated as a pointer to a WebAssembly memory offset - `i64`: same as `i64` in WebAssembly -# Tables +# Tables A table named 'callback' must be exported if any callbacks are used. All callbacks functions have a parameter of a single `i32` which will contain the error code of the orginal operation. If there where no errors then the return value will be 0 other wise it will be 1. # API -## useGas +## useGas Subtracts an amount to the gas counter -**Parameters** +**Parameters** - `amount` **i64** the amount to subtract to the gas counter -**Returns** +**Returns** *nothing* -## getAddress +## getAddress Gets address of currently executing account and loads it into memory at the given offset. -**Parameters** +**Parameters** - `resultOffset` **i32ptr** the memory offset to load the address into (`address`) -**Returns** +**Returns** *nothing* -## getBalance +## getBalance Gets balance of the given account and loads it into memory at the given offset. -**Parameters** +**Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `resultOffset` **i32ptr** the memory offset to load the balance into (`u128`) - `callBackIndex` **i32** an index of the callback function -**Returns** +**Returns** *nothing* -## getBlockHash +## getBlockHash Gets the hash of one of the 256 most recent complete blocks. -**Parameters** +**Parameters** - `number` **i64** which block to load - `resultOffset` **i32ptr** the memory offset to load the hash into (`u256`) -**Returns** +**Returns** *nothing* -## call +## call Sends a message with arbitrary date to a given address path -**Parameters** +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -74,32 +74,32 @@ Sends a message with arbitrary date to a given address path - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function -## callDataCopy +## callDataCopy Copies the input data in current environment to memory. This pertains to the input data passed with the message call instruction or transaction. -**Parameters** +**Parameters** - `resultOffset` **i32ptr** the memory offset to load data into (`bytes`) - `dataOffset` **i32** the offset in the input data - `length` **i32** the length of data to copy -**Returns** +**Returns** *nothing* -## getCallDataSize +## getCallDataSize Get size of input data in current environment. This pertains to the input data passed with the message call instruction or transaction. -**Parameters** +**Parameters** *none* -**Returns** +**Returns** `callDataSize` **i32** -## callCode +## callCode Message-call into this account with an alternative account's code. -**Parameters** +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -109,11 +109,11 @@ data passed with the message call instruction or transaction. - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function -## callDelegate +## callDelegate Message-call into this account with an alternative account’s code, but persisting the current values for sender and value. -**Parameters** +**Parameters** - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) @@ -253,40 +253,40 @@ Get size of an account’s code. - `resultOffset` **i32ptr** the memory offset to load the result into (`i32`) - `callBackIndex` **i32** an index of the callback function -**Returns** +**Returns** *none* -## getGasLeft +## getGasLeft Returns the current gasCounter -**Parameters** +**Parameters** *none* -**Returns** +**Returns** `gasLeft` **i64** -## getBlockGasLimit +## getBlockGasLimit Get the block’s gas limit. -**Parameters** +**Parameters** *none* -**Returns** +**Returns** `blockGasLimit` **i64** -## getTxGasPrice +## getTxGasPrice Gets price of gas in current environment. -**Parameters** +**Parameters** - `valueOffset` **i32ptr** the memory offset to write the value to (`u128`) -**Returns** +**Returns** *nothing* -## log +## log Creates a new log in the current environment -**Parameters** +**Parameters** - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `length` **i32** the data length - `numberOfTopics` **i32** the number of topics following (0 to 4) @@ -295,42 +295,42 @@ Creates a new log in the current environment - `topic3` **i32ptr** the memory offset to load topic3 from (`u256`) - `topic4` **i32ptr** the memory offset to load topic4 from (`u256`) -**Returns** +**Returns** *nothing* -## getBlockNumber +## getBlockNumber Get the block’s number. -**Parameters** +**Parameters** *none* -**Returns** +**Returns** `blockNumber` **i64** -## getTxOrigin +## getTxOrigin Gets the execution's origination address and loads it into memory at the given offset. This is the sender of original transaction; it is never an account with non-empty associated code. -**Parameters** +**Parameters** - `resultOffset` **i32ptr** the memory offset to load the origin address from (`address`) -**Returns** +**Returns** *nothing* -## return +## return Set the returning output data for the execution. *Note*: multiple invocations will overwrite the previous data. -**Parameters** +**Parameters** - `dataOffset` **i32ptr** the memory offset of the output data (`bytes`) - `length` **i32** the length of the output data -**Returns** +**Returns** *nothing* -## selfDestruct +## selfDestruct Mark account for later deletion and give the remaining balance to the specified beneficiary address. This takes effect once the contract execution terminates. @@ -338,17 +338,17 @@ beneficiary address. This takes effect once the contract execution terminates. *Note*: the contract **shall** halt execution after this call. -**Parameters** +**Parameters** - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) -**Returns** +**Returns** *nothing* -## getBlockTimestamp +## getBlockTimestamp Get the block’s timestamp. -**Parameters** +**Parameters** *none* -**Returns** +**Returns** `blockTimestamp` **i64** From 1dcc8782fb0742b952569108b19e8d282ee191fe Mon Sep 17 00:00:00 2001 From: cdetrio Date: Sun, 21 Jan 2018 22:55:03 +0100 Subject: [PATCH 5/5] preserve newlines --- eth_interface.md | 82 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/eth_interface.md b/eth_interface.md index 95220d29..da95b951 100644 --- a/eth_interface.md +++ b/eth_interface.md @@ -21,50 +21,64 @@ A table named 'callback' must be exported if any callbacks are used. All callbac # API ## useGas + Subtracts an amount to the gas counter **Parameters** + - `amount` **i64** the amount to subtract to the gas counter **Returns** + *nothing* ## getAddress + Gets address of currently executing account and loads it into memory at the given offset. **Parameters** + - `resultOffset` **i32ptr** the memory offset to load the address into (`address`) **Returns** + *nothing* ## getBalance + Gets balance of the given account and loads it into memory at the given offset. **Parameters** + - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `resultOffset` **i32ptr** the memory offset to load the balance into (`u128`) - `callBackIndex` **i32** an index of the callback function **Returns** + *nothing* ## getBlockHash + Gets the hash of one of the 256 most recent complete blocks. **Parameters** + - `number` **i64** which block to load - `resultOffset` **i32ptr** the memory offset to load the hash into (`u256`) **Returns** + *nothing* ## call + Sends a message with arbitrary date to a given address path **Parameters** + - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -74,32 +88,44 @@ Sends a message with arbitrary date to a given address path - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## callDataCopy + Copies the input data in current environment to memory. This pertains to the input data passed with the message call instruction or transaction. **Parameters** + - `resultOffset` **i32ptr** the memory offset to load data into (`bytes`) - `dataOffset` **i32** the offset in the input data - `length` **i32** the length of data to copy **Returns** + *nothing* ## getCallDataSize + Get size of input data in current environment. This pertains to the input data passed with the message call instruction or transaction. **Parameters** + *none* **Returns** + `callDataSize` **i32** ## callCode + Message-call into this account with an alternative account's code. **Parameters** + - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `valueOffset` **i32ptr** the memory offset to load the value from (`u128`) @@ -109,11 +135,17 @@ data passed with the message call instruction or transaction. - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## callDelegate + Message-call into this account with an alternative account’s code, but persisting the current values for sender and value. **Parameters** + - `gas` **i64** the gas limit - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) @@ -122,6 +154,10 @@ persisting the current values for sender and value. - `resultLength` **i32** the maximal length of result data - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## storageStore Store 256-bit a value in memory to persistent storage @@ -132,6 +168,10 @@ Store 256-bit a value in memory to persistent storage - `valueOffset` **i32ptr** the memory offset to load the value from (`u256`) - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## storageLoad Loads a 256-bit a value to memory from persistent storage @@ -142,6 +182,10 @@ Loads a 256-bit a value to memory from persistent storage - `resultOffset` **i32ptr** the memory offset to store the result at (`u256`) - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## getCaller Gets caller address and loads it into memory at the given offset. This is @@ -219,6 +263,10 @@ Creates a new contract with a given value. - `resultOffset` **i32ptr** the memory offset to write the new contract address to (`address`) - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## getBlockDifficulty Get the block’s difficulty. @@ -243,6 +291,10 @@ Copies the code of an account to memory. - `length` **i32** the length of code to copy - `callBackIndex` **i32** an index of the callback function +**Returns** + +*nothing* + ## getExternalCodeSize Get size of an account’s code. @@ -254,39 +306,51 @@ Get size of an account’s code. - `callBackIndex` **i32** an index of the callback function **Returns** -*none* + +*nothing* ## getGasLeft + Returns the current gasCounter **Parameters** + *none* **Returns** + `gasLeft` **i64** ## getBlockGasLimit + Get the block’s gas limit. **Parameters** + *none* **Returns** + `blockGasLimit` **i64** ## getTxGasPrice + Gets price of gas in current environment. **Parameters** + - `valueOffset` **i32ptr** the memory offset to write the value to (`u128`) **Returns** + *nothing* ## log + Creates a new log in the current environment **Parameters** + - `dataOffset` **i32ptr** the memory offset to load data from (`bytes`) - `length` **i32** the data length - `numberOfTopics` **i32** the number of topics following (0 to 4) @@ -296,41 +360,52 @@ Creates a new log in the current environment - `topic4` **i32ptr** the memory offset to load topic4 from (`u256`) **Returns** + *nothing* ## getBlockNumber + Get the block’s number. **Parameters** + *none* **Returns** + `blockNumber` **i64** ## getTxOrigin + Gets the execution's origination address and loads it into memory at the given offset. This is the sender of original transaction; it is never an account with non-empty associated code. **Parameters** + - `resultOffset` **i32ptr** the memory offset to load the origin address from (`address`) **Returns** + *nothing* ## return + Set the returning output data for the execution. *Note*: multiple invocations will overwrite the previous data. **Parameters** + - `dataOffset` **i32ptr** the memory offset of the output data (`bytes`) - `length` **i32** the length of the output data **Returns** + *nothing* ## selfDestruct + Mark account for later deletion and give the remaining balance to the specified beneficiary address. This takes effect once the contract execution terminates. @@ -339,16 +414,21 @@ beneficiary address. This takes effect once the contract execution terminates. *Note*: the contract **shall** halt execution after this call. **Parameters** + - `addressOffset` **i32ptr** the memory offset to load the address from (`address`) **Returns** + *nothing* ## getBlockTimestamp + Get the block’s timestamp. **Parameters** + *none* **Returns** + `blockTimestamp` **i64**