vyperlang / titanoboa

a vyper interpreter
https://titanoboa.readthedocs.io
Other
251 stars 49 forks source link

Allow setting up Etherscan API key and URL #249

Closed DanielSchiavini closed 3 weeks ago

DanielSchiavini commented 3 months ago

Currently, users need to pass the Etherscan API key and URL (optional) for every single call. Besides the verbosity, what happens is that we cannot automatically load dependency contracts from Etherscan.

For example, this piece of code is required to load a lot of different contracts manually just to get a proper trace.

However, it's simple for us to automatically try to load ABI from Etherscan if we have a global API key.

suggested UX

import boa
boa.setup_etherscan(...)  # uses given API key, default URL
boa.setup_etherscan(api_key=..., url=...)  # with custom URL
DanielSchiavini commented 3 weeks ago

Fixed in https://github.com/vyperlang/titanoboa/pull/306