The Merge or: How I Learned to Stop Worrying and Love the Liquid Splits

For 14+ years Song a Day Mann has been releasing a song, every single day (5,000+ days). He’s written a bunch of songs about the Merge (when Ethereum transitioned from PoW ➡️ PoS). This past month, I had the pleasure of working together with Jonathan to create an 12-song album to celebrate the merge, one of the biggest events in the life of Ethereum. This article is a reflection on my experience, what we set out to achieve, what went well & lessons learned along the way.

Introduction

a dm from abram 📬

One day I opened Twitter to find a message from Abram, co-founder of the 0xSplits hyperstructure. It was a message to see if I was interested in hearing more about a special project. They were building a new technology called “Liquid Splits”. This sounded cool. I could build my first implementation of Liquid Splits while, at the same time, partnering on a music nft for the merge. I was instantly sold. Abram connected me to Jonathan. We hopped on a call and started building together.

The Genesis

Building

liquid splits to reward nft holders

Liquid Splits is a new tool only possible with blockchain technology. It was first introduced by the 0xSplits team in Headless Chaos, a headless band of 77 artists.

https://twitter.com/0xSplits/status/1532735333607022592?s=20&t=L7fErwGHsfJcf5XWOTZZGA

I was able to learn a lot about the original implementation from the article by 0xSplits (found here). With Headless Chaos, the Liquid Split was deeply connected with the Headless Chaos smart contracts.

My goal was to create a standalone, modular, implementation of Liquid Splits. So any musician could use liquid splits in existing music nft platforms like Catalog, Zora, Sound, etc. So, with the help of Will from 0xSplits (MAJOR help btw), we published the Liquid Split module on ThirdWeb. It’s a no-code tool to publish the Liquid Split contract for you to use 100% free & preserves your ✨creator sovereignty✨.

  1. Pick what chain you want your liquid split on.

    1. Ethereum / Polygon / Optimism / Arbitrum / Binance / etc.

  2. Enter the nft contract address that will control the Liquid Split.

  3. Enter the [tokenIds] who’s holders will be recipients on the split.

https://thirdweb.com/sweetman.eth/LiquidSplit

1 token = 12 songs

Jonathan Mann took the lead on how we would represent 12 songs in 1 token. He explored Music Players similar to Outsider Collective where the animation URL is an HTML page hosted on IPFS. He also looked at a more dynamic approach similar to ChillPill’s The Decentralized Living Album On The Blockchain. Jonathan wrote up a great thread while we were making this album.

https://twitter.com/songadaymann/status/1568741813829369856?s=20&t=Kxnd0j5mbbSahWfwBmEXlQ

pricing changes at the merge

At first, this didn’t seem possible. Then I was confident it was possible. Soon after I ran tests making me think it was computationally unfeasible. Then I found a simple way to make it work. Thanks to M1guel for the simple application of EIP-4399.

https://twitter.com/m1guelpf/status/1529107845089722374?s=20&t=Kxnd0j5mbbSahWfwBmEXlQ

backdoors = none

Non-upgradeable contracts with limited mechanisms to change the rules after the contract has been deployed. Once you learn the rules, you can trust they won’t change. The rules are simple, so it’s easy for anyone to play. We built a simple system to ensure our art lives for at least as long as Ethereum does. preserved in quality as the creator intended.

Paolo Soleri's "hyperstructure" in ground-level view. The figure to the right is the Empire State Building at the same scale.

The Sale

2 days before

We used bordels calculation of TTD to determine when the sale would start. We predicted 2 days out from the merge and shipped the contract onto Ethereum mainnet.

2**64

As mentioned earlier, a solidity contract can check whether the transaction is being executed on proof-of-work or proof-of-stake by checking whether block.difficulty > 2**64 if true the merge has happened (EIP4399). I created a method called _activatePostMerge to update the price & publicSaleEnd time once the merge occured. Automatic contract changes based on the merge. This was a first for me.

Drop.sol:

2 days after

The contract automatically set the sale end time in the function (above). Nobody on the team knew when the sale would end. It all happened with rules enforced onchain.

Post-Merge

Withdrawals: where everything went wrong

5.6 ETH is stuck in the contract. I can’t call the withdraw function. It’s failing, even if I increase the gas-limit. Did I just mess everything up?

Transfer has a native gas-limit of 2,300.

Gnosis safe is a proxy contract that requires more than 2,300 gas to receive ETH. Otherwise, you get an out of gas error. This is an issue, because I used transfer, which has a limit of 2,300.

out of gas error

EIP2929 has a mechanism called access lists which seemed like a potential solution.

https://mobile.twitter.com/gakonst/status/1367418971117477888

I built a simple app so Jonathan Mann could use EIP2929 to withdraw with one click. Things were looking up. Metamask pops up, no warnings of failure. I didn’t execute the transaction, because I like seeing the number get bigger in the Merge Contract balance. But, I trusted everything would be fine.

I was wrong. It didn’t work. I spent another 24-48 hours in high-stress wondering if I got 5.6 ETH stuck in a contract. The metaphor “pulling my hair out” could not have felt more literal.

Then I looked back at this tiny, forum post by the Gnosis Safe team.

Why can't I transfer ETH from a contract into a Safe?

I started typing a message to Jonathan Mann, wondering if he could use the Song A Day DAO multi-sig to execute the withdrawal transaction. That’s when I had another idea:

Create a new contract that warms up the Gnosis Safe and withdraws the Merge.

UNBLOCK: a contract I wrote on ThirdWeb

So I wrote up a contract to test my theory. Shipped it straight to Ethereum mainnet. No unit tests. No testnet deployments. I’m at the end of my options so this has got to work.

The transaction goes through. 5.6 ETH in funds are distributed successfully. The liquid split is updated with new nft holder recipients. Everyone is paid. Mission success. 🥳✨

Statistics

Takeaways

  1. Never use transfer to move ETH in solidity.

    1. if (1 address): always use call to account for gas uncertainties.

    2. if (2+ addresses): always use 0xSplits toolkit. No need to recreate the wheel. Top-tier tech is available for free. No need to recreate the wheel. Start here:

  2. Unit Tests - essential for shipments on Ethereum Mainnet.

    1. I prefer Forge: test solidity code with solidity tests.

      1. used by Zora & 0xSplits.

    2. You can also use Hardhat.

  3. This project was successful.

    1. A+ execution from the team.

    2. Slight hiccups & learning opportunities for me to apply in future projects.

Great work to everyone involved. I’m proud to be working with some of the most intelligent people & teams in the world. Thank you to the 0xSplits team, Song A Day Mann, Song a Day DAO, Austin, Alan, Zev, Superphiz, the Ethereum Core Devs and everyone else who was a part of bringing The Merge Album to life. This project is very special to me. ✨🐼✨

Loading...
highlight
Collect this post to permanently own it.
sweetman logo
Subscribe to sweetman and never miss a post.