Precompile

Trait Precompile 

Source
pub trait Precompile {
    // Required methods
    fn required_gas(input: &[u8]) -> Result<EthGas, ExitError>
       where Self: Sized;
    fn run(
        &self,
        input: &[u8],
        target_gas: Option<EthGas>,
        context: &Context,
        is_static: bool,
    ) -> Result<PrecompileOutput, ExitError>;
}
Expand description

A precompiled function for use in the EVM.

Required Methods§

Source

fn required_gas(input: &[u8]) -> Result<EthGas, ExitError>
where Self: Sized,

The required gas in order to run the precompile function.

Source

fn run( &self, input: &[u8], target_gas: Option<EthGas>, context: &Context, is_static: bool, ) -> Result<PrecompileOutput, ExitError>

Runs the precompile function.

Implementors§