[][src]Crate ethers_contract

Type-safe abstractions for interacting with Ethereum smart contracts

Interacting with a smart contract requires broadcasting carefully crafted transactions where the data field contains the function's 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.

Modules

builders

This module exposes low lever builder structures which are only consumed by the type-safe ABI bindings generators.

Macros

abigenfeature="abigen"

Proc macro to generate type-safe bindings to a contract. This macro accepts an Ethereum contract ABI or a path. Note that this path is rooted in the crate's root CARGO_MANIFEST_DIR.

Structs

Abigenfeature="abigen"

Builder struct for generating type-safe bindings from a contract's ABI

Contract

A Contract is an abstraction of an executable program on the Ethereum Blockchain. It has code (called byte code) as well as allocated long-term memory (called storage). Every deployed Contract has an address, which is used to connect to it so that it may be sent messages to call its methods.

ContractFactory

To deploy a contract to the Ethereum network, a ContractFactory can be created which manages the Contract bytecode and Application Binary Interface (ABI), usually generated from the Solidity compiler.

Enums

ContractError

An Error which is thrown when interacting with a smart contract