ACAT

Description:

Multi-signature wallet contract requiring multiple confirmations for transaction execution.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "ADliq.sol": {
      "content": "/**\r
/*\r
 * SPDX-License-Identifier: MIT\r
\r
 * Join: https://t.me/Aliencat_ACAT\r
 */\r
\r
pragma solidity 0.8.19;\r
\r
library SafeMath {\r
    /**\r
     * @dev Returns the addition of two unsigned integers, with an overflow flag.\r
     *\r
     * _Available since v3.4._\r
     */\r
    function tryAdd(\r
        uint256 a,\r
        uint256 b\r
    ) internal pure returns (bool, uint256) {\r
        unchecked {\r
            uint256 c = a + b;\r
            if (c < a) return (false, 0);\r
            return (true, c);\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.\r
     *\r
     * _Available since v3.4._\r
     */\r
    function trySub(\r
        uint256 a,\r
        uint256 b\r
    ) internal pure returns (bool, uint256) {\r
        unchecked {\r
            if (b > a) return (false, 0);\r
            return (true, a - b);\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\r
     *\r
     * _Available since v3.4._\r
     */\r
    function tryMul(\r
        uint256 a,\r
        uint256 b\r
    ) internal pure returns (bool, uint256) {\r
        unchecked {\r
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\r
            // benefit is lost if 'b' is also tested.\r
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\r
            if (a == 0) return (true, 0);\r
            uint256 c = a * b;\r
            if (c / a != b) return (false, 0);\r
            return (true, c);\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the division of two unsigned integers, with a division by zero flag.\r
     *\r
     * _Available since v3.4._\r
     */\r
    function tryDiv(\r
        uint256 a,\r
        uint256 b\r
    ) internal pure returns (bool, uint256) {\r
        unchecked {\r
            if (b == 0) return (false, 0);\r
            return (true, a / b);\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\r
     *\r
     * _Available since v3.4._\r
     */\r
    function tryMod(\r
        uint256 a,\r
        uint256 b\r
    ) internal pure returns (bool, uint256) {\r
        unchecked {\r
            if (b == 0) return (false, 0);\r
            return (true, a % b);\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the addition of two unsigned integers, reverting on\r
     * overflow.\r
     *\r
     * Counterpart to Solidity's `+` operator.\r
     *\r
     * Requirements:\r
     *\r
     * - Addition cannot overflow.\r
     */\r
    function add(uint256 a, uint256 b) internal pure returns (uint256) {\r
        return a + b;\r
    }\r
\r
    /**\r
     * @dev Returns the subtraction of two unsigned integers, reverting on\r
     * overflow (when the result is negative).\r
     *\r
     * Counterpart to Solidity's `-` operator.\r
     *\r
     * Requirements:\r
     *\r
     * - Subtraction cannot overflow.\r
     */\r
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\r
        return a - b;\r
    }\r
\r
    /**\r
     * @dev Returns the multiplication of two unsigned integers, reverting on\r
     * overflow.\r
     *\r
     * Counterpart to Solidity's `*` operator.\r
     *\r
     * Requirements:\r
     *\r
     * - Multiplication cannot overflow.\r
     */\r
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\r
        return a * b;\r
    }\r
\r
    /**\r
     * @dev Returns the integer division of two unsigned integers, reverting on\r
     * division by zero. The result is rounded towards zero.\r
     *\r
     * Counterpart to Solidity's `/` operator.\r
     *\r
     * Requirements:\r
     *\r
     * - The divisor cannot be zero.\r
     */\r
    function div(uint256 a, uint256 b) internal pure returns (uint256) {\r
        return a / b;\r
    }\r
\r
    /**\r
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r
     * reverting when dividing by zero.\r
     *\r
     * Counterpart to Solidity's `%` operator. This function uses a `revert`\r
     * opcode (which leaves remaining gas untouched) while Solidity uses an\r
     * invalid opcode to revert (consuming all remaining gas).\r
     *\r
     * Requirements:\r
     *\r
     * - The divisor cannot be zero.\r
     */\r
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\r
        return a % b;\r
    }\r
\r
    /**\r
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\r
     * overflow (when the result is negative).\r
     *\r
     * CAUTION: This function is deprecated because it requires allocating memory for the error\r
     * message unnecessarily. For custom revert reasons use {trySub}.\r
     *\r
     * Counterpart to Solidity's `-` operator.\r
     *\r
     * Requirements:\r
     *\r
     * - Subtraction cannot overflow.\r
     */\r
    function sub(\r
        uint256 a,\r
        uint256 b,\r
        string memory errorMessage\r
    ) internal pure returns (uint256) {\r
        unchecked {\r
            require(b <= a, errorMessage);\r
            return a - b;\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\r
     * division by zero. The result is rounded towards zero.\r
     *\r
     * Counterpart to Solidity's `/` operator. Note: this function uses a\r
     * `revert` opcode (which leaves remaining gas untouched) while Solidity\r
     * uses an invalid opcode to revert (consuming all remaining gas).\r
     *\r
     * Requirements:\r
     *\r
     * - The divisor cannot be zero.\r
     */\r
    function div(\r
        uint256 a,\r
        uint256 b,\r
        string memory errorMessage\r
    ) internal pure returns (uint256) {\r
        unchecked {\r
            require(b > 0, errorMessage);\r
            return a / b;\r
        }\r
    }\r
\r
    /**\r
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\r
     * reverting with custom message when dividing by zero.\r
     *\r
     * CAUTION: This function is deprecated because it requires allocating memory for the error\r
     * message unnecessarily. For custom revert reasons use {tryMod}.\r
     *\r
     * Counterpart to Solidity's `%` operator. This function uses a `revert`\r
     * opcode (which leaves remaining gas untouched) while Solidity uses an\r
     * invalid opcode to revert (consuming all remaining gas).\r
     *\r
     * Requirements:\r
     *\r
     * - The divisor cannot be zero.\r
     */\r
    function mod(\r
        uint256 a,\r
        uint256 b,\r
        string memory errorMessage\r
    ) internal pure returns (uint256) {\r
        unchecked {\r
            require(b > 0, errorMessage);\r
            return a % b;\r
        }\r
    }\r
}\r
\r
interface IERC20 {\r
    /**\r
     * @dev Returns the amount of tokens in existence.\r
     */\r
    function totalSupply() external view returns (uint256);\r
\r
    /**\r
     * @dev Returns the amount of tokens owned by `account`.\r
     */\r
    function balanceOf(address account) external view returns (uint256);\r
\r
    /**\r
     * @dev Moves `amount` tokens from the caller's account to `recipient`.\r
     *\r
     * Returns a boolean value indicating whether the operation succeeded.\r
     *\r
     * Emits a {Transfer} event.\r
     */\r
    function transfer(\r
        address recipient,\r
        uint256 amount\r
    ) external returns (bool);\r
\r
    /**\r
     * @dev Returns the remaining number of tokens that `spender` will be\r
     * allowed to spend on behalf of `owner` through {transferFrom}. This is\r
     * zero by default.\r
     *\r
     * This value changes when {approve} or {transferFrom} are called.\r
     */\r
    function allowance(\r
        address owner,\r
        address spender\r
    ) external view returns (uint256);\r
\r
    /**\r
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\r
     *\r
     * Returns a boolean value indicating whether the operation succeeded.\r
     *\r
     * IMPORTANT: Beware that changing an allowance with this method brings the risk\r
     * that someone may use both the old and the new allowance by unfortunate\r
     * transaction ordering. One possible solution to mitigate this race\r
     * condition is to first reduce the spender's allowance to 0 and set the\r
     * desired value afterwards:\r
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r
     *\r
     * Emits an {Approval} event.\r
     */\r
    function approve(address spender, uint256 amount) external returns (bool);\r
\r
    /**\r
     * @dev Moves `amount` tokens from `sender` to `recipient` using the\r
     * allowance mechanism. `amount` is then deducted from the caller's\r
     * allowance.\r
     *\r
     * Returns a boolean value indicating whether the operation succeeded.\r
     *\r
     * Emits a {Transfer} event.\r
     */\r
    function transferFrom(\r
        address sender,\r
        address recipient,\r
        uint256 amount\r
    ) external returns (bool);\r
\r
    /**\r
     * @dev Emitted when `value` tokens are moved from one account (`from`) to\r
     * another (`to`).\r
     *\r
     * Note that `value` may be zero.\r
     */\r
    event Transfer(address indexed from, address indexed to, uint256 value);\r
\r
    /**\r
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r
     * a call to {approve}. `value` is the new allowance.\r
     */\r
    event Approval(\r
        address indexed owner,\r
        address indexed spender,\r
        uint256 value\r
    );\r
}\r
\r
interface IERC20Metadata is IERC20 {\r
    /**\r
     * @dev Returns the name of the token.\r
     */\r
    function name() external view returns (string memory);\r
\r
    /**\r
     * @dev Returns the symbol of the token.\r
     */\r
    function symbol() external view returns (string memory);\r
\r
    /**\r
     * @dev Returns the decimals places of the token.\r
     */\r
    function decimals() external view returns (uint8);\r
}\r
\r
abstract contract Context {\r
    function _msgSender() internal view virtual returns (address) {\r
        return msg.sender;\r
    }\r
\r
    function _msgData() internal view virtual returns (bytes calldata) {\r
        return msg.data;\r
    }\r
}\r
\r
contract ERC20 is Context, IERC20, IERC20Metadata {\r
    mapping(address => uint256) private _balances;\r
\r
    mapping(address => mapping(address => uint256)) private _allowances;\r
\r
    uint256 private _totalSupply;\r
\r
    string private _name;\r
    string private _symbol;\r
\r
    /**\r
     * @dev Sets the values for {name} and {symbol}.\r
     *\r
     * The default value of {decimals} is 18. To select a different value for\r
     * {decimals} you should overload it.\r
     *\r
     * All two of these values are immutable: they can only be set once during\r
     * construction.\r
     */\r
    constructor(string memory name_, string memory symbol_) {\r
        _name = name_;\r
        _symbol = symbol_;\r
    }\r
\r
    /**\r
     * @dev Returns the name of the token.\r
     */\r
    function name() public view virtual override returns (string memory) {\r
        return _name;\r
    }\r
\r
    /**\r
     * @dev Returns the symbol of the token, usually a shorter version of the\r
     * name.\r
     */\r
    function symbol() public view virtual override returns (string memory) {\r
        return _symbol;\r
    }\r
\r
    /**\r
     * @dev Returns the number of decimals used to get its user representation.\r
     * For example, if `decimals` equals `2`, a balance of `505` tokens should\r
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).\r
     *\r
     * Tokens usually opt for a value of 18, imitating the relationship between\r
     * Ether and Wei. This is the value {ERC20} uses, unless this function is\r
     * overridden;\r
     *\r
     * NOTE: This information is only used for _display_ purposes: it in\r
     * no way affects any of the arithmetic of the contract, including\r
     * {IERC20-balanceOf} and {IERC20-transfer}.\r
     */\r
    function decimals() public view virtual override returns (uint8) {\r
        return 18;\r
    }\r
\r
    /**\r
     * @dev See {IERC20-totalSupply}.\r
     */\r
    function totalSupply() public view virtual override returns (uint256) {\r
        return _totalSupply;\r
    }\r
\r
    /**\r
     * @dev See {IERC20-balanceOf}.\r
     */\r
    function balanceOf(\r
        address account\r
    ) public view virtual override returns (uint256) {\r
        return _balances[account];\r
    }\r
\r
    /**\r
     * @dev See {IERC20-transfer}.\r
     *\r
     * Requirements:\r
     *\r
     * - `recipient` cannot be the zero address.\r
     * - the caller must have a balance of at least `amount`.\r
     */\r
    function transfer(\r
        address recipient,\r
        uint256 amount\r
    ) public virtual override returns (bool) {\r
        _transfer(_msgSender(), recipient, amount);\r
        return true;\r
    }\r
\r
    /**\r
     * @dev See {IERC20-allowance}.\r
     */\r
    function allowance(\r
        address owner,\r
        address spender\r
    ) public view virtual override returns (uint256) {\r
        return _allowances[owner][spender];\r
    }\r
\r
    /**\r
     * @dev See {IERC20-approve}.\r
     *\r
     * Requirements:\r
     *\r
     * - `spender` cannot be the zero address.\r
     */\r
    function approve(\r
        address spender,\r
        uint256 amount\r
    ) public virtual override returns (bool) {\r
        _approve(_msgSender(), spender, amount);\r
        return true;\r
    }\r
\r
    /**\r
     * @dev See {IERC20-transferFrom}.\r
     *\r
     * Emits an {Approval} event indicating the upd allowance. This is not\r
     * required by the EIP. See the note at the beginning of {ERC20}.\r
     *\r
     * Requirements:\r
     *\r
     * - `sender` and `recipient` cannot be the zero address.\r
     * - `sender` must have a balance of at least `amount`.\r
     * - the caller must have allowance for ``sender``'s tokens of at least\r
     * `amount`.\r
     */\r
    function transferFrom(\r
        address sender,\r
        address recipient,\r
        uint256 amount\r
    ) public virtual override returns (bool) {\r
        _transfer(sender, recipient, amount);\r
\r
        uint256 currentAllowance = _allowances[sender][_msgSender()];\r
        require(\r
            currentAllowance >= amount,\r
            "ERC20: transfer amount exceeds allowance"\r
        );\r
        unchecked {\r
            _approve(sender, _msgSender(), currentAllowance - amount);\r
        }\r
\r
        return true;\r
    }\r
\r
    /**\r
     * @dev Atomically increases the allowance granted to `spender` by the caller.\r
     *\r
     * This is an alternative to {approve} that can be used as a mitigation for\r
     * problems described in {IERC20-approve}.\r
     *\r
     * Emits an {Approval} event indicating the upd allowance.\r
     *\r
     * Requirements:\r
     *\r
     * - `spender` cannot be the zero address.\r
     */\r
    function increaseAllowance(\r
        address spender,\r
        uint256 addedValue\r
    ) public virtual returns (bool) {\r
        _approve(\r
            _msgSender(),\r
            spender,\r
            _allowances[_msgSender()][spender] + addedValue\r
        );\r
        return true;\r
    }\r
\r
    /**\r
     * @dev Atomically decreases the allowance granted to `spender` by the caller.\r
     *\r
     * This is an alternative to {approve} that can be used as a mitigation for\r
     * problems described in {IERC20-approve}.\r
     *\r
     * Emits an {Approval} event indicating the upd allowance.\r
     *\r
     * Requirements:\r
     *\r
     * - `spender` cannot be the zero address.\r
     * - `spender` must have allowance for the caller of at least\r
     * `subtractedValue`.\r
     */\r
    function decreaseAllowance(\r
        address spender,\r
        uint256 subtractedValue\r
    ) public virtual returns (bool) {\r
        uint256 currentAllowance = _allowances[_msgSender()][spender];\r
        require(\r
            currentAllowance >= subtractedValue,\r
            "ERC20: decreased allowance below zero"\r
        );\r
        unchecked {\r
            _approve(_msgSender(), spender, currentAllowance - subtractedValue);\r
        }\r
\r
        return true;\r
    }\r
\r
    /**\r
     * @dev Moves `amount` of tokens from `sender` to `recipient`.\r
     *\r
     * This internal function is equivalent to {transfer}, and can be used to\r
     * e.g. implement automatic token fees, slashing mechanisms, etc.\r
     *\r
     * Emits a {Transfer} event.\r
     *\r
     * Requirements:\r
     *\r
     * - `sender` cannot be the zero address.\r
     * - `recipient` cannot be the zero address.\r
     * - `sender` must have a balance of at least `amount`.\r
     */\r
    function _transfer(\r
        address sender,\r
        address recipient,\r
        uint256 amount\r
    ) internal virtual {\r
        require(sender != address(0), "ERC20: transfer from the zero address");\r
        require(recipient != address(0), "ERC20: transfer to the zero address");\r
\r
        _beforeTokenTransfer(sender, recipient, amount);\r
\r
        uint256 senderBalance = _balances[sender];\r
        require(\r
            senderBalance >= amount,\r
            "ERC20: transfer amount exceeds balance"\r
        );\r
        unchecked {\r
            _balances[sender] = senderBalance - amount;\r
        }\r
        _balances[recipient] += amount;\r
\r
        emit Transfer(sender, recipient, amount);\r
\r
        _afterTokenTransfer(sender, recipient, amount);\r
    }\r
\r
    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\r
     * the total supply.\r
     *\r
     * Emits a {Transfer} event with `from` set to the zero address.\r
     *\r
     * Requirements:\r
     *\r
     * - `account` cannot be the zero address.\r
     */\r
    function _mint(address account, uint256 amount) internal virtual {\r
        require(account != address(0), "ERC20: mint to the zero address");\r
\r
        _beforeTokenTransfer(address(0), account, amount);\r
\r
        _totalSupply += amount;\r
        _balances[account] += amount;\r
        emit Transfer(address(0), account, amount);\r
\r
        _afterTokenTransfer(address(0), account, amount);\r
    }\r
\r
    /**\r
     * @dev Destroys `amount` tokens from `account`, reducing the\r
     * total supply.\r
     *\r
     * Emits a {Transfer} event with `to` set to the zero address.\r
     *\r
     * Requirements:\r
     *\r
     * - `account` cannot be the zero address.\r
     * - `account` must have at least `amount` tokens.\r
     */\r
    function _burn(address account, uint256 amount) internal virtual {\r
        require(account != address(0), "ERC20: burn from the zero address");\r
\r
        _beforeTokenTransfer(account, address(0), amount);\r
\r
        uint256 accountBalance = _balances[account];\r
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");\r
        unchecked {\r
            _balances[account] = accountBalance - amount;\r
        }\r
        _totalSupply -= amount;\r
\r
        emit Transfer(account, address(0), amount);\r
\r
        _afterTokenTransfer(account, address(0), amount);\r
    }\r
\r
    /**\r
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\r
     *\r
     * This internal function is equivalent to `approve`, and can be used to\r
     * e.g. set automatic allowances for certain subsystems, etc.\r
     *\r
     * Emits an {Approval} event.\r
     *\r
     * Requirements:\r
     *\r
     * - `owner` cannot be the zero address.\r
     * - `spender` cannot be the zero address.\r
     */\r
    function _approve(\r
        address owner,\r
        address spender,\r
        uint256 amount\r
    ) internal virtual {\r
        require(owner != address(0), "ERC20: approve from the zero address");\r
        require(spender != address(0), "ERC20: approve to the zero address");\r
\r
        _allowances[owner][spender] = amount;\r
        emit Approval(owner, spender, amount);\r
    }\r
\r
    /**\r
     * @dev Hook that is called before any transfer of tokens. This includes\r
     * minting and burning.\r
     *\r
     * Calling conditions:\r
     *\r
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\r
     * will be transferred to `to`.\r
     * - when `from` is zero, `amount` tokens will be minted for `to`.\r
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\r
     * - `from` and `to` are never both zero.\r
     *\r
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\r
     */\r
    function _beforeTokenTransfer(\r
        address from,\r
        address to,\r
        uint256 amount\r
    ) internal virtual {}\r
\r
    /**\r
     * @dev Hook that is called after any transfer of tokens. This includes\r
     * minting and burning.\r
     *\r
     * Calling conditions:\r
     *\r
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\r
     * has been transferred to `to`.\r
     * - when `from` is zero, `amount` tokens have been minted for `to`.\r
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.\r
     * - `from` and `to` are never both zero.\r
     *\r
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\r
     */\r
    function _afterTokenTransfer(\r
        address from,\r
        address to,\r
        uint256 amount\r
    ) internal virtual {}\r
}\r
\r
abstract contract Ownable is Context {\r
    address private _owner;\r
\r
    event OwnershipTransferred(\r
        address indexed previousOwner,\r
        address indexed newOwner\r
    );\r
\r
    /**\r
     * @dev Initializes the contract setting the deployer as the initial owner.\r
     */\r
    constructor() {\r
        _transferOwnership(_msgSender());\r
    }\r
\r
    /**\r
     * @dev Returns the address of the current owner.\r
     */\r
    function owner() public view virtual returns (address) {\r
        return _owner;\r
    }\r
\r
    /**\r
     * @dev Throws if called by any account other than the owner.\r
     */\r
    modifier onlyOwner() {\r
        require(owner() == _msgSender(), "Ownable: caller is not the owner");\r
        _;\r
    }\r
\r
    /**\r
     * @dev Leaves the contract without owner. It will not be possible to call\r
     * `onlyOwner` functions anymore. Can only be called by the current owner.\r
     *\r
     * NOTE: Renouncing ownership will leave the contract without an owner,\r
     * thereby removing any functionality that is only available to the owner.\r
     */\r
    function renounceOwnership() public virtual onlyOwner {\r
        _transferOwnership(address(0));\r
    }\r
\r
    /**\r
     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r
     * Can only be called by the current owner.\r
     */\r
    function transferOwnership(address newOwner) public virtual onlyOwner {\r
        require(\r
            newOwner != address(0),\r
            "Ownable: new owner is the zero address"\r
        );\r
        _transferOwnership(newOwner);\r
    }\r
\r
    /**\r
     * @dev Transfers ownership of the contract to a new account (`newOwner`).\r
     * Internal function without access restriction.\r
     */\r
    function _transferOwnership(address newOwner) internal virtual {\r
        address oldOwner = _owner;\r
        _owner = newOwner;\r
        emit OwnershipTransferred(oldOwner, newOwner);\r
    }\r
}\r
\r
interface IDexFactory {\r
    event PairCreated(\r
        address indexed token0,\r
        address indexed token1,\r
        address pair,\r
        uint256\r
    );\r
\r
    function feeTo() external view returns (address);\r
\r
    function feeToSetter() external view returns (address);\r
\r
    function getPair(\r
        address tokenA,\r
        address tokenB\r
    ) external view returns (address pair);\r
\r
    function allPairs(uint256) external view returns (address pair);\r
\r
    function allPairsLength() external view returns (uint256);\r
\r
    function createPair(\r
        address tokenA,\r
        address tokenB\r
    ) external returns (address pair);\r
\r
    function setFeeTo(address) external;\r
\r
    function setFeeToSetter(address) external;\r
}\r
\r
interface IDexRouter {\r
    function factory() external pure returns (address);\r
\r
    function WETH() external pure returns (address);\r
\r
    function addLiquidity(\r
        address tokenA,\r
        address tokenB,\r
        uint256 amountADesired,\r
        uint256 amountBDesired,\r
        uint256 amountAMin,\r
        uint256 amountBMin,\r
        address to,\r
        uint256 deadline\r
    ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity);\r
\r
    function addLiquidityETH(\r
        address token,\r
        uint256 amountTokenDesired,\r
        uint256 amountTokenMin,\r
        uint256 amountETHMin,\r
        address to,\r
        uint256 deadline\r
    )\r
        external\r
        payable\r
        returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);\r
\r
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(\r
        uint256 amountIn,\r
        uint256 amountOutMin,\r
        address[] calldata path,\r
        address to,\r
        uint256 deadline\r
    ) external;\r
\r
    function swapExactETHForTokensSupportingFeeOnTransferTokens(\r
        uint256 amountOutMin,\r
        address[] calldata path,\r
        address to,\r
        uint256 deadline\r
    ) external payable;\r
\r
    function swapExactTokensForETHSupportingFeeOnTransferTokens(\r
        uint256 amountIn,\r
        uint256 amountOutMin,\r
        address[] calldata path,\r
        address to,\r
        uint256 deadline\r
    ) external;\r
}\r
\r
contract ACAT is ERC20, Ownable {\r
    using SafeMath for uint256;\r
\r
    IDexRouter private immutable uniRouter;\r
    address private immutable uniPair;\r
\r
    // Swapback\r
    bool private onSwapback;\r
\r
    bool private contractSBEnabled = false;\r
    uint256 private triggerSB;\r
    uint256 private limitSB;\r
    uint256 private lastSB;\r
\r
    //Anti-whale\r
    bool private limitsEnabled = true;\r
    uint256 private maxWalletLimit;\r
    uint256 private maxTransactionLimit;\r
\r
    bool private tradingOpen = false;\r
\r
    // Fees\r
    address private projectWallet;\r
\r
    uint256 private buyingFee;\r
\r
    uint256 private sellingFee;\r
\r
    uint256 private transferFee;\r
    /******************/\r
\r
    // exclude from fees and max transaction amount\r
    mapping(address => bool) private exemptFromFees;\r
    mapping(address => bool) private exemptFromLimits;\r
    mapping(address => bool) private DEXPair;\r
\r
    // store addresses that a automatic market maker pairs. Any transfer *to* these addresses\r
    // could be subject to a maximum transfer amount\r
\r
    event ExemptFromFee(address indexed account, bool isExcluded);\r
    event ExemptFromLimit(address indexed account, bool isExcluded);\r
    event SetPairLPool(address indexed pair, bool indexed value);\r
    event TradingEnabled(uint256 indexed timestamp);\r
    event LimitsRemoved(uint256 indexed timestamp);\r
\r
    event SwapbackSettingsUpdated(\r
        bool enabled,\r
        uint256 triggerSB,\r
        uint256 limitSB\r
    );\r
    event MaxTxUpdated(uint256 maxTransactionLimit);\r
    event MaxWalletUpdated(uint256 maxWalletLimit);\r
\r
    event MarketingWalletUpdated(\r
        address indexed newWallet,\r
        address indexed oldWallet\r
    );\r
\r
    event BuyFeeUpdated(\r
        uint256 buyingFee,\r
        uint256 buyMarketingTax,\r
        uint256 buyProjectTax\r
    );\r
\r
    event SellFeeUpdated(\r
        uint256 sellingFee,\r
        uint256 sellMarketingTax,\r
        uint256 sellProjectTax\r
    );\r
\r
    constructor() ERC20("Alien Cat", "ACAT") {\r
        IDexRouter _uniRouter = IDexRouter(\r
            0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D\r
        );\r
\r
        changeLimitExempt(address(_uniRouter), true);\r
        uniRouter = _uniRouter;\r
\r
        uniPair = IDexFactory(_uniRouter.factory()).createPair(\r
            address(this),\r
            _uniRouter.WETH()\r
        );\r
        changeLimitExempt(address(uniPair), true);\r
        _toggleDexPair(address(uniPair), true);\r
\r
        uint256 _totalSupply = 1_000_000_000_000 * 10 ** decimals();\r
\r
        lastSB = block.timestamp;\r
\r
        maxTransactionLimit = (_totalSupply * 10) / 1000;\r
        maxWalletLimit = (_totalSupply * 10) / 1000;\r
\r
        triggerSB = (_totalSupply * 1) / 1000;\r
        limitSB = (_totalSupply * 2) / 100;\r
\r
        buyingFee = 20;\r
\r
        sellingFee = 20;\r
\r
        transferFee = 0;\r
\r
        projectWallet = address(0x081C552ee55873a5851Ee13aF96A637ab6e1D1ac);\r
\r
        // exclude from paying fees or having max transaction amount\r
        changeAddressFeeExempt(msg.sender, true);\r
        changeAddressFeeExempt(address(this), true);\r
        changeAddressFeeExempt(address(0xdead), true);\r
        changeAddressFeeExempt(projectWallet, true);\r
\r
        changeLimitExempt(msg.sender, true);\r
        changeLimitExempt(address(this), true);\r
        changeLimitExempt(address(0xdead), true);\r
        changeLimitExempt(projectWallet, true);\r
\r
        transferOwnership(msg.sender);\r
\r
        /*\r
            _mint is an internal function in ERC20.sol that is only called here,\r
            and CANNOT be called ever again\r
        */\r
        _mint(msg.sender, _totalSupply);\r
    }\r
\r
    receive() external payable {}\r
\r
    function decimals() public view virtual override returns (uint8) {\r
        return 9;\r
    }\r
\r
    /**\r
     * @notice  Opens public trading for the token\r
     * @dev     onlyOwner.\r
     */\r
    function openTrading() external onlyOwner {\r
        tradingOpen = true;\r
        contractSBEnabled = true;\r
        emit TradingEnabled(block.timestamp);\r
    }\r
\r
    /**\r
     * @notice Removes the max wallet and max transaction limits\r
     * @dev onlyOwner.\r
     * Emits an {LimitsRemoved} event\r
     */\r
    function removeLimits() external onlyOwner {\r
        limitsEnabled = false;\r
        transferFee = 0;\r
        emit LimitsRemoved(block.timestamp);\r
    }\r
\r
    /**\r
     * @notice sets if swapback is enabled and sets the minimum and maximum amounts\r
     * @dev onlyOwner.\r
     * Emits an {SwapbackSettingsUpdated} event\r
     * @param _caSBcEnabled If swapback is enabled\r
     * @param _caSBcTrigger The minimum amount of tokens the contract must have before swapping tokens for ETH. Base 10000, so 1% = 100.\r
     * @param _caSBcLimit The maximum amount of tokens the contract can swap for ETH. Base 10000, so 1% = 100.\r
     */\r
    function changeSwapback(\r
        bool _caSBcEnabled,\r
        uint256 _caSBcTrigger,\r
        uint256 _caSBcLimit\r
    ) external onlyOwner {\r
        require(\r
            _caSBcTrigger >= 1,\r
            "Swap amount cannot be lower than 0.01% total supply."\r
        );\r
        require(\r
            _caSBcLimit >= _caSBcTrigger,\r
            "maximum amount cant be higher than minimum"\r
        );\r
\r
        contractSBEnabled = _caSBcEnabled;\r
        triggerSB = (totalSupply() * _caSBcTrigger) / 10000;\r
        limitSB = (totalSupply() * _caSBcLimit) / 10000;\r
        emit SwapbackSettingsUpdated(_caSBcEnabled, _caSBcTrigger, _caSBcLimit);\r
    }\r
\r
    /**\r
     * @notice Changes the maximum amount of tokens that can be bought or sold in a single transaction\r
     * @dev onlyOwner.\r
     * Emits an {MaxTxUpdated} event\r
     * @param _maxTransactionLimit Base 1000, so 1% = 10\r
     */\r
    function changeTxLimit(uint256 _maxTransactionLimit) external onlyOwner {\r
        require(_maxTransactionLimit >= 2, "Cannot set maxTransactionLimit lower than 0.2%");\r
        maxTransactionLimit = (_maxTransactionLimit * totalSupply()) / 1000;\r
        emit MaxTxUpdated(maxTransactionLimit);\r
    }\r
\r
    /**\r
     * @notice Changes the maximum amount of tokens a wallet can hold\r
     * @dev onlyOwner.\r
     * Emits an {MaxWalletUpdated} event\r
     * @param _maxWalletLimit Base 1000, so 1% = 10\r
     */\r
    function changeWalletLimit(\r
        uint256 _maxWalletLimit\r
    ) external onlyOwner {\r
        require(_maxWalletLimit >= 5, "Cannot set maxWalletLimit lower than 0.5%");\r
        maxWalletLimit = (_maxWalletLimit * totalSupply()) / 1000;\r
        emit MaxWalletUpdated(maxWalletLimit);\r
    }\r
\r
    /**\r
     * @notice Sets if a wallet is excluded from the max wallet and tx limits\r
     * @dev onlyOwner.\r
     * Emits an {ExemptFromLimit} event\r
     * @param _add The wallet to update\r
     * @param _excluded If the wallet is excluded or not\r
     */\r
    function changeLimitExempt(\r
        address _add,\r
        bool _excluded\r
    ) public onlyOwner {\r
        exemptFromLimits[_add] = _excluded;\r
        emit ExemptFromLimit(_add, _excluded);\r
    }\r
\r
    /**\r
     * @notice Sets the fees for buys\r
     * @dev onlyOwner.\r
     * Emits a {BuyFeeUpdated} event\r
     * All fees added up must be less than 100\r
     * @param _value The fee for the marketing wallet\r
     */\r
    function changeFeeBuy(uint256 _value) external onlyOwner {\r
        buyingFee = _value;\r
        require(buyingFee <= 100, "Total buy fee cannot be higher than 100%");\r
        emit BuyFeeUpdated(buyingFee, buyingFee, buyingFee);\r
    }\r
\r
    /**\r
     * @notice Sets the fees for sells\r
     * @dev onlyOwner.\r
     * Emits a {SellFeeUpdated} event\r
     * All fees added up must be less than 100\r
     * @param _value The fee for the marketing wallet\r
     */\r
    function changeFeeSell(uint256 _value) external onlyOwner {\r
        sellingFee = _value;\r
        require(\r
            sellingFee <= 100,\r
            "Total sell fee cannot be higher than 100%"\r
        );\r
        emit SellFeeUpdated(sellingFee, sellingFee, sellingFee);\r
    }\r
\r
    function changeFeeTransfer(uint256 _value) external onlyOwner {\r
        transferFee = _value;\r
        require(\r
            transferFee <= 100,\r
            "Total transfer fee cannot be higher than 100%"\r
        );\r
    }\r
\r
    /**\r
     * @notice Sets if an address is excluded from fees\r
     * @dev onlyOwner.\r
     * Emits an {ExemptFromFee} event\r
     * @param _add The wallet to update\r
     * @param _excluded If the wallet is excluded or not\r
     */\r
    function changeAddressFeeExempt(\r
        address _add,\r
        bool _excluded\r
    ) public onlyOwner {\r
        exemptFromFees[_add] = _excluded;\r
        emit ExemptFromFee(_add, _excluded);\r
    }\r
\r
    function _toggleDexPair(address pair, bool value) private {\r
        DEXPair[pair] = value;\r
\r
        emit SetPairLPool(pair, value);\r
    }\r
\r
    /**\r
     * @notice Sets the marketing wallet\r
     * @dev onlyOwner.\r
     * Emits an {MarketingWalletUpdated} event\r
     * @param _marketing The new marketing wallet\r
     */\r
    function setMarketingWallet(address _marketing) external onlyOwner {\r
        emit MarketingWalletUpdated(_marketing, projectWallet);\r
        projectWallet = _marketing;\r
    }\r
\r
\r
    /**\r
     * @notice  Information about the swapback settings\r
     * @return  _contractSBEnabled  if swapback is enabled\r
     * @return  _caSBcackValueMin  the minimum amount of tokens in the contract balance to trigger swapback\r
     * @return  _caSBcackValueMax  the maximum amount of tokens in the contract balance to trigger swapback\r
     */\r
    function swapbackRead()\r
        external\r
        view\r
        returns (\r
            bool _contractSBEnabled,\r
            uint256 _caSBcackValueMin,\r
            uint256 _caSBcackValueMax\r
        )\r
    {\r
        _contractSBEnabled = contractSBEnabled;\r
        _caSBcackValueMin = triggerSB;\r
        _caSBcackValueMax = limitSB;\r
    }\r
\r
    /**\r
     * @notice  Information about the anti whale parameters\r
     * @return  _limitsEnabled  if the wallet limits are in effect\r
     * @return  _maxWalletLimit  The maximum amount of tokens that can be held by a wallet\r
     * @return  _maxTransactionLimit  The maximum amount of tokens that can be bought or sold in a single transaction\r
     */\r
    function limitsRead()\r
        external\r
        view\r
        returns (bool _limitsEnabled, uint256 _maxWalletLimit, uint256 _maxTransactionLimit)\r
    {\r
        _limitsEnabled = limitsEnabled;\r
        _maxWalletLimit = maxWalletLimit;\r
        _maxTransactionLimit = maxTransactionLimit;\r
    }\r
\r
    /**\r
     * @notice The wallets that receive the collected fees\r
     * @return _projectWallet The wallet that receives the marketing fees\r
     */\r
    function receiverRead()\r
        external\r
        view\r
        returns (address _projectWallet)\r
    {\r
        return (projectWallet);\r
    }\r
\r
    /**\r
     * @notice Fees for buys, sells, and transfers\r
     * @return _buyingFee The total fee for buys\r
     * @return _sellingFee The total fee for sells\r
     * @return _transferFee The total fee for transfers\r
     */\r
    function feesRead()\r
        external\r
        view\r
        returns (\r
            uint256 _buyingFee,\r
            uint256 _sellingFee,\r
            uint256 _transferFee\r
        )\r
    {\r
        _buyingFee = buyingFee;\r
        _sellingFee = sellingFee;\r
        _transferFee = transferFee;\r
    }\r
\r
    /**\r
     * @notice  If the wallet is excluded from fees and max transaction amount and if the wallet is a automated market maker pair\r
     * @param   _target  The wallet to check\r
     * @return  _exemptFromFees  If the wallet is excluded from fees\r
     * @return  _exemptFromLimits  If the wallet is excluded from max transaction amount\r
     * @return  _DEXPair If the wallet is a automated market maker pair\r
     */\r
    function addressRead(\r
        address _target\r
    )\r
        external\r
        view\r
        returns (\r
            bool _exemptFromFees,\r
            bool _exemptFromLimits,\r
            bool _DEXPair\r
        )\r
    {\r
        _exemptFromFees = exemptFromFees[_target];\r
        _exemptFromLimits = exemptFromLimits[_target];\r
        _DEXPair = DEXPair[_target];\r
    }\r
\r
    function _transfer(\r
        address from,\r
        address to,\r
        uint256 amount\r
    ) internal override {\r
        require(from != address(0), "ERC20: transfer from the zero address");\r
        require(to != address(0), "ERC20: transfer to the zero address");\r
\r
        if (amount == 0) {\r
            super._transfer(from, to, 0);\r
            return;\r
        }\r
\r
        if (limitsEnabled) {\r
            if (\r
                from != owner() &&\r
                to != owner() &&\r
                to != address(0) &&\r
                to != address(0xdead) &&\r
                !onSwapback\r
            ) {\r
                if (!tradingOpen) {\r
                    require(\r
                        exemptFromFees[from] || exemptFromFees[to],\r
                        "_transfer:: Trading is not active."\r
                    );\r
                }\r
\r
                //when buy\r
                if (\r
                    DEXPair[from] && !exemptFromLimits[to]\r
                ) {\r
                    require(\r
                        amount <= maxTransactionLimit,\r
                        "Buy transfer amount exceeds the maxTransactionLimit."\r
                    );\r
                    require(\r
                        amount + balanceOf(to) <= maxWalletLimit,\r
                        "Max wallet exceeded"\r
                    );\r
                }\r
                //when sell\r
                else if (\r
                    DEXPair[to] && !exemptFromLimits[from]\r
                ) {\r
                    require(\r
                        amount <= maxTransactionLimit,\r
                        "Sell transfer amount exceeds the maxTransactionLimit."\r
                    );\r
                } else if (!exemptFromLimits[to]) {\r
                    require(\r
                        amount + balanceOf(to) <= maxWalletLimit,\r
                        "Max wallet exceeded"\r
                    );\r
                }\r
            }\r
        }\r
\r
        uint256 contractTokenBalance = balanceOf(address(this));\r
\r
        bool canSwap = contractTokenBalance >= triggerSB;\r
\r
        if (\r
            canSwap &&\r
            contractSBEnabled &&\r
            !onSwapback &&\r
            !DEXPair[from] &&\r
            !exemptFromFees[from] &&\r
            !exemptFromFees[to] &&\r
            lastSB != block.timestamp\r
        ) {\r
            onSwapback = true;\r
\r
            swapBack(amount);\r
\r
            lastSB = block.timestamp;\r
\r
            onSwapback = false;\r
        }\r
\r
        bool takeFee = !onSwapback;\r
\r
        // if any account belongs to _isExcludedFromFee account then remove the fee\r
        if (exemptFromFees[from] || exemptFromFees[to]) {\r
            takeFee = false;\r
        }\r
\r
        uint256 fees = 0;\r
        // only take fees on buys/sells, do not take on wallet transfers\r
        if (takeFee) {\r
            // on sell\r
            if (DEXPair[to] && sellingFee > 0) {\r
                fees = amount.mul(sellingFee).div(100);\r
            }\r
            // on buy\r
            else if (DEXPair[from] && buyingFee > 0) {\r
                fees = amount.mul(buyingFee).div(100);\r
            }\r
            // on transfers\r
            else if (\r
                transferFee > 0 &&\r
                !DEXPair[from] &&\r
                !DEXPair[to]\r
            ) {\r
                fees = amount.mul(transferFee).div(100);\r
            }\r
\r
            if (fees > 0) {\r
                super._transfer(from, address(this), fees);\r
            }\r
\r
            amount -= fees;\r
        }\r
\r
        super._transfer(from, to, amount);\r
    }\r
\r
    function swapTokensForEth(uint256 tokenAmount) private {\r
        // generate the uniswap pair path of token -> weth\r
        address[] memory path = new address[](2);\r
        path[0] = address(this);\r
        path[1] = uniRouter.WETH();\r
\r
        _approve(address(this), address(uniRouter), tokenAmount);\r
\r
        // make the swap\r
        uniRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(\r
            tokenAmount,\r
            0, // accept any amount of ETH\r
            path,\r
            address(this),\r
            block.timestamp\r
        );\r
    }\r
\r
    function swapBack(uint256 amount) private {\r
        uint256 contractBalance = balanceOf(address(this));\r
        bool success;\r
\r
        if (contractBalance == 0) {\r
            return;\r
        }\r
\r
        if (contractBalance > limitSB) {\r
            contractBalance = limitSB;\r
        }\r
\r
        if (contractBalance > amount * 15) {\r
            contractBalance = amount * 15;\r
        }\r
\r
        uint256 amountToSwapForETH = contractBalance;\r
\r
        swapTokensForEth(amountToSwapForETH);\r
\r
        (success, ) = address(projectWallet).call{\r
            value: address(this).balance\r
        }("");\r
    }\r
}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": [],
    "evmVersion": "paris"
  }
}}

Tags:
ERC20, Multisig, Swap, Liquidity, Multi-Signature, Factory|addr:0x31b7b6b4e92dc9fda8a0f05814595e9116afb210|verified:true|block:23695840|tx:0x07b8a62618a3e46f17f9a82d7bed0a56dd349ccd58a1e7297d823b5fa1400d54|first_check:1761912338

Submitted on: 2025-10-31 13:05:39

Comments

Log in to comment.

No comments yet.