Contract Source Code:
File 1 of 1 : CatBox
// SPDX-License-Identifier: MIT
/**
<Bot 4>
Executing meme_in_the_shell...
/\_/\
=( o.o )=
> ^ <
/ CAT \
| BOX |
\_______/
CATBOX ACTIVATED!
-------------------
CATBOX is not just a meme coin; it's a gateway to an NFT-powered future!
Inspired by creativity and community, CATBOX combines the charm of memes
with the innovation of NFTs, creating a unique and engaging ecosystem.
Whether you're a collector, a trader, or just here for the fun,
**CATBOX offers something for everyone!**
https://x.com/CatBoxTokenXYZ
https://t.me/catbox_tokenzyz
https://catboxtoken.xyz/
*/
pragma solidity ^0.8.0;
contract CatBox {
// Token details
string public name = "CatBox";
string public symbol = "CBOX";
uint8 public decimals = 9;
uint256 public totalSupply;
// Contract owner details
address public owner;
uint256 public feePercent = 0; // 0% fee by default
bool public isRenounced = false;
// Mappings
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
// Events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event FeeChanged(uint256 newFeePercent);
event OwnershipRenounced();
// Modifier to restrict certain functions to the owner
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can perform this action");
_;
}
// Constructor: Initialize the contract and mint tokens to the owner
constructor() {
owner = msg.sender;
totalSupply = 100_000_000 * 10**decimals; // 100M tokens with 9 decimals
balanceOf[owner] = totalSupply; // Mint all tokens to the owner
emit Transfer(address(0), owner, totalSupply); // Emit transfer event
}
// Transfer function
function transfer(address to, uint256 amount) public returns (bool) {
_transfer(msg.sender, to, amount);
return true;
}
// Approve function
function approve(address spender, uint256 amount) public returns (bool) {
allowance[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
// TransferFrom function
function transferFrom(address from, address to, uint256 amount) public returns (bool) {
require(allowance[from][msg.sender] >= amount, "Allowance exceeded");
allowance[from][msg.sender] -= amount;
_transfer(from, to, amount);
return true;
}
// Internal transfer function with fee logic
function _transfer(address from, address to, uint256 amount) internal {
require(to != address(0), "Cannot transfer to zero address");
require(balanceOf[from] >= amount, "Insufficient balance");
uint256 fee = (amount * feePercent) / 100; // Calculate fee
uint256 amountAfterFee = amount - fee;
balanceOf[from] -= amount; // Deduct from sender
balanceOf[to] += amountAfterFee; // Add to receiver
if (fee > 0) {
balanceOf[owner] += fee; // Fee goes to the owner
emit Transfer(from, owner, fee); // Emit transfer event for fee
}
emit Transfer(from, to, amountAfterFee); // Emit transfer event
}
// Function to set the transaction fee percentage
function setFeePercent(uint256 newFeePercent) public onlyOwner {
require(newFeePercent <= 100, "Fee cannot exceed 100%");
feePercent = newFeePercent;
emit FeeChanged(newFeePercent);
}
// Function to renounce ownership
function renounceOwnership() public onlyOwner {
isRenounced = true;
owner = address(0);
emit OwnershipRenounced();
}
}