diff --git a/cast/src/lib.rs b/cast/src/lib.rs index 1d39c03f9fc8..099e5d46aa87 100644 --- a/cast/src/lib.rs +++ b/cast/src/lib.rs @@ -286,6 +286,21 @@ where Ok(self.provider.get_gas_price().await?) } + /// ```no_run + /// use cast::Cast; + /// use ethers_providers::{Provider, Http}; + /// use ethers_core::types::Address; + /// use std::{str::FromStr, convert::TryFrom}; + /// + /// # async fn foo() -> eyre::Result<()> { + /// let provider = Provider::::try_from("http://localhost:8545")?; + /// let cast = Cast::new(provider); + /// let addr = Address::from_str("0x00000000219ab540356cbb839cbe05303d7705fa")?; + /// let code = cast.code(addr, None).await?; + /// println!("{}", code); + /// # Ok(()) + /// # } + /// ``` pub async fn code + Send + Sync>( &self, who: T,