Speedrun #1 - Breaking The Habit

It all started with this tweet from my friend trying to quit cigarettes. He put the tweet out there as public attestation that he wanted to quit smoking. I’m not sure if it was the lack of oxygen from my flight to Boston the night before, but an idea was born: what if we could use blockchain to help us stop our bad habits?

Speedrun Part 1

I didn’t have time to dive into the concept too much that Friday evening, as I had just flown into Boston for the weekend to visit a friend from college and we were out on the town getting craft beer at Sam Adams. Saturday morning was a different story.

I’m an early riser, so I got up at 7am or so and couldn’t shake this idea. So, I got to work on it. I only had about 2 hours to spend on the initial development, so I was able to setup the contract layout, primary functionality, and left testing for later.

Speedrun Part Two

I had to leave the contract as is until my flight back to Denver on Sunday morning. I was actually quite looking forward to working on the flight back, as it makes the 5 hour flight go much quicker!

On the flight, I just had a few edits to make to the on-chain SVG generation and wrote the tests. Nothing too bad, but I was able to finish working out all the kinks and deploy to testnet!

I think the people sitting next to me thought I was hacking the plane or something 😂

Contract Details

On-chain art? ✅ The metadata + SVG is generated on-chain

Generative aspects?
✅ The background of each image is based on bad habit and current owner

Permissionless?
✅ Anyone can mint and there is no cost!

What more could you ask for?

How it works

Each NFT has an associated bad habit, set at mint by the minter. With this comes a “streak” of how many days you have been successful in quitting the bad habit. It’s up to each user to determine if they’ve had a successful day because it can look very different for different people. Going cold turkey isn’t the only option for quitting something.

In order to continue your streak, you have to interact with the NFT every 16-36 hours. The idea is that this requirement for an interaction will keep you accountable each day. With this comes some level of known gamification, as you could just keep the streak but not actually make any progress on quitting the bad habit. There’s not much I can do to get around this issue, but as this NFT has no financial benefits, it’s completely pointless for anyone to gamify it in this way.

If you break your streak, you can start again! In addition, if the NFT is transferred, the streaks reset.

Deployment

The contract is deployed to the Base network, an L2 by Coinbase aimed at scaling Ethereum. This was chosen so that it was cheap to interact with daily, plus, the contract is, as the they say, based (maybe).

Contract address: 0x4B980e7804838d0db83f673BcAAa764DdfA28108

How to mint

  1. Go to basescan.org/address/0x4B980e7804838d0db83f673BcAAa764DdfA28108#writeContract

  2. Connect your wallet

  3. Navigate to the function called mint

  4. Enter in the habit you want to break, ideally as a 2-4 word string

  5. Enter in your wallet address

  6. Hit “write” and complete the transaction

How to interact

In order to keep your streak up, you need to interact with the NFT every 16 to 36 hours. You can follow these steps to interact with your NFT daily and ensure that you keep on breaking your bad habit!

  1. Go to basescan.org/address/0x4B980e7804838d0db83f673BcAAa764DdfA28108#writeContract

  2. Connect your wallet

  3. Navigate to the function called breakTheHabit

  4. Enter in your token id

  5. Hit “write” and complete the transaction

  6. You can now refresh the token metadata on OpenSea and see that your current streak has incremented by one!

Future Ideas

I would love to work on building this contract + interactions into a frame. I think it’d be super nice to interact with this daily from farcaster, but I may need some help building this out, so if you’re interested, hit me up!

Subscribe to Marco
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.