Expand description
§ethexe-ethereum
Ethereum contract-interaction layer for the ethexe system: typed Rust wrappers around the
ethexe Solidity contracts (Router, Mirror, WrappedVara, Middleware), built on the alloy
client stack.
Consumed by ethexe-observer, ethexe-consensus, ethexe-cli, ethexe-service, and
ethexe-sdk; depends on ethexe-common, gsigner, and gprimitives. This is purely a
client/binding layer: it does not execute Gear programs (ethexe-processor), watch the
chain (ethexe-observer), implement consensus (ethexe-consensus), or persist data
(ethexe-db).
§Usage
Build a client with EthereumBuilder, then call methods on the returned Ethereum:
use ethexe_ethereum::{Ethereum, EthereumBuilder};
let ethereum = EthereumBuilder::default()
.router_address(Ethereum::DEFAULT_ROUTER_ADDRESS.into())
.signer(signer)
.sender_address(sender)
.build()
.await?;
let router = ethereum.router(); // Router.sol write handle
let mirror = ethereum.mirror(Default::default()); // per-program Mirror.sol handle
mirror.send_message(vec![], 0).await?;§Public API
EthereumBuilder— Fluent builder: RPC URL, router address, signer, fee tuningEthereum— Central connection; vends contract handles and block queriesAlloyProvider— Concrete alloy provider stack; returned byEthereum::providerrouter::Router— Router.sol: code validation, batch commitment, program creationmirror::Mirror— Mirror.sol: send/reply messages, claim value, top up balanceswvara::WVara— WrappedVara ERC-20: transfer, approve, mint, balance queriesmiddleware::Middleware— Validator election/permissions contractTryGetReceipt— Retry-aware receipt retrieval with log parsing and revert detectionIntoBlockId— ConvertH256/u32/u64into a block iddeploy::EthereumDeployer— Deploy the full contract set in local/test environmentsprimitives/abi— Re-exportedalloy::primitives; generated ABI bindings
Each contract handle also vends a read-only query counterpart (RouterQuery, MirrorQuery,
WVaraQuery, MiddlewareQuery); Router, Mirror, and WVara additionally vend
event-filter builders.
§Invariants
EthereumBuilder::builderrors ifsignerorsender_addressare not set.Ethereum::middlewarepanics if the middleware address is zero, which happens when the contract set was deployed without the middleware flag ondeploy::EthereumDeployer.TryGetReceipt::try_get_message_send_receiptrequires aMessageQueueingRequestedlog in the receipt or returns an error.
Modules§
Structs§
Traits§
- Into
Block Id - A helping trait for converting various types into
alloy::eips::BlockId. - TryGet
Receipt