Skip to content

"require" helper in assembly #7317

Closed as not planned
Closed as not planned
@axic

Description

@axic

It would be nice to start introducing helper functions in assembly. This was previously discussed in #474 and #1319.

A lot of contracts/libraries deal with calling precompiles directly to avoid cost overheads. They do this with if iszero(staticcall(..)) { revert(0, 0) }. It would be nice to support require and/or assert:

  • require(expr) -> if iszero(expr) { revert(0, 0) }
  • assert(expr) -> if iszero(expr) { invalid }

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed due inactivityThe issue/PR was automatically closed due to inactivity.staleThe issue/PR was marked as stale because it has been open for too long.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions