# Get ERC-20 token balance

Ethereum is a blockchain platform. It has its own native cryptocurrency, ether, but in this challenge, we'll be focusing on its ability to run smart contracts.

The ERC-20 standard describes an implementation of fungible tokens within a smart contract. Some examples of this implementation are EOS, OmiseGo, and the Golem Network Token. In this challenge, your job is to find the amount of tokens owned by a certain address using the fewest bytes possible.

The standard defines a balanceOf(address) contract method which is simple enough to use; however, it returns it in terms of a much smaller unit. To get the actual balance, you must divide the result by 10 to the power of whatever the decimals() method returns. For example, calling balanceOf(0x4530d03744d7ef769025623d31966da1e8485eef) returns 1.500000000000015e+21, and dividing it by 10^decimals() (10^18) results in the true balance of 1500.000000000015.

## Notes

• Assume that the computer that your program/function/etc. will be running on is running a fully-synced Geth node on the Ethereum mainnet with the JSON-RPC endpoint listening on the default port of localhost:8545.
• Your program should take two inputs: the token contract address (e.g. 0xea097a2b1db00627b2fa17460ad260c016016977) and the wallet address (e.g. 0x4530d03744d7ef769025623d31966da1e8485eef). Input can be taken in any reasonable format, such as a string, an integer, or an array of bytes (NB: Ethereum addresses are 20 bytes long).
• It should have one output: the token balance of the address in any reasonable format. Cases where the balance is zero must still be handled.
• Loss of fine floating-point precision in the final balance (e.g. the 17th or 18th decimal after dividing the balance by 10^decimals()) is okay.
• The ERC-20 standard technically says that the decimals() method might not be implemented; however, you may assume that it is.
• The use of libraries like web3.js is permitted, but discouraged.
• Standard loopholes are obviously not allowed.

## Test Cases

token, wallet -> balance