I am implementing a light client for Ethereum and I cannot find any way to call smart contract method via LES protocol. For example I need to call "balanceOf" for ERC20 token. RPC provides "eth_call" api for this and I can get balance of ERC20 token using it.
LES protocol on the other hand does not provide any way to call smart contract methods.
I was able to get balance of some ERC20 tokens by requesting storage value, but every ERC20 token has different storage key, and moreover, some ERC20 tokens even redirect to another contract when "balanceOf" method is called.
Shortly, I need an alternative for "eth_call" RPC method for light client (LES protocol)
@fjl thank you for your reply. The idea is quite interesting and challenging.
We are developing iOS and Android light clients for Ethereum network, and use swift and kotlin accordingly. Are there any implementations of EVM on these languages?
And on more point. Am I right that in order to call some contract I need to: