KittyCoin
0x556f6d981eeb12454691e6ba6e1e2e1d5b9f6ba7
Verification
Verified
v0.8.28+commit.7893614a
Type
Contract
2,763 bytes
ABI entries
30
11 read · 6 write
License
none
Contract information
- Address
- 0x556f6d981eeb12454691e6ba6e1e2e1d5b9f6ba7
- Chain
- Robinhood Chain (4663)
- Compiler
- v0.8.28+commit.7893614a
- Optimization
- Enabled
- Creator
- 0xB5FDDFbcc6…0416b475CC
- Creation tx
- 0x31f60e4ab6…9d674559d0
Token
- Name
- KittyCoin
- Symbol
- KITTY
- Decimals
- 18
- Holders
- 769
- Market
- View token page →
Read contract (11)
DOMAIN_SEPARATOR() → bytes32
MAX_SUPPLY() → uint256
allowance(address, address) → uint256
amtBurned() → uint256
balanceOf(address) → uint256
decimals() → uint8
main() → address
name() → string
nonces(address) → uint256
symbol() → string
totalSupply() → uint256
Events (2)
ApprovalTransfer
ABI
[
{
"inputs": [
{
"internalType": "address",
"name": "_main",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "AllowanceOverflow",
"type": "error"
},
{
"inputs": [],
"name": "AllowanceUnderflow",
"type": "error"
},
{
"inputs": [],
"name": "CapExceeded",
"type": "error"
},
{
"inputs": [],
"name": "InsufficientAllowance",
"type": "error"
},
{
"inputs": [],
"name": "InsufficientBalance",
"type": "error"
},
{
"inputs": [],
"name": "InvalidPermit",
"type": "error"
},
{
"inputs": [],
"name": "NotMain",
"type": "error"
},
{
"inputs": [],
"name": "Permit2AllowanceIsFixedAtInfinity",
"type": "error"
},
{
"inputs": [],
"name": "PermitExpired",
"type": "error"
},
{
"inputs": [],
"name": "TotalSupplyOverflow",
"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": "amount",
"type": "uint256"
}
],
"name": "Approval",
"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": "amount",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"inputs": [],
"name": "DOMAIN_SEPARATOR",
"outputs": [
{
"internalType": "bytes32",
"name": "result",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MAX_SUPPLY",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"internalType": "uint256",
"name": "result",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "amtBurned",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "result",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "burn",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint8",
"name": "",
"type": "uint8"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "main",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amt",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "nonces",
"outputs": [
{
"internalType": "uint256",
"name": "result",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
},
{
"internalType": "address",
"name": "spender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
},
{
"internalType": "uint8",
"name": "v",
"type": "uint8"
},
{
"internalType": "bytes32",
"name": "r",
"type": "bytes32"
},
{
"internalType": "bytes32",
"name": "s",
"type": "bytes32"
}
],
"name": "permit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "symbol",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"internalType": "uint256",
"name": "result",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "to",
"type": "address"
},
{
"internalType": "uint256",
"name": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]Source code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import {ERC20} from "solady/tokens/ERC20.sol";
import {Errors} from "./libraries/Errors.sol";
/**
* @title KittyCoin
* @notice The mining reward ERC-20 for the KittyMining game.
*
* @dev EDIT (whole file): the live OGcoin ERC-20 source is NOT present in this repo —
* only its interface (MainV2/src/interfaces/IOGcoin.sol) is. This contract is
* therefore INFERRED from that interface plus how MainV2 uses it:
* - mint(to, amt): called only by the game (MainV2._mint enforces the cap as
* amtBurned + totalSupply + amount <= MAX_SUPPLY before calling mint).
* - burn(value): the game burns from its own balance after purchases.
* - amtBurned(): cumulative burned amount, read by the game's cap check.
* Per spec, mint AND burn are restricted to the game contract, and the token
* additionally enforces the 100M hard cap itself (defense in depth — the game's
* cap check in KittyMining._mint remains the primary check, copied verbatim
* from MainV2).
*/
contract KittyCoin is ERC20 {
/// @dev maximum supply: burned + circulating can never exceed this
uint256 public constant MAX_SUPPLY = 100_000_000e18;
/// @dev The KittyMining game contract; sole minter/burner. Named `main` to match
/// the Miners NFT reference naming.
address public immutable main;
/// @dev Cumulative amount burned (burned tokens free no cap room).
uint256 public amtBurned;
error CapExceeded();
constructor(address _main) {
main = _main;
}
function name() public pure override returns (string memory) {
return "KittyCoin";
}
function symbol() public pure override returns (string memory) {
return "KITTY";
}
/// @dev 18 decimals (solady ERC20 default), stated explicitly for clarity.
function decimals() public pure override returns (uint8) {
return 18;
}
/**
* @notice Mint rewards. Only callable by the game contract.
* @dev Enforces burned + supply + amount <= MAX_SUPPLY, mirroring MainV2._mint.
*/
function mint(address to, uint256 amt) external {
require(msg.sender == main, Errors.NotMain());
require(amtBurned + totalSupply() + amt <= MAX_SUPPLY, CapExceeded());
_mint(to, amt);
}
/**
* @notice Burn tokens from the caller's balance. Only callable by the game contract.
*/
function burn(uint256 value) external {
require(msg.sender == main, Errors.NotMain());
amtBurned += value;
_burn(msg.sender, value);
}
}
Chain explorer6020msChain node82ms