$MooKee: A decentralized token on the Base Chain, combining Bitcoin-inspired simplicity with innovative minting mechanics.
$MooKee is a fun and experimental Base Chain token. It encourages natural mining with no pools or staking. $MooKee is about learning, community, and enjoying blockchain innovation.
The $MooKee token is an experimental blockchain project with no intrinsic value. It is not intended as an investment and serves as a fun token on the Base Chain.
$MooKee is a decentralized blockchain token inspired by Bitcoin, built on the Base Chain. It emphasizes learning, fair distribution, and community-driven engagement. Unlike traditional tokens, $MooKee focuses on mining mechanics with no staking or pool mechanisms, ensuring an equitable experience for all participants.
Objective: Participate in a decentralized mining race on Base Chain.
Rules: Mint tokens directly using your wallet and pay gas fees. To ensure fairness, each wallet has a cooldown period between mints.
$MooKee is more than a token; it’s a step into decentralized innovation and blockchain education. Participants contribute to a transparent tokenomics system and engage in a fun, community-focused blockchain project.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
/**
* @title MooKee Token ($MooKee)
* @notice A decentralized, Bitcoin-inspired token deployed on Base Chain.
* Designed for educational purposes with no intrinsic value.
* Learn more at: https://mookee.xyz
*
* Features:
* - Maximum supply of 21,000,000 tokens with 2 decimals.
* - Initial block reward of 50 tokens, halving every 210,000 blocks.
* - Public minting with per-address cooldown enforced.
*/
contract MooKee is ReentrancyGuard {
using SafeMath for uint256;
// Token properties
string private constant TOKEN_NAME = "MooKee";
string private constant TOKEN_SYMBOL = "$MOOKEE";
uint8 private constant TOKEN_DECIMALS = 2; // Standard decimals (2 places for tokens)
uint256 public constant MAX_SUPPLY = 21_000_000 * 10 ** TOKEN_DECIMALS; // 21M tokens, adjusted for decimals
uint256 private constant INITIAL_BLOCK_REWARD = 50 * 10 ** TOKEN_DECIMALS; // 50 tokens per block, adjusted for decimals
uint256 private constant HALVING_INTERVAL = 210_000; // Number of blocks per halving
uint256 private constant COOLDOWN_BLOCKS = 2100; // Minimum blocks between mints for the same address
// State variables
uint256 private _currentSupply;
uint256 private _blockReward;
uint256 private _blockCount;
mapping(address => uint256) private _balances;
mapping(address => uint256) private _lastMintedBlock;
mapping(address => mapping(address => uint256)) private _allowances;
// Events
event Minted(address indexed to, uint256 value, uint256 timestamp);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor() {
uint256 preMine = 1_000_000 * 10 ** TOKEN_DECIMALS;
_balances[msg.sender] = preMine;
_currentSupply = preMine;
_blockReward = INITIAL_BLOCK_REWARD;
emit Transfer(address(0), msg.sender, preMine);
}
function name() external pure returns (string memory) {
return TOKEN_NAME;
}
function symbol() external pure returns (string memory) {
return TOKEN_SYMBOL;
}
function decimals() external pure returns (uint8) {
return TOKEN_DECIMALS;
}
function mint() external nonReentrant {
uint256 supply = _currentSupply;
uint256 reward = _blockReward;
require(supply < MAX_SUPPLY, "Total supply cap reached");
require(reward > 0, "Minting phase has ended");
require(block.number >= _lastMintedBlock[msg.sender] + COOLDOWN_BLOCKS, "Cooldown active.");
if (supply + reward > MAX_SUPPLY) {
reward = MAX_SUPPLY.sub(supply);
}
_balances[msg.sender] += reward;
_currentSupply += reward;
_blockCount++;
_lastMintedBlock[msg.sender] = block.number;
if (_blockCount % HALVING_INTERVAL == 0) {
_blockReward = _blockReward / 2;
}
emit Minted(msg.sender, reward, block.timestamp);
emit Transfer(address(0), msg.sender, reward);
}
function transfer(address to, uint256 amount) external nonReentrant returns (bool) {
require(to != address(0), "Invalid recipient address");
require(_balances[msg.sender] >= amount, "Insufficient balance");
_balances[msg.sender] -= amount;
_balances[to] += amount;
emit Transfer(msg.sender, to, amount);
return true;
}
function approve(address spender, uint256 amount) external nonReentrant returns (bool) {
require(spender != address(0), "Invalid spender address");
_allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
function transferFrom(address from, address to, uint256 amount) public nonReentrant returns (bool) {
require(to != address(0), "Invalid recipient address");
require(_balances[from] >= amount, "Insufficient balance");
require(_allowances[from][msg.sender] >= amount, "Allowance exceeded");
_balances[from] -= amount;
_balances[to] += amount;
_allowances[from][msg.sender] -= amount;
emit Transfer(from, to, amount);
return true;
}
function balanceOf(address account) external view returns (uint256) {
return _balances[account];
}
function totalSupply() external pure returns (uint256) {
return MAX_SUPPLY;
}
function currentBlockReward() external view returns (uint256) {
return _blockReward;
}
function remainingSupply() external view returns (uint256) {
return MAX_SUPPLY.sub(_currentSupply);
}
}