Skip to content

Spec

Documentation for tests/amsterdam/eip8024_dupn_swapn_exchange/spec.py@b2fd7c77.

Reference spec for EIP-8024: Stack Access Instructions.

Spec dataclass

Constants and parameters from EIP-8024.

Source code in tests/amsterdam/eip8024_dupn_swapn_exchange/spec.py
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@dataclass(frozen=True)
class Spec:
    """Constants and parameters from EIP-8024."""

    # Gas cost for DUPN, SWAPN, and EXCHANGE
    GAS_COST: int = 3

    # DUPN/SWAPN stack index range (after decoding)
    MIN_STACK_INDEX: int = 17
    MAX_STACK_INDEX: int = 235

    # EXCHANGE constraints: 1 <= n < m <= 29, n + m <= 30
    EXCHANGE_MIN_N: int = 1
    EXCHANGE_MAX_N: int = 14
    EXCHANGE_MAX_M: int = 29
    EXCHANGE_MAX_SUM: int = 30