This repository was archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 791
This repository was archived by the owner on Oct 19, 2024. It is now read-only.
Failed to get ABI JSON when use abigen! w/ $ETHERSCAN_API_KEY set #589
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Version
[root@iZrj923msgidyk7ob4pwzgZ ethers-rs]# cargo tree | grep ethers
ethers-contract v0.5.3 (/root/rust/ethers-rs/ethers-contract)
├── ethers-contract-abigen v0.5.3 (/root/rust/ethers-rs/ethers-contract/ethers-contract-abigen)
│ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core)
├── ethers-contract-derive v0.5.3 (proc-macro) (/root/rust/ethers-rs/ethers-contract/ethers-contract-derive)
│ ├── ethers-contract-abigen v0.5.3 (/root/rust/ethers-rs/ethers-contract/ethers-contract-abigen) (*)
│ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-derive-eip712 v0.1.0 (proc-macro) (/root/rust/ethers-rs/ethers-core/ethers-derive-eip712)
│ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-providers v0.5.4 (/root/rust/ethers-rs/ethers-providers)
│ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-contract-abigen v0.5.3 (/root/rust/ethers-rs/ethers-contract/ethers-contract-abigen) (*)
├── ethers-contract-derive v0.5.3 (proc-macro) (/root/rust/ethers-rs/ethers-contract/ethers-contract-derive) (*)
├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-derive-eip712 v0.1.0 (proc-macro) (/root/rust/ethers-rs/ethers-core/ethers-derive-eip712) (*)
├── ethers-middleware v0.5.3 (/root/rust/ethers-rs/ethers-middleware)
│ ├── ethers-contract v0.5.3 (/root/rust/ethers-rs/ethers-contract) (*)
│ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
│ ├── ethers-providers v0.5.4 (/root/rust/ethers-rs/ethers-providers) (*)
│ ├── ethers-signers v0.5.3 (/root/rust/ethers-rs/ethers-signers)
│ │ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
│ │ ├── ethers-contract v0.5.3 (/root/rust/ethers-rs/ethers-contract) (*)
│ │ ├── ethers-derive-eip712 v0.1.0 (proc-macro) (/root/rust/ethers-rs/ethers-core/ethers-derive-eip712) (*)
│ ├── ethers-providers v0.5.4 (/root/rust/ethers-rs/ethers-providers) (*)
│ ├── ethers-solc v0.1.0 (/root/rust/ethers-rs/ethers-solc)
│ │ ├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
├── ethers-providers v0.5.4 (/root/rust/ethers-rs/ethers-providers) (*)
├── ethers-signers v0.5.3 (/root/rust/ethers-rs/ethers-signers) (*)
├── ethers-solc v0.1.0 (/root/rust/ethers-rs/ethers-solc) (*)
ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
ethers-etherscan v0.1.1 (/root/rust/ethers-rs/ethers-etherscan)
├── ethers-core v0.5.5 (/root/rust/ethers-rs/ethers-core) (*)
ethers-middleware v0.5.3 (/root/rust/ethers-rs/ethers-middleware) (*)
ethers-providers v0.5.4 (/root/rust/ethers-rs/ethers-providers) (*)
ethers-signers v0.5.3 (/root/rust/ethers-rs/ethers-signers) (*)
ethers-solc v0.1.0 (/root/rust/ethers-rs/ethers-solc) (*)
Platform
Linux
Description
failed to get ABI JSON when use abigen! w/ $ETHERSCAN_API_KEY set
[root@iZrj923msgidyk7ob4pwzgZ ethers-rs]# cargo run --example contract_with_abi -p ethers
Compiling ethers v0.5.4 (/root/rust/ethers-rs)
error: failed to get ABI JSON
--> examples/contract_with_abi.rs:15:5
|
15 | "https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: could not compile `ethers` due to previous error
I tried this code:
[root@iZrj923msgidyk7ob4pwzgZ ethers-rs]# git diff
diff --git a/examples/contract_with_abi.rs b/examples/contract_with_abi.rs
index 83af2d9..21b04be 100644
--- a/examples/contract_with_abi.rs
+++ b/examples/contract_with_abi.rs
@@ -10,6 +10,11 @@ abigen!(
event_derives(serde::Deserialize, serde::Serialize)
);
+abigen!(
+ DAI,
+ "https://etherscan.io/address/0x6b175474e89094c44da98b954eedeac495271d0f"
+);
+
#[tokio::main]
async fn main() -> Result<()> {
// 1. compile the contract (note this requires that you are inside the `examples` directory) and
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working