tuweni / org.apache.tuweni.evm / HostContext

HostContext

interface HostContext (source)

This interface represents the callback functions must be implemented in order to interface with the EVM.

Functions

accountExists

Check account existence function.

abstract suspend fun accountExists(address: Address): Boolean

call

This function supports EVM calls.

abstract suspend fun call(evmMessage: EVMMessage): EVMResult

emitLog

Log function.

abstract fun emitLog(address: Address, data: Bytes, topics: List<Bytes32>): Unit

getBalance

Get balance function.

abstract suspend fun getBalance(address: Address): Wei

getBlockHash

Get block hash function.

abstract fun getBlockHash(number: Long): Bytes32abstract fun getBlockHash(): Bytes32

getBlockNumber

abstract fun getBlockNumber(): Long

getCode

Copy code function.

abstract suspend fun getCode(address: Address): Bytes

getCodeHash

Get code hash function.

abstract suspend fun getCodeHash(address: Address): Bytes32

getCodeSize

Get code size function.

abstract suspend fun getCodeSize(address: Address): Int

getCoinbase

abstract fun getCoinbase(): Address

getDifficulty

abstract fun getDifficulty(): UInt256

getGasLimit

abstract fun getGasLimit(): Long

getGasPrice

Provides the gas price of the transaction.

abstract fun getGasPrice(): Wei

getRepositoryStorage

Get repository storage function.

abstract suspend fun getRepositoryStorage(address: Address, keyBytes: Bytes): Bytes32

getStorage

Get storage function.

abstract suspend fun getStorage(address: Address, key: Bytes32): Bytes32

getTxContext

Get transaction context function.

abstract fun getTxContext(): Bytes?

increaseBalance

abstract fun increaseBalance(address: Address, amount: Wei): Unit

selfdestruct

Selfdestruct function.

abstract suspend fun selfdestruct(address: Address, beneficiary: Address): Unit

setBalance

abstract suspend fun setBalance(address: Address, balance: Wei): Unit

setStorage

Set storage function.

abstract suspend fun setStorage(address: Address, key: Bytes, value: Bytes32): Int

timestamp

Provides the timestamp of the transaction

abstract fun timestamp(): UInt256

warmUpAccount

Returns true if the account was never used.

abstract fun warmUpAccount(address: Address): Boolean

warmUpStorage

Returns true if the storage slot was never used.

abstract fun warmUpStorage(address: Address, key: UInt256): Boolean

Inheritors

TransactionalEVMHostContext

EVM context that records changes to the world state, so they can be applied atomically.

class TransactionalEVMHostContext : HostContext