-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
ERC20 support #56
Comments
I have seen there is a Token (ERC20) column label in version 2.0.4 under Contracts already. I found in the change log ERC20 support is Work In Progress (WIP) so it is currently in an interim state. If I understand correctly Etherwall will be able to handle e.g. REP tokens (Augur), correct? |
So right now etherwall "recognizes" token contracts. If you add an existing contract and it's ERC20 compatible (right now I also expect it to have "symbol" method) it should show it's symbol under the column. That's it in this version, but you can use methods like getBalanceOf or transfer manually by invoking them and it'll work. ERC20 support is literally a bunch of shortcuts on top of normal contract method calls. E.g. getting of balances for each account via balanceOf etc. |
If you're interested in the details have a look at: https://theethereum.wiki/w/index.php/ERC20_Token_Standard I'm mainly aiming to support balanceOf and transfer in a convenient way so that people will be able to check their account balances for a specific token and send tokens out easier than by invoking the transfer method manually. |
Thanks for the information, I will definitely have a look at it. Not sure yet how to keep Augur token balances under control and where to keep REP. Don't see Kraken as a long term solution for that ... |
So you can try it out with a small amount, just add the token contract to etherwall first, see if it catches the symbol and all that. After that send a small amount to an address you control in Etherwall and you can check your balance by invoking NOTE: tokens are always stored to an address/account. Even if a wallet doesn't show them if you control the account they're sent to you control the tokens. With kraken and others they are stored on an account controlled by the operator of said exchange. |
hello, |
Hey so contracts are almost similar to normal addresses. Their "code" resides on the network and they are referenced by their address. Token contracts then store your tokens using their logic and your "caller address" as the "key". So as long as you have the caller address (or the receiver in your case) you're fine. To add a contract to Etherwall go to the contracts tab and click Add Existing. You then have to know the address of the contract. If the contract is certified open source by Etherscan the JSON interface should fill in automatically, otherwise you have to get that too from whoever made it. If the contract was successfuly added and detected as being ERC20 compatible you should see your Token's symbol in the ERC20 column in the contracts list. To check your balance then you select the newly added contract and invoke it. Select the Also note, the result will be in smallest denomination, so it might seem huge. Most tokens use 18 decimals similar to ETH so you need to divide by that to know how many "full" tokens you have. |
ok, i will experiment a bit with a small amount. thnx alot for explanation. |
Just tried to add the Augur Reputation Contract. After adding a contract name and pasting the address 0xe94327d07fc17907b4db788e5adf2ed424addff6 into the Contract Details Address field when I click OK the system replied with The Token (ERC20) column in Contracts stays empty so even so my blockchain is up to date now. I also added Augur to Watches and find Augur and Block numbers in Events now where the Event column is empty by now. |
I meanwhile sent a small amount of REP to one of my accounts and get it displayed in Ethereum Wallet / Mist as well as on etherscan.io but can't get information in Etherwall. |
Deleted and added the Augur contract to see if something changes, but no - still the ERC20 column is empty and the first column in Events also. When I invoke the contract and use the Almindor, you wrote above:
What exactly do you mean by "fill in automatically"? The symbol? |
Hey, thanks for taking the time to test a WIP "feature" :) So it seems I made a change in between that broke the symbol/ERC20 detection, but I want to explain all the stumbling points you had:
I'll fix the symbol detection by next release. Note that some ERC20 tokens DON'T supply it at all and I plan on adding an editbox to provide the symbol name in those cases. This is all a WIP right now. |
Hi,
|
Hmm I just tested on Mac and it works with the REP contract and the KrakenREP address for me. I've added contract NOTE: this is on Mac OS X version. I'll try Linux and Windows later. I think I saw the symbol detection fail on linux, maybe there's something wrong that only happens on non-mac. |
Also thanks for finding the repeat call bug, I can confirm that happens on mac too, it goes to invalid state and you have to change the input currently. I'll make it wipe the old data so you have to re-input. |
If there is something else I can test for you, let me know. |
Do you know OmiseGo? Just found I own a few tokens I received them about 2 days ago from its smart contract but don't know why. lol |
Found out there's an odd bug in Linux and Windows with data encoding when sending function calls to the node. It seems it all works ok in Mac OS X. It's really odd because the code is 100% same between the platforms. Going to investigate further. I heard about OmiseGo, but don't really know what it's about. |
Turns out the windows/linux vs mac was a Qt version problem due to this QT5 bug which was fixed in Qt5.9. I'm still using older Qt5 in Mac due to some deploy compatibility reasons so the older mac Qt5 was producing the "bugged" keccak instead of SHA3 hashes. Ethereum uses Keccak as well. There's a lot of confusion due to this in JS libraries too. I'll have a fix by next release as I already have an internal keccak implementation for the address checksums. I just need to use it for everything I used Qt5's hashing before too. |
Thanks for the feedback, another learning for me as I did not know about SHA-3 (Keccak) functions before. Really odd that Windows and/or Linux but not Mac are effected by this QT 5 bug. Following your explanation I will wait for the next release and test again. |
So it's not about windows vs mac version of Qt5 but about which major version of Qt5 is used. In windows I use 5.9 (latest) which "fixed" their SHA3 hash functions. This "fix" actually broke my functionality because up until 5.9 they actually used Keccak as the hash (Keccak is the precursor to the SHA3 standard). So if I compile Etherwall 2.0.x with Qt5.8 or older everything works ok, if I use Qt5.9+ it will break on the data parsing due to using the hash functionality. I've already pushed a fix to master that just changes the function to use my internal implementation so it won't matter which Qt5 version is used anymore. I'm just a bit disappointed in how silently Qt5 "fixed" this with no major notice. |
hi, |
ERC20 is going to happen before 2018. If you can please test this pre release of 2.0.7 on windows. It includes geth 1.7.0 so I wanna make sure everything still works. You'll need to remove and re-add token contracts. Thanks |
hi, with 2.0.7. and new geth, etherwall shows "cant connect to node" (i have no blockchain on my comp atm so i can only use thinclient if it matters). if i point to old geth (1.6.7) it can connect with the same behavior when it comes to contracts. rgds |
edit: sry i missed that it shows same error (incorrect amount of parameters passed to funktion "ballanceOf" got 0 expected 1) but the ERC20 column is no more empty it shows 454f53 followed by like 60 "0". also the behavior of etherwallet changes. after i tried 2.0.4 with new geth 1.7.0 with same results(no connection) now i was switching back to 2.0.7 and geth 1.0.7. after restart i get infinite instances of etherwallet starting and the exact error it shows is: unable to establish ipc connection to geth. fix path to geth and try again. WS: QLocal::Socket: connectToServer: invalid name . switching back to geth 1.6.7. make the wallet connect again. |
@Rob-2017 do I understand it correctly that with Etherwall I'm just double-checking I got it right. It works for me as bundled in windows 8, so this is good to know before making a new release. Can you make a screenshot of the contract line with the 2.0.7/1.6.7 combo if you re-add the contract? Which token is this? |
hi,
forgot to mentoin... yes that is correct. |
Can you send me the contract address from the screenshot please? I can't make the complete string. There's def. something wrong with the symbol detection there. The input error is OK as you didn't fill in the address to check balance of in there. When it comes to the geth issue, can you please try pointing to 1.7.0 again, start and do a clipboard copy of the geth log? Go to logs/geth and press copy to clipboard then paste here in a comment. You can use the code tags for it (three backticks, the key above tab used as quotes around the whole paste) NOTE: let it error out with cannot connect before going to the logs first. Maybe even wait a few seconds after that, I want to know what geth is doing all the time. |
I just installed above linked 1.0.7 and use it with Geth 1.6.7 by now. After removing and adding again the following contracts I get the symbol for Golem (GNT) and Augur (REP) but not for OmiseGo which is according to my understanding also a ERC20 token (JSON interface loads when adding the address). I once also was able to get the balanceOf for my Account with Augur. Events from Golem and Augur appear now with Event column getting filled, after adding OmiseGo to the Watchlist now also Events from that appear, but the Symbol and therefore maybe therefore also balanceOf for that Token does not work, Currently my blockchain is syncing, when done I will test further and give feedback here. |
Interface parcer error when trying to add Cryptonex Contract (ERC20) (just found one Token added for this to one of my addresses) Contract address: |
Multiple screen freezes when deleting / adding contracts during running sync. - always used the right top X and was able to close Etherwall by that. |
So the sync delays on operations are normal. Generally speaking if it's syncing you shouldn't be able to do anything that needs a request, I'll check that. I know that geth sometimes "intermittently" stops syncing and then resumes which makes these enabled for the time being. I'll check Cryptonex in a sec. seems their JSON ABI contains something odd. You got it filled in automatically right? |
No, Cryptonex did not load the Interface, directly the error. OmiseGo loaded but without symbol. Just had a Etherwall.exe Runtime Error while being away from the PC during sync. |
Meanwhile switched to Geth 1.7.0 - Upgrading chain index took a while. |
Hi, 0x86Fa049857E0209aa7D9e616F7eb3b3B78ECfdb0 is the address. |
@UGatgithub so u see geth 1.7.0 in headline of wallet and its working for you? need just to set the path and no further action needed? |
Yes I use Geth 1.7.0 with Etherwall now but did not change the path in Etherwall. I have geth installed to a separate folder so I just closed Etherwall, renamed the Geth folder to Geth163 and dowloaded Geth 1.7.0 from here which I than again installed to the previous used path: C://Program Files/Geth. I just found is that my he blockchain folder is 189GB ... too big ... can I just delete and recync fast and what would the size then be? |
hmm back to 2.0.7+ 1.7.0 i just added contract adress to watch and see that the name and the address is reversed in watches ?? is that ok? @UGatgithub hmmm by installed u mean copied the new geth in folder of old geth and used the old names? 189 gb for blockchain ? afaik it should be max 50 or 60 gb or less. check disk |
Fully resynced using --fast should be ~40gb or so. 1.7.0 geth should make it even smaller. NOTE: if you have old chaindata from 1.6.7 and upgrade geth to 1.7.0 it does an "upgrade" which I think can stall it long enough for Etherwall to fail with the can't connect error. Shouldn't happen if you only used thin client tho. Not sure about the access denied error. |
@UGatgithub for the contract |
@Rob-2017 not sure what you mean by reversed here. Can you be more specific? The watches table has a watch name column and contract should show the contract name (whatever you named the contract when you added it). |
OK then that's the reason for the interface parcer error lol |
Yes heh, so you need to obtain that. I only auto-fill the ones where Etherscan.io has the sources. I should maybe add a more explicit error with a FAQ link there. Confirmed that OmiseGo is not detected as ERC20, looking into why now. |
Can I just rename the chaindata folder (keep as backup until newly synced) and will it then restart sync when I start Etherwall? |
You can but make sure you have enough space for each. |
its just confusing that in watches the address is in name column and in contracs not. |
Regarding Cryptonex I did not find the JSON ABI Interface on their Website yet: https://cryptonex.org/ maybe it can be found here? https://github.com/Cryptonex?tab=repositories |
ok, cant get geth 1.7.0 working. now i used same source as ugatgithub with installation in same folder. i also tried if it matters to uninstall older geth first and switch thinclient on/off but still "Fatal: Error starting protocol stack: Access is denied." it looks like i should try with win 10. need to get to my other comp tomorow atm im on win7x64. if u have news about the name/token issue of the EOS contract pls let me know ty. |
@Rob-2017 So you named your watch with the address? That's what it seems. @UGatgithub no idea, but whoever created the token has to have the interface. |
When it comes to OmiseGo the reason why Etherwall rejects it as ERC20 is because they changed the In the ERC20 standard, the return value is supposed to be a boolean, but they removed it and it doesn't return anything with OmiseGo. I'm considering adding an exception for this. |
Made a new pre-release for v2.0.7 If you can please re-test with all the contracts again by removing and re-adding them. Every contract should now be detected with the proper symbol. |
Takes quite some time at startup while Processing eth_getLogs. Yes now the OMG symbol also gets loaded, regarding balanceOf I waited until sync was completed and I do get Results for REP, GNT and OMG now. :-) Can you define the function balanceOf as default selection? |
yes... :) i was a bit confused because of that geth issue. very strange something prevent 1.7.0 to connect but not 1.6.7. that geth error |
@UGatgithub this is just the skeleton, full ERC20 support will make it click-easy to check your balances and send tokens. @Rob-2017 I noticed one thing. If you don't delete the other non-keystore folders from the main ethereum data folder and resync things go strange. Maybe try doing that, but make 100% sure all your accounts are safe! |
When it comes to "digix global" |
First alpha release of fully erc20 compatible version is here: https://github.com/almindor/etherwall/releases/tag/v2.1.0-alpha1 I'd appreciate if you guys could test this out as much as possible. Feel free to switch to testnet (needs to be full client for that) I'll push binaries as soon as I can find the time to build them (day or two). |
Fixed via 2.1.0 release |
Add support for balances and sending of ERC20 tokens
The text was updated successfully, but these errors were encountered: