HRC-20 Homogeneous Tokens
Introduce
What are tokens?
Tokens can represent anything in Hash Ahead:
Reputation points in online platforms
A character's skill in the game
lottery ticket
financial asset An asset similar to a share in a company
fiat currency like the dollar
an ounce of gold
and more...
Such a powerful feature of Hash Ahead has to be handled with strong standards, right? This is where HRC-20 comes into play! This standard allows developers to build tokenized applications that interoperate with other products and services.
What is HRC-20?
HRC-20 proposes a standard for fungible tokens, in other words, they have a property that makes each token identical (in type and value) to another token. For example, an HRC-20 token is like HAH, meaning that a token is and always will be the same as other tokens.
Text
HRC-20 is an application programming interface standard that can implement tokens in smart contracts.
Examples of features of the HRC-20 include:
Transfer tokens from one account to another
Get the account's current token balance
Get the total supply of tokens available on the network
Approve a certain amount of tokens in an account to be used by third-party accounts
If a smart contract implements the following methods and events, it can be referred to as an HRC-20 token contract and, once deployed, will be responsible for tracking tokens created on Hash Ahead.
Method
Event
Example
Let’s see how such an important criterion allows us to simply check any HRC-20 token contract on Hash Ahead. We only need the contract's Application Binary Interface (ABI) to create an HRC-20 token interface. Below we will use a simplified API to make the example simpler.
Web3.py example
First, make sure you have the Web3.py Python library installed:
Last updated