Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Etherscan now requires API key for getsourcecode, resulting in "Invalid etherscan API Key" error #567

Open
vovikhangcdv opened this issue Jul 22, 2024 · 0 comments

Comments

@vovikhangcdv
Copy link
Contributor

Due to a recent breaking change by Etherscan, the apikey parameter is now required by default. As a result, the default command for getting the source publicly will no longer work.

For example:

$ crytic-compile 0xd3c41c85be295607e8ea5c58487ec5894300ee67
ERROR:CryticCompile:Invalid etherscan API Key
ERROR:CryticCompile:Invalid etherscan API Key: https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0xd3c41c85be295607e8ea5c58487ec5894300ee67

To address this change, it is now necessary to provide the API key using --etherscan-apikey $ETHERSCAN_API_KEY. However, this is not loaded by default.

Expected Behavior

Cryptic compile should load $ETHERSCAN_API_KEY env by default.


The issue could have occurred with other explorers as well. It was only tested with Etherscan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant