I am trying to duplicate some of the function of web3.js in C++. I don't really know much javaScript. I can see how the code calls into simple RPC calls such as eth_getBlockByNumber or eth_getTransactionByHash. That's easy enough.
I can't figure out how web3.js calls one of the functions on a smart contract though. For example, how does it call a function like an ERC20 token getTotalSupply?
I'm not looking for Javascript code explain how to use the capability, but instead the code that implements the functionality.