header-langage
简体中文
English
Scan to Download the APP
Partnered With:

NFT project Akutar valued at $34 million in ETH was permanently locked up

Read this article in 9 Minutes
Remember the word totalBids, it is worth 200 million.
Original title: " The 200 million of Akutar NFT was permanently locked because of a wrong word? ! "
Original author: Do you understand the world a little better today?
This article comes from the WeChat public account: Have you understood the world a little better today?


You can pay attention to my official account "Do you understand the world better today " to check out previous articles and have more in-depth exchanges and discussions with me, and you can also pay attention to my Twitter: jason_chen998  


The last article on NBA was too exhausting to write, and I wanted to rest for a while before writing, but it turned out to be web3 The world is so exciting, there are too many big news happening every day, and the big weekends are forced to open again.



Today, an NFT project called Akutar caused 11,539 ETH worth 34 million due to a contract bug The money of 200 million yuan in US dollars can never be withdrawn and locked up, 200 million yuan!


Let’s open the contract address to see the 200 million yuan, and imagine the Akutar team’s crying mood looking at this string of numbers.



First of all, let me introduce Akutar. From the description on the official website and their twitter, we can see that this is not a local dog project , on the contrary, it is a high-quality project with great care, whether it is in terms of fine painting style or roadmap description, the quality is very high.



Its initiator is a well-known baseball player Micha Johnson, which originated from his overheard A little black boy had a conversation with his mother, and the little boy asked his mother if the astronauts could be black, so Micha Johnson decided to release a series of little black boys wearing helmets who dreamed of becoming astronauts, a fairly wonderful story.



Then the NFT behind such a heart-warming story is so smashed? To a certain extent, the project owner’s desire to make money is greater than the so-called heart-warming public welfare, so they shot themselves in the foot, because it used a relatively unique Dutch shooting method.


The traditional auction method is to set a low price, and then everyone raises the price, and finally the highest bidder can buy it. This is an English auction, while a Dutch auction is First set a maximum price, and then gradually lower the price, and finally someone will buy it at a certain price point. The Dutch auction is a test of human nature, because everyone wants to wait for the lowest price, but they are afraid that others will buy it first.


Azuki is auctioned in the Netherlands, but Akutar has changed the auction method compared to Azuki. The price of Azuki is dynamically reduced, so you can buy The later the price is lower, the sooner you buy it, you may suffer a loss and the price will be higher. Akutar added a "refund" rule, which seems to be more user-friendly, but I think it actually wants to cut more money.


As shown in the figure below, the starting price of the auction is 3.5ETH, which will decrease by 0.1ETH every 6 minutes, and the person who buys at the lowest price will become the standard price. Other users who buy at a price higher than this price will get a refund. For example, if the final minimum selling price is 1.5ETH, all those who bid higher than 1.5ETH will get a refund for the difference. Buy, don't stick to the lowest price, even if you buy a high price, you can get a refund.



So Akutar will have a huge fund pool to store all the money paid by users, this part of the money includes What the project party deserves, including what needs to be refunded to the user, here is a knowledge of popular science. As mentioned in the previous article, the nature of the smart contract is the same as your own personal wallet address, which is a block Chain address, you can receive and send virtual currency. When you are in a certain project of mint, you actually transfer the money to the project contract address first, and then the contract transfers you an NFT, that is, the primary market for all NFTs. They all arrive at the contract address first, and then the project party will carry out the withdrawal operation, and transfer the money in the contract to its own wallet.


This time 200 million was locked because of a bug in the step of withdrawing money, because the non-tamperable feature of the blockchain smart contract caused a bug It cannot be repaired. If there is a bug in the traditional Internet that prevents money from being withdrawn, it can be repaired and iterated. But in web3, it means that you can only look at the 200 million in this life.


Let's take a look at what some key codes have done to help you understand the principle, and then analyze what went wrong.


