-
Notifications
You must be signed in to change notification settings - Fork 114
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
Failed to fetch ABI for contract when using the "Etherscan contract link" option #1419
Comments
Note: I did not set my EtherScan API Key. I am not sure if this is necessary. |
Update After inspecting the source code here, I learned that you can set the EtherScan API key via the following command:
I had to do this before running the I suggest adding this info to relevant documentation such as here. On another note, I was unable to get the -t / --template flag to work. I believe that section in the above documentation may be outdated. (i.e I was not able to set my API Key with the I hope this helps make the "Getting Started" guide more straightforward for new users of ponder. Please do let me know if you have any questions. |
Thanks for opening! Was able to reproduce. It looks like the root cause is that Etherscan has stopped serving API requests without an API key, which is a real shame. Until recently, they served unauthenticated requests with a restricted rate limit, and If there's no workaround, we'll probably need to change the etherscan template to require an API key, and improve the error logging around this. |
Hello, you are very welcome, and I am glad to bring this finding to your attention! I originally thought I made a "silly mistake" at first by not setting the API Key, but your explanation makes perfect sense. That is definitely a bit unfortunate that EtherScan got rid of their non-authenticated option, but I am sure that you will be able to find a nice workaround Can the EtherScan template be used with other block explorers? If it can be, it may be something to keep in mind (i.e other block explorers may not require auth (aka an API Key). PS: I have just started experimenting with Ponder, and I am quite impressed! It is awesome. |
Version
10.9.0
Current behavior
When I try to index the Chainlink token contract, using the following EtherScan url as input, I receive 2 different errors:
https://etherscan.io/token/0x514910771af9ca656af840dff83e8264ecf986ca
Error 1:
⚠ Failed to fetch ABI for contract 0x514910771af9ca656af840dff83e8264ecf986ca. Marking as unverified. Error: "undefined" is not valid JSON
Error 2:
⚠ Unable to fetch contract deployment block number from block explorer. Error: Cannot read properties of undefined (reading 'slice')
Since the ABI and block number is not fetched properly from EtherScan, I receive an error when running "npm run dev":
ERROR build Failed build
BuildError: Validation failed: Found 0 registered indexing functions.
Expected behavior
When I utilize an Etherscan template, the ABI and functions should automatically be populated.
However, I am currently getting a file named "UnverifiedContractAbi.ts" in the "abis" directory, and a file named "UnverifiedContract.ts" in the "src" directory.
Steps to reproduce
This issue can be reproduced by:
npm create ponder@latest
Etherscan contract link
Template Option.https://etherscan.io/address/0x514910771af9ca656af840dff83e8264ecf986ca
Link to repository
No response
Anything else?
No response
The text was updated successfully, but these errors were encountered: