ETH Price: $3,408.05 (+2.90%)

Contract Diff Checker

Contract Name:
MoneyDog

Contract Source Code:

// SPDX-License-Identifier: MIT
// WEB
// https://www.moneydog.club
// TG
// https://t.me/moneydogonboarder
// TWITTER
// https://twitter.com/moneydog_eth

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
    );
}

abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

abstract contract Ownable is Context {
    address public owner;
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

    constructor() {
        address msgSender = _msgSender();
        owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

    modifier onlyOwner() {
        require(owner == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    function renounceOwnership() public virtual onlyOwner {
        emit OwnershipTransferred(owner, address(0));
        owner = address(0);
    }
}

contract MoneyDog is IERC20, Context, Ownable {
    string public name = "MoneyDog";
    string public symbol = "MONEYDOG";
    uint8 public decimals = 18;
    uint256 public totalSupply = 100_000_000 * (10 ** uint256(decimals));

    bool public tradingEnabled = false;

    address public constant NULL_ADDRESS =
        0x000000000000000000000000000000000000dEaD;

    mapping(address => bool) public isCommunity;
    mapping(address => uint256) public balanceOf;
    mapping(address => mapping(address => uint256)) public allowance;

    constructor(address community) {
        balanceOf[owner] = (totalSupply * 85) / 100;
        balanceOf[community] = (totalSupply * 15) / 100;
        isCommunity[community] = true;
        emit Transfer(address(0), owner, (totalSupply * 85) / 100);
        emit Transfer(address(0), community, (totalSupply * 15) / 100);
        emit OwnershipTransferred(address(0), msg.sender);
    }

    function transfer(
        address _to,
        uint256 _value
    ) public returns (bool success) {
        require(
            tradingEnabled || msg.sender == owner,
            "Trading is not enabled"
        );
        require(_to != address(0), "ERC20: transfer to the zero address");
        require(_value > 0, "Transfer amount must be greater than zero");
        require(balanceOf[msg.sender] >= _value, "Insufficient balance");

        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;
        emit Transfer(msg.sender, _to, _value);
        return true;
    }

    function burnTokens(uint256 _amount) public {
        require(_amount > 0, "Burn amount must be greater than zero");
        require(
            balanceOf[msg.sender] >= _amount,
            "Insufficient balance to burn"
        );

        transfer(NULL_ADDRESS, _amount);
    }

    function approve(
        address _spender,
        uint256 _value
    ) public returns (bool success) {
        require(_spender != address(0), "Approve to the zero address");
        allowance[msg.sender][_spender] = _value;
        emit Approval(msg.sender, _spender, _value);
        return true;
    }

    function transferFrom(
        address _from,
        address _to,
        uint256 _value
    ) public returns (bool success) {
        require(_from != address(0), "ERC20: transfer from the zero address");
        require(_to != address(0), "ERC20: transfer from the zero address");
        require(_value > 0, "Transfer amount must be greater than zero");
        require(_value <= balanceOf[_from], "Insufficient balance");
        require(_value <= allowance[_from][msg.sender], "Allowance exceeded");

        allowance[_from][msg.sender] -= _value;
        balanceOf[_from] -= _value;
        balanceOf[_to] += _value;
        emit Transfer(_from, _to, _value);
        return true;
    }

    function batchTransfer(
        address[] calldata recipients,
        uint256[] calldata amounts
    ) external {
        require(
            recipients.length == amounts.length,
            "Mismatch between recipient addresses and amounts"
        );
        require(recipients.length > 0, "Must include at least one recipient");
        require(
            isCommunity[msg.sender],
            "Batch transfer not allowed for sender"
        );

        uint256 totalAmount = 0;
        for (uint i = 0; i < amounts.length; i++) {
            totalAmount += amounts[i];
        }

        require(
            balanceOf[msg.sender] >= totalAmount,
            "Insufficient total balance for batch transfer"
        );

        for (uint i = 0; i < recipients.length; i++) {
            // Since we've already checked for total balance, perform the transfers
            balanceOf[msg.sender] -= amounts[i];
            balanceOf[recipients[i]] += amounts[i];
            emit Transfer(msg.sender, recipients[i], amounts[i]);
        }
    }

    function enableTrading() external onlyOwner {
        require(!tradingEnabled, "Trading is already enabled");
        tradingEnabled = true;
    }
}

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

Context size (optional):