The ERC-20 standard defines a set of functions and events that a token contract on the Ethereum blockchain should implement. ERC-20 tokens are fungible, meaning each token is identical and can be exchanged one-to-one.
Note: ERC-20 Token addresses refer to full Hedera Token Service (HTS) fungible token entities. These tokens can be fully managed by HTS API calls. Additionally, by utilizing IERC20 interfaces or system contract functions, these tokens can also be managed by smart contracts on Hedera.
Returns of the balance of the token in the specified account. The account is the Hedera account ID 0.0.x in Solidity address format or the evm address of a contract that has been created via the CREATE2 operation.
Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom. This is zero by default. This value changes when approve or transferFrom are called. This works by loading the owner FUNGIBLE_TOKEN_ALLOWANCES from the accounts ledger and returning the allowance approved for spender The owner and spender address are the account IDs (0.0.num) in solidity format.
Transfer tokens from your account to a recipient account. The recipient is the Hedera account ID 0.0.x in Solidity format or the EVM address of a contract that has been created via CREATE2 operation.
Sets amount as the allowance of spender over the caller's tokens.
This works by creating a synthetic CryptoApproveAllowanceTransaction with payer - the account that called the precompile (the message sender property of the message frame in the EVM).
Fires an approval event with the following signature when executed:
event Approval(address indexed owner, address indexed spender, uint256 value);