From 3141bebd788aeebf07e649724abf1f6b477909d0 Mon Sep 17 00:00:00 2001 From: Yiannis M Date: Tue, 14 Feb 2023 03:09:25 +0200 Subject: [PATCH] abigen: Add human readable ABI example in documentation (#2148) --- ethers-contract/ethers-contract-derive/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ethers-contract/ethers-contract-derive/src/lib.rs b/ethers-contract/ethers-contract-derive/src/lib.rs index 891026e0..a5981094 100644 --- a/ethers-contract/ethers-contract-derive/src/lib.rs +++ b/ethers-contract/ethers-contract-derive/src/lib.rs @@ -41,6 +41,13 @@ pub(crate) mod utils; /// /// // npmjs /// abigen!(MyContract, "npm:@org/package@1.0.0/path/to/contract.json"); +/// +/// // Human readable ABI +/// abigen!(MyContract, r"[ +/// function setValue(string) +/// function getValue() external view returns (string) +/// event ValueChanged(address indexed author, string oldValue, string newValue) +/// ]"); /// ``` /// /// Note that Etherscan rate-limits requests to their API, to avoid this an