false
false

Contract Address Details

0x5ee58a955f1065e24ca1d4f015174bcfa9016e59

Token
SOBY (SOBY)
Creator
0x9b3e22–7b1b49 at 0xa5fc18–3ec788
Balance
0 Xai ( )
Tokens
Fetching tokens...
Transactions
6 Transactions
Transfers
0 Transfers
Gas Used
3,721,783
Last Balance Update
66889664
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
SOBY




Optimization enabled
true
Compiler version
v0.8.24+commit.e11b9ed9




Optimization runs
1000
EVM Version
paris




Verified at
2024-05-03T12:16:25.634036Z

Constructor Arguments

0x00000000000000000000000018e621b64d7808c3c47bccbbd7485d23f257d26f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed14480000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af

Arg [0] (address) : 0x18e621b64d7808c3c47bccbbd7485d23f257d26f
Arg [1] (address) : 0x6a63830e24f9a2f9c295fb2150107d0390ed1448
Arg [2] (address) : 0x3fb787101dc6be47cfe18aeee15404dcc842e6af

              

src/Soby/SOBY.sol

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "./ISwapFactory.sol";
import "./ISwapRouter.sol";
import "./IWXAI.sol";
import "../Pools/Jackpot/Jackpot.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract SOBY is ERC20, Ownable {
    using SafeERC20 for IERC20;
    using EnumerableSet for EnumerableSet.AddressSet;

    event SwapBack(
        uint256 burn,
        uint256 flexible,
        uint256 liquidity,
        uint256 jackpot,
        uint256 development,
        uint timestamp
    );
    event Trade(
        address user,
        address pair,
        uint256 amount,
        uint side,
        uint256 circulatingSupply,
        uint timestamp
    );
    event AddLiquidity(
        uint256 tokenAmount,
        uint256 ethAmount,
        uint256 timestamp
    );

    bool public addLiquidityEnabled = true;

    bool public inSwap;
    modifier swapping() {
        inSwap = true;
        _;
        inSwap = false;
    }

    EnumerableSet.AddressSet private _callers;
    modifier onlyCaller() {
        require(_callers.contains(_msgSender()), "onlyCaller");
        _;
    }

    mapping(address => bool) public isFeeExempt;

    uint256 private burnFee;
    uint256 public flexibleFee;
    uint256 private liquidityFee;
    uint256 private jackpotFee;
    uint256 private developmentFee;
    uint256 private totalFee;
    uint256 public feeDenominator = 10000;

    // Buy Fees
    uint256 public burnFeeBuy = 100;
    uint256 public flexibleFeeBuy = 200;
    uint256 public liquidityFeeBuy = 200;
    uint256 public jackpotFeeBuy = 150;
    uint256 public developmentFeeBuy = 150;
    uint256 public totalFeeBuy = 800;
    // Sell Fees
    uint256 public burnFeeSell = 100;
    uint256 public flexibleFeeSell = 200;
    uint256 public liquidityFeeSell = 200;
    uint256 public jackpotFeeSell = 150;
    uint256 public developmentFeeSell = 150;
    uint256 public totalFeeSell = 800;

    // Fees receivers
    address public flexibleWallet;
    Jackpot public jackpotWallet;
    address public developmentWallet;

    bool private initialized;

    ISwapFactory private immutable factory;
    ISwapRouter private immutable swapRouter;
    IWXAI private immutable WXAI;
    address private constant DEAD = 0x000000000000000000000000000000000000dEaD;
    address private constant ZERO = 0x0000000000000000000000000000000000000000;

    EnumerableSet.AddressSet private _pairs;

    constructor(
        address _factory,
        address _swapRouter,
        address _weth
    ) ERC20("SOBY", "SOBY") Ownable(msg.sender) {
        uint256 _totalSupply = 210_000_000_000_000_000 * 1e6;
        isFeeExempt[msg.sender] = true;
        isFeeExempt[address(this)] = true;
        factory = ISwapFactory(_factory);
        swapRouter = ISwapRouter(_swapRouter);
        WXAI = IWXAI(_weth);
        _mint(_msgSender(), _totalSupply);
    }

    function initializePair() external onlyOwner {
        require(!initialized, "Already initialized");
        address pair = factory.createPair(address(WXAI), address(this));
        _pairs.add(pair);
        initialized = true;
    }

    function decimals() public view virtual override returns (uint8) {
        return 6;
    }

    function transfer(
        address to,
        uint256 amount
    ) public virtual override returns (bool) {
        return _dogTransfer(_msgSender(), to, amount);
    }

    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(sender, spender, amount);
        return _dogTransfer(sender, recipient, amount);
    }

    function _dogTransfer(
        address sender,
        address recipient,
        uint256 amount
    ) internal returns (bool) {
        if (inSwap) {
            _transfer(sender, recipient, amount);
            return true;
        }

        bool shouldTakeFee = (!isFeeExempt[sender] && !isFeeExempt[recipient]);
        uint side = 0;
        address user_ = sender;
        address pair_ = recipient;
        // Set Fees
        if (isPair(sender)) {
            buyFees();
            side = 1;
            user_ = recipient;
            pair_ = sender;
            try jackpotWallet.tradeEvent(sender, amount) {} catch {}
        } else if (isPair(recipient)) {
            sellFees();
            side = 2;
        } else {
            shouldTakeFee = false;
        }

        uint256 amountReceived = shouldTakeFee
            ? takeFee(sender, amount)
            : amount;
        _transfer(sender, recipient, amountReceived);

        if (side > 0) {
            emit Trade(
                user_,
                pair_,
                amount,
                side,
                getCirculatingSupply(),
                block.timestamp
            );
        }
        return true;
    }

    function swapBack() internal swapping {
        uint256 taxAmount = balanceOf(address(this));
        _approve(address(this), address(swapRouter), taxAmount);

        uint256 amountDogBurn = (taxAmount * burnFee) / (totalFee);
        uint256 amountDogLp = (taxAmount * liquidityFee) / (totalFee);
        taxAmount -= amountDogBurn;
        taxAmount -= amountDogLp;

        address[] memory path = new address[](2);
        path[0] = address(this);
        path[1] = address(WXAI);

        bool success = false;
        uint256 balanceBefore = address(this).balance;
        try
            swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
                taxAmount,
                0,
                path,
                address(this),
                address(0),
                block.timestamp
            )
        {
            success = true;
        } catch {}
        if (!success) {
            return;
        }

        _transfer(address(this), DEAD, amountDogBurn);

        uint256 amountBackToken = address(this).balance - balanceBefore;
        uint256 backTokenTotalFee = totalFee - burnFee - liquidityFee;
        uint256 amountBackTokenFlexible = (amountBackToken * flexibleFee) /
            (backTokenTotalFee);
        uint256 amountBackTokenJackpot = (amountBackToken * jackpotFee) /
            backTokenTotalFee;
        uint256 amountBackTokenDevelopment = amountBackToken -
            amountBackTokenFlexible -
            amountBackTokenJackpot;

        WXAI.deposit{value: amountBackToken}();
        WXAI.transfer(flexibleWallet, amountBackTokenFlexible);
        WXAI.transfer(address(jackpotWallet), amountBackTokenJackpot);
        WXAI.transfer(developmentWallet, amountBackTokenDevelopment);

        if (addLiquidityEnabled) {
            _doAddLp();
        }

        emit SwapBack(
            amountDogBurn,
            amountBackTokenFlexible,
            amountDogLp,
            amountBackTokenJackpot,
            amountBackTokenDevelopment,
            block.timestamp
        );
    }

    function _doAddLp() internal {
        address[] memory pathEth = new address[](2);
        pathEth[0] = address(this);
        pathEth[1] = address(WXAI);

        uint256 tokenAmount = balanceOf(address(this));
        uint256 half = tokenAmount / 2;
        if (half < 1000) return;

        uint256 ethAmountBefore = address(this).balance;
        bool success = false;
        try
            swapRouter.swapExactTokensForETHSupportingFeeOnTransferTokens(
                half,
                0,
                pathEth,
                address(this),
                address(0),
                block.timestamp
            )
        {
            success = true;
        } catch {}
        if (!success) {
            return;
        }

        uint256 ethAmount = address(this).balance - ethAmountBefore;
        _addLiquidity(half, ethAmount);
    }

    function _addLiquidity(uint256 tokenAmount, uint256 ethAmount) internal {
        _approve(address(this), address(swapRouter), tokenAmount);
        try
            swapRouter.addLiquidityETH{value: ethAmount}(
                address(this),
                tokenAmount,
                0,
                0,
                address(this),
                block.timestamp
            )
        {
            // Burn all LP token
            IERC20 pair = IERC20(factory.getPair(address(WXAI), address(this)));
            uint256 amountLpPairBurn = pair.balanceOf(address(this));
            pair.transfer(DEAD, amountLpPairBurn);

            emit AddLiquidity(tokenAmount, ethAmount, block.timestamp);
        } catch {}
    }

    function doSwapBack() public onlyCaller {
        swapBack();
    }

    function buyFees() internal {
        burnFee = burnFeeBuy;
        flexibleFee = flexibleFeeBuy;
        liquidityFee = liquidityFeeBuy;
        jackpotFee = jackpotFeeBuy;
        developmentFee = developmentFeeBuy;
        totalFee = totalFeeBuy;
    }

    function sellFees() internal {
        burnFee = burnFeeSell;
        flexibleFee = flexibleFeeSell;
        liquidityFee = liquidityFeeSell;
        jackpotFee = jackpotFeeSell;
        developmentFee = developmentFeeSell;
        totalFee = totalFeeSell;
    }

    function takeFee(
        address sender,
        uint256 amount
    ) internal returns (uint256) {
        uint256 feeAmount = (amount * totalFee) / feeDenominator;
        _transfer(sender, address(this), feeAmount);
        return amount - feeAmount;
    }

    function clearStuckEthBalance() external onlyOwner {
        uint256 amountETH = address(this).balance;
        (bool success, ) = payable(_msgSender()).call{value: amountETH}(
            new bytes(0)
        );
        require(success, "ETH_TRANSFER_FAILED");
    }

    function getCirculatingSupply() public view returns (uint256) {
        return totalSupply() - balanceOf(DEAD) - balanceOf(ZERO);
    }

    /*** ADMIN FUNCTIONS ***/
    function setBuyFees(
        uint256 _flexibleFee,
        uint256 _liquidityFee,
        uint256 _jackpotFee,
        uint256 _developmentFee,
        uint256 _burnFee
    ) external onlyOwner {
        uint256 _totalFeeBuy = _flexibleFee +
            _liquidityFee +
            _jackpotFee +
            _developmentFee +
            _burnFee;
        require(_totalFeeBuy <= 2500, "over 25%");

        flexibleFeeBuy = _flexibleFee;
        liquidityFeeBuy = _liquidityFee;
        jackpotFeeBuy = _jackpotFee;
        developmentFeeBuy = _developmentFee;
        burnFeeBuy = _burnFee;
        totalFeeBuy = _totalFeeBuy;
    }

    function setSellFees(
        uint256 _flexibleFee,
        uint256 _liquidityFee,
        uint256 _jackpotFee,
        uint256 _developmentFee,
        uint256 _burnFee
    ) external onlyOwner {
        uint256 _totalFeeSell = _flexibleFee +
            _liquidityFee +
            _jackpotFee +
            _developmentFee +
            _burnFee;
        require(_totalFeeSell <= 2500, "over 25%");

        flexibleFeeSell = _flexibleFee;
        liquidityFeeSell = _liquidityFee;
        jackpotFeeSell = _jackpotFee;
        developmentFeeSell = _developmentFee;
        burnFeeSell = _burnFee;
        totalFeeSell = _totalFeeSell;
    }

    function setFeeReceivers(
        address _flexibleWallet,
        address _jackpotWallet,
        address _devWallet
    ) external onlyOwner {
        flexibleWallet = _flexibleWallet;
        jackpotWallet = Jackpot(payable(_jackpotWallet));
        developmentWallet = _devWallet;
    }

    function setIsFeeExempt(address holder, bool exempt) external onlyOwner {
        isFeeExempt[holder] = exempt;
    }

    function setAddLiquidityEnabled(bool _enabled) external onlyOwner {
        addLiquidityEnabled = _enabled;
    }

    function isPair(address account) public view returns (bool) {
        return _pairs.contains(account);
    }

    function addPair(address pair) public onlyOwner returns (bool) {
        require(pair != address(0), "pair is the zero address");
        return _pairs.add(pair);
    }

    function delPair(address pair) public onlyOwner returns (bool) {
        require(pair != address(0), "pair is the zero address");
        return _pairs.remove(pair);
    }

    function getMinterLength() public view returns (uint256) {
        return _pairs.length();
    }

    function getPair(uint256 index) public view returns (address) {
        require(index <= _pairs.length() - 1, "index out of bounds");
        return _pairs.at(index);
    }

    function addCaller(address val) public onlyOwner {
        require(val != address(0), "val is the zero address");
        _callers.add(val);
    }

    function delCaller(address caller) public onlyOwner returns (bool) {
        require(caller != address(0), "caller is the zero address");
        return _callers.remove(caller);
    }

    function getCallers() public view returns (address[] memory ret) {
        return _callers.values();
    }

    receive() external payable {}
}
        

