Rather pedantic edits

This commit is contained in:
Yoichi Hirai 2017-12-01 17:54:17 +01:00
parent 0fe1eb7c46
commit cbe317dcd6
No known key found for this signature in database
GPG Key ID: E7B75D080FCF7992

View File

@ -31,7 +31,7 @@ Note that this proposal also makes the EIP that proposes to allow to return data
If `block.number >= BYZANTIUM_FORK_BLKNUM`, add two new opcodes and amend the semantics of any opcode that creates a new call frame (like `CALL`, `CREATE`, `DELEGATECALL`, ...) called call-like opcodes in the following. It is assumed that the EVM (to be more specific: an EVM call frame) has a new internal buffer of variable size, called the return data buffer. This buffer is created empty for each new call frame. Upon executing any call-like opcode, the buffer is cleared (its size is set to zero). After executing a call-like opcode, the complete return data (or failure data, see [EIP-140](./eip-140.md)) of the call is stored in the return data buffer (of the caller), and its size changed accordingly. As an exception, `CREATE` and `CREATE2` are considered to return the empty buffer in the success case and the failure data in the failure case. If the call-like opcode is executed but does not really instantiate a call frame (for example due to insufficient funds for a value transfer or if the called contract does not exist), the return data buffer is empty.
As an optimization, it is possible to share the return data buffer across call frames because only one will be non-empty at any time.
As an optimization, it is possible to share the return data buffer across call frames because at most one will be non-empty at any time.
`RETURNDATASIZE`: `0x3d`
@ -40,7 +40,7 @@ Gas costs: 2 (same as `CALLDATASIZE`)
`RETURNDATACOPY`: `0x3e`
This opcode has similar semantics to `CALLDATACOPY`, but instead of copying data from the call data, it copies data from the return data buffer. Furthermore, accessing the return data buffer beyond its size results in a failure, i.e. if `start + length` overflows or results in a value larger than `RETURNDATASIZE`, the current call stops in an out-of-gas condition. In particular, reading 0 bytes from the end of the buffer will read 0 bytes; reading 0 bytes from one-byte out of the buffer causes an exception.
This opcode has similar semantics to `CALLDATACOPY`, but instead of copying data from the call data, it copies data from the return data buffer. Furthermore, accessing the return data buffer beyond its size results in a failure; i.e. if `start + length` overflows or results in a value larger than `RETURNDATASIZE`, the current call stops in an out-of-gas condition. In particular, reading 0 bytes from the end of the buffer will read 0 bytes; reading 0 bytes from one-byte out of the buffer causes an exception.
Gas costs: `3 + 3 * ceil(amount / 32)` (same as `CALLDATACOPY`)