Skip to content

Commit

Permalink
Applied the check for Create transaciton too
Browse files Browse the repository at this point in the history
  • Loading branch information
xgreenx committed Nov 7, 2023
1 parent 0eab75e commit 286414b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tx-format/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ enum ReceiptType : uint8 {
| `outputs` | [Output](./output.md)`[]` | List of outputs. |
| `witnesses` | [Witness](./witness.md)`[]` | List of witnesses. |

Given helper `max_gas()` returns the maximum gas that the transaction can use..
Given helper `max_gas()` returns the maximum gas that the transaction can use.
Given helper `len()` that returns the number of bytes of a field.
Given helper `count_ones()` that returns the number of ones in the binary representation of a field.
Given helper `count_variants()` that returns the number of variants in an enum.
Expand Down Expand Up @@ -117,6 +117,7 @@ The receipts root `receiptsRoot` is the root of the [binary Merkle tree](../prot
| `outputs` | [Output](./output.md)`[]` | List of outputs. |
| `witnesses` | [Witness](./witness.md)`[]` | List of witnesses. |

Given helper `max_gas()` returns the maximum gas that the transaction can use.
Given helper `count_ones()` that returns the number of ones in the binary representation of a field.
Given helper `count_variants()` that returns the number of variants in an enum.
Given helper `sum_variants()` that sums all variants of an enum.
Expand All @@ -134,6 +135,7 @@ Transaction is invalid if:
- The keys of `storageSlots` are not in ascending lexicographic order
- The computed contract ID (see below) is not equal to the `contractID` of the one `OutputType.ContractCreated` output
- `storageSlotsCount > MAX_STORAGE_SLOTS`
- `max_gas(tx) > MAX_GAS_PER_TX`
- The [Sparse Merkle tree](../protocol/cryptographic-primitives.md#sparse-merkle-tree) root of `storageSlots` is not equal to the `stateRoot` of the one `OutputType.ContractCreated` output
- No policy of type `PolicyType.GasPrice`
- `count_ones(policyTypes) > count_variants(PolicyType)`
Expand Down

0 comments on commit 286414b

Please sign in to comment.