File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 4444 /// Makes a read-only call to the specified address
4545 ///
4646 /// ```no_run
47- ///
47+ ///
4848 /// use cast::Cast;
4949 /// use ethers_core::types::Address;
5050 /// use ethers_providers::{Provider, Http};
@@ -286,6 +286,21 @@ where
286286 Ok ( self . provider . get_gas_price ( ) . await ?)
287287 }
288288
289+ /// ```no_run
290+ /// use cast::Cast;
291+ /// use ethers_providers::{Provider, Http};
292+ /// use ethers_core::types::Address;
293+ /// use std::{str::FromStr, convert::TryFrom};
294+ ///
295+ /// # async fn foo() -> eyre::Result<()> {
296+ /// let provider = Provider::<Http>::try_from("http://localhost:8545")?;
297+ /// let cast = Cast::new(provider);
298+ /// let addr = Address::from_str("0x00000000219ab540356cbb839cbe05303d7705fa")?;
299+ /// let code = cast.code(addr, None).await?;
300+ /// println!("{}", code);
301+ /// # Ok(())
302+ /// # }
303+ /// ```
289304 pub async fn code < T : Into < NameOrAddress > + Send + Sync > (
290305 & self ,
291306 who : T ,
You can’t perform that action at this time.
0 commit comments