src/Soby/ISwapRouter.sol

//SPDX-License-Identifier: MIT
pragma solidity >=0.6.2;

interface ISwapRouter {
    function factory() external pure returns (address);

    function WXAI() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);

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

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);

    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint amountA, uint amountB);

    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external returns (uint amountToken, uint amountETH);

    function quote(
        uint amountA,
        uint reserveA,
        uint reserveB
    ) external pure returns (uint amountB);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        address referrer,
        uint256 deadline
    ) external;

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        address referrer,
        uint deadline
    ) external;

    function getAmountsOut(
        uint amountIn,
        address[] calldata path
    ) external returns (uint[] memory);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/AccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/IAccessControl.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../token/ERC20/IERC20.sol";
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, false);
            }
        }
    }
}
          

src/Soby/IWXAI.sol

//SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface IWXAI {
    function totalSupply() external view returns (uint256);

    function balanceOf(address account) external view returns (uint256);

    function allowance(address owner, address spender) external view returns (uint256);

    function approve(address spender, uint256 amount) external returns (bool);

    function deposit() external payable;

    function transfer(address to, uint256 value) external returns (bool);

    function withdraw(uint256) external;
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Permit.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 *
 * ==== Security Considerations
 *
 * There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
 * expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
 * considered as an intention to spend the allowance in any specific way. The second is that because permits have
 * built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
 * take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
 * generally recommended is:
 *
 * ```solidity
 * function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
 *     try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
 *     doThing(..., value);
 * }
 *
 * function doThing(..., uint256 value) public {
 *     token.safeTransferFrom(msg.sender, address(this), value);
 *     ...
 * }
 * ```
 *
 * Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
 * `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
 * {SafeERC20-safeTransferFrom}).
 *
 * Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
 * contracts should have entry points that don't rely on permit.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     *
     * CAUTION: See Security Considerations above.
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";
import {IERC20Permit} from "../extensions/IERC20Permit.sol";
import {Address} from "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    /**
     * @dev An operation with an ERC20 token failed.
     */
    error SafeERC20FailedOperation(address token);

    /**
     * @dev Indicates a failed `decreaseAllowance` request.
     */
    error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);

    /**
     * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
    }

    /**
     * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
     * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
     */
    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
    }

    /**
     * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful.
     */
    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 oldAllowance = token.allowance(address(this), spender);
        forceApprove(token, spender, oldAllowance + value);
    }

    /**
     * @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
     * value, non-reverting calls are assumed to be successful.
     */
    function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
        unchecked {
            uint256 currentAllowance = token.allowance(address(this), spender);
            if (currentAllowance < requestedDecrease) {
                revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
            }
            forceApprove(token, spender, currentAllowance - requestedDecrease);
        }
    }

    /**
     * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
     * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
     * to be set to zero before setting it to a non-zero value, such as USDT.
     */
    function forceApprove(IERC20 token, address spender, uint256 value) internal {
        bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));

        if (!_callOptionalReturnBool(token, approvalCall)) {
            _callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
            _callOptionalReturn(token, approvalCall);
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data);
        if (returndata.length != 0 && !abi.decode(returndata, (bool))) {
            revert SafeERC20FailedOperation(address(token));
        }
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     *
     * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead.
     */
    function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We cannot use {Address-functionCall} here since this should return false
        // and not revert is the subcall reverts.

        (bool success, bytes memory returndata) = address(token).call(data);
        return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && address(token).code.length > 0;
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Address.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)

pragma solidity ^0.8.20;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev The ETH balance of the account is not enough to perform the operation.
     */
    error AddressInsufficientBalance(address account);

    /**
     * @dev There's no code at `target` (it is not a contract).
     */
    error AddressEmptyCode(address target);

    /**
     * @dev A call to an address target failed. The target may have reverted.
     */
    error FailedInnerCall();

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        if (address(this).balance < amount) {
            revert AddressInsufficientBalance(address(this));
        }

        (bool success, ) = recipient.call{value: amount}("");
        if (!success) {
            revert FailedInnerCall();
        }
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason or custom error, it is bubbled
     * up by this function (like regular Solidity function calls). However, if
     * the call reverted with no returned reason, this function reverts with a
     * {FailedInnerCall} error.
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        if (address(this).balance < value) {
            revert AddressInsufficientBalance(address(this));
        }
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResultFromTarget(target, success, returndata);
    }

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
     * was not a contract or bubbling up the revert reason (falling back to {FailedInnerCall}) in case of an
     * unsuccessful call.
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata
    ) internal view returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            // only check if target is a contract if the call was successful and the return data is empty
            // otherwise we already know that it was a contract
            if (returndata.length == 0 && target.code.length == 0) {
                revert AddressEmptyCode(target);
            }
            return returndata;
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and reverts if it wasn't, either by bubbling the
     * revert reason or with a default {FailedInnerCall} error.
     */
    function verifyCallResult(bool success, bytes memory returndata) internal pure returns (bytes memory) {
        if (!success) {
            _revert(returndata);
        } else {
            return returndata;
        }
    }

    /**
     * @dev Reverts with returndata if present. Otherwise reverts with {FailedInnerCall}.
     */
    function _revert(bytes memory returndata) private pure {
        // Look for revert reason and bubble it up if present
        if (returndata.length > 0) {
            // The easiest way to bubble the revert reason is using memory via assembly
            /// @solidity memory-safe-assembly
            assembly {
                let returndata_size := mload(returndata)
                revert(add(32, returndata), returndata_size)
            }
        } else {
            revert FailedInnerCall();
        }
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/ERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/introspection/IERC165.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
          

lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/structs/EnumerableSet.sol)
// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```solidity
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 *
 * [WARNING]
 * ====
 * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure
 * unusable.
 * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.
 *
 * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an
 * array of EnumerableSet.
 * ====
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;
        // Position is the index of the value in the `values` array plus 1.
        // Position 0 is used to mean a value is not in the set.
        mapping(bytes32 value => uint256) _positions;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._positions[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We cache the value's position to prevent multiple reads from the same storage slot
        uint256 position = set._positions[value];

        if (position != 0) {
            // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 valueIndex = position - 1;
            uint256 lastIndex = set._values.length - 1;

            if (valueIndex != lastIndex) {
                bytes32 lastValue = set._values[lastIndex];

                // Move the lastValue to the index where the value to delete is
                set._values[valueIndex] = lastValue;
                // Update the tracked position of the lastValue (that was just moved)
                set._positions[lastValue] = position;
            }

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the tracked position for the deleted slot
            delete set._positions[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._positions[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        return set._values[index];
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function _values(Set storage set) private view returns (bytes32[] memory) {
        return set._values;
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
        bytes32[] memory store = _values(set._inner);
        bytes32[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(AddressSet storage set) internal view returns (address[] memory) {
        bytes32[] memory store = _values(set._inner);
        address[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

    /**
     * @dev Returns the value stored at position `index` in the set. O(1).
     *
     * Note that there are no guarantees on the ordering of values inside the
     * array, and it may change when more values are added or removed.
     *
     * Requirements:
     *
     * - `index` must be strictly less than {length}.
     */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }

    /**
     * @dev Return the entire set in an array
     *
     * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
     * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
     * this function has an unbounded cost, and using it as part of a state-changing function may render the function
     * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
     */
    function values(UintSet storage set) internal view returns (uint256[] memory) {
        bytes32[] memory store = _values(set._inner);
        uint256[] memory result;

        /// @solidity memory-safe-assembly
        assembly {
            result := store
        }

        return result;
    }
}
          

src/Pools/Jackpot/ISwapTools.sol

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.23;

interface ISwapTools {
    function anchorToken() external view returns (address);

    function getCurrentPriceMule12(
        address token
    ) external view returns (uint256 price);
}
          

src/Pools/Jackpot/Jackpot.sol

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "./ISwapTools.sol";
import "../../libs/SafeMath.sol";

contract Jackpot is AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;
    using SafeMath for uint256;

    bytes32 private constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

    struct Tick {
        uint256 id;
        address user;
        uint probability;
    }

    struct InfoView {
        uint currentTicks;
        uint256 currentBonusPool;
        uint256 totalBonus;
        uint latestBonusTimestamp;
        uint256 minBonus;
        uint256 maxBonus;
    }

    event Winner(uint256 tickId, address winner, uint256 bonus, uint timestamp);
    event NewTick(
        uint256 tickId,
        address user,
        uint256 probability,
        uint256 amount,
        uint256 amountUSD,
        uint timestamp
    );

    EnumerableSet.AddressSet private _callers;
    IERC20 public bonusToken;

    Tick[] public ticks;
    uint256 public totalProbability;
    uint256 public minBonus;
    uint256 public maxBonus;
    uint[] public tickProbability;
    uint256 public tokenPrice;
    uint256 public tickId;
    uint256 public totalBonus;
    uint public latestBonusTimestamp;
    ISwapTools public swapTools;
    address public tradeToken;

    constructor(
        IERC20 bonusToken_,
        address tradeToken_,
        ISwapTools swapTools_,
        uint256 minBonus_,
        uint256 maxBonus_
    ) {
        _grantRole(DEFAULT_ADMIN_ROLE, _msgSender());
        _grantRole(ADMIN_ROLE, _msgSender());
        bonusToken = bonusToken_;
        tradeToken = tradeToken_;
        swapTools = swapTools_;
        minBonus = minBonus_;
        maxBonus = maxBonus_;
        tickProbability = [
            0,
            100,
            200,
            300,
            400,
            500,
            600,
            700,
            800,
            900,
            1000
        ];
    }

    function lottery() public onlyCaller {
        uint256 bal = bonusToken.balanceOf(address(this));
        if (bal < minBonus) {
            return;
        }
        latestBonusTimestamp = block.timestamp;

        uint256 randomValue = uint256(
            keccak256(abi.encodePacked(block.timestamp, block.number))
        ) % totalProbability;

        uint256 cumulativeProbability = 0;
        for (uint256 i = 0; i < ticks.length; i++) {
            cumulativeProbability += ticks[i].probability;
            if (randomValue < cumulativeProbability) {
                uint256 bonus = bal > maxBonus ? maxBonus : bal;
                bonusToken.transfer(ticks[i].user, bonus);
                totalBonus += bonus;
                emit Winner(ticks[i].id, ticks[i].user, bonus, block.timestamp);
                break;
            }
        }

        totalProbability = 0;
        delete ticks;
    }

    function _addTick(address user, uint256 amount) internal {
        tickId++;
        (uint tick, uint256 amountUSD) = getTickTypeWithTradeAmount(amount);
        ticks.push(
            Tick({id: tickId, user: user, probability: tickProbability[tick]})
        );
        totalProbability += tickProbability[tick];

        emit NewTick(
            tickId,
            user,
            tickProbability[tick],
            amount,
            amountUSD,
            block.timestamp
        );
    }

    function tradeEvent(address, uint256 amount) public onlyCaller {
        _addTick(tx.origin, amount);

        tokenPrice = swapTools.getCurrentPriceMule12(tradeToken);
    }

    function getTickTypeWithTradeAmount(
        uint256 amount
    ) public view returns (uint tp, uint256 amountUSD) {
        uint8 decimals = IERC20Metadata(swapTools.anchorToken()).decimals();
        uint8 tradeTokenDecimals = IERC20Metadata(tradeToken).decimals();
        uint256 value = amount
            .mul(tokenPrice)
            .div(10 ** tradeTokenDecimals)
            .div(10 ** decimals)
            .div(1e12);
        return (getTickTypeWithTradeUsdAmount(value), value);
    }

    function getTickTypeWithTradeUsdAmount(
        uint256 amount
    ) public pure returns (uint256) {
        if (amount > 500) {
            return 10;
        }
        return amount / 50;
    }

    function setMinBouns(uint256 val) public onlyRole(ADMIN_ROLE) {
        require(val < maxBonus, "bad val");
        minBonus = val;
    }

    function setMaxBouns(uint256 val) public onlyRole(ADMIN_ROLE) {
        require(val > minBonus, "bad val");
        maxBonus = val;
    }

    function setLatestBonusTimestamp(uint val) public onlyRole(ADMIN_ROLE) {
        latestBonusTimestamp = val;
    }

    function setTickProbability(
        uint[] memory vals
    ) public onlyRole(ADMIN_ROLE) {
        require(vals.length == tickProbability.length, "bad length");
        tickProbability = vals;
    }

    function setTokenPrice(uint256 price) public onlyRole(ADMIN_ROLE) {
        require(price > 0, "bad price");
        tokenPrice = price;
    }

    function setTradeToken(address val) public onlyRole(ADMIN_ROLE) {
        require(val != address(0), "bad val");
        tradeToken = val;
    }

    function setSwapTools(ISwapTools val) public onlyRole(ADMIN_ROLE) {
        require(address(val) != address(0), "bad val");
        swapTools = val;
    }

    function addCaller(address val) public onlyRole(ADMIN_ROLE) {
        require(val != address(0), "Jackpot: val is the zero address");
        _callers.add(val);
    }

    function delCaller(
        address caller
    ) public onlyRole(ADMIN_ROLE) returns (bool) {
        require(caller != address(0), "Jackpot: caller is the zero address");
        return _callers.remove(caller);
    }

    function getCallers() public view returns (address[] memory ret) {
        return _callers.values();
    }

    function getView() public view returns (InfoView memory) {
        return
            InfoView({
                currentTicks: ticks.length,
                currentBonusPool: bonusToken.balanceOf(address(this)),
                totalBonus: totalBonus,
                latestBonusTimestamp: latestBonusTimestamp,
                minBonus: minBonus,
                maxBonus: maxBonus
            });
    }

    modifier onlyCaller() {
        require(_callers.contains(_msgSender()), "onlyCaller");
        _;
    }

    receive() external payable {}
}
          

src/Soby/ISwapFactory.sol

//SPDX-License-Identifier: MIT
pragma solidity >=0.5.0;

interface ISwapFactory {
    event PairCreated(
        address indexed token0,
        address indexed token1,
        address pair,
        uint256
    );

    function owner() external view returns (address);

    function feeTo() external view returns (address);

    function getPair(
        address tokenA,
        address tokenB
    ) external view returns (address pair);

    function allPairs(uint256) external view returns (address pair);

    function allPairsLength() external view returns (uint256);

    function createPair(
        address tokenA,
        address tokenB
    ) external returns (address pair);

    function setFeeTo(address) external;
}
          

src/libs/SafeMath.sol

// SPDX-License-Identifier: UNLICENSED

pragma solidity ^0.8.23;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    /**
     * @dev Multiplies two numbers, throws on overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
        if (a == 0) {
            return 0;
        }
        c = a * b;
        return c;
    }

    /**
     * @dev Integer division of two numbers, truncating the quotient.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        // assert(b > 0); // Solidity automatically throws when dividing by 0
        // uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold
        return a / b;
    }

    /**
     * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Adds two numbers, throws on overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
        c = a + b;
        return c;
    }
}
          

Compiler Settings

{"viaIR":false,"remappings":["@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/","@openzeppelin/contracts/=lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/","ds-test/=lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","murky/=lib/murky/","openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/","openzeppelin-contracts/=lib/openzeppelin-contracts/","openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/","solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/","solmate/=lib/solmate/src/"],"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers"]}},"optimizer":{"runs":1000,"enabled":true},"metadata":{"useLiteralContent":false,"bytecodeHash":"ipfs","appendCBOR":true},"libraries":{},"evmVersion":"paris"}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_factory","internalType":"address"},{"type":"address","name":"_swapRouter","internalType":"address"},{"type":"address","name":"_weth","internalType":"address"}]},{"type":"error","name":"ERC20InsufficientAllowance","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"allowance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InsufficientBalance","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"uint256","name":"balance","internalType":"uint256"},{"type":"uint256","name":"needed","internalType":"uint256"}]},{"type":"error","name":"ERC20InvalidApprover","inputs":[{"type":"address","name":"approver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidReceiver","inputs":[{"type":"address","name":"receiver","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSender","inputs":[{"type":"address","name":"sender","internalType":"address"}]},{"type":"error","name":"ERC20InvalidSpender","inputs":[{"type":"address","name":"spender","internalType":"address"}]},{"type":"error","name":"OwnableInvalidOwner","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"error","name":"OwnableUnauthorizedAccount","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"event","name":"AddLiquidity","inputs":[{"type":"uint256","name":"tokenAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"ethAmount","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Approval","inputs":[{"type":"address","name":"owner","internalType":"address","indexed":true},{"type":"address","name":"spender","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"SwapBack","inputs":[{"type":"uint256","name":"burn","internalType":"uint256","indexed":false},{"type":"uint256","name":"flexible","internalType":"uint256","indexed":false},{"type":"uint256","name":"liquidity","internalType":"uint256","indexed":false},{"type":"uint256","name":"jackpot","internalType":"uint256","indexed":false},{"type":"uint256","name":"development","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Trade","inputs":[{"type":"address","name":"user","internalType":"address","indexed":false},{"type":"address","name":"pair","internalType":"address","indexed":false},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false},{"type":"uint256","name":"side","internalType":"uint256","indexed":false},{"type":"uint256","name":"circulatingSupply","internalType":"uint256","indexed":false},{"type":"uint256","name":"timestamp","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"Transfer","inputs":[{"type":"address","name":"from","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addCaller","inputs":[{"type":"address","name":"val","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"addLiquidityEnabled","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"addPair","inputs":[{"type":"address","name":"pair","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"allowance","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"address","name":"spender","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"approve","inputs":[{"type":"address","name":"spender","internalType":"address"},{"type":"uint256","name":"value","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"balanceOf","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"burnFeeSell","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"clearStuckEthBalance","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"decimals","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"delCaller","inputs":[{"type":"address","name":"caller","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"delPair","inputs":[{"type":"address","name":"pair","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"developmentFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"developmentFeeSell","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"developmentWallet","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"doSwapBack","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"feeDenominator","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"flexibleFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"flexibleFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"flexibleFeeSell","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"flexibleWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"ret","internalType":"address[]"}],"name":"getCallers","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getCirculatingSupply","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getMinterLength","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"getPair","inputs":[{"type":"uint256","name":"index","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"inSwap","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initializePair","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isFeeExempt","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isPair","inputs":[{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"jackpotFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"jackpotFeeSell","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract Jackpot"}],"name":"jackpotWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"liquidityFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"liquidityFeeSell","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"name","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setAddLiquidityEnabled","inputs":[{"type":"bool","name":"_enabled","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setBuyFees","inputs":[{"type":"uint256","name":"_flexibleFee","internalType":"uint256"},{"type":"uint256","name":"_liquidityFee","internalType":"uint256"},{"type":"uint256","name":"_jackpotFee","internalType":"uint256"},{"type":"uint256","name":"_developmentFee","internalType":"uint256"},{"type":"uint256","name":"_burnFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setFeeReceivers","inputs":[{"type":"address","name":"_flexibleWallet","internalType":"address"},{"type":"address","name":"_jackpotWallet","internalType":"address"},{"type":"address","name":"_devWallet","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setIsFeeExempt","inputs":[{"type":"address","name":"holder","internalType":"address"},{"type":"bool","name":"exempt","internalType":"bool"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setSellFees","inputs":[{"type":"uint256","name":"_flexibleFee","internalType":"uint256"},{"type":"uint256","name":"_liquidityFee","internalType":"uint256"},{"type":"uint256","name":"_jackpotFee","internalType":"uint256"},{"type":"uint256","name":"_developmentFee","internalType":"uint256"},{"type":"uint256","name":"_burnFee","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"symbol","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalFeeBuy","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalFeeSell","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSupply","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transfer","inputs":[{"type":"address","name":"to","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"transferFrom","inputs":[{"type":"address","name":"sender","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"receive","stateMutability":"payable"}]
              

Contract Creation Code

Verify & Publish
0x60e06040526001600560146101000a81548160ff021916908315150217905550612710600f55606460105560c860115560c860125560966013556096601455610320601555606460165560c860175560c860185560966019556096601a55610320601b553480156200007057600080fd5b5060405162002e0538038062002e0583398101604081905262000093916200036f565b604080518082018252600480825263534f425960e01b602080840182905284518086019095529184529083015233916003620000d0838262000460565b506004620000df828262000460565b5050506001600160a01b0381166200011257604051631e4fbdf760e01b8152600060048201526024015b60405180910390fd5b6200011d816200018f565b50336000908152600860205260408082208054600160ff19918216811790925530845291909220805490911690911790556001600160a01b0383811660805282811660a052811660c052692c781f708c509f400000620001856200017e3390565b82620001e1565b5050505062000554565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b0382166200020d5760405163ec442f0560e01b81526000600482015260240162000109565b6200021b600083836200021f565b5050565b6001600160a01b0383166200024e5780600260008282546200024291906200052c565b90915550620002c29050565b6001600160a01b03831660009081526020819052604090205481811015620002a35760405163391434e360e21b81526001600160a01b0385166004820152602481018290526044810183905260640162000109565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b038216620002e057600280548290039055620002ff565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200034591815260200190565b60405180910390a3505050565b80516001600160a01b03811681146200036a57600080fd5b919050565b6000806000606084860312156200038557600080fd5b620003908462000352565b9250620003a06020850162000352565b9150620003b06040850162000352565b90509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620003e457607f821691505b6020821081036200040557634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200045b576000816000526020600020601f850160051c81016020861015620004365750805b601f850160051c820191505b81811015620004575782815560010162000442565b5050505b505050565b81516001600160401b038111156200047c576200047c620003b9565b62000494816200048d8454620003cf565b846200040b565b602080601f831160018114620004cc5760008415620004b35750858301515b600019600386901b1c1916600185901b17855562000457565b600085815260208120601f198616915b82811015620004fd57888601518255948401946001909101908401620004dc565b50858210156200051c5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b808201808211156200054e57634e487b7160e01b600052601160045260246000fd5b92915050565b60805160a05160c05161282d620005d860003960008181610bce015281816115ff015281816117720152818161180a015281816118a70152818161194001528181611dc101526121dc01526000818161152a0152818161165b01528181611e53015281816120c10152612136015260008181610bff015261220e015261282d6000f3fe6080604052600436106103225760003560e01c806373431e31116101a5578063b7eed4c4116100ec578063d7c0103211610095578063dd8d4c401161006f578063dd8d4c401461087b578063e5e31b131461089d578063f2fde38b146108bd578063fb5f27fb146108dd57600080fd5b8063d7c01032146107f4578063d830678614610814578063dd62ed3e1461083557600080fd5b8063c04a5414116100c6578063c04a541414610794578063c1cf53c4146107b4578063c2b7bbb6146107d457600080fd5b8063b7eed4c414610749578063bdf391cc1461075f578063bfa382b51461077f57600080fd5b80638fbbd7501161014e578063a9059cbb11610128578063a9059cbb146106f3578063aac46c9514610713578063b3b0902a1461073357600080fd5b80638fbbd750146106a957806395d89b41146106be578063a5bc5085146106d357600080fd5b806382d201161161017f57806382d2011614610654578063860139401461066a5780638da5cb5b1461068b57600080fd5b806373431e3114610608578063747293fb1461061e5780637cf848151461063e57600080fd5b806323b872dd116102695780634fab9e4c116102125780636c470595116101ec5780636c470595146105a757806370a08231146105bd578063715018a6146105f357600080fd5b80634fab9e4c1461055c5780635314841614610571578063658d4b7f1461058757600080fd5b8063313ce56711610243578063313ce567146104ee5780633f4218e01461050a57806347a28b791461053a57600080fd5b806323b872dd146104995780632b112e49146104b95780632d2f244b146104ce57600080fd5b806315674e8e116102cb5780631bb61f06116102a55780631bb61f061461044d578063231a418c14610463578063234a2daa1461048357600080fd5b806315674e8e1461040c578063180b0d7e1461042257806318160ddd1461043857600080fd5b806310d0cc7e116102fc57806310d0cc7e146103a85780631107b3a5146103e057806313921f0b146103f657600080fd5b80630323aac71461032e57806306fdde0314610356578063095ea7b31461037857600080fd5b3661032957005b600080fd5b34801561033a57600080fd5b506103436108f3565b6040519081526020015b60405180910390f35b34801561036257600080fd5b5061036b610904565b60405161034d91906123e0565b34801561038457600080fd5b50610398610393366004612428565b610996565b604051901515815260200161034d565b3480156103b457600080fd5b50601c546103c8906001600160a01b031681565b6040516001600160a01b03909116815260200161034d565b3480156103ec57600080fd5b5061034360185481565b34801561040257600080fd5b5061034360115481565b34801561041857600080fd5b5061034360105481565b34801561042e57600080fd5b50610343600f5481565b34801561044457600080fd5b50600254610343565b34801561045957600080fd5b50610343601a5481565b34801561046f57600080fd5b5061039861047e366004612454565b6109b0565b34801561048f57600080fd5b5061034360165481565b3480156104a557600080fd5b506103986104b4366004612471565b610a20565b3480156104c557600080fd5b50610343610a44565b3480156104da57600080fd5b50601d546103c8906001600160a01b031681565b3480156104fa57600080fd5b506040516006815260200161034d565b34801561051657600080fd5b50610398610525366004612454565b60086020526000908152604090205460ff1681565b34801561054657600080fd5b5061055a6105553660046124b2565b610aab565b005b34801561056857600080fd5b5061055a610b3c565b34801561057d57600080fd5b50610343601b5481565b34801561059357600080fd5b5061055a6105a23660046124fb565b610c92565b3480156105b357600080fd5b5061034360135481565b3480156105c957600080fd5b506103436105d8366004612454565b6001600160a01b031660009081526020819052604090205490565b3480156105ff57600080fd5b5061055a610cc5565b34801561061457600080fd5b50610343600a5481565b34801561062a57600080fd5b5061055a610639366004612454565b610cd9565b34801561064a57600080fd5b5061034360145481565b34801561066057600080fd5b5061034360125481565b34801561067657600080fd5b5060055461039890600160a01b900460ff1681565b34801561069757600080fd5b506005546001600160a01b03166103c8565b3480156106b557600080fd5b5061055a610d46565b3480156106ca57600080fd5b5061036b610da5565b3480156106df57600080fd5b506103986106ee366004612454565b610db4565b3480156106ff57600080fd5b5061039861070e366004612428565b610e1f565b34801561071f57600080fd5b5061055a61072e366004612534565b610e2c565b34801561073f57600080fd5b5061034360175481565b34801561075557600080fd5b5061034360195481565b34801561076b57600080fd5b506103c861077a366004612551565b610e52565b34801561078b57600080fd5b5061055a610ec4565b3480156107a057600080fd5b50601e546103c8906001600160a01b031681565b3480156107c057600080fd5b5061055a6107cf3660046124b2565b610f81565b3480156107e057600080fd5b506103986107ef366004612454565b611012565b34801561080057600080fd5b5061055a61080f36600461256a565b61107d565b34801561082057600080fd5b5060055461039890600160a81b900460ff1681565b34801561084157600080fd5b506103436108503660046125b5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561088757600080fd5b506108906110d1565b60405161034d9190612628565b3480156108a957600080fd5b506103986108b8366004612454565b6110dd565b3480156108c957600080fd5b5061055a6108d8366004612454565b6110ea565b3480156108e957600080fd5b5061034360155481565b60006108ff601f611141565b905090565b6060600380546109139061263b565b80601f016020809104026020016040519081016040528092919081815260200182805461093f9061263b565b801561098c5780601f106109615761010080835404028352916020019161098c565b820191906000526020600020905b81548152906001019060200180831161096f57829003601f168201915b5050505050905090565b6000336109a481858561114b565b60019150505b92915050565b60006109ba61115d565b6001600160a01b038216610a155760405162461bcd60e51b815260206004820152601a60248201527f63616c6c657220697320746865207a65726f206164647265737300000000000060448201526064015b60405180910390fd5b6109aa6006836111a3565b600033610a2e8582856111b8565b610a3985858561124f565b9150505b9392505050565b600060208190527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb55461dead82527f44ad89ba62b98ff34f51403ac22759b55759460c0bb5521eb4b6ee3cff49cf8354600254610aa1919061268b565b6108ff919061268b565b610ab361115d565b6000818385610ac2888a61269e565b610acc919061269e565b610ad6919061269e565b610ae0919061269e565b90506109c4811115610b1f5760405162461bcd60e51b81526020600482015260086024820152676f7665722032352560c01b6044820152606401610a0c565b601195909555601293909355601391909155601455601055601555565b610b4461115d565b601e54600160a01b900460ff1615610b9e5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610a0c565b6040517fc9c653960000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301523060248301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063c9c65396906044016020604051808303816000875af1158015610c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6e91906126b1565b9050610c7b601f82611469565b5050601e805460ff60a01b1916600160a01b179055565b610c9a61115d565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b610ccd61115d565b610cd7600061147e565b565b610ce161115d565b6001600160a01b038116610d375760405162461bcd60e51b815260206004820152601760248201527f76616c20697320746865207a65726f20616464726573730000000000000000006044820152606401610a0c565b610d42600682611469565b5050565b610d516006336114dd565b610d9d5760405162461bcd60e51b815260206004820152600a60248201527f6f6e6c7943616c6c6572000000000000000000000000000000000000000000006044820152606401610a0c565b610cd76114ff565b6060600480546109139061263b565b6000610dbe61115d565b6001600160a01b038216610e145760405162461bcd60e51b815260206004820152601860248201527f7061697220697320746865207a65726f206164647265737300000000000000006044820152606401610a0c565b6109aa601f836111a3565b6000610a3d33848461124f565b610e3461115d565b60058054911515600160a01b0260ff60a01b19909216919091179055565b60006001610e60601f611141565b610e6a919061268b565b821115610eb95760405162461bcd60e51b815260206004820152601360248201527f696e646578206f7574206f6620626f756e6473000000000000000000000000006044820152606401610a0c565b6109aa601f83611a3a565b610ecc61115d565b60408051600080825260208201928390524792909133918491610eee916126ce565b60006040518083038185875af1925050503d8060008114610f2b576040519150601f19603f3d011682016040523d82523d6000602084013e610f30565b606091505b5050905080610d425760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610a0c565b610f8961115d565b6000818385610f98888a61269e565b610fa2919061269e565b610fac919061269e565b610fb6919061269e565b90506109c4811115610ff55760405162461bcd60e51b81526020600482015260086024820152676f7665722032352560c01b6044820152606401610a0c565b601795909555601893909355601991909155601a55601655601b55565b600061101c61115d565b6001600160a01b0382166110725760405162461bcd60e51b815260206004820152601860248201527f7061697220697320746865207a65726f206164647265737300000000000000006044820152606401610a0c565b6109aa601f83611469565b61108561115d565b601c80546001600160a01b0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155601d805493851693821693909317909255601e8054919093169116179055565b60606108ff6006611a46565b60006109aa601f836114dd565b6110f261115d565b6001600160a01b038116611135576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b61113e8161147e565b50565b60006109aa825490565b6111588383836001611a53565b505050565b6005546001600160a01b03163314610cd7576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610a0c565b6000610a3d836001600160a01b038416611b5a565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611249578181101561123a576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610a0c565b61124984848484036000611a53565b50505050565b600554600090600160a81b900460ff16156112775761126f848484611c4d565b506001610a3d565b6001600160a01b03841660009081526008602052604081205460ff161580156112b957506001600160a01b03841660009081526008602052604090205460ff16155b9050600085856112c8826110dd565b15611381576112f6601054600955601154600a55601254600b55601354600c55601454600d55601554600e55565b5050601d546040517f67d198a60000000000000000000000000000000000000000000000000000000081526001600160a01b0380891660048301526024820187905260019350879289929116906367d198a690604401600060405180830381600087803b15801561136657600080fd5b505af1925050508015611377575060015b156113c6576113c6565b61138a876110dd565b156113c1576113b8601654600955601754600a55601854600b55601954600c55601a54600d55601b54600e55565b600292506113c6565b600093505b6000846113d357866113dd565b6113dd8988611cde565b90506113ea898983611c4d565b831561145a577fe6f814da7244d1ae6c61b54b5684858ba39cad7b9a91884be10060664987d7548383898761141d610a44565b604080516001600160a01b03968716815295909416602086015292840191909152606083015260808201524260a082015260c00160405180910390a15b50600198975050505050505050565b6000610a3d836001600160a01b038416611d1b565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811660009081526001830160205260408120541515610a3d565b6005805460ff60a81b1916600160a81b17905530600090815260208190526040812054905061154f307f00000000000000000000000000000000000000000000000000000000000000008361114b565b6000600e546009548361156291906126ea565b61156c9190612701565b90506000600e54600b548461158191906126ea565b61158b9190612701565b9050611597828461268b565b92506115a3818461268b565b604080516002808252606082018352929550600092909160208301908036833701905050905030816000815181106115dd576115dd612723565b60200260200101906001600160a01b031690816001600160a01b0316815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061163157611631612723565b6001600160a01b039283166020918202929092010152604051632955261160e11b815260009147917f0000000000000000000000000000000000000000000000000000000000000000909116906352aa4c229061169c90899086908890309083904290600401612739565b600060405180830381600087803b1580156116b657600080fd5b505af19250505080156116c7575060015b156116d157600191505b816116e157505050505050611a2b565b6116ee3061dead87611c4d565b60006116fa824761268b565b90506000600b54600954600e54611711919061268b565b61171b919061268b565b9050600081600a548461172e91906126ea565b6117389190612701565b9050600082600c548561174b91906126ea565b6117559190612701565b9050600081611764848761268b565b61176e919061268b565b90507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117cb57600080fd5b505af11580156117df573d6000803e3d6000fd5b5050601c5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018890527f0000000000000000000000000000000000000000000000000000000000000000909116935063a9059cbb925060440190506020604051808303816000875af1158015611859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187d919061277d565b50601d5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af11580156118f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611916919061277d565b50601e5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f00000000000000000000000000000000000000000000000000000000000000009091169063a9059cbb906044016020604051808303816000875af115801561198b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119af919061277d565b50600554600160a01b900460ff16156119ca576119ca611d6a565b604080518b8152602081018590529081018a905260608101839052608081018290524260a08201527ffc18969df35ccba802c14035d6d6273bf5bb4d8b9de8faa7aba1044c813b13009060c00160405180910390a150505050505050505050505b6005805460ff60a81b19169055565b6000610a3d8383611ef2565b60606000610a3d83611f1c565b6001600160a01b038416611a96576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038316611ad9576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561124957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611b4c91815260200190565b60405180910390a350505050565b60008181526001830160205260408120548015611c43576000611b7e60018361268b565b8554909150600090611b929060019061268b565b9050808214611bf7576000866000018281548110611bb257611bb2612723565b9060005260206000200154905080876000018481548110611bd557611bd5612723565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611c0857611c0861279a565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109aa565b60009150506109aa565b6001600160a01b038316611c90576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038216611cd3576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b611158838383611f78565b600080600f54600e5484611cf291906126ea565b611cfc9190612701565b9050611d09843083611c4d565b611d13818461268b565b949350505050565b6000818152600183016020526040812054611d62575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109aa565b5060006109aa565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611d9f57611d9f612723565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000000000000000000000000000000000000000000081600181518110611df357611df3612723565b6001600160a01b039290921660209283029190910182015230600090815290819052604081205490611e26600283612701565b90506103e8811015611e3757505050565b604051632955261160e11b815247906000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906352aa4c2290611e9290869085908a90309083904290600401612739565b600060405180830381600087803b158015611eac57600080fd5b505af1925050508015611ebd575060015b15611ec6575060015b80611ed2575050505050565b6000611ede834761268b565b9050611eea84826120bb565b505050505050565b6000826000018281548110611f0957611f09612723565b9060005260206000200154905092915050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611f6c57602002820191906000526020600020905b815481526020019060010190808311611f58575b50505050509050919050565b6001600160a01b038316611fa3578060026000828254611f98919061269e565b9091555061202e9050565b6001600160a01b0383166000908152602081905260409020548181101561200f576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610a0c565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661204a57600280548290039055612069565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516120ae91815260200190565b60405180910390a3505050565b6120e6307f00000000000000000000000000000000000000000000000000000000000000008461114b565b6040517ff305d719000000000000000000000000000000000000000000000000000000008152306004820181905260248201849052600060448301819052606483015260848201524260a48201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063f305d71990839060c40160606040518083038185885af1935050505080156121a5575060408051601f3d908101601f191682019092526121a2918101906127b0565b60015b15610d425750506040517fe6a439050000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081166004830152306024830152600092507f0000000000000000000000000000000000000000000000000000000000000000169063e6a4390590604401602060405180830381865afa158015612255573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227991906126b1565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156122dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230091906127de565b60405163a9059cbb60e01b815261dead6004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015612352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612376919061277d565b506040805185815260208101859052428183015290517ff75993dbe1645872cbbea6395e1feebee76b435baf0e4d62d7eac269c6f57b249181900360600190a150505050565b60005b838110156123d75781810151838201526020016123bf565b50506000910152565b60208152600082518060208401526123ff8160408501602087016123bc565b601f01601f19169190910160400192915050565b6001600160a01b038116811461113e57600080fd5b6000806040838503121561243b57600080fd5b823561244681612413565b946020939093013593505050565b60006020828403121561246657600080fd5b8135610a3d81612413565b60008060006060848603121561248657600080fd5b833561249181612413565b925060208401356124a181612413565b929592945050506040919091013590565b600080600080600060a086880312156124ca57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b801515811461113e57600080fd5b6000806040838503121561250e57600080fd5b823561251981612413565b91506020830135612529816124ed565b809150509250929050565b60006020828403121561254657600080fd5b8135610a3d816124ed565b60006020828403121561256357600080fd5b5035919050565b60008060006060848603121561257f57600080fd5b833561258a81612413565b9250602084013561259a81612413565b915060408401356125aa81612413565b809150509250925092565b600080604083850312156125c857600080fd5b82356125d381612413565b9150602083013561252981612413565b60008151808452602080850194506020840160005b8381101561261d5781516001600160a01b0316875295820195908201906001016125f8565b509495945050505050565b602081526000610a3d60208301846125e3565b600181811c9082168061264f57607f821691505b60208210810361266f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156109aa576109aa612675565b808201808211156109aa576109aa612675565b6000602082840312156126c357600080fd5b8151610a3d81612413565b600082516126e08184602087016123bc565b9190910192915050565b80820281158282048414176109aa576109aa612675565b60008261271e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b86815285602082015260c06040820152600061275860c08301876125e3565b6001600160a01b03958616606084015293909416608082015260a00152949350505050565b60006020828403121561278f57600080fd5b8151610a3d816124ed565b634e487b7160e01b600052603160045260246000fd5b6000806000606084860312156127c557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156127f057600080fd5b505191905056fea26469706673582212205d02edbcd14b275219ee4f192e922ccc6a4931b8f73a2f4c9cde519d3d270c3964736f6c6343000818003300000000000000000000000018e621b64d7808c3c47bccbbd7485d23f257d26f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed14480000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af

Deployed ByteCode

0x6080604052600436106103225760003560e01c806373431e31116101a5578063b7eed4c4116100ec578063d7c0103211610095578063dd8d4c401161006f578063dd8d4c401461087b578063e5e31b131461089d578063f2fde38b146108bd578063fb5f27fb146108dd57600080fd5b8063d7c01032146107f4578063d830678614610814578063dd62ed3e1461083557600080fd5b8063c04a5414116100c6578063c04a541414610794578063c1cf53c4146107b4578063c2b7bbb6146107d457600080fd5b8063b7eed4c414610749578063bdf391cc1461075f578063bfa382b51461077f57600080fd5b80638fbbd7501161014e578063a9059cbb11610128578063a9059cbb146106f3578063aac46c9514610713578063b3b0902a1461073357600080fd5b80638fbbd750146106a957806395d89b41146106be578063a5bc5085146106d357600080fd5b806382d201161161017f57806382d2011614610654578063860139401461066a5780638da5cb5b1461068b57600080fd5b806373431e3114610608578063747293fb1461061e5780637cf848151461063e57600080fd5b806323b872dd116102695780634fab9e4c116102125780636c470595116101ec5780636c470595146105a757806370a08231146105bd578063715018a6146105f357600080fd5b80634fab9e4c1461055c5780635314841614610571578063658d4b7f1461058757600080fd5b8063313ce56711610243578063313ce567146104ee5780633f4218e01461050a57806347a28b791461053a57600080fd5b806323b872dd146104995780632b112e49146104b95780632d2f244b146104ce57600080fd5b806315674e8e116102cb5780631bb61f06116102a55780631bb61f061461044d578063231a418c14610463578063234a2daa1461048357600080fd5b806315674e8e1461040c578063180b0d7e1461042257806318160ddd1461043857600080fd5b806310d0cc7e116102fc57806310d0cc7e146103a85780631107b3a5146103e057806313921f0b146103f657600080fd5b80630323aac71461032e57806306fdde0314610356578063095ea7b31461037857600080fd5b3661032957005b600080fd5b34801561033a57600080fd5b506103436108f3565b6040519081526020015b60405180910390f35b34801561036257600080fd5b5061036b610904565b60405161034d91906123e0565b34801561038457600080fd5b50610398610393366004612428565b610996565b604051901515815260200161034d565b3480156103b457600080fd5b50601c546103c8906001600160a01b031681565b6040516001600160a01b03909116815260200161034d565b3480156103ec57600080fd5b5061034360185481565b34801561040257600080fd5b5061034360115481565b34801561041857600080fd5b5061034360105481565b34801561042e57600080fd5b50610343600f5481565b34801561044457600080fd5b50600254610343565b34801561045957600080fd5b50610343601a5481565b34801561046f57600080fd5b5061039861047e366004612454565b6109b0565b34801561048f57600080fd5b5061034360165481565b3480156104a557600080fd5b506103986104b4366004612471565b610a20565b3480156104c557600080fd5b50610343610a44565b3480156104da57600080fd5b50601d546103c8906001600160a01b031681565b3480156104fa57600080fd5b506040516006815260200161034d565b34801561051657600080fd5b50610398610525366004612454565b60086020526000908152604090205460ff1681565b34801561054657600080fd5b5061055a6105553660046124b2565b610aab565b005b34801561056857600080fd5b5061055a610b3c565b34801561057d57600080fd5b50610343601b5481565b34801561059357600080fd5b5061055a6105a23660046124fb565b610c92565b3480156105b357600080fd5b5061034360135481565b3480156105c957600080fd5b506103436105d8366004612454565b6001600160a01b031660009081526020819052604090205490565b3480156105ff57600080fd5b5061055a610cc5565b34801561061457600080fd5b50610343600a5481565b34801561062a57600080fd5b5061055a610639366004612454565b610cd9565b34801561064a57600080fd5b5061034360145481565b34801561066057600080fd5b5061034360125481565b34801561067657600080fd5b5060055461039890600160a01b900460ff1681565b34801561069757600080fd5b506005546001600160a01b03166103c8565b3480156106b557600080fd5b5061055a610d46565b3480156106ca57600080fd5b5061036b610da5565b3480156106df57600080fd5b506103986106ee366004612454565b610db4565b3480156106ff57600080fd5b5061039861070e366004612428565b610e1f565b34801561071f57600080fd5b5061055a61072e366004612534565b610e2c565b34801561073f57600080fd5b5061034360175481565b34801561075557600080fd5b5061034360195481565b34801561076b57600080fd5b506103c861077a366004612551565b610e52565b34801561078b57600080fd5b5061055a610ec4565b3480156107a057600080fd5b50601e546103c8906001600160a01b031681565b3480156107c057600080fd5b5061055a6107cf3660046124b2565b610f81565b3480156107e057600080fd5b506103986107ef366004612454565b611012565b34801561080057600080fd5b5061055a61080f36600461256a565b61107d565b34801561082057600080fd5b5060055461039890600160a81b900460ff1681565b34801561084157600080fd5b506103436108503660046125b5565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561088757600080fd5b506108906110d1565b60405161034d9190612628565b3480156108a957600080fd5b506103986108b8366004612454565b6110dd565b3480156108c957600080fd5b5061055a6108d8366004612454565b6110ea565b3480156108e957600080fd5b5061034360155481565b60006108ff601f611141565b905090565b6060600380546109139061263b565b80601f016020809104026020016040519081016040528092919081815260200182805461093f9061263b565b801561098c5780601f106109615761010080835404028352916020019161098c565b820191906000526020600020905b81548152906001019060200180831161096f57829003601f168201915b5050505050905090565b6000336109a481858561114b565b60019150505b92915050565b60006109ba61115d565b6001600160a01b038216610a155760405162461bcd60e51b815260206004820152601a60248201527f63616c6c657220697320746865207a65726f206164647265737300000000000060448201526064015b60405180910390fd5b6109aa6006836111a3565b600033610a2e8582856111b8565b610a3985858561124f565b9150505b9392505050565b600060208190527fad3228b676f7d3cd4284a5443f17f1962b36e491b30a40b2405849e597ba5fb55461dead82527f44ad89ba62b98ff34f51403ac22759b55759460c0bb5521eb4b6ee3cff49cf8354600254610aa1919061268b565b6108ff919061268b565b610ab361115d565b6000818385610ac2888a61269e565b610acc919061269e565b610ad6919061269e565b610ae0919061269e565b90506109c4811115610b1f5760405162461bcd60e51b81526020600482015260086024820152676f7665722032352560c01b6044820152606401610a0c565b601195909555601293909355601391909155601455601055601555565b610b4461115d565b601e54600160a01b900460ff1615610b9e5760405162461bcd60e51b815260206004820152601360248201527f416c726561647920696e697469616c697a6564000000000000000000000000006044820152606401610a0c565b6040517fc9c653960000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af811660048301523060248301526000917f00000000000000000000000018e621b64d7808c3c47bccbbd7485d23f257d26f9091169063c9c65396906044016020604051808303816000875af1158015610c4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6e91906126b1565b9050610c7b601f82611469565b5050601e805460ff60a01b1916600160a01b179055565b610c9a61115d565b6001600160a01b03919091166000908152600860205260409020805460ff1916911515919091179055565b610ccd61115d565b610cd7600061147e565b565b610ce161115d565b6001600160a01b038116610d375760405162461bcd60e51b815260206004820152601760248201527f76616c20697320746865207a65726f20616464726573730000000000000000006044820152606401610a0c565b610d42600682611469565b5050565b610d516006336114dd565b610d9d5760405162461bcd60e51b815260206004820152600a60248201527f6f6e6c7943616c6c6572000000000000000000000000000000000000000000006044820152606401610a0c565b610cd76114ff565b6060600480546109139061263b565b6000610dbe61115d565b6001600160a01b038216610e145760405162461bcd60e51b815260206004820152601860248201527f7061697220697320746865207a65726f206164647265737300000000000000006044820152606401610a0c565b6109aa601f836111a3565b6000610a3d33848461124f565b610e3461115d565b60058054911515600160a01b0260ff60a01b19909216919091179055565b60006001610e60601f611141565b610e6a919061268b565b821115610eb95760405162461bcd60e51b815260206004820152601360248201527f696e646578206f7574206f6620626f756e6473000000000000000000000000006044820152606401610a0c565b6109aa601f83611a3a565b610ecc61115d565b60408051600080825260208201928390524792909133918491610eee916126ce565b60006040518083038185875af1925050503d8060008114610f2b576040519150601f19603f3d011682016040523d82523d6000602084013e610f30565b606091505b5050905080610d425760405162461bcd60e51b815260206004820152601360248201527f4554485f5452414e534645525f4641494c4544000000000000000000000000006044820152606401610a0c565b610f8961115d565b6000818385610f98888a61269e565b610fa2919061269e565b610fac919061269e565b610fb6919061269e565b90506109c4811115610ff55760405162461bcd60e51b81526020600482015260086024820152676f7665722032352560c01b6044820152606401610a0c565b601795909555601893909355601991909155601a55601655601b55565b600061101c61115d565b6001600160a01b0382166110725760405162461bcd60e51b815260206004820152601860248201527f7061697220697320746865207a65726f206164647265737300000000000000006044820152606401610a0c565b6109aa601f83611469565b61108561115d565b601c80546001600160a01b0394851673ffffffffffffffffffffffffffffffffffffffff1991821617909155601d805493851693821693909317909255601e8054919093169116179055565b60606108ff6006611a46565b60006109aa601f836114dd565b6110f261115d565b6001600160a01b038116611135576040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b61113e8161147e565b50565b60006109aa825490565b6111588383836001611a53565b505050565b6005546001600160a01b03163314610cd7576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610a0c565b6000610a3d836001600160a01b038416611b5a565b6001600160a01b038381166000908152600160209081526040808320938616835292905220546000198114611249578181101561123a576040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526001600160a01b03841660048201526024810182905260448101839052606401610a0c565b61124984848484036000611a53565b50505050565b600554600090600160a81b900460ff16156112775761126f848484611c4d565b506001610a3d565b6001600160a01b03841660009081526008602052604081205460ff161580156112b957506001600160a01b03841660009081526008602052604090205460ff16155b9050600085856112c8826110dd565b15611381576112f6601054600955601154600a55601254600b55601354600c55601454600d55601554600e55565b5050601d546040517f67d198a60000000000000000000000000000000000000000000000000000000081526001600160a01b0380891660048301526024820187905260019350879289929116906367d198a690604401600060405180830381600087803b15801561136657600080fd5b505af1925050508015611377575060015b156113c6576113c6565b61138a876110dd565b156113c1576113b8601654600955601754600a55601854600b55601954600c55601a54600d55601b54600e55565b600292506113c6565b600093505b6000846113d357866113dd565b6113dd8988611cde565b90506113ea898983611c4d565b831561145a577fe6f814da7244d1ae6c61b54b5684858ba39cad7b9a91884be10060664987d7548383898761141d610a44565b604080516001600160a01b03968716815295909416602086015292840191909152606083015260808201524260a082015260c00160405180910390a15b50600198975050505050505050565b6000610a3d836001600160a01b038416611d1b565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03811660009081526001830160205260408120541515610a3d565b6005805460ff60a81b1916600160a81b17905530600090815260208190526040812054905061154f307f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed14488361114b565b6000600e546009548361156291906126ea565b61156c9190612701565b90506000600e54600b548461158191906126ea565b61158b9190612701565b9050611597828461268b565b92506115a3818461268b565b604080516002808252606082018352929550600092909160208301908036833701905050905030816000815181106115dd576115dd612723565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af8160018151811061163157611631612723565b6001600160a01b039283166020918202929092010152604051632955261160e11b815260009147917f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed1448909116906352aa4c229061169c90899086908890309083904290600401612739565b600060405180830381600087803b1580156116b657600080fd5b505af19250505080156116c7575060015b156116d157600191505b816116e157505050505050611a2b565b6116ee3061dead87611c4d565b60006116fa824761268b565b90506000600b54600954600e54611711919061268b565b61171b919061268b565b9050600081600a548461172e91906126ea565b6117389190612701565b9050600082600c548561174b91906126ea565b6117559190612701565b9050600081611764848761268b565b61176e919061268b565b90507f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af6001600160a01b031663d0e30db0866040518263ffffffff1660e01b81526004016000604051808303818588803b1580156117cb57600080fd5b505af11580156117df573d6000803e3d6000fd5b5050601c5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018890527f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af909116935063a9059cbb925060440190506020604051808303816000875af1158015611859573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187d919061277d565b50601d5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018490527f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af9091169063a9059cbb906044016020604051808303816000875af11580156118f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611916919061277d565b50601e5460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390527f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af9091169063a9059cbb906044016020604051808303816000875af115801561198b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119af919061277d565b50600554600160a01b900460ff16156119ca576119ca611d6a565b604080518b8152602081018590529081018a905260608101839052608081018290524260a08201527ffc18969df35ccba802c14035d6d6273bf5bb4d8b9de8faa7aba1044c813b13009060c00160405180910390a150505050505050505050505b6005805460ff60a81b19169055565b6000610a3d8383611ef2565b60606000610a3d83611f1c565b6001600160a01b038416611a96576040517fe602df0500000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038316611ad9576040517f94280d6200000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038085166000908152600160209081526040808320938716835292905220829055801561124957826001600160a01b0316846001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611b4c91815260200190565b60405180910390a350505050565b60008181526001830160205260408120548015611c43576000611b7e60018361268b565b8554909150600090611b929060019061268b565b9050808214611bf7576000866000018281548110611bb257611bb2612723565b9060005260206000200154905080876000018481548110611bd557611bd5612723565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080611c0857611c0861279a565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506109aa565b60009150506109aa565b6001600160a01b038316611c90576040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b6001600160a01b038216611cd3576040517fec442f0500000000000000000000000000000000000000000000000000000000815260006004820152602401610a0c565b611158838383611f78565b600080600f54600e5484611cf291906126ea565b611cfc9190612701565b9050611d09843083611c4d565b611d13818461268b565b949350505050565b6000818152600183016020526040812054611d62575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556109aa565b5060006109aa565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110611d9f57611d9f612723565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af81600181518110611df357611df3612723565b6001600160a01b039290921660209283029190910182015230600090815290819052604081205490611e26600283612701565b90506103e8811015611e3757505050565b604051632955261160e11b815247906000906001600160a01b037f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed144816906352aa4c2290611e9290869085908a90309083904290600401612739565b600060405180830381600087803b158015611eac57600080fd5b505af1925050508015611ebd575060015b15611ec6575060015b80611ed2575050505050565b6000611ede834761268b565b9050611eea84826120bb565b505050505050565b6000826000018281548110611f0957611f09612723565b9060005260206000200154905092915050565b606081600001805480602002602001604051908101604052809291908181526020018280548015611f6c57602002820191906000526020600020905b815481526020019060010190808311611f58575b50505050509050919050565b6001600160a01b038316611fa3578060026000828254611f98919061269e565b9091555061202e9050565b6001600160a01b0383166000908152602081905260409020548181101561200f576040517fe450d38c0000000000000000000000000000000000000000000000000000000081526001600160a01b03851660048201526024810182905260448101839052606401610a0c565b6001600160a01b03841660009081526020819052604090209082900390555b6001600160a01b03821661204a57600280548290039055612069565b6001600160a01b03821660009081526020819052604090208054820190555b816001600160a01b0316836001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516120ae91815260200190565b60405180910390a3505050565b6120e6307f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed14488461114b565b6040517ff305d719000000000000000000000000000000000000000000000000000000008152306004820181905260248201849052600060448301819052606483015260848201524260a48201527f0000000000000000000000006a63830e24f9a2f9c295fb2150107d0390ed14486001600160a01b03169063f305d71990839060c40160606040518083038185885af1935050505080156121a5575060408051601f3d908101601f191682019092526121a2918101906127b0565b60015b15610d425750506040517fe6a439050000000000000000000000000000000000000000000000000000000081526001600160a01b037f0000000000000000000000003fb787101dc6be47cfe18aeee15404dcc842e6af81166004830152306024830152600092507f00000000000000000000000018e621b64d7808c3c47bccbbd7485d23f257d26f169063e6a4390590604401602060405180830381865afa158015612255573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061227991906126b1565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529091506000906001600160a01b038316906370a0823190602401602060405180830381865afa1580156122dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230091906127de565b60405163a9059cbb60e01b815261dead6004820152602481018290529091506001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015612352573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612376919061277d565b506040805185815260208101859052428183015290517ff75993dbe1645872cbbea6395e1feebee76b435baf0e4d62d7eac269c6f57b249181900360600190a150505050565b60005b838110156123d75781810151838201526020016123bf565b50506000910152565b60208152600082518060208401526123ff8160408501602087016123bc565b601f01601f19169190910160400192915050565b6001600160a01b038116811461113e57600080fd5b6000806040838503121561243b57600080fd5b823561244681612413565b946020939093013593505050565b60006020828403121561246657600080fd5b8135610a3d81612413565b60008060006060848603121561248657600080fd5b833561249181612413565b925060208401356124a181612413565b929592945050506040919091013590565b600080600080600060a086880312156124ca57600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b801515811461113e57600080fd5b6000806040838503121561250e57600080fd5b823561251981612413565b91506020830135612529816124ed565b809150509250929050565b60006020828403121561254657600080fd5b8135610a3d816124ed565b60006020828403121561256357600080fd5b5035919050565b60008060006060848603121561257f57600080fd5b833561258a81612413565b9250602084013561259a81612413565b915060408401356125aa81612413565b809150509250925092565b600080604083850312156125c857600080fd5b82356125d381612413565b9150602083013561252981612413565b60008151808452602080850194506020840160005b8381101561261d5781516001600160a01b0316875295820195908201906001016125f8565b509495945050505050565b602081526000610a3d60208301846125e3565b600181811c9082168061264f57607f821691505b60208210810361266f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b818103818111156109aa576109aa612675565b808201808211156109aa576109aa612675565b6000602082840312156126c357600080fd5b8151610a3d81612413565b600082516126e08184602087016123bc565b9190910192915050565b80820281158282048414176109aa576109aa612675565b60008261271e57634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b86815285602082015260c06040820152600061275860c08301876125e3565b6001600160a01b03958616606084015293909416608082015260a00152949350505050565b60006020828403121561278f57600080fd5b8151610a3d816124ed565b634e487b7160e01b600052603160045260246000fd5b6000806000606084860312156127c557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156127f057600080fd5b505191905056fea26469706673582212205d02edbcd14b275219ee4f192e922ccc6a4931b8f73a2f4c9cde519d3d270c3964736f6c63430008180033