-
Notifications
You must be signed in to change notification settings - Fork 87
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
New eth-scan broken for some tokens #260
Comments
Thanks for bringing this up! I'm not sure why this happens for this particular contract. I'm not familiar with Vyper, but I will try and look more into this. Any suggestions as to why this might happen are much appreciated too. It could potentially be solved by using just the first 32 bytes, which is what we do in the JavaScript library: Line 16 in 0b10a29
Regarding the old versus new contract: We ran into similar issues with certain contracts, like non-ERC-20 compliant proxy contracts, where the We also had issues with the call running out of gas, due to a non-compliant token using up the entire gas limit. I believe this is because a call to a non-view function uses up all of the gas. Some of the contracts that were causing issues before:
Again, I'm not a 100% sure what the exact reason for this was, but I think it may have to do with reading revert reasons. I'm happy to accept any contributions! |
So when called from inside contracts you had problems, but when called from the node it was all fine, right? |
Yes. So in the JavaScript library we check if the call failed, and fetch again by calling |
The problem
At rotki we use the old eth-scan version: https://etherscan.io/address/0x86F25b64e1Fe4C5162cDEeD5245575D32eC549db
Tried and true, works every time.
@yabirgb deployed the new one in optimism, so thought we could try and use it in mainnet too.
While trying to accomplish that it turns out that there is some edge-cases for which it's broken.
While for many tokens it works fine and returns True/false plus the uint256 in bytes for the token balance, there is a few tokens where it returns True plus a humongous byte string.
One such token is
0x0e880118C29F095143dDA28e64d95333A9e75A47
(https://etherscan.io/address/0x0e880118C29F095143dDA28e64d95333A9e75A47)If you try to query balance for any user it spits out the huge byte string. But probably best example is someone who actually owns a bit of it.
So
tokensBalance
forowner
: 0xeE620a0991D57f464aaD452789a4564Ba51245E8 andcontracts
: 0x0e880118C29F095143dDA28e64d95333A9e75A47Try via: https://etherscan.io/address/0x08A8fDBddc160A7d5b957256b903dCAb1aE512C5#readContract
Result can be seen below
Some extra thoughts
I can't help but feel that the original very first contract is superior in every way. Only downside is that it has
view
only the EtherBalances and the other calls are notview
while they should have been.But for this new one the following problems exist:
etherBalances
does not make sense since it's always true. So it takes up extra space and reduces the amount of possible addresses we can have in a roundtrip to a node due to size limitations.It's quite possible I am missing something, but I would love some explanation into the thinking that went into these changes.
Explanation on the reduction of amount of possible addresses: Same code that was querying exact same amount of tokens for a given address fails both with etherscan proxy (they close the connection) and with my own node (times out). Works fine with old contract.
If with the new contract I send less addresses in each batch then it works. So in the end the new contract forces us to make more calls to a node.
The text was updated successfully, but these errors were encountered: