HeadToken
0x094be5fd7e80c1e7460c4a0c3692a1ebc2c06a87
Verification
Verified
v0.8.35+commit.47b9dedd
Type
Contract
4,470 bytes
ABI entries
27
9 read · 6 write
License
none
Contract information
- Address
- 0x094be5fd7e80c1e7460c4a0c3692a1ebc2c06a87
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.35+commit.47b9dedd
- Optimization
- Disabled
- Creator
- 0x9644d865a8…C4f8FC5ceA
- Creation tx
- 0x1627a50c75…ce70c00730
Token
- Name
- Terminal Heads
- Symbol
- HEAD
- Decimals
- 18
- Holders
- 22
- Market
- View token page →
Read contract (9)
MAX_SUPPLY() → uint256
allowance(address, address) → uint256
balanceOf(address) → uint256
decimals() → uint8
minter() → address
name() → string
owner() → address
symbol() → string
totalSupply() → uint256
Events (4)
ApprovalMinterSetOwnershipTransferredTransfer
ABI
[
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "CapExceeded",
"type": "error"
},
{
"inputs": [],
"name": "InsufficientAllowance",
"type": "error"
},
{
"inputs": [],
"name": "InsufficientBalance",
"type": "error"
},
{
"inputs": [],
"name": "MinterAlreadySet",
"type": "error"
},
{
"inputs": [],
"name": "NotMinter",
"type": "error"
},
{
"inputs": [],
"name": "NotOwner",
"type": "error"
},
{
"inputs": [],
"name": "ZeroAddress",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "minter",
"type": "address"
}
],
"name": "MinterSet",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "MAX_SUPPLY",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "v",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "minter",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "m",
"type": "address"
}
],
"name": "setMinter",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "v",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "from",
"type": "address"
},
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "v",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title $HEAD — the Terminal Heads token
/// @notice Fixed supply, no presale, no team allocation. The only way $HEAD is
/// ever created is by minting an NFT: 1 NFT mints exactly 1,000 $HEAD.
/// 10,000 NFTs x 1,000 = 10,000,000, which is the hard cap.
contract HeadToken {
string public constant name = "Terminal Heads";
string public constant symbol = "HEAD";
uint8 public constant decimals = 18;
/// @dev Enforced in mint(); nothing can push supply past this.
uint256 public constant MAX_SUPPLY = 10_000_000e18;
uint256 public totalSupply;
address public owner;
/// @notice The NFT contract. Settable exactly once, then frozen forever.
address public minter;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event MinterSet(address indexed minter);
event OwnershipTransferred(address indexed from, address indexed to);
error NotOwner();
error NotMinter();
error MinterAlreadySet();
error CapExceeded();
error ZeroAddress();
error InsufficientBalance();
error InsufficientAllowance();
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwner();
_;
}
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
/// @notice Wire in the NFT contract. One shot — it can never be repointed,
/// so no future owner can mint $HEAD from somewhere else.
function setMinter(address m) external onlyOwner {
if (minter != address(0)) revert MinterAlreadySet();
if (m == address(0)) revert ZeroAddress();
minter = m;
emit MinterSet(m);
}
function mint(address to, uint256 amount) external {
if (msg.sender != minter) revert NotMinter();
if (to == address(0)) revert ZeroAddress();
if (totalSupply + amount > MAX_SUPPLY) revert CapExceeded();
totalSupply += amount;
unchecked {
balanceOf[to] += amount;
}
emit Transfer(address(0), to, amount);
}
function transfer(address to, uint256 v) external returns (bool) {
return _transfer(msg.sender, to, v);
}
function approve(address spender, uint256 v) external returns (bool) {
allowance[msg.sender][spender] = v;
emit Approval(msg.sender, spender, v);
return true;
}
function transferFrom(address from, address to, uint256 v) external returns (bool) {
uint256 a = allowance[from][msg.sender];
if (a != type(uint256).max) {
if (a < v) revert InsufficientAllowance();
unchecked {
allowance[from][msg.sender] = a - v;
}
}
return _transfer(from, to, v);
}
function transferOwnership(address to) external onlyOwner {
if (to == address(0)) revert ZeroAddress();
emit OwnershipTransferred(owner, to);
owner = to;
}
function _transfer(address from, address to, uint256 v) internal returns (bool) {
if (to == address(0)) revert ZeroAddress();
uint256 b = balanceOf[from];
if (b < v) revert InsufficientBalance();
unchecked {
balanceOf[from] = b - v;
balanceOf[to] += v;
}
emit Transfer(from, to, v);
return true;
}
}
Chain explorer2408msChain node70ms