Skip to content

feat(EDSL): enum support (uint8-backed with range checks) #2088

Description

@Th0rgal

Child of #1724. Needed by Lido (module status enums) and ERC-4337 (IPaymaster.PostOpMode); Morpho does not use enums.

Goal

Solidity-compatible enum declarations in verity_contract:

  • Underlying uint8 representation, member constants, EnumName(x) cast with range check (revert on out-of-range, matching solc)
  • Usable as function params/returns, event/error payloads, storage values, and mapping values
  • ABI surface identical to solc (uint8 in the selector/ABI JSON)

Done when

  • Enum-typed params/storage compile with differential tests vs solc (incl. out-of-range cast revert)
  • PostOpMode-style contract expressible without uint8-constant workaround
  • Parity map rows updated in the same PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1: core languageBlocks writing common contractsblocks:erc4337Blocks ERC-4337 EntryPoint parity/verificationblocks:lidoBlocks Lido StakingRouter parity/verificationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions