Jack Allan Kasbeer.

← All posts

GUD & EVOL 3x

· solidity, ethereum, nft, game design, merkle

LOGIK's illustration: an angel and a red devil playing tug of war with a yellow character's stretched-out lips
The question behind every version: which side pulls harder?

Last Friday, GUD and EVOL went live as two open editions, presented by Audio Galleries with Studio LOGIK and TIMEPieces. Seventy-two hours later, 232 GUDs and 208 EVOLs had been minted. LOGIK talked through the art in his OpenSea interview; this post is about the engineering.

What you could mint last week is the third design we built under that name. GUD (an angel with a halo) and EVOL (a demon with horns, and “love” spelled backwards) have been LOGIK’s characters for almost a year. In that time the project has been a game, a collaboration with TIME, and finally a drop. Each version kept some ideas from the one before and dropped others.

v1 · November 2022: the Game of GUD & EVOL

The first version was the most ambitious: an evolving collection based on life decisions. Our one-line pitch:

Your NFT will cycle between the influences of an angel named GUD and a demon named EVOL.

The NFT is a soul. Its history is a run of pivotal moments, each tipping it toward G or E, and between cycles it passes through states of enlightenment, from a dark first state to a grey one to a gold, third-eyed one. Souls that reach the top can trade themselves for a Grail, a piece from a strictly limited supply. Or they can give in to EVOL and gamble their progress for an immediate shot at one.

LOGIK's game diagram: a row of G and E tiles, each a pivotal moment, broken up by three faces for the states of enlightenment: dark, grey, and gold with a third eye.
LOGIK's mechanic diagram. The credits on the site read: world by LOGIK, system and code by me, game mechanics by both of us.

The architecture borrowed from what I’d done for Kim Rose’s Ocean Series: keep the contract small and let an API do the interpretation. My notes at the top of the draft contract read:

/*
  The contract is aware of two things: (1) which address owns which token,
  and (2) how many times each token has visited every address that it's
  seen... the API does everything else
*/
// token id --> address (wallet) --> number of times received
mapping(uint256 => mapping(address => uint8)) private _lifeHacks;
// make sure purgatory transfers don't affect this number on accident
mapping(uint256 => bool) private _tokensInPurgatory;

The second mapping was the interesting rule. Each wallet could only touch a given token a fixed number of times (we were leaning toward five), and we called those touches life hacks. Flipping a soul back and forth between wallets would burn through them. Purgatory was a state the game itself could put a token into, and moves in and out of it weren’t supposed to count against anyone.

v1 never left the draft. The contract file is still in the repo, commented out from top to bottom. But two of its ideas survived: you pick a side, and the game keeps score off to one side of the art.

v2 · January–March 2023: GUD & EVOL x TIME

In January, TIMEPieces, TIME’s web3 program, released The Seven Collection with Deepak Chopra for the 25th anniversary of The Seven Spiritual Laws of Success: 73 artists each reimagined the book’s cover. LOGIK’s cover puts GUD and EVOL on either side of a third-eyed figure weighing a decision, each making their case.

LOGIK's cover for The Seven Spiritual Laws of Success, TIME 25th anniversary NFT edition: a bald yellow figure with a third eye, hand on chin, with GUD the angel on one side and EVOL the red devil on the other.
LOGIK's cover for The Seven Collection, issued as 14 tokens. Each artist's cover ran as an edition.

That cover became the brief for the second version, GUD TIME and EVOL TIME:

GUD TIME
EVOL TIME

The game shrank, but its bookkeeping stayed. The new contract (TimePieces.sol) was a regular mint with one decision, bool good, plus four ways in, each rewarding a different community:

Flow: allowlist and public minters mint one token of their chosen side; TIMEPieces x LOGIK holders, and Plug holders who also own one, mint two (their side and the other); every path adds game tokens to an on-chain ledger, and Plug holders get two to four more depending on their juice level.
*+1 for allowlist and public mints. The ledger only records who is owed what; no game tokens exist yet.
  • Allowlist. A Merkle proof against a single root covering the communities of every artist involved. One 32-byte value on-chain instead of thousands of addresses.
  • TIMEPieces x LOGIK holders mint both sides for the price of one. The contract checks ownerOf for each of the 14 token IDs of LOGIK’s cover, a list short enough to loop over on-chain.
  • Plug holders get a discount that scales with how many Plugs they hold, plus game tokens based on their juice level.
  • Public, once the private window closed.

The Plug discount is one line of integer math. With n Plugs (capped at six), you pay 5 / (n + 4) of the price: full price for one Plug, half price for six or more, with a smooth curve in between.

modifier enoughEther(address to, uint256 amount) {
    uint256 plugBalance = plugNft.balanceOf(to);
    if (plugBalance > 0 && !isPublic) {
        plugBalance = plugBalance > 6 ? 6 : plugBalance;
        if (msg.value < ((5 * purchasePrice) / (plugBalance + 4)))
            revert InsufficientFunds();
    } else {
        if (amount < purchasePrice) revert InsufficientFunds();
    }
    _;
}

The game tokens are v1 surviving in miniature. Every mint adds to _additionalTokens[wallet], a ledger of GUD and EVOL game tokens each minter would be owed once the game launched: +1 for a regular mint, +2 for TIMEPieces holders, and +2, +3 or +4 for Plug holders depending on how far their juice meter had climbed. Like the Sugoi keys, it read the level from The Plug’s tokenURI, but this time it matched every level, sorted into three groups, so no holder could fall through the cracks the way a few could at Sugoi. It was a way to write down loyalty before the thing it would pay out in existed.

Two smaller touches:

  • Only EVOL can be burned. burn() reverts with "only EVOL tokens can be burned" if you try it on a GUD. You can destroy evil, but not good.
  • The hi-res files were token-gated. The mint page let holders download full-resolution GUD and EVOL art for a profile picture or a print. It was the first version of what would become the fashion drop.

v2 got as far as the Goerli testnet and a finished mint page. Then the plan changed again.

v3 · October 2023: GUD and EVOL by LOGIK

The version that shipped is the simplest one. Audio Galleries ran it as two open editions on their own contracts: one for GUD, one for EVOL, open to anyone for 72 hours, with 30 of each reserved for LOGIK, TIMEPieces and the Audio Galleries vault. There’s no on-chain game and no ledger. Your only decision is which one to mint.

Look at what came through from the earlier versions, though:

Idea v1 v2 v3
Pick a side The soul drifts between both bool good at mint Mint GUD or EVOL
The Plug as a key Planned Discount + game tokens Airdrop for Plug holders who minted
Token-gated extras Grails for enlightened souls Hi-res downloads Limited-edition fashion
TIMEPieces – Holders mint both sides Partner on the drop

Picking a side survived every rewrite because it’s the one mechanic that needs no explanation. The Plug keeps working as a membership card: holders who minted GUD or EVOL before the October 17 snapshot get an extra airdropped piece, two years after The Plug launched. And token gating moved out of the browser and into a closet: GUD and EVOL holders can buy fashion pieces printed with Japanese idioms LOGIK chose for each character. GUD’s is 知らぬが仏 (“ignorance is bliss”), and EVOL’s is 鬼の目にも涙 (“even a demon cries”).

I don’t count v1 and v2 as wasted work. Building them is how we learned which parts of the idea were the art and which were machinery. The machinery can still come back: a ledger of who picked which side, and how loyal they’ve been, is exactly the input a game would need.

Contracts

Artwork © LOGIK.