abigen: Add human readable ABI example in documentation (#2148)

This commit is contained in:
Yiannis M 2023-02-14 03:09:25 +02:00 committed by GitHub
parent fefaf7433f
commit 3141bebd78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -41,6 +41,13 @@ pub(crate) mod utils;
/// ///
/// // npmjs /// // npmjs
/// abigen!(MyContract, "npm:@org/package@1.0.0/path/to/contract.json"); /// 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 /// Note that Etherscan rate-limits requests to their API, to avoid this an