From d6d66b37dd3d3f8e657f444498b21b12ee7b756b Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sun, 27 Feb 2022 16:41:26 +0100 Subject: [PATCH] chore: add rate limit message (#971) --- ethers-contract/ethers-contract-abigen/src/source.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ethers-contract/ethers-contract-abigen/src/source.rs b/ethers-contract/ethers-contract-abigen/src/source.rs index a3fc1819..346a4b94 100644 --- a/ethers-contract/ethers-contract-abigen/src/source.rs +++ b/ethers-contract/ethers-contract-abigen/src/source.rs @@ -279,6 +279,12 @@ fn get_etherscan_contract(address: Address, domain: &str) -> Result { if abi.starts_with("Contract source code not verified") { eyre::bail!("Contract source code not verified: {:?}", address); } + if abi.starts_with('{') && abi.contains("Max rate limit reached") { + eyre::bail!( + "Max rate limit reached, please use etherscan API Key for higher rate limit: {:?}", + address + ); + } Ok(abi) }