morpho_rs_contracts/
lib.rs

1//! Contract bindings and transaction clients for Morpho vaults.
2//!
3//! This crate provides Solidity contract bindings and transaction clients
4//! for interacting with Morpho V1 (MetaMorpho) and V2 vaults on-chain.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use morpho_rs_contracts::{VaultV1TransactionClient, VaultV2TransactionClient};
10//! use alloy::primitives::{Address, U256};
11//!
12//! #[tokio::main]
13//! async fn main() -> morpho_rs_contracts::Result<()> {
14//!     let client = VaultV1TransactionClient::new(
15//!         "https://eth.llamarpc.com",
16//!         "0x...", // private key
17//!     )?;
18//!
19//!     // Get vault asset
20//!     let vault: Address = "0x...".parse().unwrap();
21//!     let asset = client.get_asset(vault).await?;
22//!
23//!     Ok(())
24//! }
25//! ```
26
27pub mod erc20;
28pub mod erc4626;
29pub mod error;
30pub mod prepared_call;
31pub mod provider;
32pub mod vault_v1;
33pub mod vault_v2;
34
35pub use error::{ContractError, Result};
36pub use prepared_call::PreparedCall;
37pub use provider::HttpProvider;
38pub use vault_v1::VaultV1TransactionClient;
39pub use vault_v2::VaultV2TransactionClient;