Contracts chapter (#2281)
This commit is contained in:
parent
757314b082
commit
0356db1fae
|
@ -1,11 +1,13 @@
|
||||||
# Summary
|
# Summary
|
||||||
|
|
||||||
# Getting started
|
# Getting started
|
||||||
- [Intro](./getting-started/intro.md)
|
|
||||||
- [Start a new project](./getting-started/start_a_new_project.md)
|
- [Intro](./getting-started/intro.md)
|
||||||
- [Connect to an Ethereum node](./getting-started/connect_to_an_ethereum_node.md)
|
- [Start a new project](./getting-started/start_a_new_project.md)
|
||||||
|
- [Connect to an Ethereum node](./getting-started/connect_to_an_ethereum_node.md)
|
||||||
|
|
||||||
# Reference guide
|
# Reference guide
|
||||||
|
|
||||||
- [Providers](./providers/providers.md)
|
- [Providers](./providers/providers.md)
|
||||||
- [Http](./providers/http.md)
|
- [Http](./providers/http.md)
|
||||||
- [WebSocket](./providers/ws.md)
|
- [WebSocket](./providers/ws.md)
|
||||||
|
@ -26,16 +28,16 @@
|
||||||
- [Signer](./middleware/signer.md)
|
- [Signer](./middleware/signer.md)
|
||||||
- [Time lag]()
|
- [Time lag]()
|
||||||
- [Transformer]()
|
- [Transformer]()
|
||||||
- [Contracts]()
|
- [Contracts](./contracts/contracts.md)
|
||||||
- [Abigen]()
|
- [Abigen](./contracts/abigen.md)
|
||||||
- [Compile]()
|
- [Compile](./contracts/compile.md)
|
||||||
- [Creating Instances]()
|
- [Creating Instances](./contracts/creating-instances.md)
|
||||||
- [Deploy Anvil]()
|
- [Deploy Anvil](./contracts/deploy-anvil.md)
|
||||||
- [Deploy from ABI and bytecode]()
|
- [Deploy from ABI and bytecode](./contracts/deploy-from-abi-and-bytecode.md)
|
||||||
- [Deploy Moonbeam]()
|
- [Deploy Moonbeam](./contracts/doploy-moonbeam.md)
|
||||||
- [Events]()
|
- [Events](./contracts/events.md)
|
||||||
- [Events with meta]()
|
- [Events with meta](./contracts/events-with-meta.md)
|
||||||
- [Methods]()
|
- [Methods](contracts/methods.md)
|
||||||
- [Events]()
|
- [Events]()
|
||||||
- [Logs and filtering]()
|
- [Logs and filtering]()
|
||||||
- [Solidity topics]()
|
- [Solidity topics]()
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Abigen
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/abigen.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Compile
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/compile.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,29 @@
|
||||||
|
# Contracts
|
||||||
|
|
||||||
|
In ethers-rs, contracts are a way to interact with smart contracts on the Ethereum blockchain through rust bindings, which serve as a robust rust API to these objects.
|
||||||
|
|
||||||
|
The ethers-contracts module includes the following features:
|
||||||
|
|
||||||
|
- [Abigen](): A module for generating Rust code from Solidity contracts.
|
||||||
|
- [Compile](): A module for compiling Solidity contracts into bytecode and ABI files.
|
||||||
|
- [Creating Instances](): A module for creating instances of smart contracts.
|
||||||
|
- [Deploy Anvil](): A module for deploying smart contracts on the Anvil network.
|
||||||
|
- [Deploy from ABI and bytecode](): A module for deploying smart contracts from their ABI and bytecode files.
|
||||||
|
- [Deploy Moonbeam](): A module for deploying smart contracts on the Moonbeam network.
|
||||||
|
- [Events](): A module for listening to smart contract events.
|
||||||
|
- [Events with Meta](): A module for listening to smart contract events with metadata.
|
||||||
|
- [Methods](): A module for calling smart contract methods.
|
||||||
|
|
||||||
|
The ethers-contracts module provides a convenient way to work with Ethereum smart contracts in Rust. With this module, you can easily create instances of smart contracts, deploy them to the network, and interact with their methods and events.
|
||||||
|
|
||||||
|
The Abigen module allows you to generate Rust code from Solidity contracts, which can save you a lot of time and effort when writing Rust code for Ethereum smart contracts.
|
||||||
|
|
||||||
|
The Compile module makes it easy to compile Solidity contracts into bytecode and ABI files, which are required for deploying smart contracts.
|
||||||
|
|
||||||
|
The Deploy Anvil and Deploy Moonbeam modules allow you to deploy smart contracts to specific networks, making it easy to test and deploy your smart contracts on the desired network.
|
||||||
|
|
||||||
|
The Events and Events with Meta modules allow you to listen to smart contract events and retrieve event data, which is essential for building applications that interact with Ethereum smart contracts.
|
||||||
|
|
||||||
|
Finally, the Methods module provides a simple way to call smart contract methods from Rust code, allowing you to interact with smart contracts in a programmatic way.
|
||||||
|
|
||||||
|
Overall, the ethers-contracts module provides a comprehensive set of tools for working with Ethereum smart contracts in Rust, making it an essential tool for Rust developers building decentralized applications on the Ethereum network.
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Creating Instances
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/instances.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Deploy Anvil
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/deploy_anvil.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Deploying a Contract from ABI and Bytecode
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/deploy_from_abi_and_bytecode.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Deploy Moonbeam
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/deploy_moonbeam.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Events with meta
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/events_with_meta.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Events
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/events.rs}}
|
||||||
|
```
|
|
@ -0,0 +1,5 @@
|
||||||
|
# Methods
|
||||||
|
|
||||||
|
```rust
|
||||||
|
{{#include ../../examples/contracts/examples/methods.rs}}
|
||||||
|
```
|
Loading…
Reference in New Issue