Skip to content

New opcode: STATIC_CALL #116

@vbuterin

Description

@vbuterin

If block.number >= METROPOLIS_FORK_BLKNUM, then opcode 0xfa functions equivalently to a CALL, except it takes 6 arguments not including value, and calls the child with a STATIC flag on. Any calls, static or otherwise, made by an execution instance with a STATIC flag on will also have a STATIC flag on. Any attempts to make state-changing operations inside an execution instance with a STATIC flag on, including nonzero-value calls, creates, and SSTORE, SSTOREBYTES or SUICIDE operations, will instead throw an exception.

Rationale

This allows contracts to make calls that are clearly non-state-changing, reassuring developers and reviewers that re-entrancy bugs or other problems cannot possibly arise from that particular call; it is a pure function that returns an output and does nothing else. This may also make purely functional HLLs easier to implement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions