Crate evmasm [] [src]

The evmasm crate aims to provide a simple interface for the conversion between evm bytecode and it's human readable form.

extern crate evmasm;
use evmasm::{BYTE_INST, instruction, arguments_size};

fn main() {
    for (&bc, _) in BYTE_INST.iter() {
        let inst = instruction(bc).ok().unwrap();
        println!("0x{:2x} - {} - needs {} bytes of arguments",
                 bc,
                 inst,
                 arguments_size(bc).ok().unwrap());
    }
}

Structs

BYTE_INST

Lazily initialized struct that derefs into an HashMap<u8, &'static str>

INST_BYTE

Lazily initialized struct that derefs into an HashMap<&'static str, u8>

Enums

Error

Error is only returned when an instruction/bytecode is not found

Functions

arguments_size

Return the size in bytes of the arguments of a specific bytecode

bytecode

Return the bytecode corresponding to the provided instruction

instruction

Return the instruction corresponding to the provided bytecode