-
Notifications
You must be signed in to change notification settings - Fork 794
Conversation
ethers-etherscan/src/contract.rs
Outdated
let path = cache.join("abis").join(format!("{:?}.json", address)); | ||
let reader = std::io::BufReader::new(std::fs::File::create(path)?); | ||
let abi = serde_json::from_reader(reader)?; | ||
return Ok(abi) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we instead continue with the request if this results in an error, like file does not exist?
ethers-etherscan/src/lib.rs
Outdated
let mut this = Self::new(chain, api_key)?; | ||
this.cache = cache; | ||
Ok(this) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively call Self::new_cached(chain, api_key, None)
from Self::new
ethers-etherscan/src/contract.rs
Outdated
let path = cache.join("sources").join(format!("{:?}.json", address)); | ||
let reader = std::io::BufReader::new(std::fs::File::create(path)?); | ||
let src = serde_json::from_reader(reader)?; | ||
return Ok(src) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above.
FYI @onbjerg this had seemed to work but I never tested it. May want to take it over so we don't hit rate limits when tracing with https://github.com/gakonst/foundry/tree/onbjerg/etherscan-identifier or https://github.com/gakonst/foundry/tree/etherscan-identifier-v2 |
Took over in #1108, there is some missing stuff |
Ack |
As title, will be useful for avoidign rate limiting when doing mainnet forking in foundry and fetching ABIs/sources for tracing