API¶
Application Entry Point¶
-
std::shared_ptr<enclave::RpcHandler>
ccfapp::get_rpc_handler(ccf::NetworkTables &nwt, ccf::AbstractNotifier ¬ifier)¶
RPCs¶
See Supported RPCs
eEVM¶
-
struct
eevm::Account¶ Abstract interface for interacting with EVM accounts
Subclassed by eevm::SimpleAccount, evm4ccf::AccountProxy
Public Types
-
using
Nonce= size_t¶
-
using
-
struct
eevm::GlobalState¶ Abstract interface for interacting with EVM world state
Subclassed by eevm::SimpleGlobalState, evm4ccf::EthereumState
Public Functions
-
void
remove(const Address &addr) = 0¶
-
AccountState
get(const Address &addr) = 0¶ Creates a new zero-initialized account under the given address if none exists
-
AccountState
create(const Address &addr, const uint256_t &balance, const Code &code) = 0¶
-
const Block &
get_current_block() = 0¶
-
uint256_t
get_block_hash(uint8_t offset) = 0¶
-
void
-
class
eevm::Processor¶ Ethereum bytecode processor.
Public Functions
-
Processor(GlobalState &gs)¶
-
ExecResult
run(Transaction &tx, const Address &caller, AccountState callee, const std::vector<uint8_t> &input, const uint256_t &call_value, Trace *tr = nullptr)¶ The main entry point for the EVM.
Runs the callee’s code in the caller’s context. VM exceptions (ie, eevm::Exception) will be caught and returned in the result.
- Return
ExecResult the execution result
- Parameters
tx: the transactioncaller: the caller’s addresscallee: the callee’s account stateinput: the raw byte inputcall_value: the call valuetr: [optional] a pointer to a trace object. If given, a trace of the execution will be collected.
-
Ethereum App¶
-
class
evm4ccf::EthereumState: public eevm::GlobalState¶ Public Functions
-
eevm::AccountState
get(const eevm::Address &address) override¶ Creates a new zero-initialized account under the given address if none exists
-
eevm::AccountState
-
class
evm4ccf::EVMForCCFFrontend: public UserRpcFrontend¶ Public Functions
-
EVMForCCFFrontend(NetworkTables &nwt, AbstractNotifier ¬ifier)¶
Private Functions
-
EthereumState
make_state(Store::Tx &tx)¶
-
void
install_standard_rpcs()¶
-
pair<bool, nlohmann::json>
execute_transaction(CallerId caller_id, const rpcparams::MessageCall &call_data, Store::Tx &tx)¶
Private Static Functions
-
std::pair<ExecResult, AccountState>
run_in_evm(const rpcparams::MessageCall &call_data, EthereumState &es, LogHandler &log_handler)¶
-
pair<ExecResult, AccountState>
run_in_evm(const rpcparams::MessageCall &call_data, EthereumState &es)¶
-
std::tuple<ExecResult, TxHash, Address>
execute_transaction(const rpcparams::MessageCall &call_data, EthereumState &es, LogHandler &log_handler)¶
-