Staking Without the Stake: Engineering LOGIK's The Plug
· updated · solidity, ethereum, nft, staking, community
The Plug went live on Ethereum today. It’s the first project I’ve built with LOGIK, and the idea behind it is simple enough to fit in one sentence: the longer you hold it, the more it gives back.
This post follows the token’s own eight levels, from the first day in your wallet to the last. Each one covers a piece of how it works.
1% · Fly on the Wall: the idea
In LOGIK’s words, “A Plug is a connector.” It’s the person who gets you the hard-to-find ticket, the introduction, the room you couldn’t get into on your own. LOGIK has been that person for a lot of people: he left St. Louis for Chicago, came up through the city’s underground art scene as a fly on the wall, and rose to creative director in corporate America. With this NFT, LOGIK becomes The Plug to whoever holds it.
Most NFT launches reward speed: mint early, flip fast. We wanted the opposite incentive. A Plug earns its holder more the longer it stays in one wallet: invitations to events, studio and gallery visits, physical merch, and airdrops from other artists LOGIK works with. The collection itself is a bet on the long game, too. Its roadmap ties sales milestones to LOGIK going full-time as an artist, donations to the Chiba Center (his Japanese language school for the Black and Brown creative community) and the Marcus Graham Project, turning his Chicago studio into a gallery for artists of color, and sending a Chiba Center student to Japan.
I’m the engineer: I wrote the contract and the site at getjuice.today.
17% · Dream Chaser: the rules
Every Plug carries a juice meter. It starts at 1% and gains a charge every 60 days the token stays with the same owner. Each charge swaps the artwork for the next rank in LOGIK’s own story:
Two rules make it a commitment rather than a collectible:
- Sell it or move it, and the meter drops back to 1%. The next owner starts their own climb. (Airdrops you already received stay yours.)
- Reach The Alchemist and it’s locked. After about 18 months a Plug never loses its juice again, even when it changes hands. An Alchemist passes its full charge to whoever collects it next.
33% · Mover & Shaker: counting days on-chain
The whole mechanic rests on one number per token: when it last changed hands. The contract calls it a birthday.
//@dev How we keep track of how many days a person has held a Plug
mapping(uint256 => uint) internal _birthdays; // tokenId -> timestamp
function countDaysPassed(uint256 tokenId) public view returns (uint256) {
return (block.timestamp - _birthdays[tokenId]) / 1 days;
}
A birthday is set at mint, and again on every transfer, which is where the reset comes from. OpenZeppelin’s ERC-721 runs a hook before any token moves, whether it’s a sale, a gift or a move between wallets, so there’s exactly one place to enforce the rule:
function _beforeTokenTransfer(address from, address to, uint256 tokenId)
internal virtual override
{
// Alchemists (557+ days) keep their birthday forever
if (_exists(tokenId) && countDaysPassed(tokenId) < 557) {
_setBirthday(tokenId); // back to day 0
}
emit PlugTransferred(from, to);
}
Then tokenURI turns days into a level. Every level is a separate metadata file on IPFS, so the contract only has to pick which one to point at. Condensed (the deployed contract spells this out as an if/else ladder):
uint16[8] THRESHOLDS = [0, 60, 120, 180, 240, 300, 360, 557]; // days
function _tokenHash(uint256 tokenId) internal view returns (string memory) {
uint256 daysPassed = countDaysPassed(tokenId);
uint8 level = 0;
while (level < 7 && daysPassed >= THRESHOLDS[level + 1]) level++;
return _cityHashes(tokenId)[level]; // see below
}
Nothing is written when a Plug levels up. The level is worked out fresh every time a wallet or marketplace asks for it, so juice accrues at no cost to anyone.
50% · Hustler: three cities, one contract
LOGIK’s story runs through two cities, and so does the collection. Every Plug belongs to one of three editions, decided entirely by its token number:
if (tokenId <= 176) return chiHashes; // Chicago: Plugs #1–176
else if (tokenId % 88 == 0) return stlHashes; // St. Louis: #264, #352 … #880
else return normHashes; // Nomad: everyone else
That works out to 176 Chicago Plugs, 8 St. Louis Plugs and 704 Nomads, each with its own eight-level set of art. It costs no extra storage and needs no randomness: the edition is a pure function of the ID.
67% · Innovator: staking without the stake
What we’ve built is a form of staking, but without the parts that make staking a chore. In most NFT staking setups you send your token into a vault contract: it leaves your wallet, it disappears from your profile, you pay gas going in and out, and you trust a second contract with your asset. The Plug skips all of that:
- Nothing moves. The Plug stays in your wallet and on your profile the whole time.
- Nothing to sign. There’s no stake or unstake transaction, and no gas to accrue juice.
- The commitment is the asset itself. Selling is the “unstake,” and the penalty is built into the transfer rule rather than a separate lock-up.
- The reward is visible. A Plug’s level is public in its artwork, so a long-time holder is recognizable anywhere the NFT is shown.
83% · The Connect: from juice to perks
The perks happen off-chain: events, merch, visits and airdrops. The contract’s job is to make it trivial to answer “who qualifies?” Two read-only functions turn the chain into a guest list:
//@dev List the owners for a certain level. We'll need this for airdrops and benefits
function listPlugOwnersForHash(string memory assetHash)
public view returns (address[] memory)
{
address[] memory levelOwners = new address[](MAX_NUM_TOKENS);
uint16 counter;
for (uint16 tokenId = 1; tokenId <= _tokenIds.current(); tokenId++) {
if (_stringsEqual(_tokenHash(tokenId), assetHash)) {
levelOwners[counter++] = ownerOf(tokenId);
}
}
return levelOwners;
}
listPlugOwnersForType does the same by city. Both are view functions, so calling them is free. Any artist who wants to reward LOGIK’s most committed collectors can pull “every Hustler and above” or “every Chicago holder” in one call, with no spreadsheet and nobody to trust.
95% · Sensei: what I’m watching
A few trade-offs we chose with our eyes open:
- Marketplaces cache metadata. The level is computed live, but a marketplace may show an old one until it refreshes the token. Wallets that read
tokenURIdirectly always see the current level. - Every transfer resets the meter, including your own. Moving a Plug to your own hardware wallet counts as a transfer. Pick the wallet you’ll hold in before you start the climb.
- The guest-list functions scan the whole collection. Looping over 888 tokens and comparing strings is fine for a free read, but it would be far too expensive inside a transaction. They’re meant to be called, not built on.
- The art can be updated. Admins can replace a level’s IPFS hash (
updateHash), which lets us fix or upgrade artwork. That’s flexibility, and it’s also trust: the rules for juice are fixed in code, but the pictures aren’t.
100% · The Alchemist: locked in
The last level is the reason to stay. At 557 days, roughly a year and a half, a Plug becomes The Alchemist, and the transfer hook stops resetting it. From then on it keeps its full charge no matter who owns it. Short-term holders get nothing special; patient ones end up holding something permanently different from everyone else’s.
That’s the whole contract: a birthday per token, a hook that resets it, a ladder of eight levels, and two functions that turn loyalty into a list. Everything else, from the events to the drops to the connections, is LOGIK being The Plug.
Update, June 2022
- All 888 Plugs sold out within two hours of the public mint.
- The first roadmap milestone came true. LOGIK left his creative director role at Google this spring to work full-time as an artist.
- Juice got people through a real door. For Sugoi, LOGIK’s three-day art and music festival in DUMBO, Brooklyn during NFT NYC (June 21–23), I built a ticket contract that reads The Plug directly. Every holder could claim up to five RSVP keys (more for bigger holders) so they could bring friends, and holders who had reached Hustler, the highest level anyone could have reached when the contract went live, got the rarest key. The new contract checks the level by asking The Plug which artwork a holder’s token currently points to:
string memory uri = thePlug.tokenURI(plugTid);
if (_stringsEqual(uri, _hustlers[0]) ||
_stringsEqual(uri, _hustlers[1]) ||
_stringsEqual(uri, _hustlers[2]))
_tokens[currentIdx] = _hashes[2]; // Alpha Key for Hustlers
else
_tokens[currentIdx] = _hashes[1]; // Golden Key for every other holder
- The idea is catching on. In April, Moonbirds launched with “nesting”: holders keep the NFT in their wallet, and the longer they don’t list or sell it, the higher their level and the better their rewards. It’s the same core idea The Plug shipped six months earlier, built here directly into the token’s transfer logic.
Contract
- The Plug:
0x2Bb501A0374ff3Af41f2009509E9D6a36D56A6c0· OpenSea
Artwork © LOGIK.