pub trait StatefulPrecompile {
// Required methods
fn new() -> Self;
fn execute(
&self,
handle: &mut impl PrecompileHandle
) -> EvmResult<PrecompileOutput>;
}
Expand description
Trait similar to fp_evm::Precompile
but with a &self
parameter to manage some
state (this state is only kept in a single transaction and is lost afterward).
Required Methods§
sourcefn new() -> Self
fn new() -> Self
Instanciate the precompile. Will be called once when building the PrecompileSet at the start of each Ethereum transaction.
sourcefn execute(
&self,
handle: &mut impl PrecompileHandle
) -> EvmResult<PrecompileOutput>
fn execute( &self, handle: &mut impl PrecompileHandle ) -> EvmResult<PrecompileOutput>
Execute the precompile with a reference to its state.