2020-06-20 13:55:07 +00:00
|
|
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
|
|
|
//! Type-safe abstractions for interacting with Ethereum smart contracts
|
|
|
|
//!
|
|
|
|
//! Interacting with a smart contract requires broadcasting carefully crafted
|
|
|
|
//! [transactions](ethers_core::types::TransactionRequest) where the `data` field contains
|
|
|
|
//! the [function's
|
|
|
|
//! selector](https://ethereum.stackexchange.com/questions/72363/what-is-a-function-selector)
|
|
|
|
//! along with the arguments of the called function. This module provides the
|
|
|
|
//! [`Contract`] and [`ContractFactory`] abstractions so that you do not have to worry about that.
|
|
|
|
//! It also provides typesafe bindings via the [`abigen`] macro and the [`Abigen` builder].
|
|
|
|
//!
|
|
|
|
//! [`ContractFactory`]: crate::ContractFactory
|
|
|
|
//! [`Contract`]: crate::Contract
|
|
|
|
//! [`abigen`]: ./macro.abigen.html
|
|
|
|
//! [`Abigen` builder]: crate::Abigen
|
2020-05-26 18:57:59 +00:00
|
|
|
mod contract;
|
2020-05-27 08:46:16 +00:00
|
|
|
pub use contract::Contract;
|
|
|
|
|
2020-10-27 10:57:01 +00:00
|
|
|
mod base;
|
2021-01-22 09:25:22 +00:00
|
|
|
pub use base::{decode_function_data, encode_function_data, AbiError, BaseContract};
|
2020-10-27 10:57:01 +00:00
|
|
|
|
2020-05-27 08:46:16 +00:00
|
|
|
mod call;
|
2020-06-10 18:20:47 +00:00
|
|
|
pub use call::ContractError;
|
2020-05-26 10:44:35 +00:00
|
|
|
|
2020-05-30 14:24:50 +00:00
|
|
|
mod factory;
|
|
|
|
pub use factory::ContractFactory;
|
|
|
|
|
2020-06-10 18:20:47 +00:00
|
|
|
mod event;
|
2021-07-30 11:01:38 +00:00
|
|
|
pub use event::EthEvent;
|
2020-06-10 18:20:47 +00:00
|
|
|
|
2021-03-19 15:44:59 +00:00
|
|
|
mod log;
|
2021-07-30 11:01:38 +00:00
|
|
|
pub use log::{decode_logs, EthLogDecode, LogMeta};
|
2021-03-19 15:44:59 +00:00
|
|
|
|
2020-11-30 09:33:06 +00:00
|
|
|
mod stream;
|
|
|
|
|
2020-07-03 16:52:09 +00:00
|
|
|
mod multicall;
|
|
|
|
pub use multicall::Multicall;
|
|
|
|
|
2020-06-10 18:20:47 +00:00
|
|
|
/// This module exposes low lever builder structures which are only consumed by the
|
|
|
|
/// type-safe ABI bindings generators.
|
|
|
|
pub mod builders {
|
|
|
|
pub use super::call::ContractCall;
|
|
|
|
pub use super::event::Event;
|
|
|
|
pub use super::factory::Deployer;
|
|
|
|
}
|
|
|
|
|
2021-08-28 21:06:29 +00:00
|
|
|
#[cfg(any(test, feature = "abigen"))]
|
2020-06-20 13:55:07 +00:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "abigen")))]
|
2020-06-03 21:05:05 +00:00
|
|
|
pub use ethers_contract_abigen::Abigen;
|
2020-05-26 10:44:35 +00:00
|
|
|
|
2021-08-28 21:06:29 +00:00
|
|
|
#[cfg(any(test, feature = "abigen"))]
|
2020-06-20 13:55:07 +00:00
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "abigen")))]
|
2021-03-15 11:59:52 +00:00
|
|
|
pub use ethers_contract_derive::{abigen, EthAbiType, EthEvent};
|
2020-05-26 10:44:35 +00:00
|
|
|
|
2020-06-10 18:20:47 +00:00
|
|
|
// Hide the Lazy re-export, it's just for convenience
|
|
|
|
#[doc(hidden)]
|
2020-05-26 18:57:59 +00:00
|
|
|
pub use once_cell::sync::Lazy;
|