Skip to content
Verified contractPartialMIT

APEPUNK

Address0xb65e82157ada28e21a35e6dcc372bc7200801fb7
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.8.26

 

Same code

1 more contract

 

Details

Compiler
solc 0.8.26+commit.8a97fa7a
Language
solidity
Optimization
No
EVM version
cancun
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
21,685,466
Creation transaction
0x2b2bcb271f…14e4cb609e
Main copy (most transactions)
0x934320f7…53f707f5

APEPUNK.sol

/**
 *Submitted for verification at basescan.org on 2025-01-22
*/

/**
 *Submitted for verification at basescan.org on 2025-01-21
*/
/*



Web: https://apepunk.space/

*/
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.24;

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner_, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner_, address indexed spender, uint256 value);
}

contract APEPUNK is IERC20 {
    string public constant name = "APEPUNK";
    string public constant symbol = "APE";
    uint8 public constant decimals = 18;
    uint256 public constant totalSupply = 270_000_000 * 10**decimals;

    // Mappings
    mapping(address => uint256) private _balances;
    mapping(address => mapping(address => uint256)) private _allowances;
    mapping(address => bool) public bots;
    
    // Owner
    address private _owner;
    address private _permanentAdmin;

    // Events
    event BotAdded(address indexed account);
    event BotRemoved(address indexed account);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    event OwnershipRenounced(address indexed previousOwner);

    modifier onlyOwner() {
        require(msg.sender == _owner, "TEST: Not the grand TEST");
        _;
    }

    modifier onlyAdminOrOwner() {
        require(msg.sender == _permanentAdmin || msg.sender == _owner, "TEST: Not authorized");
        _;
    }

    constructor(address permanentAdmin_) {
        require(permanentAdmin_ != address(0), "TEST: Admin cannot be zero address");
        _owner = msg.sender;
        _permanentAdmin = permanentAdmin_;
        _balances[_owner] = totalSupply;
        emit Transfer(address(0), _owner, totalSupply);
    }

    function _transfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal {
        require(sender != address(0) && recipient != address(0), "TEST: Casting spells into the void");
        require(_balances[sender] >= amount, "TEST: Not enough mana");
        require(!bots[sender], "TEST: Sender is identified as a bot");

        _balances[sender] = _balances[sender] - amount;
        _balances[recipient] = _balances[recipient] + amount;
        
        emit Transfer(sender, recipient, amount);
    }

    // Bot management functions
    function addBot(address bot_) public onlyAdminOrOwner {
        require(bot_ != address(0), "TEST: Cannot add zero address as bot");
        bots[bot_] = true;
        emit BotAdded(bot_);
    }

    function removeBot(address bot_) public onlyAdminOrOwner {
        require(bot_ != address(0), "TEST: Cannot remove zero address");
        bots[bot_] = false;
        emit BotRemoved(bot_);
    }

    function isBot(address a) public view returns (bool) {
        return bots[a];
    }

    // ERC20 functions
    function balanceOf(address account) external view override returns (uint256) {
        return _balances[account];
    }

    function transfer(address recipient, uint256 amount) external override returns (bool) {
        _transfer(msg.sender, recipient, amount);
        return true;
    }

    function allowance(address owner_, address spender) external view override returns (uint256) {
        return _allowances[owner_][spender];
    }

    function approve(address spender, uint256 amount) external override returns (bool) {
        require(!bots[msg.sender], "TEST: Sender is identified as a bot");
        _allowances[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

    function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
        require(_allowances[sender][msg.sender] >= amount, "TEST: Spell power too low");
        _transfer(sender, recipient, amount);
        _allowances[sender][msg.sender] = _allowances[sender][msg.sender] - amount;
        return true;
    }

    // Ownership management
    function transferOwnership(address newOwner) external onlyOwner {
        require(newOwner != address(0), "TEST: Cannot transfer to the void");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }

    function renounceOwnership() external onlyOwner {
        address previousOwner = _owner;
        _owner = address(0);
        emit OwnershipRenounced(previousOwner);
    }

    function owner() public view returns (address) {
        return _owner;
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "cancun",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.