Let’s first learn the principle of the Dutch auction, first of all, to obtain the current price, here we first obtain the time block.timestamp of the latest block, and then use the current time to subtract Go to the start time startAt and divide it by 6 (because the price is reduced every 6 minutes), so as to obtain the timeElapsed of how many times the price should be reduced, and then multiply the number of price reductions by the price reduction amount to calculate the total price discount, and finally subtract the price reduction amount from the starting price startingPrice Get the current fees that should be paid. The parameters related to the amount mentioned in the code just now are not pre-written in the contract, but variables that can be modified, indicating that the project party has left a back door for itself and can modify the amount at any time according to the situation to better wield the sickle .



How to get the price is clear, let's look at the user's bid What happened in the process, this part of the code is too long, so I won’t post all of it, and I will pick the important ones.


First obtain the current price mentioned above, then multiply it by the amount purchased by the user to get the total price that should be paid, and then judge the actual price paid by the user Whether the price value is greater than the total price, if it is greater, it means that the money is enough and then execute downward.



Here first defines what a bid bid contains, They are the address of the bidder bidder, the price specific quotation, bidsPlaced the total purchase quantity, and finalProcess the refund status, 0 is refunded, 1 is refunded, and 2 is canceled refund.



Then the first buried pit: totalBids Indicates the number of NFTs that are currently being auctioned. The default is 0. Every time a user quotes, the amount that the user wants to buy will be added. Remember this, it will be used later.



Then buried the second pit: using a called The parameter of bidIndex is used to store the number of users who generated the quotation. Remember these two parameters, totalBids stores how many NFTs are sold in total, and bidIndex stores how many people bought NFTs in total.



Let’s talk about the project’s process of refunding users. The project party must first click a button called processRefunds to start the refund. The logic behind this button is to cycle through all bidding users once. The number of cycles is the bidIndex that stores the number of bidders just mentioned. The content of the processing is to first judge whether the refund status of the user's finalProcess is 0. 0 means that no refund has been made. If it is 0, continue to execute downwards. Subtract the lowest transaction price from the user's quotation at that time, and then multiply it by the purchase quantity, which is equal to The price difference refund to be refunded to the user.


Then set the finalProcess user refund from 0 to 1, indicating that the refund has been completed, so the user can no longer refund.


The parameter refundProgress is to record the number of people who have completed the refund. Every time a user is refunded, it will add 1, because it is cycled according to the bidIndex of the number of bidders, so refundProgress and bidIndex It is consistent, there is actually no problem here, the person who originally bid and the person who refunded should be the same, but! Then look down!



What is the logic of the project party's withdrawal, and What loophole makes it impossible to withdraw money?


The figure below shows the withdrawal function of the project party, that is, when the project party clicks the claimProjectFunds button, the money can be mentioned in its own wallet. There are three layers of verification here , the first layer is to verify whether the current auction is over. If it is over, enter the second layer to check whether the number of refunds is greater than the number of bidders. Withdrawal, but there is a problem with the verification at this level. I don’t know if you still remember what totalBids means? It is the number of NFTs sold, not the number of quotes!



You will ask what happened to this? One person can buy multiple NFTs when quoting. The number of refunds is actually the number of buyers. You require the number of buyers to exceed the number of NFTs sold, but each person can buy more than one, so as long as one person buys it 2 means that the number of buyers can never be greater than the number of sellers, 10 people sold 11, why do you require 10 to be greater than 11?


Let’s go to etherscan to see that the number of refundProgess is 3699, indicating that there are 3699 bids in total, but the number of totalBids is 5495, that is, a total of 5495 were sold. Far more than 3699, refundProgess cannot be greater than totalBids in this life, and the 200 million will be locked in the contract forever for future generations to observe.



< br>

So the project side wrote the wrong word. It should have written the number of bidIndex purchases, but it turned out to be the number of totalBids sold. A word is worth 200 million, which should be the most expensive in the world One word, please remember this word totalBids for me, it is worth 200 million!


Through this article, I took you to learn a new mint method and its principle, and also introduced you to a 200 million word totalBids .


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

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit