-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Unverified contracts with "similiar code" not handled [APE-1451] #104
Comments
I just came across this and dug a little. There isn't a way to see the "similar code" contract via the API. So while I don't have a true fix, I have a band-aid for the issue I came across: Uniswap V3 pools. For some reason not all of them are verified despite Uniswap saying they should be on deploy (some certainly do get verified automatically). Not sure this is worth implementing, but figured I would add this here for consideration and maybe to get someone smarter than I thinking creatively. So when ape-etherscan comes across a pool that isn't verified, get info on the contract creation:
That returns something like this:
Pull out the txHash and you can call the
That returns a bunch of JSON. Pull out the
I recognize this isn't perfect. |
makes me wonder if we should index and publish all the pools that were never published lol |
It should be working! https://github.com/ApeWorX/ape-etherscan/blob/main/ape_etherscan/verify.py#L402-L403 I have seen it work plenty of times. Edit: sorry I thought this ticket was for verification but it is for retrieval, so idk actually! |
Yeah, this is when a contract is not verified on etherscan but it still has some ABI information because it is "similar to" another contract (matching bytecode, but basically unsure about the initcode matching) This is common for contracts created via "factory pattern" that produces a lot of child contracts with the same code |
we stumbled on a solution for this error. @salparadi A solution to the "Etherscan doesn't have the ABI for this unverified contract" issue would be to BYPASS this check. Check out this snippet and see if it can work for you: It is an alternative solution which solves the issue specifically for Uniswap pools contracts. |
example:
https://etherscan.io/address/0x5777d92f208679db4b9778590fa3cab3ac9e2168#code
raises:
The text was updated successfully, but these errors were encountered: