APE Price: $1.14 (+2.80%)

Contract Diff Checker

Contract Name:
BANANA

Contract Source Code:

File 1 of 1 : BANANA

// SPDX-License-Identifier: Unlicense
//https://t.me/bananaonape
//https://x.com/bananaonape
                                 
// | |                                  
// | |__   __ _ _ __   __ _ _ __   __ _ 
// | '_ \ / _` | '_ \ / _` | '_ \ / _` |
// | |_) | (_| | | | | (_| | | | | (_| |
// |_.__/ \__,_|_| |_|\__,_|_| |_|\__,_|
                                     

pragma solidity ^0.8.26;

contract BANANA {
    mapping(address => uint) public balances;
    mapping(address => mapping(address => uint)) public allowance;
    uint public totalSupply = 6904200001 * 10 ** 18;
    string public name = "Banana";
    string public symbol = "BANANA";
    uint public decimals = 18;
    address public owner;
    
    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
    
    modifier onlyOwner() {
        require(msg.sender == owner, "Not the owner");
        _;
    }
    
    constructor() {
        balances[msg.sender] = totalSupply;
        owner = msg.sender;
    }
    
    function balanceOf(address _owner) public view returns(uint) {
        return balances[_owner];
    }
    
    function transfer(address _to, uint _value) public returns(bool) {
        require(balanceOf(msg.sender) >= _value, 'balance too low');
        balances[_to] += _value;
        balances[msg.sender] -= _value;
        emit Transfer(msg.sender, _to, _value);
        return true;
    }
    
    function transferFrom(address _from, address _to, uint _value) public returns(bool) {
        require(balanceOf(_from) >= _value, 'balance too low');
        require(allowance[_from][msg.sender] >= _value, 'allowance too low');
        balances[_to] += _value;
        balances[_from] -= _value;
        emit Transfer(_from, _to, _value);
        return true;   
    }
    
    function approve(address _spender, uint _value) public returns (bool) {
        allowance[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;   
    }
    
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(owner, address(0));
        owner = address(0);
    }

    // Mint function to create new tokens
    function mint(address _to, uint _amount) public onlyOwner {
        require(_to != address(0), "Cannot mint to the zero address");
        totalSupply += _amount;
        balances[_to] += _amount;
        emit Transfer(address(0), _to, _amount);
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):