Struct ethers_core::abi::AbiParser [−][src]
pub struct AbiParser {
pub structs: HashMap<String, SolStruct>,
pub struct_tuples: HashMap<String, Vec<ParamType>>,
pub function_params: HashMap<(String, String), String>,
pub outputs: HashMap<String, Vec<String>>,
}
Expand description
A parser that turns a “human readable abi” into a Abi
Fields
structs: HashMap<String, SolStruct>
solidity structs
struct_tuples: HashMap<String, Vec<ParamType>>
solidity structs as tuples
function_params: HashMap<(String, String), String>
(function name, param name) -> struct which are the identifying properties we get the name from ethabi.
outputs: HashMap<String, Vec<String>>
(function name) -> Vec
Implementations
Parses a “human readable abi” string
Example
let abi = AbiParser::default().parse_str(r#"[
function setValue(string)
function getValue() external view returns (string)
event ValueChanged(address indexed author, string oldValue, string newValue)
]"#).unwrap();
Parses a “human readable abi” string vector
Example
use ethers_core::abi::AbiParser;
let abi = AbiParser::default().parse(&[
"function x() external view returns (uint256)",
]).unwrap();
Link additional structs for parsing
Parses a solidity event declaration from event <name> (args*) anonymous?