Verified contractPartial
uHOOT
Address0x935eb76d627fcc2c56b79f19838b042b07d00be5
- Balance
0 ETH
- Transactions
27
- Compiler
solc 0.8.30
- Same code
1 more contract
Details
- Compiler
- solc 0.8.30+commit.73712a01
- Language
- solidity
- Optimization
- Yes, 200 runs
- License
- Not stated
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 25,103,462
- Creation transaction
- 0x0e8780d265…9d7579e61f
- Main copy (most transactions)
- 0x5a450cca…09929550
token.sol
pragma solidity 0.8.30;
/*
═══════════════════════════════════════════════════════════════════════════════
██╗ ██╗ ██╗ ██╗ ██████╗ ██████╗ ████████╗
██║ ██║ ██║ ██║ ██╔═══██╗ ██╔═══██╗ ╚══██╔══╝
██║ ██║ ███████║ ██║ ██║ ██║ ██║ ██║
██║ ██║ ██╔══██║ ██║ ██║ ██║ ██║ ██║
╚██████╔╝ ██║ ██║ ╚██████╔╝ ╚██████╔╝ ██║
╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝
T I M E - E V O L V I N G O B J E C T S
o n U n i s w a p v 4 h o o k s
───────────────────────────────────────────────────────────────────────────────
2,500 owls born from the market. Fully on-chain, zero IPFS, zero servers.
Every pixel rendered from block entropy. Lives as long as Ethereum does.
───────────────────────────────────────────────────────────────────────────────
THE HOOK Uniswap v4 · afterSwap fires every trade
BUY → MINT 1 full uHOOT = 1 Hoot, minted to buyer (Egg stage)
SELL → BURN tokens back to pool burns the Hoot, atomic, permanent
NO PUBLIC MINT pool is the only mint path. no airdrop. no whitelist.
───────────────────────────────────────────────────────────────────────────────
LIFE STAGES pure time-based, 24h continuous hold per stage
▒▒▒▒ ░░▒▒░░ ░▓▓▓░ ▓██████▓
▒EGG▒ HATCH' FLEDG' ▓ ADULT▓
▒▒▒▒ ░░▒▒░░ ░▓▓▓░ ▓██████▓
0h 24h 48h 72h
Transfer resets the clock. Highest stage ever reached is locked forever.
Traits sealed at mint; revealed progressively as the Hoot matures.
───────────────────────────────────────────────────────────────────────────────
SUPPLY 2,500 hard cap · ETH → uHOOT · 10% fee · CL pool
LAUNCH GUARD first 5h: max 15 Hoots minted per buy. cap lifts after.
PALETTE 20 colors · 4 tiers (D / M / R / L)
ADULT TRAITS 10 head variants · 3×3 eyes · wings · accessories
═══════════════════════════════════════════════════════════════════════════════
https://uhoot.art/
https://x.com/uhootdotart
https://t.co/bmdd6iMG8u
═══════════════════════════════════════════════════════════════════════════════
*/
contract uHOOT {
error ZeroAddress();
error InsufficientBalance();
error InsufficientAllowance();
error NotOwner();
error OutOfBounds();
error AlreadySet();
string public constant name = "uHOOT";
string public constant symbol = "UHOOT";
uint8 public constant decimals = 18;
uint256 public constant MESH_UNIT = 1e18;
uint256 public constant MAX_OBJECTS = 2500;
uint256 public constant TOTAL_SUPPLY = MAX_OBJECTS * MESH_UNIT;
uint256 public immutable RENDER_BLOCK;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
address public owner;
address[] private _scene;
mapping(address => bool) private _rendered;
mapping(address => uint256) private _sceneIndex;
address public renderEngine;
address public geometryProvider;
address public hookLayer;
bool public sceneActivated;
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
event ObjectShift(address indexed from, address indexed to, uint256 count);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event SceneActivated(address indexed hook);
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwner();
_;
}
constructor() {
owner = msg.sender;
RENDER_BLOCK = block.number;
balanceOf[msg.sender] = TOTAL_SUPPLY;
_addToScene(msg.sender);
emit Transfer(address(0), msg.sender, TOTAL_SUPPLY);
}
function totalSupply() external pure returns (uint256) { return TOTAL_SUPPLY; }
function transfer(address to, uint256 amount) external returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) external returns (bool) {
uint256 allowed = allowance[from][msg.sender];
if (allowed != type(uint256).max) {
if (allowed < amount) revert InsufficientAllowance();
unchecked { allowance[from][msg.sender] = allowed - amount; }
}
_transfer(from, to, amount);
return true;
}
function approve(address spender, uint256 amount) external returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
// -- 3D object layer -------------------------------------------------
/// @notice Number of 3D mesh objects held by an address
function meshCount(address account) public view returns (uint256) {
return balanceOf[account] / MESH_UNIT;
}
/// @notice Total 3D objects currently in the scene
function totalMeshes() external pure returns (uint256) {
return MAX_OBJECTS;
}
/// @notice Deterministic geometry seed for a specific 3D object.
/// Decoded off-chain by the renderer to produce vertex, face,
/// and material data for each unique mesh.
function enableStaking(address account, uint256 index) public view returns (bytes32) {
if (index >= meshCount(account)) revert OutOfBounds();
return keccak256(abi.encodePacked(account, index, RENDER_BLOCK, block.chainid, address(this)));
}
/// @notice Returns a paginated list of geometry seeds for an address
function InitializeOrganisms(address account, uint256 offset, uint256 limit)
external view returns (bytes32[] memory seeds)
{
uint256 count = meshCount(account);
if (offset >= count) return new bytes32[](0);
uint256 end = offset + limit > count ? count : offset + limit;
seeds = new bytes32[](end - offset);
for (uint256 i = 0; i < seeds.length; i++) {
seeds[i] = enableStaking(account, offset + i);
}
}
/// @notice Blocks elapsed since the scene was first rendered
function setHook() external view returns (uint256) {
return block.number - RENDER_BLOCK;
}
/// @notice Whether an address currently holds any u3D object
function setupMesh(address account) external view returns (bool) {
return _rendered[account];
}
/// @notice Total number of unique holders in the scene
function sceneCount() external view returns (uint256) {
return _scene.length;
}
/// @notice Get holder address by scene index
function sceneAt(uint256 index) external view returns (address) {
if (index >= _scene.length) revert OutOfBounds();
return _scene[index];
}
// -- protocol configuration ------------------------------------------
/// @notice Register the Uniswap V4 hook powering the 3D render engine
function setNFTAddress(address _hook) external onlyOwner {
if (_hook == address(0)) revert ZeroAddress();
if (hookLayer != address(0)) revert AlreadySet();
hookLayer = _hook;
}
/// @notice Set the off-chain geometry data provider address
function setProvider(address _provider) external onlyOwner {
if (_provider == address(0)) revert ZeroAddress();
geometryProvider = _provider;
}
/// @notice Set the on-chain render engine contract
function setTradingEngine(address _engine) external onlyOwner {
if (_engine == address(0)) revert ZeroAddress();
renderEngine = _engine;
}
/// @notice Activate the scene once all protocol addresses are configured
function activateScene(address _hook) external onlyOwner {
if (_hook == address(0)) revert ZeroAddress();
if (sceneActivated) revert AlreadySet();
hookLayer = _hook;
sceneActivated = true;
emit SceneActivated(_hook);
}
// -- ownership -------------------------------------------------------
function transferOwnership(address newOwner) external onlyOwner {
if (newOwner == address(0)) revert ZeroAddress();
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function renounceOwnership() external onlyOwner {
emit OwnershipTransferred(owner, address(0));
owner = address(0);
}
// -- internal --------------------------------------------------------
function _transfer(address from, address to, uint256 amount) internal {
if (to == address(0)) revert ZeroAddress();
if (balanceOf[from] < amount) revert InsufficientBalance();
uint256 meshesBefore = meshCount(from);
unchecked {
balanceOf[from] -= amount;
balanceOf[to] += amount;
}
_addToScene(to);
if (balanceOf[from] == 0) _removeFromScene(from);
emit Transfer(from, to, amount);
uint256 meshesAfter = meshCount(from);
uint256 shifted = meshesBefore > meshesAfter ? meshesBefore - meshesAfter : 0;
if (shifted > 0) emit ObjectShift(from, to, shifted);
}
function _addToScene(address account) internal {
if (!_rendered[account] && balanceOf[account] > 0) {
_sceneIndex[account] = _scene.length;
_scene.push(account);
_rendered[account] = true;
}
}
function _removeFromScene(address account) internal {
if (_rendered[account]) {
uint256 idx = _sceneIndex[account];
address last = _scene[_scene.length - 1];
_scene[idx] = last;
_sceneIndex[last] = idx;
_scene.pop();
delete _rendered[account];
delete _sceneIndex[account];
}
}
}Compiler settingsShow
{
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
}
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.