Everything you need to know
Holy crap Mouse. What’s all this?
These are the contracts, Joe. All the money flows via these so everything is secure.
Contracts. So I’m finally at the table to discuss my pay?
Afraid not, Joe. This is where all wagers, sponsors and weekly prize pools are stored. Open to see here for anyone to verify.
Of course, Mouse. Everyone paid here except Joe. Sounds about right.
You are paid in joy and self fulfilment, Joe. More than any man needs.
Wen lambo Mouse. Wen lambo.
// 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;
}
}