Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the ERC standards of Yi Tai Fang pass?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the "Ethernet Square pass standard ERC". In the daily operation, I believe that many people have doubts about the Ethernet Square pass standard ERC. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what is the Yi Tai Fang pass standard ERC?" Next, please follow the editor to study!

The two most famous ethernet pass standards are token standard ERC20 and digital asset standard ERC721. In this article, in addition to introducing these two popular ERC Ethernet standards, we will also introduce some other improved ERC20 standards for specific application scenarios: ERC223, ERC621 and ERC827.

What is ERC?

ERC stands for "Etuereum Request for Comment", which is the Ethereum version of the opinion solicitation draft (RFC). RFC is a concept developed by the Internet Engineering Task Force. The memo in RFC contains technical and organizational considerations. For ERC, the draft includes some technical guidance on the construction of ethernet network.

ERC is written by Ethereum developers for the Yi Tai Fang community. Therefore, developers are included in the process of creating ERC. In order to create a standard for the ethernet platform, the developer should submit an ethernet improvement plan (EIP), which includes agreement specifications and contract standards. Once EIP is approved by the committee and finalized, it becomes ERC. A complete list of EIP can be found here.

The final EIP provides a set of enforceable standards for Yitaifang developers. This enables intelligent contracts to be built in accordance with these common interface standards.

ERC-20 is the most well-known standard in the entire encryption community and is used by most token issued on the Ethereum platform.

The content of ERC-20 standard

The following function interfaces are defined in ERC-20 standard:

TotalSupply (): returns the total amount of token supply

BalanceOf (address _ owner): returns the account balance of _ owner

Transfer (address _ to,uint256 _ value): transfer the number of tokens of _ value to the address _ to and trigger the transfer event

TransferFrom (address _ from,address _ to,uint256_value): transfers the token of the number of _ value in the address _ from to the address _ to and triggers the transfer event

Approve (address _ spender,uint256 _ value): allows _ spender to withdraw tokens of limit _ value

Allowance (address _ owner,address _ spender): returns the maximum number of tokens that _ spender can withdraw from _ owner

The above functions trigger the following events:

Transfer (address indexed _ from,address indexed _ to,uint256 _ value): triggered every time a token transfer is made

Approval (address indexed _ owner,address indexed _ spender,uint256 _ value): calling the approve () method will trigger this event

ERC-20 was proposed in 2015 and formally implemented in September 2017. This is a good starting point for token standardization. However, the developer community has noticed that it has some flaws and loopholes, in addition, there are some scenarios it is not well satisfied. Therefore, other ERC standards have been proposed one after another.

ERC-223

Status: on

Suggested date: 3Compact 5Compact 2017

In an article, developer Dexaran described in detail two scenarios where ETC20 is not suitable:

"there are two ways to execute a transaction in ERC20:

Transfer function.

Approve + transferFrom mechanism.

The balance of the pass is only a variable in the permit contract.

The transaction of a pass is a change in the internal variables of the contract. The balance transferred out of the account will be reduced and the balance transferred to the account will increase.

When a transaction occurs, the transfer () function does not notify the transfer to the account. Therefore, transferred to the account will not be able to recognize incoming transactions! I wrote an example that shows the process that leads to outstanding transactions and financial losses.

Therefore, if the receiving account is a contract, you must use the approve + transferFrom mechanism to send the pass.

If the accepting account is externally owned, the pass must be sent through the transfer function. If you choose the wrong mechanism, the pass will be stuck in the contract (the contract will not identify the transaction), and there is no way to extract these stuck permits. "

His proposed solution to this problem is included in ERC-223. It is very similar to the ERC-20 standard, but solves the above problems. When the pass is transferred to the smart contract account, the contract's special function tokenFallback () allows the recipient contract to reject the token or trigger further action. In most cases, this can be used instead of the approve () function.

ERC-621

Status: on

Proposed date: 2017-5-1

ERC-621 is an extension of the ERC-20 standard. It adds two additional functions, increaseSupply and decreaseSupply. This increases and reduces the supply of tokens in circulation. ERC-20 only allows a single pass issue event. This limits the supply to a fixed and immutable quantity. ERC-621 suggests that totalSupply should be modifiable.

ERC-721

Status: on

Suggested date: 922 Universe 2017

ERC-721 is very different from both ERC-20 and ERC-223. It describes a non-interchangeable pass. This means that each pass is completely different, and each pass has different value to different users. One way to understand this certificate is to recall CryptoKittes. Each digital cat is independent, and its value depends on its scarcity and users' desire to buy.

ERC-721 tokens can be used on any exchange, but the value of the pass is "determined by the uniqueness and scarcity of each pass". The interface functions specified in the standard include name, symbol, totalSupply, balanceOf, ownerOf, approve, takeOwnership, transfer, tokenOfOwnerByIndex and tokenMetadata. It also defines two events: Transfer and Approval. This article by Gerald Nash explains the concept of interchangeability very well.

ERC-827

Status: on

Suggested date: 1Compact 12 Universe 2018

Another extension of the ERC-20 standard is ERC-827. It allows the transfer of the pass and allows the holder to allow third parties to use the pass. The passes on Ethernet Square can be reused by other applications, including wallets and exchanges. This is useful when you need to support third-party dynamic consumption limit adjustments.

Most importantly, because ERC-827 is an extension of ERC-20, it is also compatible with ERC-20.

Some of the proposed interface functions include:

TransferFrom (address _ from,address _ to,uint256 _ value,bytes _ data) returns (bool success)

Approve (address _ spender,uint256 _ value,bytes _ data) returns (bool success)

At this point, the study on "what are the ERC standards of ethernet pass" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report