From f562b47fd22c4227bd808318ca111faf2f196417 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Wed, 10 Jun 2020 22:34:39 +0300 Subject: [PATCH] docs(abigen): update struct --- ethers-contract/ethers-contract-abigen/src/lib.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ethers-contract/ethers-contract-abigen/src/lib.rs b/ethers-contract/ethers-contract-abigen/src/lib.rs index c3332d8d..90d3320b 100644 --- a/ethers-contract/ethers-contract-abigen/src/lib.rs +++ b/ethers-contract/ethers-contract-abigen/src/lib.rs @@ -28,6 +28,17 @@ use proc_macro2::TokenStream; use std::{collections::HashMap, fs::File, io::Write, path::Path}; /// Builder struct for generating type-safe bindings from a contract's ABI +/// +/// # Example +/// +/// Running the command below will generate a file called `token.rs` containing the +/// bindings inside, which exports an `ERC20Token` struct, along with all its events. +/// +/// ```no_run +/// # fn foo() -> Result<(), Box> { +/// Abigen::new("ERC20Token", "./abi.json")?.generate()?.write_to_file("token.rs")?; +/// # Ok(()) +/// # } pub struct Abigen { /// The source of the ABI JSON for the contract whose bindings /// are being generated.