PrizesShop

Everything you need to know

The Rulebook

The contractsRobinhood · chain 4663
ROGAN
ROGAN

Holy crap Mouse. What’s all this?

MOUSE
MOUSE

These are the contracts, Joe. All the money flows via these so everything is secure.

ROGAN
ROGAN

Contracts. So I’m finally at the table to discuss my pay?

MOUSE
MOUSE

Afraid not, Joe. This is where all wagers, sponsors and weekly prize pools are stored. Open to see here for anyone to verify.

ROGAN
ROGAN

Of course, Mouse. Everyone paid here except Joe. Sounds about right.

MOUSE
MOUSE

You are paid in joy and self fulfilment, Joe. More than any man needs.

ROGAN
ROGAN

Wen lambo Mouse. Wen lambo.

UHC entry0x01bb94291a64D335…585beC51The escrow. Holds every wager, every sponsor's pot, and the weekly.
Hood lookup0x5Cdf17058AA10D2D…87A0a6b5Ours. Asks HoodOS where a hoodie's wallet is, and who holds it.
$OCH0x8bdd5adff8a9d083…605af983The token. OnChainHoodies deployed it, not us.
OnChainHoodies0x9ec6c5b9f572a9b0…da735f45The collection. Not ours.
HoodOS0x1993c5515E81d276…f4e4beB9Where a hoodie's own wallet is found. Not ours.
// SPDX-License-Identifier: MIT
//
//            ████████              ██████████
//            ██████                  ████████
//            ████                    ████████
//            ████                      ██████
//            ██          ██████████      ████
//            ██        ██████████████    ████
//            ██      ██  ██  ██  ██      ████
//            ██      ████  ██████  ██    ████
//            ██        ██████████████    ████
//            ██          ██████  ████    ████
//            ████          ████████      ████
//            ████              ████      ████
//            ████          ██            ████
//            ████          ██████        ████
//            ██████          ██          ████
//            ████                ██      ████
//            ████                        ████
//
//                 ██  ██  ██  ██  ██████
//                 ██  ██  ██  ██  ██
//                 ██  ██  ██████  ██
//                 ██  ██  ██  ██  ██
//                 ██████  ██  ██  ██████
//
// ────────────────────────────────────────────────────────
//
// MOUSE  Welcome to the little black book of UHC fighters. Here we look up the canonical HoodWallet
//        For a hoodie. One job, asked of HoodOS, so no address in a payout can ever come from us or from whoever is calling.
// JOE    And how does that one know where my money lives?
// MOUSE  It asks HoodOS, Joe. The same contract OnChainHoodies built.
// JOE    Not the website?
// MOUSE  Never the website. If the site could name the address, breaking into the site
//        would be worth the whole escrow.
// JOE    I never activated mine.
// MOUSE  You still have an address. It has been yours since you were minted. The money
//        will sit in it until you do.
//
pragma solidity 0.8.28;

import {IHoodWallets} from "./UHCEntry.sol";

/**
 * JOE    Why take the whole thing when you want one field of it?
 * MOUSE  Because if I wrote out a shorter version of theirs, Joe, and they ever changed
 *        the order, it would still compile and start reading the wrong number.
 */
interface IHoodOS {
    struct HoodInfo {
        uint256 tokenId;
        address owner;
        address wallet;
        bool walletDeployed;
        bool active;
        address activationOwner;
        uint64 activatedAt;
        uint256 walletState;
        uint256 nativeBalance;
        uint256 paymentTokenBalance;
    }

    function hoodInfo(uint256 tokenId) external view returns (HoodInfo memory);
}

/**
 * JOE    So this is the bit that knows where my winnings land.
 * MOUSE  It is. And it asks OnChainHoodies, Joe — never the website, never whoever is
 *        calling. If the site could name the address, breaking into the site would be
 *        worth the entire escrow.
 * JOE    Mine is not activated.
 * MOUSE  Does not matter. You have had an address since you were minted; this hands it
 *        over either way and the money waits for you.
 * JOE    And if I sell?
 * MOUSE  Then whoever buys you gets it. That is rather the point of a hoodie owning its
 *        own winnings.
 */
contract HoodOSWallets is IHoodWallets {
    IHoodOS public immutable HOOD_OS;

    error ZeroAddress();

    constructor(IHoodOS hoodOS) {
        if (address(hoodOS) == address(0)) revert ZeroAddress();
        HOOD_OS = hoodOS;
    }

    /**
     * JOE    What if it comes back with nothing?
     * MOUSE  Then the escrow refuses to pay, Joe. Better a claim that will not go through
     *        than one that goes nowhere.
     */
    function walletOf(uint256 tokenId) external view returns (address) {
        return HOOD_OS.hoodInfo(tokenId).wallet;
    }

    /**
     * JOE    And who owns one?
     * MOUSE  Same book, Joe. The free card asks before it lets anybody claim a hoodie's
     *        place, because a seat that costs nothing is a seat somebody will take for
     *        the sake of it.
     */
    function ownerOf(uint256 tokenId) external view returns (address) {
        return HOOD_OS.hoodInfo(tokenId).owner;
    }

    /**
     * JOE    And this one?
     * MOUSE  For the website, and for anybody checking a payout after the fact.
     */
    function isActive(uint256 tokenId) external view returns (bool) {
        return HOOD_OS.hoodInfo(tokenId).active;
    }
}