Trait evmil::AbstractState
source · pub trait AbstractState: Clone {
fn is_reachable(&self) -> bool;
fn transfer(self, insn: &Instruction) -> Self;
fn branch(&self, target: usize, insn: &Instruction) -> Self;
fn merge(&mut self, other: Self) -> bool;
fn peek(&self, n: usize) -> AbstractValue;
fn bottom() -> Self;
fn origin() -> Self;
}
Expand description
An abstract state provides information about the possible states of the EVM at a given point.
Required Methods§
sourcefn is_reachable(&self) -> bool
fn is_reachable(&self) -> bool
Determines whether a given block is considered reachable or not.
sourcefn transfer(self, insn: &Instruction) -> Self
fn transfer(self, insn: &Instruction) -> Self
Apply a given instruction to this state, yielding an updated state.
sourcefn branch(&self, target: usize, insn: &Instruction) -> Self
fn branch(&self, target: usize, insn: &Instruction) -> Self
Apply a given branch to this stage, yielding an updated state at the point of the branch.
sourcefn merge(&mut self, other: Self) -> bool
fn merge(&mut self, other: Self) -> bool
Merge this state with another, whilst returning a flag indicating whether anything changed.
sourcefn peek(&self, n: usize) -> AbstractValue
fn peek(&self, n: usize) -> AbstractValue
Determine value on top of stack
Implementations on Foreign Types§
source§impl AbstractState for ()
impl AbstractState for ()
source§fn is_reachable(&self) -> bool
fn is_reachable(&self) -> bool
Default implementation indicates everything is reachable.
source§fn transfer(self, _insn: &Instruction) -> Self
fn transfer(self, _insn: &Instruction) -> Self
Default implementation does nothing
source§fn branch(&self, _target: usize, _insn: &Instruction) -> Self
fn branch(&self, _target: usize, _insn: &Instruction) -> Self
Default implementation does nothing
source§fn peek(&self, _n: usize) -> AbstractValue
fn peek(&self, _n: usize) -> AbstractValue
Does nothing