The Ether Rock project was launched on the Ethereum blockchain in December of 2017. It is one of the oldest and most famous NFT collections on Ethereum. Some rocks even sold for millions of dollars in 2021.
Despite the popularity of the project, confusion surrounds its origin story. Most in the NFT community know that there are 100 rocks, numbered 0 through 99. But did you know that a bug in the original contract led to complications in the rollout and the deployment of a second contract?
The Problem and the Fix
In the flawed contract, every rock was automatically on sale at all times. An owner did not have the option to take their rock off the market. Further, rocks beyond number 99 could be purchased, thus uncapping the supply.
Before the flaw was discovered in the first contract, rocks 0 through 10 were created. Upon discovering the problem, the creators quickly coded a new contract. In writing the new contract, they needed to address the fact that 11 rocks already existed and were owned by various addresses. They decided to hard code the states of those 11 rocks into the new contract and start where the broken one left off.
Their fix was essentially a fork, which created doubles of rocks 0 through 10. The ones in the old contract were abandoned, and all activity moved to the new contract.
The flawed contract was rediscovered years later, and thousands more rocks were created through it. Wrapper contracts were used to circumvent the always-for-sale bug and allow for trading on NFT marketplaces. However, rocks 0 through 10 were never separated out and given the special treatment that they deserved. I decided to remedy that.
For those of you who happen to hold one of the aforementioned rocks, here are instructions for wrapping and unwrapping.
First, make absolutely sure that your rock is one of 0 through 10 in the flawed version of the Ether Rock contract. If you try to wrap something else, it will go into a black hole and be lost forever.
Let’s assume you hold rock i in address A.
Step 1: In the wrapper contract, call CreateDropBox() to generate an address to drop your rock into. The drop box address is associated with the address holding the rock, and it can be reused in the future to wrap more rocks from that address.
Step 2: Look up your drop box address by calling dropBoxes(A) in the wrapper contract. Let’s call this address D.
Step 3: In the original contract, call giftRock(i, D) to send rock i to your drop box address.
Step 4: In the wrapper contract, call Wrap(i) to move the rock from the drop box to the address of the wrapper contract and receive a corresponding token.
To unwrap token i, simply call Unwrap(i) in the wrapper contract. This causes the token to be burned, and the corresponding rock will be transferred from the wrapper address to your address.
A Word of Warning
As usual, I tried my best to write a flawless wrapper contract, but I can provide no guarantees. Dealing with old projects and wrappers is for advanced users only. Proceed at your own risk!