Trait revm_interpreter::Host
source · pub trait Host {
Show 13 methods
// Required methods
fn env(&self) -> &Env;
fn env_mut(&mut self) -> &mut Env;
fn load_account(&mut self, address: Address) -> Option<LoadAccountResult>;
fn block_hash(&mut self, number: U256) -> Option<B256>;
fn balance(&mut self, address: Address) -> Option<(U256, bool)>;
fn code(&mut self, address: Address) -> Option<(Bytecode, bool)>;
fn code_hash(&mut self, address: Address) -> Option<(B256, bool)>;
fn sload(&mut self, address: Address, index: U256) -> Option<(U256, bool)>;
fn sstore(
&mut self,
address: Address,
index: U256,
value: U256
) -> Option<SStoreResult>;
fn tload(&mut self, address: Address, index: U256) -> U256;
fn tstore(&mut self, address: Address, index: U256, value: U256);
fn log(&mut self, log: Log);
fn selfdestruct(
&mut self,
address: Address,
target: Address
) -> Option<SelfDestructResult>;
}
Expand description
EVM context host.
Required Methods§
sourcefn load_account(&mut self, address: Address) -> Option<LoadAccountResult>
fn load_account(&mut self, address: Address) -> Option<LoadAccountResult>
Load an account.
Returns (is_cold, is_new_account)
sourcefn block_hash(&mut self, number: U256) -> Option<B256>
fn block_hash(&mut self, number: U256) -> Option<B256>
Get the block hash of the given block number
.
sourcefn balance(&mut self, address: Address) -> Option<(U256, bool)>
fn balance(&mut self, address: Address) -> Option<(U256, bool)>
Get balance of address
and if the account is cold.
sourcefn code(&mut self, address: Address) -> Option<(Bytecode, bool)>
fn code(&mut self, address: Address) -> Option<(Bytecode, bool)>
Get code of address
and if the account is cold.
sourcefn code_hash(&mut self, address: Address) -> Option<(B256, bool)>
fn code_hash(&mut self, address: Address) -> Option<(B256, bool)>
Get code hash of address
and if the account is cold.
sourcefn sload(&mut self, address: Address, index: U256) -> Option<(U256, bool)>
fn sload(&mut self, address: Address, index: U256) -> Option<(U256, bool)>
Get storage value of address
at index
and if the account is cold.
sourcefn sstore(
&mut self,
address: Address,
index: U256,
value: U256
) -> Option<SStoreResult>
fn sstore( &mut self, address: Address, index: U256, value: U256 ) -> Option<SStoreResult>
Set storage value of account address at index.
Returns (original, present, new, is_cold).
sourcefn tload(&mut self, address: Address, index: U256) -> U256
fn tload(&mut self, address: Address, index: U256) -> U256
Get the transient storage value of address
at index
.
sourcefn tstore(&mut self, address: Address, index: U256, value: U256)
fn tstore(&mut self, address: Address, index: U256, value: U256)
Set the transient storage value of address
at index
.
sourcefn selfdestruct(
&mut self,
address: Address,
target: Address
) -> Option<SelfDestructResult>
fn selfdestruct( &mut self, address: Address, target: Address ) -> Option<SelfDestructResult>
Mark address
to be deleted, with funds transferred to target
.