Tron FAQ :: What is TRC20?steemCreated with Sketch.

in Tron Fan Clublast year (edited)

TRC20 (TRC20 Token Standard) is a token standard based on the implementation of smart contracts when using the TRON network to issue tokens.

Tron FAQ :: What is TRC20?

To exchange, transfer and share tokens and support them in digital wallets, all TRC20 tokens conform to a set of specifications, including six mandatory clauses and three additional items.

Implementation rules.

3 additional items
  1. Token name: string public persistent name = "TronFanClubCoin";
  2. Token abbreviation: public persistent string character = "TFCC", abbreviation for TronFanClubCoin.
  3. Token precision: the smallest divisible unit. Precision 0 means that the smallest divisible unit is 1, precision 2 means that the smallest divisible unit is 0.01. The maximum precision is 18.
6 required items

The following code is a short example of a TRC20 smart contract:

Tron FAQ :: What is TRC20?

totalSupply() - this function returns the total token supply.

Tron FAQ :: What is TRC20?

balanceOf() - this function returns the token balance for a given account.

Tron FAQ :: What is TRC20?

transfer() - this function is used to transfer the number of tokens from a smart contract to a specific address.

Tron FAQ :: What is TRC20?

approve() - this function is used to authorize a third party (in the form of a DAPP smart contract) to transfer tokens from the token holder's account.

Tron FAQ :: What is TRC20?

transferFrom() - this function is used to authorize a third party to transfer the token from the holder's account to the recipient's account.

Tron FAQ :: What is TRC20?

The owner account must be authorized to be called by the third party. This function allows third parties to automatically transfer tokens from the owner's account to another account.

allowance() is a function used to request the number of remaining tokens that can be transferred by third parties. This method must be called before Approve() is executed.

For example:

Mary has 1000 TRX and wants to allow a third contractor, C, to operate 100 TRX from her account:

  1. Call approve(C, 100) on Mary's account.
  2. Contractor C wants to transfer 10 TRX from Mary to Bob. Call transferFrom(Mary, Bob, 10) using Contractor C's account.
  3. Call allowance(Mary, C) to query the remaining tokens that contract C can transfer from Mary's account.
Event Function

Event Transfer(address indexed _from, address indexed _to, uint256 _value)

The transfer event occurs when the token is successfully transferred.

Event Approval(address indexed _owner, address indexed _spender, uint256 _value)

If approval() is called successfully, an Approval Event should be triggered.


To earn TRX I use the service Feee.io is a TRON energy trading platform, you want to receive income from 50% APY. Join our friendly team!

Sort:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.

Upvoted! Thank you for supporting witness @jswit.

What is TRC20? Is a great article
I know this from you.

Blockchain Tron contains a lot of interesting and technological moments, stay with us and learn a lot of new things!

You have given us a nice explanation on what trc-20 is, thanks for sharing with us 😊👍

Coin Marketplace

STEEM 0.17
TRX 0.14
JST 0.028
BTC 58083.18
ETH 2578.52
USDT 1.00
SBD 2.42