原文标题:《 可以退款的 ERC721R 会成为闯入 NFT 市场的鲶鱼吗? 》
Do you understand the world a little better today
This article is from wechat official account:Did you understand the world a little better today
A few days ago, I discussed the existing problems of NFT with everyone in the group. I mentioned that buyers are in a weak position in the NFT market, and in the primary market, they are in the hands of the project operators, and the secondary market relies on the project operators to do real work rather than run away with money, and deduced an ideal model:

At that time, the proposed model was that the mint process in the primary market should ensure absolute fairness, while in the secondary market, the project side should ensure that the money gained under the roadmap can be realized instead of being rolled out with leek. Therefore, first of all, the project side should not directly withdraw the money after Mint, after all, there are assets worth hundreds of millions in the account. It is hard for people to resist the temptation of mentioning personal accounts by just moving their fingers. Secondly, the withdrawal of the project side should be used in the right way, that is, to realize the promise of the roadmap. Users should know that what they buy is not the JPG of the project side, but the rights and interests and stories after the JPG. The moment the user buys is overdrawing the time of the project side in the future.
In my opinion, THE NFT market should be a market where good currency drives out bad currency. If the above model is implemented, if the project side does not use it, the users will think that the project side is guilty and will not buy it, and then force the project side to use a healthier model, and finally form a positive cycle to purify the whole market.
ERC721R protocol is a new protocol that can be used to implement the ERC721R protocol.

We can see the media reports that it allows the foundry to refund, that is, before you bought fake goods on Taobao only admit, now you can refund within 7 days without any reason.
If we go to the official website of ERC721R, https://erc721r.org/, slogen brings a great sense of responsibility to the creators of NFT, so it restricts the rights of slogen and demands that slogen do something carefully, otherwise the users will get their money back.

It can be seen that the 4 advantages listed by them are also focused on the problem of the project side running away. The project side can do nothing within 30 days to get a refund.

Referred to in the QA project party during the refund is impossible to mint money, secondly to explain, he also for the project said oh you if it is a serious project party affirmative won't need to finish mint immediately put money, put a few days so it doesn't matter, that means you don't have my agreement that is a ghost in my heart, Good money drives out bad money.

The idea is good. Next, let's see how their code implements the above process. Let's go to their Github homepage https://github.com/exo-digital-labs/ERC721R
You can see the more detailed description, which says that the refund function has been added to the old 721 and 1155 protocols.

As for the description of how it works, the money paid by the user is first entered into the smart contract (721 and 1155 are themselves such), and then there is a lock-up period, during which the project side cannot withdraw money, but the user can get a refund.

This is the example code, and I'll take you through it.

RefundPeriod is defined and defaults to 45 days. Of course, the project can change it by itself.
The constructor is then defined, and the default withdrawal account is contract deployer,

And called a time calculation function, that is, the time to get the current contract deployment plus the lockup period is the final date that the project side can withdraw money.

This function is used to verify whether the user is in a lockup period, which will be used in the following user refund operation.

Then we look at the core of the refund operation, the user input the corresponding token ID of the refund, because it is an array format can refund multiple NFT, then the contract first use the verification function just mentioned to determine whether the lockup period, if so, the user can refund from the inside. Then, the for loop is used to traverse the token ID entered by the user and verify one by one whether it really belongs to the current user. If so, transfer function will be called to return the USER's NFT to the project side. It then calculates how much money to refund to the user, multiplying the amount of NFT the user has returned by the Mint price, and calls sendValue of the third-party contract to send the money to the user.

This is the normal project withdrawal function, with a check to see if the lock time has been reached. If not, the function cannot be executed.

To sum up, 721R makes two major changes to 721, 1155 and other agreements:
- The withdrawal function adds a layer of time check, can not withdraw before the time, thus limiting the project side
- Added a refund function for users.
The whole process is no more than 30 lines of code, and it is not packaged at the bottom like 721A. It is only modified in the mint contract code at the top, so it is determined first: it does not belong to the protocol, or it does not reach the protocol level.
Secondly, since all changes are made in the upper contract, it is necessary to treat the symptoms rather than the root cause. Not to mention whether the project side will remove some restrictions in it. Of course, after the code is open source, it will be discovered by everyone.
I still remember the refund mentioned above, the refund to the user is the amount of NFT multiplied by the mint price, but the mint price is a parameter, as long as it is a parameter, you can change, if I mint price was 1 ETH, after mint project changed the price to 0 ETH, then I refund a lonely... And the process is undetected until the user refunds.
So let's run through the code and see if this works.
I set the price to 1 ETH and mint 5.

At this point, my balance is 94.99.

Then I will refund the NFT with ID 1.

After the execution, my balance increased by 1 ETH.

So let's say I'm a project owner who has no conscience and no morals and just wants to cut the leeks and I'm going to do something to disrupt it, right? I'm going to change the price to zero and I'm going to give you a refund.
And then I'm going to try to undo NFT with id 2.

NFT has been returned, but the balance has not changed.....

Therefore, if you want to solve this problem, it also depends on the consciousness of the project side. Do not change the price, or directly write the price as constant cannot be changed at all. We should not rush as soon as we hear that the project side uses ERC721R, or take a careful look at the code, in the end there is no pit for you.
To sum up, ERC721R is a clear current in today's NFT market. He points out the disadvantages of this market, truly considers from the perspective of users, and puts forward a feasible solution. However, this solution is not perfect, and there are still a lot of areas to be improved and added. But that doesn't stop him from being, to put it too well, the market's truth-telling whistle-blower.
As the previous article Web3 world a wilderness - detailed explanation of ERC721A, Web3 world is still a wilderness, there are a lot of land waiting for us to reclaim, ERC721R opened a good start, we need to do a lot of things.
You can pay attention to my public number "today have a little more understand this world & NBSP;" Check out previous posts for more in-depth discussions, and follow me on Twitter at Jason_chen998
The original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia