rust-web3
rust-web3 copied to clipboard
How to read a public variable of a contract?
I code:
web3::contract::Contract::from_json(...).call(...).await?;
The problem is the call method returns a H256, how should I read the data of contract variables and functions execution results?
You don't need to use call but query instead:
https://github.com/AmbireTech/adex-validator-stack-rust/blob/f4fb43b3c6c8765be7a7c68345379b72ad8cea01/adapter/src/ethereum/client.rs#L253-L265