Skip to content

Commit

Permalink
EIP-3540: Correct whitespace in the document (#4414)
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored Nov 3, 2021
1 parent 882b899 commit 2b5476a
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions EIPS/eip-3540.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The container starts with the header:

This is followed by one or more section headers:

| description | length | |
| description | length | |
|--------------|---------|-|
| section_kind | 1-byte | Encoded as a 8-bit unsigned number. |
| section_size | 2-bytes | Encoded as a 16-bit unsigned big-endian number. |
Expand Down Expand Up @@ -125,7 +125,7 @@ For clarity, the *container* refers to the complete account code, while *code* r

### Changes to contract creation semantics

For clarity, the *EOF prefix* together with a version number *n* is denoted as the *EOFn prefix*, e.g. *EOF1 prefix*.
For clarity, the *EOF prefix* together with a version number *n* is denoted as the *EOFn prefix*, e.g. *EOF1 prefix*.

1. If _initcode's container_ has EOF1 prefix it must be valid EOF1 code.
2. If _code's container_ has EOF1 prefix it must be valid EOF1 code.
Expand Down Expand Up @@ -236,15 +236,15 @@ The choice of *magic* guarantees that none of the contracts existing on the chai
All cases should be checked for creation transaction, `CREATE` and `CREATE2`.

- Legacy init code
- Returns legacy code
- Returns valid EOF1 code
- Returns invalid EOF1 code
- Returns 0xEF not followed by EOF1 code
- Returns legacy code
- Returns valid EOF1 code
- Returns invalid EOF1 code
- Returns 0xEF not followed by EOF1 code
- Valid EOF1 init code
- Returns legacy code
- Returns valid EOF1 code
- Returns invalid EOF1 code
- Returns 0xEF not followed by EOF1 code
- Returns legacy code
- Returns valid EOF1 code
- Returns invalid EOF1 code
- Returns 0xEF not followed by EOF1 code
- Invalid EOF1 init code

### Contract execution
Expand All @@ -253,24 +253,24 @@ All cases should be checked for creation transaction, `CREATE` and `CREATE2`.
- `JUMP`/`JUMPI` to `5B` (`JUMPDEST`) byte outside of code section - exceptional abort
- EOF code containing `PC` opcode - offset inside code section is returned
- `PUSH*` instructions
- Complete push data - no changes expected
- Truncated push data without data section - execution ends with exceptional abort
- Truncated push data with data section - execution ends with exceptional abort
- Complete push data - no changes expected
- Truncated push data without data section - execution ends with exceptional abort
- Truncated push data with data section - execution ends with exceptional abort
- Execution flows out of code section bounds (i.e. PC gets to `code_section_size`) - exceptional abort
- EOF code containing `CODECOPY/CODESIZE` - works as in legacy code
- `CODESIZE` returns the size of entire container
- `CODECOPY` can copy from code section
- `CODECOPY` can copy from data section
- `CODECOPY` can copy from the EOF header
- `CODECOPY` can copy entire container
- `CODESIZE` returns the size of entire container
- `CODECOPY` can copy from code section
- `CODECOPY` can copy from data section
- `CODECOPY` can copy from the EOF header
- `CODECOPY` can copy entire container
- `EXTCODECOPY/EXTCODESIZE/EXTCODEHASH` with the EOF *target* contract - works as with legacy target contract
- `EXTCODESIZE` returns the size of entire target container
- `EXTCODEHASH` returns the hash of entire target container
- `EXTCODECOPY` can copy from target's code section
- `EXTCODECOPY` can copy from target's data section
- `EXTCODECOPY` can copy from target's EOF header
- `EXTCODECOPY` can copy entire target container
- Results don't differ when executed inside legacy or EOF contract
- `EXTCODESIZE` returns the size of entire target container
- `EXTCODEHASH` returns the hash of entire target container
- `EXTCODECOPY` can copy from target's code section
- `EXTCODECOPY` can copy from target's data section
- `EXTCODECOPY` can copy from target's EOF header
- `EXTCODECOPY` can copy entire target container
- Results don't differ when executed inside legacy or EOF contract

## Reference Implementation

Expand Down

0 comments on commit 2b5476a

Please sign in to comment.