-
Notifications
You must be signed in to change notification settings - Fork 18
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
Ethereum: find a way to differentiate between 0 balance and account does not exist #676
Comments
@LucasIsasmendi @ethanfrey do you think it is practically possible to clear a once used Ethereum account to 0 wei? With the gas system, some wei should always be left in an account, right? This would allow a very simple and fast implementation: balance 0 -> account never used |
If you are smart, you can make it 0. Especially if such "smart" usage can trigger un-tested edge case -> possible exploit. I mean, sending wei to another account has a known gas cost (42k I believe). Offer a high gas Price (eg. 10Gwei) and then deduct the predicatible fee from total balance and send it to a second account you control. I mean, if you use the current gas calculation in iov-wallet, it is not practical, but most more advanced gas handling solutions would let you do this quite easily. |
#774 now moves the workaround from the wallet into IOV-Core. I'll let this ticket open since I'm not convinced what the final answer will be. Scanning for transactions is a very expensive operation (extra request and parsing) and adds the dependency on a scraper to a simple operation like get balance. |
Fair enough, very hard to do correctly. I'm happy with a simple solution for now, leaving the open issue for the correct solution |
eth_getBalance gives us 0x0 for existing and non-existing accounts. We should be able to differentate this somehow to properly represent as
BcpAccount | undefined
.The text was updated successfully, but these errors were encountered: