- Setting a token standard like ERC20 enables services, like exchanges and wallets, to efficiently add support for new tokens. In addition, the defined commands from a token standard allows for tokens to communicate with each other.
balanceOf : returns the token amount present on the given address
transfer : sends a given token amount from the present address to a given address. The transfer function is not ideal for paying in a smart contract. When a smart contract runs it won’t have access to the details of the action - specifically, between which addresses a transfer took place.
approve : The present address creates permission for a given address (usually a smart contract) to transfer tokens up to the given amount in the function.
transferFrom: Once permission has been created by the approve function, the address with permission can use transferFrom to transfer tokens needed as payment for its own functions operations.
allowance : A public function that provides the amount of tokens allowed to be transferred from a given address by another address. Anyone can query this allowance.