1

This is the documentation for the Ethereum Json RPC:

https://github.com/ethereum/wiki/wiki/JSON-RPC

Pretty straight forward, but where is the documentation for dealing with tokens via this protocol?

In particular, I need to understand how the eth_call method works. I understand that I need to send some ABI, and get back some ABI. Here is the documentation for this: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI

What I need is a spec of all the messages I can send, and get back.

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
  • Please see here https://ethereum.stackexchange.com/questions/51087/what-is-the-json-rpc-method-to-call-a-contracts-function/51088#51088 - you just need to call EIP-20 smart contract methods of the token to transfer it around. – Mikko Ohtamaa Jun 13 '18 at 12:51
  • Thanks, but I need actual documentation. This doesn't give me any clue what to do. How do I list the tokens at an address? How do I get their balances? – Christian Findlay Jun 15 '18 at 09:16
  • I also say this because there is NO library for C#. I am building it myself. JSON RPC is easy enough, but there's no documentation on how to access smart contracts. – Christian Findlay Jun 15 '18 at 09:17
  • What's I'm really struggling with is all these libraries that are written in golang, or solidity. I don't understand why there is no documentation for straight up JSON. – Christian Findlay Jun 15 '18 at 09:29
  • Hey Melbourne, you're mixing up a lot of things, and that's fine when starting out with Ethereum Development. Get yourself familiar with the truffle framework, web3js, and maybe web3j. For development, use the ganache-cli tool. – n1cK Jun 15 '18 at 09:40
  • I'm looking at that now. Actually, I am looking at Nethereum which is a C# implementation of the Web3 standard. It works well. I was able to get a balance from an Eth address for Tronix. Great. So, then I reverse engineered the Json and I get the request and response which is exactly what I'm looking for. But, I shouldn't have to reverse engineer this stuff. There should just be documentation for it. – Christian Findlay Jun 15 '18 at 10:46
  • Ethereum has been around two years and tokens basically one year. I think here is a mismatch of expectations. It is not centralized effort so there is no single party who should write the documentation. However I can point you forward to projects where you can document this stuff. – Mikko Ohtamaa Jun 15 '18 at 11:41
  • Several tokens are in the top ten for market capitalization of all crypto currencies. It's crazy that even basic documentation does not exist. – Christian Findlay Jun 15 '18 at 23:17

1 Answers1

1

Technically, ERC20 tokens are not at the owners addresses. If you have a token, your address is registered in the smart contract of the ERC20 token as a list of [address]: [balance].

To check the register and see your balance, you need the address of the ERC20 token smart contract.

Anyone can make an ERC20 token, and there's no easy decentralized way to list all of them.

You could collect all the addresses listed on https://etherscan.io/tokens and write a script which checked your balance on all of them, but you would have to keep the list updated when new ERC-20 tokens are launched.

Even more ambitiously, you could set up an Ethereum client and parse all contract creations, defining a filter or pattern to identify ERC20 contracts. But that's very hard to get right.

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
Svante
  • 450
  • 1
  • 3
  • 10
  • You've copied and pasted your answer here. I'm looking for actual documentation. – Christian Findlay Jun 15 '18 at 22:44
  • Well, the answer is correct. The short answer to your updated question: Ethereum tokens (most popularly defined in the ERC-20 interface) is not part of the Ethereum protocol or any client you can call with JSON RPC. It is a standard interface to token Smart Contracts built on top of Ethereum. – Svante Jun 18 '18 at 14:31