Copyright | 2018 Simon Shine |
---|---|
License | MIT |
Maintainer | Simon Shine <shreddedglory@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
This module exposes the PositionalOpcode
type for expressing Ethereum
VM opcodes where jumps and jumpdests are annotated with the byte position
of the translated opcode.
This representation is useful for when generating code that refers to the size of itself or other chunks of code. E.g. the CODECOPY segment of an Ethereum contract must refer to the size of the code being copied, and determining the size of a jump is trivial when it's annotated with the destination address.
Documentation
type PositionalOpcode = Opcode' Position Source #
translate :: [PositionalOpcode] -> [Opcode] Source #
Translate a PositionalOpcode
into an Opcode
by converting the position
into a PUSH
instruction.