ETH Price: $2,871.60 (-2.63%)
 

Overview

Max Total Supply

9,993 KATANA

Holders

6

Transfers

-
0

Market

Price

$0.00 @ 0.000000 ETH

Onchain Market Cap

-

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information

Contract Source Code Verified (Exact Match)

Contract Name:
KatanaERC20HX

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion, MIT license
File 1 of 40 : KatanaERC20HX.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "./extensions/ERC20HXFeesOracle.sol";

contract KatanaERC20HX is ERC20HXFeesOracle {
    constructor(
        address _nftContractAddress,
        string memory _tokenName,
        string memory _tokenSymbol
    ) ERC20(_tokenName, _tokenSymbol) ERC20Permit(_tokenSymbol) {
        _mint(msg.sender, 10000 * 10 ** decimals());
        _setNFTContract(_nftContractAddress);
    }
}

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../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 => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    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 override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @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 override 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 override 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 override 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 `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @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 Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @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.
     *
     * _Available since v3.1._
     */
    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 `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

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

pragma solidity ^0.8.0;

import "../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.
 *
 * By default, the owner account will be the one that deploys the contract. 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;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @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 {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @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 {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _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);
    }
}

File 5 of 40 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)

pragma solidity ^0.8.0;

import "../token/ERC20/IERC20.sol";

File 6 of 40 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.0;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 7 of 40 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC721.sol)

pragma solidity ^0.8.0;

import "../token/ERC721/IERC721.sol";

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
     * `nonReentrant` function in the call stack.
     */
    function _reentrancyGuardEntered() internal view returns (bool) {
        return _status == _ENTERED;
    }
}

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

pragma solidity ^0.8.0;

import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.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}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * 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.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

    mapping(address => mapping(address => 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 override returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual override 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 override returns (uint8) {
        return 18;
    }

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

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override 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 `amount`.
     */
    function transfer(address to, uint256 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, amount);
        return true;
    }

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

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `amount` 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 amount) public virtual override returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, amount);
        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 `amount`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, amount);
        _transfer(from, to, amount);
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, allowance(owner, spender) + addedValue);
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        address owner = _msgSender();
        uint256 currentAllowance = allowance(owner, spender);
        require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
        unchecked {
            _approve(owner, spender, currentAllowance - subtractedValue);
        }

        return true;
    }

    /**
     * @dev Moves `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.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(address from, address to, uint256 amount) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

        uint256 fromBalance = _balances[from];
        require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
        unchecked {
            _balances[from] = fromBalance - amount;
            // Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
            // decrementing then incrementing.
            _balances[to] += amount;
        }

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply += amount;
        unchecked {
            // Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
            _balances[account] += amount;
        }
        emit Transfer(address(0), account, amount);

        _afterTokenTransfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        uint256 accountBalance = _balances[account];
        require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
        unchecked {
            _balances[account] = accountBalance - amount;
            // Overflow not possible: amount <= accountBalance <= totalSupply.
            _totalSupply -= amount;
        }

        emit Transfer(account, address(0), amount);

        _afterTokenTransfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` 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.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

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

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}

    /**
     * @dev Hook that is called after any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * has been transferred to `to`.
     * - when `from` is zero, `amount` tokens have been minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens have been burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/extensions/ERC20Burnable.sol)

pragma solidity ^0.8.0;

import "../ERC20.sol";
import "../../../utils/Context.sol";

/**
 * @dev Extension of {ERC20} that allows token holders to destroy both their own
 * tokens and those that they have an allowance for, in a way that can be
 * recognized off-chain (via event analysis).
 */
abstract contract ERC20Burnable is Context, ERC20 {
    /**
     * @dev Destroys `amount` tokens from the caller.
     *
     * See {ERC20-_burn}.
     */
    function burn(uint256 amount) public virtual {
        _burn(_msgSender(), amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, deducting from the caller's
     * allowance.
     *
     * See {ERC20-_burn} and {ERC20-allowance}.
     *
     * Requirements:
     *
     * - the caller must have allowance for ``accounts``'s tokens of at least
     * `amount`.
     */
    function burnFrom(address account, uint256 amount) public virtual {
        _spendAllowance(account, _msgSender(), amount);
        _burn(account, amount);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (token/ERC20/extensions/ERC20Permit.sol)

pragma solidity ^0.8.0;

import "./IERC20Permit.sol";
import "../ERC20.sol";
import "../../../utils/cryptography/ECDSA.sol";
import "../../../utils/cryptography/EIP712.sol";
import "../../../utils/Counters.sol";

/**
 * @dev Implementation 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.
 *
 * _Available since v3.4._
 */
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
    using Counters for Counters.Counter;

    mapping(address => Counters.Counter) private _nonces;

    // solhint-disable-next-line var-name-mixedcase
    bytes32 private constant _PERMIT_TYPEHASH =
        keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
    /**
     * @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
     * However, to ensure consistency with the upgradeable transpiler, we will continue
     * to reserve a slot.
     * @custom:oz-renamed-from _PERMIT_TYPEHASH
     */
    // solhint-disable-next-line var-name-mixedcase
    bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;

    /**
     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
     *
     * It's a good idea to use the same `name` that is defined as the ERC20 token name.
     */
    constructor(string memory name) EIP712(name, "1") {}

    /**
     * @inheritdoc IERC20Permit
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual override {
        require(block.timestamp <= deadline, "ERC20Permit: expired deadline");

        bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));

        bytes32 hash = _hashTypedDataV4(structHash);

        address signer = ECDSA.recover(hash, v, r, s);
        require(signer == owner, "ERC20Permit: invalid signature");

        _approve(owner, spender, value);
    }

    /**
     * @inheritdoc IERC20Permit
     */
    function nonces(address owner) public view virtual override returns (uint256) {
        return _nonces[owner].current();
    }

    /**
     * @inheritdoc IERC20Permit
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view override returns (bytes32) {
        return _domainSeparatorV4();
    }

    /**
     * @dev "Consume a nonce": return the current value and increment.
     *
     * _Available since v4.1._
     */
    function _useNonce(address owner) internal virtual returns (uint256 current) {
        Counters.Counter storage nonce = _nonces[owner];
        current = nonce.current();
        nonce.increment();
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 *
 * _Available since v4.1._
 */
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);
}

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

pragma solidity ^0.8.0;

/**
 * @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);
}

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

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional metadata extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Metadata is IERC721 {
    /**
     * @dev Returns the token collection name.
     */
    function name() external view returns (string memory);

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

    /**
     * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
     */
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 17 of 40 : IERC721Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

/**
 * @title ERC721 token receiver interface
 * @dev Interface for any contract that wants to support safeTransfers
 * from ERC721 asset contracts.
 */
interface IERC721Receiver {
    /**
     * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
     * by `operator` from `from`, this function is called.
     *
     * It must return its Solidity selector to confirm the token transfer.
     * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
     *
     * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
     */
    function onERC721Received(
        address operator,
        address from,
        uint256 tokenId,
        bytes calldata data
    ) external returns (bytes4);
}

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

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     *
     * Furthermore, `isContract` will also return true if the target contract within
     * the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
     * which only has an effect at the end of a transaction.
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @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.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @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, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * 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.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @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`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResultFromTarget(target, success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

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

    /**
     * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
     * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
     *
     * _Available since v4.8._
     */
    function verifyCallResultFromTarget(
        address target,
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        if (success) {
            if (returndata.length == 0) {
                // only check isContract if the call was successful and the return data is empty
                // otherwise we already know that it was a contract
                require(isContract(target), "Address: call to non-contract");
            }
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    /**
     * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason or using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            _revert(returndata, errorMessage);
        }
    }

    function _revert(bytes memory returndata, string memory errorMessage) 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(errorMessage);
        }
    }
}

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

pragma solidity ^0.8.0;

/**
 * @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;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV // Deprecated in v4.8
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            /// @solidity memory-safe-assembly
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError) {
        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
        uint8 v = uint8((uint256(vs) >> 255) + 27);
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,
     * `r` and `s` signature fields separately.
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address, RecoverError) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
            return (address(0), RecoverError.InvalidSignatureS);
        }

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32 message) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32")
            mstore(0x1c, hash)
            message := keccak256(0x00, 0x3c)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 data) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, "\x19\x01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            data := keccak256(ptr, 0x42)
        }
    }

    /**
     * @dev Returns an Ethereum Signed Data with intended validator, created from a
     * `validator` and `data` according to the version 0 of EIP-191.
     *
     * See {recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x00", validator, data));
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.8;

import "./ECDSA.sol";
import "../ShortStrings.sol";
import "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,
 * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding
 * they need in their contracts using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * _Available since v3.4._
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant _TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(_TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {EIP-5267}.
     *
     * _Available since v4.9._
     */
    function eip712Domain()
        public
        view
        virtual
        override
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _name.toStringWithFallback(_nameFallback),
            _version.toStringWithFallback(_versionFallback),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./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);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1, "Math: mulDiv overflow");

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.8;

import "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant _FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(_FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != _FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.0;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract");
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 *
 * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._
 * _Available since v4.9 for `string`, `bytes`._
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";
import "./math/SignedMath.sol";

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toString(int256 value) internal pure returns (string memory) {
        return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value))));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

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

import "./helpers/IFeesOracle.sol";
import "../hybridX/ERC20HX.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";

abstract contract ERC20HXFeesOracle is ERC20HX, ReentrancyGuard {
    address feesOracle;

    struct FeesInfo {
        address payable receiver;
        uint96 weight;
    }

    FeesInfo[] public feesInfo;

    function setFeesOracle(address _feesOracle) public onlyOwner {
        _setFeesOracle(_feesOracle);
    }

    function _setFeesOracle(address _feesOracle) internal {
        feesOracle = _feesOracle;
    }

    function _totalWeight() internal view virtual returns (uint96) {
        uint96 totalWeight = 0;
        for (uint i = 0; i < feesInfo.length; i++)
            totalWeight += feesInfo[i].weight;

        return totalWeight;
    }

    function _pushFeeInfo(
        address payable receiver,
        uint96 feeNumerator
    ) internal virtual {
        require(receiver != address(0), "ERC20HXFees: Invalid parameters");

        feesInfo.push(FeesInfo(receiver, feeNumerator));
    }

    function pushFeeInfo(
        address payable[] calldata receivers,
        uint96[] calldata weights
    ) public virtual onlyOwner {
        require(
            receivers.length == weights.length,
            "ERC20HXFees: receivers length must be equal to feeEnumerators"
        );

        for (uint i = 0; i < receivers.length; i++)
            _pushFeeInfo(receivers[i], weights[i]);
    }

    function deleteFeeInfo() public virtual onlyOwner {
        delete feesInfo;
    }

    function fee(uint256 amount) public view virtual returns (uint256) {
        return IFeesOracle(feesOracle).fee(amount);
    }

    function _handleFeesEth(uint256 _fee) internal virtual {
        require(msg.value >= _fee, "ERC20HXFees: Insufficient fees");

        if (msg.value > _fee) {
            uint256 refund = (msg.value - _fee);
            (bool sent, ) = _msgSender().call{value: refund}("");

            require(sent, "ERC20HXFees: Failure to refund");
        }

        uint256 totalWeight = _totalWeight();
        for (uint i = 0; i < feesInfo.length; i++) {
            uint256 recv = (_fee * feesInfo[i].weight) / totalWeight;
            (bool sent, ) = (feesInfo[i].receiver).call{value: recv}("");

            require(sent, "ERC20HXFees: Failure to transfer ETH");
        }
    }

    function burnNFT(
        uint256[] calldata nftIds
    ) public payable override nonReentrant {
        uint256 _fee = fee(nftIds.length);

        _handleFeesEth(_fee);

        super.burnNFT(nftIds);
    }

    function mintNFT(uint256 amount) public payable override nonReentrant {
        uint256 _fee = fee(amount);

        _handleFeesEth(_fee);

        super.mintNFT(amount);
    }

    function burnNFTFrom(
        address from,
        address to,
        uint256[] calldata nftIds
    ) public payable override nonReentrant {
        uint256 _fee = fee(nftIds.length);

        _handleFeesEth(_fee);

        super.burnNFTFrom(from, to, nftIds);
    }

    function mintNFTFrom(
        address from,
        address to,
        uint256 amount
    ) public payable override nonReentrant {
        uint256 _fee = fee(amount);

        _handleFeesEth(_fee);

        super.mintNFTFrom(from, to, amount);
    }
}

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

interface IFeesOracle {
    function fee(uint256 amount) external view returns (uint256 value);
}

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

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IERC20HX.sol";
import "./interfaces/IERC721HX.sol";

abstract contract ERC20HX is IERC20HX, ERC20, ERC20Permit, Ownable {
    IERC721HX nftContract;

    function _setNFTContract(address _nftContract) internal {
        nftContract = IERC721HX(_nftContract);

        emit SetNFTContract(nftContract);
    }

    function setNFTContract(address _nftContract) public onlyOwner {
        _setNFTContract(_nftContract);
    }

    function getNFTContractAddress() public view returns (IERC721HX) {
        return nftContract;
    }

    function mintNFTFrom(address from, address to, uint256 amountNFT) payable public virtual {
        uint256 amountFT = amountNFT * 10 ** decimals();
        require(
            allowance(from, _msgSender()) >= amountFT,
            "ERC20HX: Insufficient allowance"
        );

        _mintNFTFrom(from, to, amountNFT);
    }

    function mintNFT(uint256 amountNFT) payable public virtual {
        address spender = _msgSender();
        _mintNFTFrom(spender, spender, amountNFT);
    }

    function _mintNFTFrom(
        address spender,
        address to,
        uint256 amountNFT
    ) virtual internal {
        uint256 amountFT = amountNFT * 10 ** decimals();

        ERC20._burn(spender, amountFT);
        nftContract.mint(to, amountNFT);

        emit MintNFT(to, amountNFT);
    }

    function burnNFTFrom(
        address from,
        address to,
        uint256[] calldata nftIds
    ) public payable virtual {
        require(
            nftContract.isApprovedForAll(from, _msgSender()),
            "ERC20HX: NFT not approved"
        );
        address owner = from;
        _burnNFTFrom(owner, to, nftIds);
    }

    function burnNFT(uint256[] calldata nftIds) payable public virtual {
        address owner = _msgSender();
        _burnNFTFrom(owner, owner, nftIds);
    }

    function _burnNFTFrom(
        address owner,
        address to,
        uint256[] calldata nftIds
    ) virtual internal {
        uint256 amountFT = (nftIds.length) * 10 ** decimals();

        nftContract.burn(owner, nftIds);
        ERC20._mint(to, amountFT);

        emit BurnNFT(owner, nftIds);
    }
}

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

import "erc721psi/contracts/ERC721Psi.sol";
import "erc721psi/contracts/extension/ERC721PsiBurnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "./interfaces/IERC721HX.sol";

abstract contract ERC721PsiHX is IERC721HX, ERC721Psi, ERC721PsiBurnable, AccessControl {
    string public baseURI;

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");

    function mint(
        address target,
        uint256 quantity
    ) external virtual onlyRole(MINTER_ROLE) {
        _safeMint(target, quantity);
    }

    function burn(
        address origin,
        uint256[] calldata ids
    ) external virtual onlyRole(MINTER_ROLE) {
        uint256 pre = totalSupply();
        for (uint i = 0; i < ids.length; i++) {
            require(origin == ownerOf(ids[i]), "ERC721PsiHX: Not token owner");

            _burn(ids[i]);
        }
        uint256 post = totalSupply();

        require(pre - post == ids.length, "ERC721PsiHX: Burning error");
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC721Psi, AccessControl, IERC165) returns (bool) {
        return
            ERC721Psi.supportsInterface(interfaceId) ||
            AccessControl.supportsInterface(interfaceId);
    }

    function _exists(
        uint256 id
    ) internal view override(ERC721Psi, ERC721PsiBurnable) returns (bool) {
        return ERC721PsiBurnable._exists(id);
    }

    function totalSupply()
        public
        view
        override(ERC721Psi, ERC721PsiBurnable)
        returns (uint256)
    {
        return ERC721PsiBurnable.totalSupply();
    }

    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    function setBaseURI(
        string memory newBaseURI
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        _setBaseURI(newBaseURI);
    }

    function _setBaseURI(string memory _newBaseURI) internal virtual {
        baseURI = _newBaseURI;
    }

    function setMinterRole(
        address ftContractAddress
    ) public onlyRole(DEFAULT_ADMIN_ROLE) {
        _grantRole(MINTER_ROLE, ftContractAddress);
    }
}

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

import "@openzeppelin/contracts/interfaces/IERC20.sol";
import "./IERC721HX.sol";

interface IERC20HX is IERC20 {
    // Events
    event MintNFT(address indexed from, uint256 amount);
    event BurnNFT(address indexed from, uint256[] ids);
    event SetNFTContract(IERC721HX nftContract);
    
    // Function to get the NFT contract address associated with the ERC20HX contract
    function getNFTContractAddress() external view returns (IERC721HX);

    // Mint NFT by burning ERC20 tokens
    function mintNFTFrom(address from, address to, uint256 amountNFT) payable external;

    // Mint NFT for the sender by burning sender's ERC20 tokens
    function mintNFT(uint256 amountNFT) payable external;

    // Burn NFTs from a specified address and credit ERC20 tokens to another address
    function burnNFTFrom(address from, address to, uint256[] calldata nftIds) payable external;

    // Burn sender's NFTs and credit ERC20 tokens to the sender
    function burnNFT(uint256[] calldata nftIds) payable external;
}

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

import "@openzeppelin/contracts/interfaces/IERC721.sol";

interface IERC721HX is IERC721 {
    function MINTER_ROLE() external returns (bytes32);

    /**
     * @dev Mints `quantity` tokens and assigns them to `target`, increasing
     * the total supply.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     */
    function mint(address target, uint256 quantity) external;

    /**
     * @dev Burns `ids` tokens from `origin`, decreasing the total supply.
     *
     * Requirements:
     *
     * - the caller must have the `MINTER_ROLE`.
     * - `origin` must be the owner of the tokens in `ids`.
     */
    function burn(address origin, uint256[] calldata ids) external;

    /**
     * @dev Sets the Minter role to ERC20HX contract address
     *
     * Requirements:
     *
     * - the caller must have the `DEFAULT_ADMIN_ROLE` or `Owner`.
     * - `ftContractAddress` must be the ERC20HX contract address.
     */
    function setMinterRole(address ftContractAddress) external;
}

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

import "./hybridX/ERC721PsiHX.sol";

contract KatanaERC721PsiHX is ERC721PsiHX {
    constructor(
        address _defaultAdmin,
        address _ftContractAddress,
        string memory _tokenBaseURI,
        string memory _tokenName,
        string memory _tokenSymbol
    ) ERC721Psi(_tokenName, _tokenSymbol) {
        _grantRole(DEFAULT_ADMIN_ROLE, _defaultAdmin);
        _grantRole(MINTER_ROLE, _ftContractAddress);
        _setBaseURI(_tokenBaseURI);
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC721PsiHX) returns (bool) {
        return ERC721PsiHX.supportsInterface(interfaceId);
    }
}

// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   

 - github: https://github.com/estarriolvetch/ERC721Psi
 - npm: https://www.npmjs.com/package/erc721psi
                                          
 */

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
import "solidity-bits/contracts/BitMaps.sol";


contract ERC721Psi is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;
    using BitMaps for BitMaps.BitMap;

    BitMaps.BitMap private _batchHead;

    string private _name;
    string private _symbol;

    // Mapping from token ID to owner address
    mapping(uint256 => address) internal _owners;
    uint256 private _currentIndex;

    mapping(uint256 => address) private _tokenApprovals;
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    /**
     * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
        _currentIndex = _startTokenId();
    }

    /**
     * @dev Returns the starting token ID.
     * To change the starting token ID, please override this function.
     */
    function _startTokenId() internal pure returns (uint256) {
        // It will become modifiable in the future versions
        return 0;
    }

    /**
     * @dev Returns the next token ID to be minted.
     */
    function _nextTokenId() internal view virtual returns (uint256) {
        return _currentIndex;
    }

    /**
     * @dev Returns the total amount of tokens minted in the contract.
     */
    function _totalMinted() internal view virtual returns (uint256) {
        return _currentIndex - _startTokenId();
    }


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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) 
        public 
        view 
        virtual 
        override 
        returns (uint) 
    {
        require(owner != address(0), "ERC721Psi: balance query for the zero address");

        uint count;
        for( uint i = _startTokenId(); i < _nextTokenId(); ++i ){
            if(_exists(i)){
                if( owner == ownerOf(i)){
                    ++count;
                }
            }
        }
        return count;
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        (address owner, ) = _ownerAndBatchHeadOf(tokenId);
        return owner;
    }

    function _ownerAndBatchHeadOf(uint256 tokenId) internal view returns (address owner, uint256 tokenIdBatchHead){
        require(_exists(tokenId), "ERC721Psi: owner query for nonexistent token");
        tokenIdBatchHead = _getBatchHead(tokenId);
        owner = _owners[tokenIdBatchHead];
    }

    /**
     * @dev See {IERC721Metadata-name}.
     */
    function name() public view virtual override returns (string memory) {
        return _name;
    }

    /**
     * @dev See {IERC721Metadata-symbol}.
     */
    function symbol() public view virtual override returns (string memory) {
        return _symbol;
    }

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Psi: URI query for nonexistent token");

        string memory baseURI = _baseURI();
        return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
    }

    /**
     * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
     * token will be the concatenation of the `baseURI` and the `tokenId`. Empty
     * by default, can be overriden in child contracts.
     */
    function _baseURI() internal view virtual returns (string memory) {
        return "";
    }


    /**
     * @dev See {IERC721-approve}.
     */
    function approve(address to, uint256 tokenId) public virtual override {
        address owner = ownerOf(tokenId);
        require(to != owner, "ERC721Psi: approval to current owner");

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721Psi: approve caller is not owner nor approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId)
        public
        view
        virtual
        override
        returns (address)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: approved query for nonexistent token"
        );

        return _tokenApprovals[tokenId];
    }

    /**
     * @dev See {IERC721-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved)
        public
        virtual
        override
    {
        require(operator != _msgSender(), "ERC721Psi: approve to caller");

        _operatorApprovals[_msgSender()][operator] = approved;
        emit ApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC721-isApprovedForAll}.
     */
    function isApprovedForAll(address owner, address operator)
        public
        view
        virtual
        override
        returns (bool)
    {
        return _operatorApprovals[owner][operator];
    }

    /**
     * @dev See {IERC721-transferFrom}.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        //solhint-disable-next-line max-line-length
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );

        _transfer(from, to, tokenId);
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) public virtual override {
        safeTransferFrom(from, to, tokenId, "");
    }

    /**
     * @dev See {IERC721-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) public virtual override {
        require(
            _isApprovedOrOwner(_msgSender(), tokenId),
            "ERC721Psi: transfer caller is not owner nor approved"
        );
        _safeTransfer(from, to, tokenId, _data);
    }

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * `_data` is additional data, it has no specified format and it is sent in call to `to`.
     *
     * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
     * implement alternative mechanisms to perform token transfer, such as signature-based.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeTransfer(
        address from,
        address to,
        uint256 tokenId,
        bytes memory _data
    ) internal virtual {
        _transfer(from, to, tokenId);
        require(
            _checkOnERC721Received(from, to, tokenId, 1,_data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`).
     */
    function _exists(uint256 tokenId) internal view virtual returns (bool) {
        return tokenId < _nextTokenId() && _startTokenId() <= tokenId;
    }

    /**
     * @dev Returns whether `spender` is allowed to manage `tokenId`.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function _isApprovedOrOwner(address spender, uint256 tokenId)
        internal
        view
        virtual
        returns (bool)
    {
        require(
            _exists(tokenId),
            "ERC721Psi: operator query for nonexistent token"
        );
        address owner = ownerOf(tokenId);
        return (spender == owner ||
            getApproved(tokenId) == spender ||
            isApprovedForAll(owner, spender));
    }

    /**
     * @dev Safely mints `quantity` tokens and transfers them to `to`.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called for each safe transfer.
     * - `quantity` must be greater than 0.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 quantity) internal virtual {
        _safeMint(to, quantity, "");
    }

    
    function _safeMint(
        address to,
        uint256 quantity,
        bytes memory _data
    ) internal virtual {
        uint256 nextTokenId = _nextTokenId();
        _mint(to, quantity);
        require(
            _checkOnERC721Received(address(0), to, nextTokenId, quantity, _data),
            "ERC721Psi: transfer to non ERC721Receiver implementer"
        );
    }


    function _mint(
        address to,
        uint256 quantity
    ) internal virtual {
        uint256 nextTokenId = _nextTokenId();
        
        require(quantity > 0, "ERC721Psi: quantity must be greater 0");
        require(to != address(0), "ERC721Psi: mint to the zero address");
        
        _beforeTokenTransfers(address(0), to, nextTokenId, quantity);
        _currentIndex += quantity;
        _owners[nextTokenId] = to;
        _batchHead.set(nextTokenId);
        _afterTokenTransfers(address(0), to, nextTokenId, quantity);
        
        // Emit events
        for(uint256 tokenId=nextTokenId; tokenId < nextTokenId + quantity; tokenId++){
            emit Transfer(address(0), to, tokenId);
        } 
    }


    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *  As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     *
     * Emits a {Transfer} event.
     */
    function _transfer(
        address from,
        address to,
        uint256 tokenId
    ) internal virtual {
        (address owner, uint256 tokenIdBatchHead) = _ownerAndBatchHeadOf(tokenId);

        require(
            owner == from,
            "ERC721Psi: transfer of token that is not own"
        );
        require(to != address(0), "ERC721Psi: transfer to the zero address");

        _beforeTokenTransfers(from, to, tokenId, 1);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);   

        uint256 subsequentTokenId = tokenId + 1;

        if(!_batchHead.get(subsequentTokenId) &&  
            subsequentTokenId < _nextTokenId()
        ) {
            _owners[subsequentTokenId] = from;
            _batchHead.set(subsequentTokenId);
        }

        _owners[tokenId] = to;
        if(tokenId != tokenIdBatchHead) {
            _batchHead.set(tokenId);
        }

        emit Transfer(from, to, tokenId);

        _afterTokenTransfers(from, to, tokenId, 1);
    }

    /**
     * @dev Approve `to` to operate on `tokenId`
     *
     * Emits a {Approval} event.
     */
    function _approve(address to, uint256 tokenId) internal virtual {
        _tokenApprovals[tokenId] = to;
        emit Approval(ownerOf(tokenId), to, tokenId);
    }

    /**
     * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
     * The call is not executed if the target address is not a contract.
     *
     * @param from address representing the previous owner of the given token ID
     * @param to target address that will receive the tokens
     * @param startTokenId uint256 the first ID of the tokens to be transferred
     * @param quantity uint256 amount of the tokens to be transfered.
     * @param _data bytes optional data to send along with the call
     * @return r bool whether the call correctly returned the expected magic value
     */
    function _checkOnERC721Received(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity,
        bytes memory _data
    ) private returns (bool r) {
        if (to.isContract()) {
            r = true;
            for(uint256 tokenId = startTokenId; tokenId < startTokenId + quantity; tokenId++){
                try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
                    r = r && retval == IERC721Receiver.onERC721Received.selector;
                } catch (bytes memory reason) {
                    if (reason.length == 0) {
                        revert("ERC721Psi: transfer to non ERC721Receiver implementer");
                    } else {
                        assembly {
                            revert(add(32, reason), mload(reason))
                        }
                    }
                }
            }
            return r;
        } else {
            return true;
        }
    }

    function _getBatchHead(uint256 tokenId) internal view returns (uint256 tokenIdBatchHead) {
        tokenIdBatchHead = _batchHead.scanForward(tokenId); 
    }


    function totalSupply() public virtual view returns (uint256) {
        return _totalMinted();
    }

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * This function is compatiable with ERC721AQueryable.
     */
    function tokensOfOwner(address owner) external view virtual returns (uint256[] memory) {
        unchecked {
            uint256 tokenIdsIdx;
            uint256 tokenIdsLength = balanceOf(owner);
            uint256[] memory tokenIds = new uint256[](tokenIdsLength);
            for (uint256 i = _startTokenId(); tokenIdsIdx != tokenIdsLength; ++i) {
                if (_exists(i)) {
                    if (ownerOf(i) == owner) {
                        tokenIds[tokenIdsIdx++] = i;
                    }
                }
            }
            return tokenIds;   
        }
    }

    /**
     * @dev Hook that is called before a set of serially-ordered token ids are about to be transferred. This includes minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
     * transferred to `to`.
     * - When `from` is zero, `tokenId` will be minted for `to`.
     */
    function _beforeTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}

    /**
     * @dev Hook that is called after a set of serially-ordered token ids have been transferred. This includes
     * minting.
     *
     * startTokenId - the first token id to be transferred
     * quantity - the amount to be transferred
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero.
     * - `from` and `to` are never both zero.
     */
    function _afterTokenTransfers(
        address from,
        address to,
        uint256 startTokenId,
        uint256 quantity
    ) internal virtual {}
}

// SPDX-License-Identifier: MIT
/**
  ______ _____   _____ ______ ___  __ _  _  _ 
 |  ____|  __ \ / ____|____  |__ \/_ | || || |
 | |__  | |__) | |        / /   ) || | \| |/ |
 |  __| |  _  /| |       / /   / / | |\_   _/ 
 | |____| | \ \| |____  / /   / /_ | |  | |   
 |______|_|  \_\\_____|/_/   |____||_|  |_|   
                                              
                                            
 */
pragma solidity ^0.8.0;

import "solidity-bits/contracts/BitMaps.sol";
import "../ERC721Psi.sol";


abstract contract ERC721PsiBurnable is ERC721Psi {
    using BitMaps for BitMaps.BitMap;
    BitMaps.BitMap private _burnedToken;

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address from = ownerOf(tokenId);
        _beforeTokenTransfers(from, address(0), tokenId, 1);
        _burnedToken.set(tokenId);
        
        emit Transfer(from, address(0), tokenId);

        _afterTokenTransfers(from, address(0), tokenId, 1);
    }

    /**
     * @dev Returns whether `tokenId` exists.
     *
     * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
     *
     * Tokens start existing when they are minted (`_mint`),
     * and stop existing when they are burned (`_burn`).
     */
    function _exists(uint256 tokenId) internal view override virtual returns (bool){
        if(_burnedToken.get(tokenId)) {
            return false;
        } 
        return super._exists(tokenId);
    }

    /**
     * @dev See {IERC721Enumerable-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalMinted() - _burned();
    }

    /**
     * @dev Returns number of token burned.
     */
    function _burned() internal view returns (uint256 burned){
        uint256 startBucket = _startTokenId() >> 8;
        uint256 lastBucket = (_nextTokenId() >> 8) + 1;

        for(uint256 i=startBucket; i < lastBucket; i++) {
            uint256 bucket = _burnedToken.getBucket(i);
            burned += _popcount(bucket);
        }
    }

    /**
     * @dev Returns number of set bits.
     */
    function _popcount(uint256 x) private pure returns (uint256 count) {
        unchecked{
            for (count=0; x!=0; count++)
                x &= x - 1;
        }
    }
}

// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */
pragma solidity ^0.8.0;

import "./BitScan.sol";

/**
 * @dev This Library is a modified version of Openzeppelin's BitMaps library.
 * Functions of finding the index of the closest set bit from a given index are added.
 * The indexing of each bucket is modifed to count from the MSB to the LSB instead of from the LSB to the MSB.
 * The modification of indexing makes finding the closest previous set bit more efficient in gas usage.
*/

/**
 * @dev Library for managing uint256 to bool mapping in a compact and efficient way, providing the keys are sequential.
 * Largelly inspired by Uniswap's https://github.com/Uniswap/merkle-distributor/blob/master/contracts/MerkleDistributor.sol[merkle-distributor].
 */

library BitMaps {
    using BitScan for uint256;
    uint256 private constant MASK_INDEX_ZERO = (1 << 255);
    uint256 private constant MASK_FULL = type(uint256).max;

    struct BitMap {
        mapping(uint256 => uint256) _data;
    }

    /**
     * @dev Returns whether the bit at `index` is set.
     */
    function get(BitMap storage bitmap, uint256 index) internal view returns (bool) {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        return bitmap._data[bucket] & mask != 0;
    }

    /**
     * @dev Sets the bit at `index` to the boolean `value`.
     */
    function setTo(
        BitMap storage bitmap,
        uint256 index,
        bool value
    ) internal {
        if (value) {
            set(bitmap, index);
        } else {
            unset(bitmap, index);
        }
    }

    /**
     * @dev Sets the bit at `index`.
     */
    function set(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] |= mask;
    }

    /**
     * @dev Unsets the bit at `index`.
     */
    function unset(BitMap storage bitmap, uint256 index) internal {
        uint256 bucket = index >> 8;
        uint256 mask = MASK_INDEX_ZERO >> (index & 0xff);
        bitmap._data[bucket] &= ~mask;
    }


    /**
     * @dev Consecutively sets `amount` of bits starting from the bit at `startIndex`.
     */    
    function setBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] |= MASK_FULL << (256 - amount) >> bucketStartIndex;
            } else {
                bitmap._data[bucket] |= MASK_FULL >> bucketStartIndex;
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = MASK_FULL;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] |= MASK_FULL << (256 - amount);
            }
        }
    }


    /**
     * @dev Consecutively unsets `amount` of bits starting from the bit at `startIndex`.
     */    
    function unsetBatch(BitMap storage bitmap, uint256 startIndex, uint256 amount) internal {
        uint256 bucket = startIndex >> 8;

        uint256 bucketStartIndex = (startIndex & 0xff);

        unchecked {
            if(bucketStartIndex + amount < 256) {
                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount) >> bucketStartIndex);
            } else {
                bitmap._data[bucket] &= ~(MASK_FULL >> bucketStartIndex);
                amount -= (256 - bucketStartIndex);
                bucket++;

                while(amount > 256) {
                    bitmap._data[bucket] = 0;
                    amount -= 256;
                    bucket++;
                }

                bitmap._data[bucket] &= ~(MASK_FULL << (256 - amount));
            }
        }
    }


    /**
     * @dev Find the closest index of the set bit before `index`.
     */
    function scanForward(BitMap storage bitmap, uint256 index) internal view returns (uint256 setBitIndex) {
        uint256 bucket = index >> 8;

        // index within the bucket
        uint256 bucketIndex = (index & 0xff);

        // load a bitboard from the bitmap.
        uint256 bb = bitmap._data[bucket];

        // offset the bitboard to scan from `bucketIndex`.
        bb = bb >> (0xff ^ bucketIndex); // bb >> (255 - bucketIndex)
        
        if(bb > 0) {
            unchecked {
                setBitIndex = (bucket << 8) | (bucketIndex -  bb.bitScanForward256());    
            }
        } else {
            while(true) {
                require(bucket > 0, "BitMaps: The set bit before the index doesn't exist.");
                unchecked {
                    bucket--;
                }
                // No offset. Always scan from the least significiant bit now.
                bb = bitmap._data[bucket];
                
                if(bb > 0) {
                    unchecked {
                        setBitIndex = (bucket << 8) | (255 -  bb.bitScanForward256());
                        break;
                    }
                } 
            }
        }
    }

    function getBucket(BitMap storage bitmap, uint256 bucket) internal view returns (uint256) {
        return bitmap._data[bucket];
    }
}

// SPDX-License-Identifier: MIT
/**
   _____       ___     ___ __           ____  _ __      
  / ___/____  / (_)___/ (_) /___  __   / __ )(_) /______
  \__ \/ __ \/ / / __  / / __/ / / /  / __  / / __/ ___/
 ___/ / /_/ / / / /_/ / / /_/ /_/ /  / /_/ / / /_(__  ) 
/____/\____/_/_/\__,_/_/\__/\__, /  /_____/_/\__/____/  
                           /____/                        

- npm: https://www.npmjs.com/package/solidity-bits
- github: https://github.com/estarriolvetch/solidity-bits

 */

pragma solidity ^0.8.0;


library BitScan {
    uint256 constant private DEBRUIJN_256 = 0x818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff;
    bytes constant private LOOKUP_TABLE_256 = hex"0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8";

    /**
        @dev Isolate the least significant set bit.
     */ 
    function isolateLS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            return bb & (0 - bb);
        }
    } 

    /**
        @dev Isolate the most significant set bit.
     */ 
    function isolateMS1B256(uint256 bb) pure internal returns (uint256) {
        require(bb > 0);
        unchecked {
            bb |= bb >> 128;
            bb |= bb >> 64;
            bb |= bb >> 32;
            bb |= bb >> 16;
            bb |= bb >> 8;
            bb |= bb >> 4;
            bb |= bb >> 2;
            bb |= bb >> 1;
            
            return (bb >> 1) + 1;
        }
    } 

    /**
        @dev Find the index of the lest significant set bit. (trailing zero count)
     */ 
    function bitScanForward256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateLS1B256(bb) * DEBRUIJN_256) >> 248]);
        }   
    }

    /**
        @dev Find the index of the most significant set bit.
     */ 
    function bitScanReverse256(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return 255 - uint8(LOOKUP_TABLE_256[((isolateMS1B256(bb) * DEBRUIJN_256) >> 248)]);
        }   
    }

    function log2(uint256 bb) pure internal returns (uint8) {
        unchecked {
            return uint8(LOOKUP_TABLE_256[(isolateMS1B256(bb) * DEBRUIJN_256) >> 248]);
        } 
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"_nftContractAddress","type":"address"},{"internalType":"string","name":"_tokenName","type":"string"},{"internalType":"string","name":"_tokenSymbol","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"BurnNFT","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"MintNFT","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract IERC721HX","name":"nftContract","type":"address"}],"name":"SetNFTContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"name":"burnNFT","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"nftIds","type":"uint256[]"}],"name":"burnNFTFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deleteFeeInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"feesInfo","outputs":[{"internalType":"address payable","name":"receiver","type":"address"},{"internalType":"uint96","name":"weight","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNFTContractAddress","outputs":[{"internalType":"contract IERC721HX","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintNFT","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mintNFTFrom","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"receivers","type":"address[]"},{"internalType":"uint96[]","name":"weights","type":"uint96[]"}],"name":"pushFeeInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feesOracle","type":"address"}],"name":"setFeesOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nftContract","type":"address"}],"name":"setNFTContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

61016060405234801561001157600080fd5b50604051612cf3380380612cf3833981016040819052610030916103fe565b6040805180820190915260018152603160f81b6020820152819081908482600361005a838261050a565b506004610067828261050a565b506100779150839050600561015d565b6101205261008681600661015d565b61014052815160208084019190912060e052815190820120610100524660a05261011360e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525061012633610190565b6001600b5561014c3361013b6012600a6106c3565b610147906127106106d9565b6101e2565b610155836102a6565b50505061075a565b600060208351101561017957610172836102fa565b905061018a565b81610184848261050a565b5060ff90505b92915050565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821661023d5760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064015b60405180910390fd5b806002600082825461024f91906106f0565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527fd44942a6101d02dd817a0dc4e7a5e3043f24435b9929130d50257047cdf1a87d9060200160405180910390a150565b600080829050601f81511115610325578260405163305a27a960e01b81526004016102349190610703565b805161033082610736565b179392505050565b505050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561036e578181015183820152602001610356565b50506000910152565b600082601f83011261038857600080fd5b81516001600160401b03808211156103a2576103a261033d565b604051601f8301601f19908116603f011681019082821181831017156103ca576103ca61033d565b816040528381528660208588010111156103e357600080fd5b6103f4846020830160208901610353565b9695505050505050565b60008060006060848603121561041357600080fd5b83516001600160a01b038116811461042a57600080fd5b60208501519093506001600160401b038082111561044757600080fd5b61045387838801610377565b9350604086015191508082111561046957600080fd5b5061047686828701610377565b9150509250925092565b600181811c9082168061049457607f821691505b6020821081036104b457634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115610338576000816000526020600020601f850160051c810160208610156104e35750805b601f850160051c820191505b81811015610502578281556001016104ef565b505050505050565b81516001600160401b038111156105235761052361033d565b610537816105318454610480565b846104ba565b602080601f83116001811461056c57600084156105545750858301515b600019600386901b1c1916600185901b178555610502565b600085815260208120601f198616915b8281101561059b5788860151825594840194600190910190840161057c565b50858210156105b95787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561061a578160001904821115610600576106006105c9565b8085161561060d57918102915b93841c93908002906105e4565b509250929050565b6000826106315750600161018a565b8161063e5750600061018a565b8160018114610654576002811461065e5761067a565b600191505061018a565b60ff84111561066f5761066f6105c9565b50506001821b61018a565b5060208310610133831016604e8410600b841016171561069d575081810a61018a565b6106a783836105df565b80600019048211156106bb576106bb6105c9565b029392505050565b60006106d260ff841683610622565b9392505050565b808202811582820484141761018a5761018a6105c9565b8082018082111561018a5761018a6105c9565b6020815260008251806020840152610722816040850160208701610353565b601f01601f19169190910160400192915050565b805160208083015191908110156104b45760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161253f6107b460003960006107c4015260006107990152600061141e015260006113f6015260006113510152600061137b015260006113a5015261253f6000f3fe6080604052600436106101c25760003560e01c806384b0196e116100f7578063a7ccabdf11610095578063d505accf11610064578063d505accf146104ff578063d9e7c4521461051f578063dd62ed3e14610534578063f2fde38b1461055457600080fd5b8063a7ccabdf1461047f578063a9059cbb1461049f578063bbb0e2d0146104bf578063c4791d5e146104df57600080fd5b806392642744116100d1578063926427441461042457806395d89b411461043757806395de7a9e1461044c578063a457c2d71461045f57600080fd5b806384b0196e146103cb578063884f08a1146103f35780638da5cb5b1461040657600080fd5b80633644e5151161016457806339b37ab01161013e57806339b37ab01461034057806370a0823114610360578063715018a6146103965780637ecebe00146103ab57600080fd5b80633644e515146102d957806338b3b5b5146102ee578063395093511461032057600080fd5b806319445a14116101a057806319445a141461024157806323b872dd1461028857806328c8bf80146102a8578063313ce567146102bd57600080fd5b806306fdde03146101c7578063095ea7b3146101f257806318160ddd14610222575b600080fd5b3480156101d357600080fd5b506101dc610574565b6040516101e99190611ecc565b60405180910390f35b3480156101fe57600080fd5b5061021261020d366004611efb565b610606565b60405190151581526020016101e9565b34801561022e57600080fd5b506002545b6040519081526020016101e9565b34801561024d57600080fd5b5061026161025c366004611f27565b610620565b604080516001600160a01b0390931683526001600160601b039091166020830152016101e9565b34801561029457600080fd5b506102126102a3366004611f40565b61065b565b6102bb6102b6366004611fcd565b61067f565b005b3480156102c957600080fd5b50604051601281526020016101e9565b3480156102e557600080fd5b506102336106ba565b3480156102fa57600080fd5b50600a546001600160a01b03165b6040516001600160a01b0390911681526020016101e9565b34801561032c57600080fd5b5061021261033b366004611efb565b6106c9565b34801561034c57600080fd5b5061023361035b366004611f27565b6106eb565b34801561036c57600080fd5b5061023361037b366004612032565b6001600160a01b031660009081526020819052604090205490565b3480156103a257600080fd5b506102bb610759565b3480156103b757600080fd5b506102336103c6366004612032565b61076d565b3480156103d757600080fd5b506103e061078b565b6040516101e9979695949392919061204f565b6102bb610401366004611f40565b610814565b34801561041257600080fd5b506009546001600160a01b0316610308565b6102bb610432366004611f27565b61084d565b34801561044357600080fd5b506101dc610882565b6102bb61045a3660046120e8565b610891565b34801561046b57600080fd5b5061021261047a366004611efb565b6108c8565b34801561048b57600080fd5b506102bb61049a366004612032565b610948565b3480156104ab57600080fd5b506102126104ba366004611efb565b610959565b3480156104cb57600080fd5b506102bb6104da366004612032565b610967565b3480156104eb57600080fd5b506102bb6104fa36600461212a565b61098d565b34801561050b57600080fd5b506102bb61051a36600461218a565b610a7a565b34801561052b57600080fd5b506102bb610bde565b34801561054057600080fd5b5061023361054f366004612201565b610bf2565b34801561056057600080fd5b506102bb61056f366004612032565b610c1d565b6060600380546105839061223a565b80601f01602080910402602001604051908101604052809291908181526020018280546105af9061223a565b80156105fc5780601f106105d1576101008083540402835291602001916105fc565b820191906000526020600020905b8154815290600101906020018083116105df57829003601f168201915b5050505050905090565b600033610614818585610c93565b60019150505b92915050565b600d818154811061063057600080fd5b6000918252602090912001546001600160a01b0381169150600160a01b90046001600160601b031682565b600033610669858285610db7565b610674858585610e2b565b506001949350505050565b610687610fcf565b6000610692826106eb565b905061069d81611028565b6106a985858585611269565b506106b46001600b55565b50505050565b60006106c4611344565b905090565b6000336106148185856106dc8383610bf2565b6106e69190612284565b610c93565b600c5460405163039b37ab60e41b8152600481018390526000916001600160a01b0316906339b37ab090602401602060405180830381865afa158015610735573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190612297565b61076161146f565b61076b60006114c9565b565b6001600160a01b03811660009081526007602052604081205461061a565b6000606080828080836107bf7f0000000000000000000000000000000000000000000000000000000000000000600561151b565b6107ea7f0000000000000000000000000000000000000000000000000000000000000000600661151b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61081c610fcf565b6000610827826106eb565b905061083281611028565b61083d8484846115c6565b506108486001600b55565b505050565b610855610fcf565b6000610860826106eb565b905061086b81611028565b61087482611644565b5061087f6001600b55565b50565b6060600480546105839061223a565b610899610fcf565b60006108a4826106eb565b90506108af81611028565b6108b98383611650565b506108c46001600b55565b5050565b600033816108d68286610bf2565b90508381101561093b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6106748286868403610c93565b61095061146f565b61087f8161165d565b600033610614818585610e2b565b61096f61146f565b600c80546001600160a01b0319166001600160a01b03831617905550565b61099561146f565b828114610a0a5760405162461bcd60e51b815260206004820152603d60248201527f45524332304858466565733a20726563656976657273206c656e677468206d7560448201527f737420626520657175616c20746f20666565456e756d657261746f72730000006064820152608401610932565b60005b83811015610a7357610a6b858583818110610a2a57610a2a6122b0565b9050602002016020810190610a3f9190612032565b848484818110610a5157610a516122b0565b9050602002016020810190610a6691906122c6565b6116b1565b600101610a0d565b5050505050565b83421115610aca5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610932565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610af98c611779565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610b54826117a1565b90506000610b64828787876117ce565b9050896001600160a01b0316816001600160a01b031614610bc75760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610932565b610bd28a8a8a610c93565b50505050505050505050565b610be661146f565b61076b600d6000611e54565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610c2561146f565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610932565b61087f816114c9565b6001600160a01b038316610cf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610932565b6001600160a01b038216610d565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610932565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610dc38484610bf2565b905060001981146106b45781811015610e1e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610932565b6106b48484848403610c93565b6001600160a01b038316610e8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610932565b6001600160a01b038216610ef15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610932565b6001600160a01b03831660009081526020819052604090205481811015610f695760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610932565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36106b4565b6002600b54036110215760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610932565b6002600b55565b803410156110785760405162461bcd60e51b815260206004820152601e60248201527f45524332304858466565733a20496e73756666696369656e74206665657300006044820152606401610932565b8034111561112a57600061108c82346122ef565b604051909150600090339083908381818185875af1925050503d80600081146110d1576040519150601f19603f3d011682016040523d82523d6000602084013e6110d6565b606091505b50509050806111275760405162461bcd60e51b815260206004820152601e60248201527f45524332304858466565733a204661696c75726520746f20726566756e6400006044820152606401610932565b50505b60006111346117f6565b6001600160601b0316905060005b600d5481101561084857600082600d8381548110611162576111626122b0565b60009182526020909120015461118890600160a01b90046001600160601b031686612302565b6111929190612319565b90506000600d83815481106111a9576111a96122b0565b60009182526020822001546040516001600160a01b039091169184919081818185875af1925050503d80600081146111fd576040519150601f19603f3d011682016040523d82523d6000602084013e611202565b606091505b505090508061125f5760405162461bcd60e51b8152602060048201526024808201527f45524332304858466565733a204661696c75726520746f207472616e736665726044820152630408aa8960e31b6064820152608401610932565b5050600101611142565b600a546001600160a01b031663e985e9c585336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa1580156112c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112eb919061233b565b6113375760405162461bcd60e51b815260206004820152601960248201527f455243323048583a204e4654206e6f7420617070726f766564000000000000006044820152606401610932565b83610a7381858585611848565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561139d57507f000000000000000000000000000000000000000000000000000000000000000046145b156113c757507f000000000000000000000000000000000000000000000000000000000000000090565b6106c4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6009546001600160a01b0316331461076b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff83146115355761152e8361191b565b905061061a565b8180546115419061223a565b80601f016020809104026020016040519081016040528092919081815260200182805461156d9061223a565b80156115ba5780601f1061158f576101008083540402835291602001916115ba565b820191906000526020600020905b81548152906001019060200180831161159d57829003601f168201915b5050505050905061061a565b60006115d46012600a612441565b6115de9083612302565b9050806115eb8533610bf2565b10156116395760405162461bcd60e51b815260206004820152601f60248201527f455243323048583a20496e73756666696369656e7420616c6c6f77616e6365006044820152606401610932565b6106b484848461195a565b336108c481808461195a565b3361084881808585611848565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527fd44942a6101d02dd817a0dc4e7a5e3043f24435b9929130d50257047cdf1a87d9060200160405180910390a150565b6001600160a01b0382166117075760405162461bcd60e51b815260206004820152601f60248201527f45524332304858466565733a20496e76616c696420706172616d6574657273006044820152606401610932565b604080518082019091526001600160a01b0392831681526001600160601b0391821660208201908152600d805460018101825560009190915291519051909216600160a01b0291909216177fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590910155565b6001600160a01b03811660009081526007602052604090208054600181018255905b50919050565b600061061a6117ae611344565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006117df87878787611a2d565b915091506117ec81611af1565b5095945050505050565b600080805b600d5481101561179b57600d8181548110611818576118186122b0565b60009182526020909120015461183e90600160a01b90046001600160601b031683612450565b91506001016117fb565b60006118566012600a612441565b6118609083612302565b600a5460405163ba36b92d60e01b81529192506001600160a01b03169063ba36b92d90611895908890879087906004016124a9565b600060405180830381600087803b1580156118af57600080fd5b505af11580156118c3573d6000803e3d6000fd5b505050506118d18482611c3b565b846001600160a01b03167ffe4b4dca71e75a87453da565aaedf6a2d04ee9a78ec4aa35912b5b4850a0c0b4848460405161190c9291906124d7565b60405180910390a25050505050565b6060600061192883611cfa565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60006119686012600a612441565b6119729083612302565b905061197e8482611d22565b600a546040516340c10f1960e01b81526001600160a01b03858116600483015260248201859052909116906340c10f1990604401600060405180830381600087803b1580156119cc57600080fd5b505af11580156119e0573d6000803e3d6000fd5b50505050826001600160a01b03167f1f89f147a58d1673945cf416187db98efc8208408c011b91887acd59fd8523c383604051611a1f91815260200190565b60405180910390a250505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611a645750600090506003611ae8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611ab8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611ae157600060019250925050611ae8565b9150600090505b94509492505050565b6000816004811115611b0557611b056124f3565b03611b0d5750565b6001816004811115611b2157611b216124f3565b03611b6e5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610932565b6002816004811115611b8257611b826124f3565b03611bcf5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610932565b6003816004811115611be357611be36124f3565b0361087f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610932565b6001600160a01b038216611c915760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610932565b8060026000828254611ca39190612284565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060ff8216601f81111561061a57604051632cd44ac360e21b815260040160405180910390fd5b6001600160a01b038216611d825760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610932565b6001600160a01b03821660009081526020819052604090205481811015611df65760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610932565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b508054600082559060005260206000209081019061087f91905b80821115611e825760008155600101611e6e565b5090565b6000815180845260005b81811015611eac57602081850181015186830182015201611e90565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611edf6020830184611e86565b9392505050565b6001600160a01b038116811461087f57600080fd5b60008060408385031215611f0e57600080fd5b8235611f1981611ee6565b946020939093013593505050565b600060208284031215611f3957600080fd5b5035919050565b600080600060608486031215611f5557600080fd5b8335611f6081611ee6565b92506020840135611f7081611ee6565b929592945050506040919091013590565b60008083601f840112611f9357600080fd5b50813567ffffffffffffffff811115611fab57600080fd5b6020830191508360208260051b8501011115611fc657600080fd5b9250929050565b60008060008060608587031215611fe357600080fd5b8435611fee81611ee6565b93506020850135611ffe81611ee6565b9250604085013567ffffffffffffffff81111561201a57600080fd5b61202687828801611f81565b95989497509550505050565b60006020828403121561204457600080fd5b8135611edf81611ee6565b60ff60f81b881681526000602060e0602084015261207060e084018a611e86565b8381036040850152612082818a611e86565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b818110156120d6578351835292840192918401916001016120ba565b50909c9b505050505050505050505050565b600080602083850312156120fb57600080fd5b823567ffffffffffffffff81111561211257600080fd5b61211e85828601611f81565b90969095509350505050565b6000806000806040858703121561214057600080fd5b843567ffffffffffffffff8082111561215857600080fd5b61216488838901611f81565b9096509450602087013591508082111561217d57600080fd5b5061202687828801611f81565b600080600080600080600060e0888a0312156121a557600080fd5b87356121b081611ee6565b965060208801356121c081611ee6565b95506040880135945060608801359350608088013560ff811681146121e457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561221457600080fd5b823561221f81611ee6565b9150602083013561222f81611ee6565b809150509250929050565b600181811c9082168061224e57607f821691505b60208210810361179b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561061a5761061a61226e565b6000602082840312156122a957600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156122d857600080fd5b81356001600160601b0381168114611edf57600080fd5b8181038181111561061a5761061a61226e565b808202811582820484141761061a5761061a61226e565b60008261233657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561234d57600080fd5b81518015158114611edf57600080fd5b600181815b8085111561239857816000190482111561237e5761237e61226e565b8085161561238b57918102915b93841c9390800290612362565b509250929050565b6000826123af5750600161061a565b816123bc5750600061061a565b81600181146123d257600281146123dc576123f8565b600191505061061a565b60ff8411156123ed576123ed61226e565b50506001821b61061a565b5060208310610133831016604e8410600b841016171561241b575081810a61061a565b612425838361235d565b80600019048211156124395761243961226e565b029392505050565b6000611edf60ff8416836123a0565b6001600160601b038181168382160190808211156124705761247061226e565b5092915050565b81835260006001600160fb1b0383111561249057600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b03841681526040602082018190526000906124ce9083018486612477565b95945050505050565b6020815260006124eb602083018486612477565b949350505050565b634e487b7160e01b600052602160045260246000fdfea26469706673582212202ae42060f5d42233332e37d8e2d9179a8d49b5f140565c3fe41903989c7775d964736f6c63430008190033000000000000000000000000046204c8da991dcbc8b33df2254482138ec5cda2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000c4b4154414e41204245415453000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064b4154414e410000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106101c25760003560e01c806384b0196e116100f7578063a7ccabdf11610095578063d505accf11610064578063d505accf146104ff578063d9e7c4521461051f578063dd62ed3e14610534578063f2fde38b1461055457600080fd5b8063a7ccabdf1461047f578063a9059cbb1461049f578063bbb0e2d0146104bf578063c4791d5e146104df57600080fd5b806392642744116100d1578063926427441461042457806395d89b411461043757806395de7a9e1461044c578063a457c2d71461045f57600080fd5b806384b0196e146103cb578063884f08a1146103f35780638da5cb5b1461040657600080fd5b80633644e5151161016457806339b37ab01161013e57806339b37ab01461034057806370a0823114610360578063715018a6146103965780637ecebe00146103ab57600080fd5b80633644e515146102d957806338b3b5b5146102ee578063395093511461032057600080fd5b806319445a14116101a057806319445a141461024157806323b872dd1461028857806328c8bf80146102a8578063313ce567146102bd57600080fd5b806306fdde03146101c7578063095ea7b3146101f257806318160ddd14610222575b600080fd5b3480156101d357600080fd5b506101dc610574565b6040516101e99190611ecc565b60405180910390f35b3480156101fe57600080fd5b5061021261020d366004611efb565b610606565b60405190151581526020016101e9565b34801561022e57600080fd5b506002545b6040519081526020016101e9565b34801561024d57600080fd5b5061026161025c366004611f27565b610620565b604080516001600160a01b0390931683526001600160601b039091166020830152016101e9565b34801561029457600080fd5b506102126102a3366004611f40565b61065b565b6102bb6102b6366004611fcd565b61067f565b005b3480156102c957600080fd5b50604051601281526020016101e9565b3480156102e557600080fd5b506102336106ba565b3480156102fa57600080fd5b50600a546001600160a01b03165b6040516001600160a01b0390911681526020016101e9565b34801561032c57600080fd5b5061021261033b366004611efb565b6106c9565b34801561034c57600080fd5b5061023361035b366004611f27565b6106eb565b34801561036c57600080fd5b5061023361037b366004612032565b6001600160a01b031660009081526020819052604090205490565b3480156103a257600080fd5b506102bb610759565b3480156103b757600080fd5b506102336103c6366004612032565b61076d565b3480156103d757600080fd5b506103e061078b565b6040516101e9979695949392919061204f565b6102bb610401366004611f40565b610814565b34801561041257600080fd5b506009546001600160a01b0316610308565b6102bb610432366004611f27565b61084d565b34801561044357600080fd5b506101dc610882565b6102bb61045a3660046120e8565b610891565b34801561046b57600080fd5b5061021261047a366004611efb565b6108c8565b34801561048b57600080fd5b506102bb61049a366004612032565b610948565b3480156104ab57600080fd5b506102126104ba366004611efb565b610959565b3480156104cb57600080fd5b506102bb6104da366004612032565b610967565b3480156104eb57600080fd5b506102bb6104fa36600461212a565b61098d565b34801561050b57600080fd5b506102bb61051a36600461218a565b610a7a565b34801561052b57600080fd5b506102bb610bde565b34801561054057600080fd5b5061023361054f366004612201565b610bf2565b34801561056057600080fd5b506102bb61056f366004612032565b610c1d565b6060600380546105839061223a565b80601f01602080910402602001604051908101604052809291908181526020018280546105af9061223a565b80156105fc5780601f106105d1576101008083540402835291602001916105fc565b820191906000526020600020905b8154815290600101906020018083116105df57829003601f168201915b5050505050905090565b600033610614818585610c93565b60019150505b92915050565b600d818154811061063057600080fd5b6000918252602090912001546001600160a01b0381169150600160a01b90046001600160601b031682565b600033610669858285610db7565b610674858585610e2b565b506001949350505050565b610687610fcf565b6000610692826106eb565b905061069d81611028565b6106a985858585611269565b506106b46001600b55565b50505050565b60006106c4611344565b905090565b6000336106148185856106dc8383610bf2565b6106e69190612284565b610c93565b600c5460405163039b37ab60e41b8152600481018390526000916001600160a01b0316906339b37ab090602401602060405180830381865afa158015610735573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061a9190612297565b61076161146f565b61076b60006114c9565b565b6001600160a01b03811660009081526007602052604081205461061a565b6000606080828080836107bf7f4b4154414e410000000000000000000000000000000000000000000000000006600561151b565b6107ea7f3100000000000000000000000000000000000000000000000000000000000001600661151b565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b61081c610fcf565b6000610827826106eb565b905061083281611028565b61083d8484846115c6565b506108486001600b55565b505050565b610855610fcf565b6000610860826106eb565b905061086b81611028565b61087482611644565b5061087f6001600b55565b50565b6060600480546105839061223a565b610899610fcf565b60006108a4826106eb565b90506108af81611028565b6108b98383611650565b506108c46001600b55565b5050565b600033816108d68286610bf2565b90508381101561093b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084015b60405180910390fd5b6106748286868403610c93565b61095061146f565b61087f8161165d565b600033610614818585610e2b565b61096f61146f565b600c80546001600160a01b0319166001600160a01b03831617905550565b61099561146f565b828114610a0a5760405162461bcd60e51b815260206004820152603d60248201527f45524332304858466565733a20726563656976657273206c656e677468206d7560448201527f737420626520657175616c20746f20666565456e756d657261746f72730000006064820152608401610932565b60005b83811015610a7357610a6b858583818110610a2a57610a2a6122b0565b9050602002016020810190610a3f9190612032565b848484818110610a5157610a516122b0565b9050602002016020810190610a6691906122c6565b6116b1565b600101610a0d565b5050505050565b83421115610aca5760405162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610932565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888610af98c611779565b6040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810186905260e0016040516020818303038152906040528051906020012090506000610b54826117a1565b90506000610b64828787876117ce565b9050896001600160a01b0316816001600160a01b031614610bc75760405162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610932565b610bd28a8a8a610c93565b50505050505050505050565b610be661146f565b61076b600d6000611e54565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610c2561146f565b6001600160a01b038116610c8a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610932565b61087f816114c9565b6001600160a01b038316610cf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610932565b6001600160a01b038216610d565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610932565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6000610dc38484610bf2565b905060001981146106b45781811015610e1e5760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e63650000006044820152606401610932565b6106b48484848403610c93565b6001600160a01b038316610e8f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610932565b6001600160a01b038216610ef15760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610932565b6001600160a01b03831660009081526020819052604090205481811015610f695760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610932565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a36106b4565b6002600b54036110215760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610932565b6002600b55565b803410156110785760405162461bcd60e51b815260206004820152601e60248201527f45524332304858466565733a20496e73756666696369656e74206665657300006044820152606401610932565b8034111561112a57600061108c82346122ef565b604051909150600090339083908381818185875af1925050503d80600081146110d1576040519150601f19603f3d011682016040523d82523d6000602084013e6110d6565b606091505b50509050806111275760405162461bcd60e51b815260206004820152601e60248201527f45524332304858466565733a204661696c75726520746f20726566756e6400006044820152606401610932565b50505b60006111346117f6565b6001600160601b0316905060005b600d5481101561084857600082600d8381548110611162576111626122b0565b60009182526020909120015461118890600160a01b90046001600160601b031686612302565b6111929190612319565b90506000600d83815481106111a9576111a96122b0565b60009182526020822001546040516001600160a01b039091169184919081818185875af1925050503d80600081146111fd576040519150601f19603f3d011682016040523d82523d6000602084013e611202565b606091505b505090508061125f5760405162461bcd60e51b8152602060048201526024808201527f45524332304858466565733a204661696c75726520746f207472616e736665726044820152630408aa8960e31b6064820152608401610932565b5050600101611142565b600a546001600160a01b031663e985e9c585336040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381865afa1580156112c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112eb919061233b565b6113375760405162461bcd60e51b815260206004820152601960248201527f455243323048583a204e4654206e6f7420617070726f766564000000000000006044820152606401610932565b83610a7381858585611848565b6000306001600160a01b037f000000000000000000000000d742784c3a7122d8dad90df6a66c47829733bc481614801561139d57507f000000000000000000000000000000000000000000000000000000000000210546145b156113c757507f9715de491f18485a3eb5f2d6454f6a22b28e4b8800080d84d0c23ca48c4cc19090565b6106c4604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f3560783e8d37c4b0afc78bb78c2afeebd2330b86c4cc23abf8da5985dec28280918101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6009546001600160a01b0316331461076b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610932565b600980546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b606060ff83146115355761152e8361191b565b905061061a565b8180546115419061223a565b80601f016020809104026020016040519081016040528092919081815260200182805461156d9061223a565b80156115ba5780601f1061158f576101008083540402835291602001916115ba565b820191906000526020600020905b81548152906001019060200180831161159d57829003601f168201915b5050505050905061061a565b60006115d46012600a612441565b6115de9083612302565b9050806115eb8533610bf2565b10156116395760405162461bcd60e51b815260206004820152601f60248201527f455243323048583a20496e73756666696369656e7420616c6c6f77616e6365006044820152606401610932565b6106b484848461195a565b336108c481808461195a565b3361084881808585611848565b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527fd44942a6101d02dd817a0dc4e7a5e3043f24435b9929130d50257047cdf1a87d9060200160405180910390a150565b6001600160a01b0382166117075760405162461bcd60e51b815260206004820152601f60248201527f45524332304858466565733a20496e76616c696420706172616d6574657273006044820152606401610932565b604080518082019091526001600160a01b0392831681526001600160601b0391821660208201908152600d805460018101825560009190915291519051909216600160a01b0291909216177fd7b6990105719101dabeb77144f2a3385c8033acd3af97e9423a695e81ad1eb590910155565b6001600160a01b03811660009081526007602052604090208054600181018255905b50919050565b600061061a6117ae611344565b8360405161190160f01b8152600281019290925260228201526042902090565b60008060006117df87878787611a2d565b915091506117ec81611af1565b5095945050505050565b600080805b600d5481101561179b57600d8181548110611818576118186122b0565b60009182526020909120015461183e90600160a01b90046001600160601b031683612450565b91506001016117fb565b60006118566012600a612441565b6118609083612302565b600a5460405163ba36b92d60e01b81529192506001600160a01b03169063ba36b92d90611895908890879087906004016124a9565b600060405180830381600087803b1580156118af57600080fd5b505af11580156118c3573d6000803e3d6000fd5b505050506118d18482611c3b565b846001600160a01b03167ffe4b4dca71e75a87453da565aaedf6a2d04ee9a78ec4aa35912b5b4850a0c0b4848460405161190c9291906124d7565b60405180910390a25050505050565b6060600061192883611cfa565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60006119686012600a612441565b6119729083612302565b905061197e8482611d22565b600a546040516340c10f1960e01b81526001600160a01b03858116600483015260248201859052909116906340c10f1990604401600060405180830381600087803b1580156119cc57600080fd5b505af11580156119e0573d6000803e3d6000fd5b50505050826001600160a01b03167f1f89f147a58d1673945cf416187db98efc8208408c011b91887acd59fd8523c383604051611a1f91815260200190565b60405180910390a250505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611a645750600090506003611ae8565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015611ab8573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611ae157600060019250925050611ae8565b9150600090505b94509492505050565b6000816004811115611b0557611b056124f3565b03611b0d5750565b6001816004811115611b2157611b216124f3565b03611b6e5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610932565b6002816004811115611b8257611b826124f3565b03611bcf5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610932565b6003816004811115611be357611be36124f3565b0361087f5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610932565b6001600160a01b038216611c915760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610932565b8060026000828254611ca39190612284565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600060ff8216601f81111561061a57604051632cd44ac360e21b815260040160405180910390fd5b6001600160a01b038216611d825760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610932565b6001600160a01b03821660009081526020819052604090205481811015611df65760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610932565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b508054600082559060005260206000209081019061087f91905b80821115611e825760008155600101611e6e565b5090565b6000815180845260005b81811015611eac57602081850181015186830182015201611e90565b506000602082860101526020601f19601f83011685010191505092915050565b602081526000611edf6020830184611e86565b9392505050565b6001600160a01b038116811461087f57600080fd5b60008060408385031215611f0e57600080fd5b8235611f1981611ee6565b946020939093013593505050565b600060208284031215611f3957600080fd5b5035919050565b600080600060608486031215611f5557600080fd5b8335611f6081611ee6565b92506020840135611f7081611ee6565b929592945050506040919091013590565b60008083601f840112611f9357600080fd5b50813567ffffffffffffffff811115611fab57600080fd5b6020830191508360208260051b8501011115611fc657600080fd5b9250929050565b60008060008060608587031215611fe357600080fd5b8435611fee81611ee6565b93506020850135611ffe81611ee6565b9250604085013567ffffffffffffffff81111561201a57600080fd5b61202687828801611f81565b95989497509550505050565b60006020828403121561204457600080fd5b8135611edf81611ee6565b60ff60f81b881681526000602060e0602084015261207060e084018a611e86565b8381036040850152612082818a611e86565b606085018990526001600160a01b038816608086015260a0850187905284810360c08601528551808252602080880193509091019060005b818110156120d6578351835292840192918401916001016120ba565b50909c9b505050505050505050505050565b600080602083850312156120fb57600080fd5b823567ffffffffffffffff81111561211257600080fd5b61211e85828601611f81565b90969095509350505050565b6000806000806040858703121561214057600080fd5b843567ffffffffffffffff8082111561215857600080fd5b61216488838901611f81565b9096509450602087013591508082111561217d57600080fd5b5061202687828801611f81565b600080600080600080600060e0888a0312156121a557600080fd5b87356121b081611ee6565b965060208801356121c081611ee6565b95506040880135945060608801359350608088013560ff811681146121e457600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561221457600080fd5b823561221f81611ee6565b9150602083013561222f81611ee6565b809150509250929050565b600181811c9082168061224e57607f821691505b60208210810361179b57634e487b7160e01b600052602260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8082018082111561061a5761061a61226e565b6000602082840312156122a957600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b6000602082840312156122d857600080fd5b81356001600160601b0381168114611edf57600080fd5b8181038181111561061a5761061a61226e565b808202811582820484141761061a5761061a61226e565b60008261233657634e487b7160e01b600052601260045260246000fd5b500490565b60006020828403121561234d57600080fd5b81518015158114611edf57600080fd5b600181815b8085111561239857816000190482111561237e5761237e61226e565b8085161561238b57918102915b93841c9390800290612362565b509250929050565b6000826123af5750600161061a565b816123bc5750600061061a565b81600181146123d257600281146123dc576123f8565b600191505061061a565b60ff8411156123ed576123ed61226e565b50506001821b61061a565b5060208310610133831016604e8410600b841016171561241b575081810a61061a565b612425838361235d565b80600019048211156124395761243961226e565b029392505050565b6000611edf60ff8416836123a0565b6001600160601b038181168382160190808211156124705761247061226e565b5092915050565b81835260006001600160fb1b0383111561249057600080fd5b8260051b80836020870137939093016020019392505050565b6001600160a01b03841681526040602082018190526000906124ce9083018486612477565b95945050505050565b6020815260006124eb602083018486612477565b949350505050565b634e487b7160e01b600052602160045260246000fdfea26469706673582212202ae42060f5d42233332e37d8e2d9179a8d49b5f140565c3fe41903989c7775d964736f6c63430008190033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000046204c8da991dcbc8b33df2254482138ec5cda2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000000000000000000000000000000000000000000c4b4154414e41204245415453000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064b4154414e410000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _nftContractAddress (address): 0x046204c8dA991DcbC8b33dF2254482138EC5cDa2
Arg [1] : _tokenName (string): KATANA BEATS
Arg [2] : _tokenSymbol (string): KATANA

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000046204c8da991dcbc8b33df2254482138ec5cda2
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000c
Arg [4] : 4b4154414e412042454154530000000000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000006
Arg [6] : 4b4154414e410000000000000000000000000000000000000000000000000000


Deployed Bytecode Sourcemap

104:341:28:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:98:7;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4444:197;;;;;;;;;;-1:-1:-1;4444:197:7;;;;;:::i;:::-;;:::i;:::-;;;1288:14:40;;1281:22;1263:41;;1251:2;1236:18;4444:197:7;1123:187:40;3255:106:7;;;;;;;;;;-1:-1:-1;3342:12:7;;3255:106;;;1461:25:40;;;1449:2;1434:18;3255:106:7;1315:177:40;372:26:30;;;;;;;;;;-1:-1:-1;372:26:30;;;;;:::i;:::-;;:::i;:::-;;;;-1:-1:-1;;;;;1888:32:40;;;1870:51;;-1:-1:-1;;;;;1957:39:40;;;1952:2;1937:18;;1930:67;1843:18;372:26:30;1682:321:40;5203:256:7;;;;;;;;;;-1:-1:-1;5203:256:7;;;;;:::i;:::-;;:::i;2806:268:30:-;;;;;;:::i;:::-;;:::i;:::-;;3104:91:7;;;;;;;;;;-1:-1:-1;3104:91:7;;3186:2;3701:36:40;;3689:2;3674:18;3104:91:7;3559:184:40;2836:113:10;;;;;;;;;;;;;:::i;764:100:32:-;;;;;;;;;;-1:-1:-1;846:11:32;;-1:-1:-1;;;;;846:11:32;764:100;;;-1:-1:-1;;;;;4112:32:40;;;4094:51;;4082:2;4067:18;764:100:32;3930:221:40;5854:234:7;;;;;;;;;;-1:-1:-1;5854:234:7;;;;;:::i;:::-;;:::i;1598:126:30:-;;;;;;;;;;-1:-1:-1;1598:126:30;;;;;:::i;:::-;;:::i;3419:125:7:-;;;;;;;;;;-1:-1:-1;3419:125:7;;;;;:::i;:::-;-1:-1:-1;;;;;3519:18:7;3493:7;3519:18;;;;;;;;;;;;3419:125;1824:101:2;;;;;;;;;;;;;:::i;2603:126:10:-;;;;;;;;;;-1:-1:-1;2603:126:10;;;;;:::i;:::-;;:::i;5021:633:23:-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;:::i;3080:250:30:-;;;;;;:::i;:::-;;:::i;1201:85:2:-;;;;;;;;;;-1:-1:-1;1273:6:2;;-1:-1:-1;;;;;1273:6:2;1201:85;;2624:176:30;;;;;;:::i;:::-;;:::i;2369:102:7:-;;;;;;;;;;;;;:::i;2410:208:30:-;;;;;;:::i;:::-;;:::i;6575:427:7:-;;;;;;;;;;-1:-1:-1;6575:427:7;;;;;:::i;:::-;;:::i;649:109:32:-;;;;;;;;;;-1:-1:-1;649:109:32;;;;;:::i;:::-;;:::i;3740:189:7:-;;;;;;;;;;-1:-1:-1;3740:189:7;;;;;:::i;:::-;;:::i;405:105:30:-;;;;;;;;;;-1:-1:-1;405:105:30;;;;;:::i;:::-;;:::i;1107:397::-;;;;;;;;;;-1:-1:-1;1107:397:30;;;;;:::i;:::-;;:::i;1923:626:10:-;;;;;;;;;;-1:-1:-1;1923:626:10;;;;;:::i;:::-;;:::i;1510:82:30:-;;;;;;;;;;;;;:::i;3987:149:7:-;;;;;;;;;;-1:-1:-1;3987:149:7;;;;;:::i;:::-;;:::i;2074:198:2:-;;;;;;;;;;-1:-1:-1;2074:198:2;;;;;:::i;:::-;;:::i;2158:98:7:-;2212:13;2244:5;2237:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2158:98;:::o;4444:197::-;4527:4;734:10:17;4581:32:7;734:10:17;4597:7:7;4606:6;4581:8;:32::i;:::-;4630:4;4623:11;;;4444:197;;;;;:::o;372:26:30:-;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;372:26:30;;;-1:-1:-1;;;;372:26:30;;-1:-1:-1;;;;;372:26:30;;:::o;5203:256:7:-;5300:4;734:10:17;5356:38:7;5372:4;734:10:17;5387:6:7;5356:15;:38::i;:::-;5404:27;5414:4;5420:2;5424:6;5404:9;:27::i;:::-;-1:-1:-1;5448:4:7;;5203:256;-1:-1:-1;;;;5203:256:7:o;2806:268:30:-;2261:21:6;:19;:21::i;:::-;2957:12:30::1;2972:18;2976:6:::0;2972:3:::1;:18::i;:::-;2957:33;;3001:20;3016:4;3001:14;:20::i;:::-;3032:35;3050:4;3056:2;3060:6;;3032:17;:35::i;:::-;2947:127;2303:20:6::0;1716:1;2809:7;:22;2629:209;2303:20;2806:268:30;;;;:::o;2836:113:10:-;2896:7;2922:20;:18;:20::i;:::-;2915:27;;2836:113;:::o;5854:234:7:-;5942:4;734:10:17;5996:64:7;734:10:17;6012:7:7;6049:10;6021:25;734:10:17;6012:7:7;6021:9;:25::i;:::-;:38;;;;:::i;:::-;5996:8;:64::i;1598:126:30:-;1694:10;;1682:35;;-1:-1:-1;;;1682:35:30;;;;;1461:25:40;;;1656:7:30;;-1:-1:-1;;;;;1694:10:30;;1682:27;;1434:18:40;;1682:35:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1824:101:2:-;1094:13;:11;:13::i;:::-;1888:30:::1;1915:1;1888:18;:30::i;:::-;1824:101::o:0;2603:126:10:-;-1:-1:-1;;;;;2698:14:10;;2672:7;2698:14;;;:7;:14;;;;;918::18;2698:24:10;827:112:18;5021:633:23;5136:13;5163:18;;5136:13;;;5163:18;5427:41;:5;5454:13;5427:26;:41::i;:::-;5482:47;:8;5512:16;5482:29;:47::i;:::-;5621:16;;;5605:1;5621:16;;;;;;;;;-1:-1:-1;;;5376:271:23;;;-1:-1:-1;5376:271:23;;-1:-1:-1;5543:13:23;;-1:-1:-1;5578:4:23;;-1:-1:-1;5605:1:23;-1:-1:-1;5621:16:23;-1:-1:-1;5376:271:23;-1:-1:-1;5021:633:23:o;3080:250:30:-;2261:21:6;:19;:21::i;:::-;3220:12:30::1;3235:11;3239:6;3235:3;:11::i;:::-;3220:26;;3257:20;3272:4;3257:14;:20::i;:::-;3288:35;3306:4;3312:2;3316:6;3288:17;:35::i;:::-;3210:120;2303:20:6::0;1716:1;2809:7;:22;2629:209;2303:20;3080:250:30;;;:::o;2624:176::-;2261:21:6;:19;:21::i;:::-;2704:12:30::1;2719:11;2723:6;2719:3;:11::i;:::-;2704:26;;2741:20;2756:4;2741:14;:20::i;:::-;2772:21;2786:6;2772:13;:21::i;:::-;2694:106;2303:20:6::0;1716:1;2809:7;:22;2629:209;2303:20;2624:176:30;:::o;2369:102:7:-;2425:13;2457:7;2450:14;;;;;:::i;2410:208:30:-;2261:21:6;:19;:21::i;:::-;2515:12:30::1;2530:18;2534:6:::0;2530:3:::1;:18::i;:::-;2515:33;;2559:20;2574:4;2559:14;:20::i;:::-;2590:21;2604:6;;2590:13;:21::i;:::-;2505:113;2303:20:6::0;1716:1;2809:7;:22;2629:209;2303:20;2410:208:30;;:::o;6575:427:7:-;6668:4;734:10:17;6668:4:7;6749:25;734:10:17;6766:7:7;6749:9;:25::i;:::-;6722:52;;6812:15;6792:16;:35;;6784:85;;;;-1:-1:-1;;;6784:85:7;;9504:2:40;6784:85:7;;;9486:21:40;9543:2;9523:18;;;9516:30;9582:34;9562:18;;;9555:62;-1:-1:-1;;;9633:18:40;;;9626:35;9678:19;;6784:85:7;;;;;;;;;6903:60;6912:5;6919:7;6947:15;6928:16;:34;6903:8;:60::i;649:109:32:-;1094:13:2;:11;:13::i;:::-;722:29:32::1;738:12;722:15;:29::i;3740:189:7:-:0;3819:4;734:10:17;3873:28:7;734:10:17;3890:2:7;3894:6;3873:9;:28::i;405:105:30:-;1094:13:2;:11;:13::i;:::-;580:10:30;:24;;-1:-1:-1;;;;;;580:24:30;-1:-1:-1;;;;;580:24:30;;;;;2624:176;:::o;1107:397::-;1094:13:2;:11;:13::i;:::-;1271:34:30;;::::1;1250:142;;;::::0;-1:-1:-1;;;1250:142:30;;9910:2:40;1250:142:30::1;::::0;::::1;9892:21:40::0;9949:2;9929:18;;;9922:30;9988:34;9968:18;;;9961:62;10059:31;10039:18;;;10032:59;10108:19;;1250:142:30::1;9708:425:40::0;1250:142:30::1;1408:6;1403:94;1420:20:::0;;::::1;1403:94;;;1459:38;1472:9;;1482:1;1472:12;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;1486:7;;1494:1;1486:10;;;;;;;:::i;:::-;;;;;;;;;;;;;;:::i;:::-;1459:12;:38::i;:::-;1442:3;;1403:94;;;;1107:397:::0;;;;:::o;1923:626:10:-;2158:8;2139:15;:27;;2131:69;;;;-1:-1:-1;;;2131:69:10;;11029:2:40;2131:69:10;;;11011:21:40;11068:2;11048:18;;;11041:30;11107:31;11087:18;;;11080:59;11156:18;;2131:69:10;10827:353:40;2131:69:10;2211:18;1125:95;2271:5;2278:7;2287:5;2294:16;2304:5;2294:9;:16::i;:::-;2242:79;;;;;;11472:25:40;;;;-1:-1:-1;;;;;11571:15:40;;;11551:18;;;11544:43;11623:15;;;;11603:18;;;11596:43;11655:18;;;11648:34;11698:19;;;11691:35;11742:19;;;11735:35;;;11444:19;;2242:79:10;;;;;;;;;;;;2232:90;;;;;;2211:111;;2333:12;2348:28;2365:10;2348:16;:28::i;:::-;2333:43;;2387:14;2404:28;2418:4;2424:1;2427;2430;2404:13;:28::i;:::-;2387:45;;2460:5;-1:-1:-1;;;;;2450:15:10;:6;-1:-1:-1;;;;;2450:15:10;;2442:58;;;;-1:-1:-1;;;2442:58:10;;11983:2:40;2442:58:10;;;11965:21:40;12022:2;12002:18;;;11995:30;12061:32;12041:18;;;12034:60;12111:18;;2442:58:10;11781:354:40;2442:58:10;2511:31;2520:5;2527:7;2536:5;2511:8;:31::i;:::-;2121:428;;;1923:626;;;;;;;:::o;1510:82:30:-;1094:13:2;:11;:13::i;:::-;1570:15:30::1;1577:8;;1570:15;:::i;3987:149:7:-:0;-1:-1:-1;;;;;4102:18:7;;;4076:7;4102:18;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;3987:149::o;2074:198:2:-;1094:13;:11;:13::i;:::-;-1:-1:-1;;;;;2162:22:2;::::1;2154:73;;;::::0;-1:-1:-1;;;2154:73:2;;12342:2:40;2154:73:2::1;::::0;::::1;12324:21:40::0;12381:2;12361:18;;;12354:30;12420:34;12400:18;;;12393:62;-1:-1:-1;;;12471:18:40;;;12464:36;12517:19;;2154:73:2::1;12140:402:40::0;2154:73:2::1;2237:28;2256:8;2237:18;:28::i;10457:340:7:-:0;-1:-1:-1;;;;;10558:19:7;;10550:68;;;;-1:-1:-1;;;10550:68:7;;12749:2:40;10550:68:7;;;12731:21:40;12788:2;12768:18;;;12761:30;12827:34;12807:18;;;12800:62;-1:-1:-1;;;12878:18:40;;;12871:34;12922:19;;10550:68:7;12547:400:40;10550:68:7;-1:-1:-1;;;;;10636:21:7;;10628:68;;;;-1:-1:-1;;;10628:68:7;;13154:2:40;10628:68:7;;;13136:21:40;13193:2;13173:18;;;13166:30;13232:34;13212:18;;;13205:62;-1:-1:-1;;;13283:18:40;;;13276:32;13325:19;;10628:68:7;12952:398:40;10628:68:7;-1:-1:-1;;;;;10707:18:7;;;;;;;:11;:18;;;;;;;;:27;;;;;;;;;;;;;:36;;;10758:32;;1461:25:40;;;10758:32:7;;1434:18:40;10758:32:7;;;;;;;10457:340;;;:::o;11078:411::-;11178:24;11205:25;11215:5;11222:7;11205:9;:25::i;:::-;11178:52;;-1:-1:-1;;11244:16:7;:37;11240:243;;11325:6;11305:16;:26;;11297:68;;;;-1:-1:-1;;;11297:68:7;;13557:2:40;11297:68:7;;;13539:21:40;13596:2;13576:18;;;13569:30;13635:31;13615:18;;;13608:59;13684:18;;11297:68:7;13355:353:40;11297:68:7;11407:51;11416:5;11423:7;11451:6;11432:16;:25;11407:8;:51::i;7456:788::-;-1:-1:-1;;;;;7552:18:7;;7544:68;;;;-1:-1:-1;;;7544:68:7;;13915:2:40;7544:68:7;;;13897:21:40;13954:2;13934:18;;;13927:30;13993:34;13973:18;;;13966:62;-1:-1:-1;;;14044:18:40;;;14037:35;14089:19;;7544:68:7;13713:401:40;7544:68:7;-1:-1:-1;;;;;7630:16:7;;7622:64;;;;-1:-1:-1;;;7622:64:7;;14321:2:40;7622:64:7;;;14303:21:40;14360:2;14340:18;;;14333:30;14399:34;14379:18;;;14372:62;-1:-1:-1;;;14450:18:40;;;14443:33;14493:19;;7622:64:7;14119:399:40;7622:64:7;-1:-1:-1;;;;;7768:15:7;;7746:19;7768:15;;;;;;;;;;;7801:21;;;;7793:72;;;;-1:-1:-1;;;7793:72:7;;14725:2:40;7793:72:7;;;14707:21:40;14764:2;14744:18;;;14737:30;14803:34;14783:18;;;14776:62;-1:-1:-1;;;14854:18:40;;;14847:36;14900:19;;7793:72:7;14523:402:40;7793:72:7;-1:-1:-1;;;;;7899:15:7;;;:9;:15;;;;;;;;;;;7917:20;;;7899:38;;8114:13;;;;;;;;;;:23;;;;;;8163:26;;1461:25:40;;;8114:13:7;;8163:26;;1434:18:40;8163:26:7;;;;;;;8200:37;3080:250:30;2336:287:6;1759:1;2468:7;;:19;2460:63;;;;-1:-1:-1;;;2460:63:6;;15132:2:40;2460:63:6;;;15114:21:40;15171:2;15151:18;;;15144:30;15210:33;15190:18;;;15183:61;15261:18;;2460:63:6;14930:355:40;2460:63:6;1759:1;2598:7;:18;2336:287::o;1730:674:30:-;1816:4;1803:9;:17;;1795:60;;;;-1:-1:-1;;;1795:60:30;;15492:2:40;1795:60:30;;;15474:21:40;15531:2;15511:18;;;15504:30;15570:32;15550:18;;;15543:60;15620:18;;1795:60:30;15290:354:40;1795:60:30;1882:4;1870:9;:16;1866:210;;;1902:14;1920:16;1932:4;1920:9;:16;:::i;:::-;1967:36;;1902:35;;-1:-1:-1;1952:9:30;;734:10:17;;1902:35:30;;1952:9;1967:36;1952:9;1967:36;1902:35;734:10:17;1967:36:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1951:52;;;2026:4;2018:47;;;;-1:-1:-1;;;2018:47:30;;16194:2:40;2018:47:30;;;16176:21:40;16233:2;16213:18;;;16206:30;16272:32;16252:18;;;16245:60;16322:18;;2018:47:30;15992:354:40;2018:47:30;1888:188;;1866:210;2086:19;2108:14;:12;:14::i;:::-;-1:-1:-1;;;;;2086:36:30;;;2137:6;2132:266;2153:8;:15;2149:19;;2132:266;;;2189:12;2234:11;2212:8;2221:1;2212:11;;;;;;;;:::i;:::-;;;;;;;;;;:18;2205:25;;-1:-1:-1;;;2212:18:30;;-1:-1:-1;;;;;2212:18:30;2205:4;:25;:::i;:::-;2204:41;;;;:::i;:::-;2189:56;;2260:9;2276:8;2285:1;2276:11;;;;;;;;:::i;:::-;;;;;;;;;:20;2275:44;;-1:-1:-1;;;;;2276:20:30;;;;2310:4;;2275:44;;2276:11;2275:44;2310:4;2276:20;2275:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2259:60;;;2342:4;2334:53;;;;-1:-1:-1;;;2334:53:30;;16948:2:40;2334:53:30;;;16930:21:40;16987:2;16967:18;;;16960:30;17026:34;17006:18;;;16999:62;-1:-1:-1;;;17077:18:40;;;17070:34;17121:19;;2334:53:30;16746:400:40;2334:53:30;-1:-1:-1;;2170:3:30;;2132:266;;1672:335:32;1830:11;;-1:-1:-1;;;;;1830:11:32;:28;1859:4;734:10:17;1830:48:32;;-1:-1:-1;;;;;;1830:48:32;;;;;;;-1:-1:-1;;;;;17381:15:40;;;1830:48:32;;;17363:34:40;17433:15;;17413:18;;;17406:43;17298:18;;1830:48:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;1809:120;;;;-1:-1:-1;;;1809:120:32;;17944:2:40;1809:120:32;;;17926:21:40;17983:2;17963:18;;;17956:30;18022:27;18002:18;;;17995:55;18067:18;;1809:120:32;17742:349:40;1809:120:32;1955:4;1969:31;1955:4;1989:2;1993:6;;1969:12;:31::i;3695:262:23:-;3748:7;3779:4;-1:-1:-1;;;;;3788:11:23;3771:28;;:63;;;;;3820:14;3803:13;:31;3771:63;3767:184;;;-1:-1:-1;3857:22:23;;3695:262::o;3767:184::-;3917:23;4054:81;;;1929:95;4054:81;;;22005:25:40;4077:11:23;22046:18:40;;;22039:34;;;;4090:14:23;22089:18:40;;;22082:34;4106:13:23;22132:18:40;;;22125:34;4129:4:23;22175:19:40;;;22168:61;4018:7:23;;21977:19:40;;4054:81:23;;;;;;;;;;;;4044:92;;;;;;4037:99;;3963:180;;1359:130:2;1273:6;;-1:-1:-1;;;;;1273:6:2;734:10:17;1422:23:2;1414:68;;;;-1:-1:-1;;;1414:68:2;;18298:2:40;1414:68:2;;;18280:21:40;;;18317:18;;;18310:30;18376:34;18356:18;;;18349:62;18428:18;;1414:68:2;18096:356:40;2426:187:2;2518:6;;;-1:-1:-1;;;;;2534:17:2;;;-1:-1:-1;;;;;;2534:17:2;;;;;;;2566:40;;2518:6;;;2534:17;2518:6;;2566:40;;2499:16;;2566:40;2489:124;2426:187;:::o;3367:268:19:-;3461:13;1371:66;3490:47;;3486:143;;3560:15;3569:5;3560:8;:15::i;:::-;3553:22;;;;3486:143;3613:5;3606:12;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;870:326:32;969:16;1000;3186:2:7;1000::32;:16;:::i;:::-;988:28;;:9;:28;:::i;:::-;969:47;-1:-1:-1;969:47:32;1047:29;1057:4;734:10:17;3987:149:7;:::i;1047:29:32:-;:41;;1026:119;;;;-1:-1:-1;;;1026:119:32;;20036:2:40;1026:119:32;;;20018:21:40;20075:2;20055:18;;;20048:30;20114:33;20094:18;;;20087:61;20165:18;;1026:119:32;19834:355:40;1026:119:32;1156:33;1169:4;1175:2;1179:9;1156:12;:33::i;1202:157::-;734:10:17;1311:41:32;734:10:17;;1342:9:32;1311:12;:41::i;2013:156::-;734:10:17;2128:34:32;734:10:17;;2155:6:32;;2128:12;:34::i;490:153::-;556:11;:37;;-1:-1:-1;;;;;;556:37:32;-1:-1:-1;;;;;556:37:32;;;;;;;;609:27;;4094:51:40;;;609:27:32;;4082:2:40;4067:18;609:27:32;;;;;;;490:153;:::o;852:249:30:-;-1:-1:-1;;;;;978:22:30;;970:66;;;;-1:-1:-1;;;970:66:30;;20396:2:40;970:66:30;;;20378:21:40;20435:2;20415:18;;;20408:30;20474:33;20454:18;;;20447:61;20525:18;;970:66:30;20194:355:40;970:66:30;1061:32;;;;;;;;;-1:-1:-1;;;;;1061:32:30;;;;;-1:-1:-1;;;;;1061:32:30;;;;;;;;;1047:8;:47;;;;;;;-1:-1:-1;1047:47:30;;;;;;;;;;;-1:-1:-1;;;1047:47:30;;;;;;;;;;;852:249::o;3080:203:10:-;-1:-1:-1;;;;;3200:14:10;;3140:15;3200:14;;;:7;:14;;;;;918::18;;1050:1;1032:19;;;;918:14;3259:17:10;3157:126;3080:203;;;:::o;4768:165:23:-;4845:7;4871:55;4893:20;:18;:20::i;:::-;4915:10;8536:4:22;8530:11;-1:-1:-1;;;8554:23:22;;8606:4;8597:14;;8590:39;;;;8658:4;8649:14;;8642:34;8712:4;8697:20;;;8336:397;6598:232;6683:7;6703:17;6722:18;6744:25;6755:4;6761:1;6764;6767;6744:10;:25::i;:::-;6702:67;;;;6779:18;6791:5;6779:11;:18::i;:::-;-1:-1:-1;6814:9:22;6598:232;-1:-1:-1;;;;;6598:232:22:o;617:229:30:-;672:6;;;722:88;743:8;:15;739:19;;722:88;;;792:8;801:1;792:11;;;;;;;;:::i;:::-;;;;;;;;;;:18;777:33;;-1:-1:-1;;;792:18:30;;-1:-1:-1;;;;;792:18:30;777:33;;:::i;:::-;;-1:-1:-1;760:3:30;;722:88;;2175:308:32;2308:16;2345;3186:2:7;2345::32;:16;:::i;:::-;2327:34;;2328:6;2327:34;:::i;:::-;2372:11;;:31;;-1:-1:-1;;;2372:31:32;;2308:53;;-1:-1:-1;;;;;;2372:11:32;;:16;;:31;;2389:5;;2396:6;;;;2372:31;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2413:25;2425:2;2429:8;2413:11;:25::i;:::-;2462:5;-1:-1:-1;;;;;2454:22:32;;2469:6;;2454:22;;;;;;;:::i;:::-;;;;;;;;2298:185;2175:308;;;;:::o;2059:405:19:-;2118:13;2143:11;2157:16;2168:4;2157:10;:16::i;:::-;2281:14;;;2292:2;2281:14;;;;;;;;;2143:30;;-1:-1:-1;2261:17:19;;2281:14;;;;;;;;;-1:-1:-1;;;2371:16:19;;;-1:-1:-1;2416:4:19;2407:14;;2400:28;;;;-1:-1:-1;2371:16:19;2059:405::o;1365:301:32:-;1492:16;1523;3186:2:7;1523::32;:16;:::i;:::-;1511:28;;:9;:28;:::i;:::-;1492:47;;1550:30;1562:7;1571:8;1550:11;:30::i;:::-;1590:11;;:31;;-1:-1:-1;;;1590:31:32;;-1:-1:-1;;;;;22432:32:40;;;1590:31:32;;;22414:51:40;22481:18;;;22474:34;;;1590:11:32;;;;:16;;22387:18:40;;1590:31:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1645:2;-1:-1:-1;;;;;1637:22:32;;1649:9;1637:22;;;;1461:25:40;;1449:2;1434:18;;1315:177;1637:22:32;;;;;;;;1482:184;1365:301;;;:::o;5009:1456:22:-;5097:7;;6021:66;6008:79;;6004:161;;;-1:-1:-1;6119:1:22;;-1:-1:-1;6123:30:22;6103:51;;6004:161;6276:24;;;6259:14;6276:24;;;;;;;;;22746:25:40;;;22819:4;22807:17;;22787:18;;;22780:45;;;;22841:18;;;22834:34;;;22884:18;;;22877:34;;;6276:24:22;;22718:19:40;;6276:24:22;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;6276:24:22;;-1:-1:-1;;6276:24:22;;;-1:-1:-1;;;;;;;6314:20:22;;6310:101;;6366:1;6370:29;6350:50;;;;;;;6310:101;6429:6;-1:-1:-1;6437:20:22;;-1:-1:-1;5009:1456:22;;;;;;;;:::o;570:511::-;647:20;638:5;:29;;;;;;;;:::i;:::-;;634:441;;570:511;:::o;634:441::-;743:29;734:5;:38;;;;;;;;:::i;:::-;;730:345;;788:34;;-1:-1:-1;;;788:34:22;;23256:2:40;788:34:22;;;23238:21:40;23295:2;23275:18;;;23268:30;23334:26;23314:18;;;23307:54;23378:18;;788:34:22;23054:348:40;730:345:22;852:35;843:5;:44;;;;;;;;:::i;:::-;;839:236;;903:41;;-1:-1:-1;;;903:41:22;;23609:2:40;903:41:22;;;23591:21:40;23648:2;23628:18;;;23621:30;23687:33;23667:18;;;23660:61;23738:18;;903:41:22;23407:355:40;839:236:22;974:30;965:5;:39;;;;;;;;:::i;:::-;;961:114;;1020:44;;-1:-1:-1;;;1020:44:22;;23969:2:40;1020:44:22;;;23951:21:40;24008:2;23988:18;;;23981:30;24047:34;24027:18;;;24020:62;-1:-1:-1;;;24098:18:40;;;24091:32;24140:19;;1020:44:22;23767:398:40;8520:535:7;-1:-1:-1;;;;;8603:21:7;;8595:65;;;;-1:-1:-1;;;8595:65:7;;24372:2:40;8595:65:7;;;24354:21:40;24411:2;24391:18;;;24384:30;24450:33;24430:18;;;24423:61;24501:18;;8595:65:7;24170:355:40;8595:65:7;8747:6;8731:12;;:22;;;;;;;:::i;:::-;;;;-1:-1:-1;;;;;;;8899:18:7;;:9;:18;;;;;;;;;;;:28;;;;;;8952:37;1461:25:40;;;8952:37:7;;1434:18:40;8952:37:7;;;;;;;2410:208:30;;:::o;2536:245:19:-;2597:7;2669:4;2633:40;;2696:2;2687:11;;2683:69;;;2721:20;;-1:-1:-1;;;2721:20:19;;;;;;;;;;;9375:659:7;-1:-1:-1;;;;;9458:21:7;;9450:67;;;;-1:-1:-1;;;9450:67:7;;24732:2:40;9450:67:7;;;24714:21:40;24771:2;24751:18;;;24744:30;24810:34;24790:18;;;24783:62;-1:-1:-1;;;24861:18:40;;;24854:31;24902:19;;9450:67:7;24530:397:40;9450:67:7;-1:-1:-1;;;;;9613:18:7;;9588:22;9613:18;;;;;;;;;;;9649:24;;;;9641:71;;;;-1:-1:-1;;;9641:71:7;;25134:2:40;9641:71:7;;;25116:21:40;25173:2;25153:18;;;25146:30;25212:34;25192:18;;;25185:62;-1:-1:-1;;;25263:18:40;;;25256:32;25305:19;;9641:71:7;24932:398:40;9641:71:7;-1:-1:-1;;;;;9746:18:7;;:9;:18;;;;;;;;;;;9767:23;;;9746:44;;9883:12;:22;;;;;;;9931:37;1461:25:40;;;9746:9:7;;:18;9931:37;;1434:18:40;9931:37:7;;;;;;;3080:250:30;;;:::o;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:423:40:-;56:3;94:5;88:12;121:6;116:3;109:19;146:1;156:162;170:6;167:1;164:13;156:162;;;232:4;288:13;;;284:22;;278:29;260:11;;;256:20;;249:59;185:12;156:162;;;160:3;363:1;356:4;347:6;342:3;338:16;334:27;327:38;426:4;419:2;415:7;410:2;402:6;398:15;394:29;389:3;385:39;381:50;374:57;;;14:423;;;;:::o;442:220::-;591:2;580:9;573:21;554:4;611:45;652:2;641:9;637:18;629:6;611:45;:::i;:::-;603:53;442:220;-1:-1:-1;;;442:220:40:o;667:131::-;-1:-1:-1;;;;;742:31:40;;732:42;;722:70;;788:1;785;778:12;803:315;871:6;879;932:2;920:9;911:7;907:23;903:32;900:52;;;948:1;945;938:12;900:52;987:9;974:23;1006:31;1031:5;1006:31;:::i;:::-;1056:5;1108:2;1093:18;;;;1080:32;;-1:-1:-1;;;803:315:40:o;1497:180::-;1556:6;1609:2;1597:9;1588:7;1584:23;1580:32;1577:52;;;1625:1;1622;1615:12;1577:52;-1:-1:-1;1648:23:40;;1497:180;-1:-1:-1;1497:180:40:o;2008:456::-;2085:6;2093;2101;2154:2;2142:9;2133:7;2129:23;2125:32;2122:52;;;2170:1;2167;2160:12;2122:52;2209:9;2196:23;2228:31;2253:5;2228:31;:::i;:::-;2278:5;-1:-1:-1;2335:2:40;2320:18;;2307:32;2348:33;2307:32;2348:33;:::i;:::-;2008:456;;2400:7;;-1:-1:-1;;;2454:2:40;2439:18;;;;2426:32;;2008:456::o;2469:367::-;2532:8;2542:6;2596:3;2589:4;2581:6;2577:17;2573:27;2563:55;;2614:1;2611;2604:12;2563:55;-1:-1:-1;2637:20:40;;2680:18;2669:30;;2666:50;;;2712:1;2709;2702:12;2666:50;2749:4;2741:6;2737:17;2725:29;;2809:3;2802:4;2792:6;2789:1;2785:14;2777:6;2773:27;2769:38;2766:47;2763:67;;;2826:1;2823;2816:12;2763:67;2469:367;;;;;:::o;2841:713::-;2945:6;2953;2961;2969;3022:2;3010:9;3001:7;2997:23;2993:32;2990:52;;;3038:1;3035;3028:12;2990:52;3077:9;3064:23;3096:31;3121:5;3096:31;:::i;:::-;3146:5;-1:-1:-1;3203:2:40;3188:18;;3175:32;3216:33;3175:32;3216:33;:::i;:::-;3268:7;-1:-1:-1;3326:2:40;3311:18;;3298:32;3353:18;3342:30;;3339:50;;;3385:1;3382;3375:12;3339:50;3424:70;3486:7;3477:6;3466:9;3462:22;3424:70;:::i;:::-;2841:713;;;;-1:-1:-1;3513:8:40;-1:-1:-1;;;;2841:713:40:o;4156:247::-;4215:6;4268:2;4256:9;4247:7;4243:23;4239:32;4236:52;;;4284:1;4281;4274:12;4236:52;4323:9;4310:23;4342:31;4367:5;4342:31;:::i;4408:1259::-;4814:3;4809;4805:13;4797:6;4793:26;4782:9;4775:45;4756:4;4839:2;4877:3;4872:2;4861:9;4857:18;4850:31;4904:46;4945:3;4934:9;4930:19;4922:6;4904:46;:::i;:::-;4998:9;4990:6;4986:22;4981:2;4970:9;4966:18;4959:50;5032:33;5058:6;5050;5032:33;:::i;:::-;5096:2;5081:18;;5074:34;;;-1:-1:-1;;;;;5145:32:40;;5139:3;5124:19;;5117:61;5165:3;5194:19;;5187:35;;;5259:22;;;5253:3;5238:19;;5231:51;5331:13;;5353:22;;;5403:2;5429:15;;;;-1:-1:-1;5391:15:40;;;;-1:-1:-1;5472:169:40;5486:6;5483:1;5480:13;5472:169;;;5547:13;;5535:26;;5616:15;;;;5581:12;;;;5508:1;5501:9;5472:169;;;-1:-1:-1;5658:3:40;;4408:1259;-1:-1:-1;;;;;;;;;;;;4408:1259:40:o;5880:437::-;5966:6;5974;6027:2;6015:9;6006:7;6002:23;5998:32;5995:52;;;6043:1;6040;6033:12;5995:52;6083:9;6070:23;6116:18;6108:6;6105:30;6102:50;;;6148:1;6145;6138:12;6102:50;6187:70;6249:7;6240:6;6229:9;6225:22;6187:70;:::i;:::-;6276:8;;6161:96;;-1:-1:-1;5880:437:40;-1:-1:-1;;;;5880:437:40:o;6322:780::-;6451:6;6459;6467;6475;6528:2;6516:9;6507:7;6503:23;6499:32;6496:52;;;6544:1;6541;6534:12;6496:52;6584:9;6571:23;6613:18;6654:2;6646:6;6643:14;6640:34;;;6670:1;6667;6660:12;6640:34;6709:70;6771:7;6762:6;6751:9;6747:22;6709:70;:::i;:::-;6798:8;;-1:-1:-1;6683:96:40;-1:-1:-1;6886:2:40;6871:18;;6858:32;;-1:-1:-1;6902:16:40;;;6899:36;;;6931:1;6928;6921:12;6899:36;;6970:72;7034:7;7023:8;7012:9;7008:24;6970:72;:::i;7107:829::-;7218:6;7226;7234;7242;7250;7258;7266;7319:3;7307:9;7298:7;7294:23;7290:33;7287:53;;;7336:1;7333;7326:12;7287:53;7375:9;7362:23;7394:31;7419:5;7394:31;:::i;:::-;7444:5;-1:-1:-1;7501:2:40;7486:18;;7473:32;7514:33;7473:32;7514:33;:::i;:::-;7566:7;-1:-1:-1;7620:2:40;7605:18;;7592:32;;-1:-1:-1;7671:2:40;7656:18;;7643:32;;-1:-1:-1;7727:3:40;7712:19;;7699:33;7776:4;7763:18;;7751:31;;7741:59;;7796:1;7793;7786:12;7741:59;7107:829;;;;-1:-1:-1;7107:829:40;;;;7819:7;7873:3;7858:19;;7845:33;;-1:-1:-1;7925:3:40;7910:19;;;7897:33;;7107:829;-1:-1:-1;;7107:829:40:o;7941:388::-;8009:6;8017;8070:2;8058:9;8049:7;8045:23;8041:32;8038:52;;;8086:1;8083;8076:12;8038:52;8125:9;8112:23;8144:31;8169:5;8144:31;:::i;:::-;8194:5;-1:-1:-1;8251:2:40;8236:18;;8223:32;8264:33;8223:32;8264:33;:::i;:::-;8316:7;8306:17;;;7941:388;;;;;:::o;8334:380::-;8413:1;8409:12;;;;8456;;;8477:61;;8531:4;8523:6;8519:17;8509:27;;8477:61;8584:2;8576:6;8573:14;8553:18;8550:38;8547:161;;8630:10;8625:3;8621:20;8618:1;8611:31;8665:4;8662:1;8655:15;8693:4;8690:1;8683:15;8719:127;8780:10;8775:3;8771:20;8768:1;8761:31;8811:4;8808:1;8801:15;8835:4;8832:1;8825:15;8851:125;8916:9;;;8937:10;;;8934:36;;;8950:18;;:::i;8981:184::-;9051:6;9104:2;9092:9;9083:7;9079:23;9075:32;9072:52;;;9120:1;9117;9110:12;9072:52;-1:-1:-1;9143:16:40;;8981:184;-1:-1:-1;8981:184:40:o;10138:127::-;10199:10;10194:3;10190:20;10187:1;10180:31;10230:4;10227:1;10220:15;10254:4;10251:1;10244:15;10530:292;10588:6;10641:2;10629:9;10620:7;10616:23;10612:32;10609:52;;;10657:1;10654;10647:12;10609:52;10696:9;10683:23;-1:-1:-1;;;;;10739:5:40;10735:38;10728:5;10725:49;10715:77;;10788:1;10785;10778:12;15649:128;15716:9;;;15737:11;;;15734:37;;;15751:18;;:::i;16351:168::-;16424:9;;;16455;;16472:15;;;16466:22;;16452:37;16442:71;;16493:18;;:::i;16524:217::-;16564:1;16590;16580:132;;16634:10;16629:3;16625:20;16622:1;16615:31;16669:4;16666:1;16659:15;16697:4;16694:1;16687:15;16580:132;-1:-1:-1;16726:9:40;;16524:217::o;17460:277::-;17527:6;17580:2;17568:9;17559:7;17555:23;17551:32;17548:52;;;17596:1;17593;17586:12;17548:52;17628:9;17622:16;17681:5;17674:13;17667:21;17660:5;17657:32;17647:60;;17703:1;17700;17693:12;18457:416;18546:1;18583:5;18546:1;18597:270;18618:7;18608:8;18605:21;18597:270;;;18677:4;18673:1;18669:6;18665:17;18659:4;18656:27;18653:53;;;18686:18;;:::i;:::-;18736:7;18726:8;18722:22;18719:55;;;18756:16;;;;18719:55;18835:22;;;;18795:15;;;;18597:270;;;18601:3;18457:416;;;;;:::o;18878:806::-;18927:5;18957:8;18947:80;;-1:-1:-1;18998:1:40;19012:5;;18947:80;19046:4;19036:76;;-1:-1:-1;19083:1:40;19097:5;;19036:76;19128:4;19146:1;19141:59;;;;19214:1;19209:130;;;;19121:218;;19141:59;19171:1;19162:10;;19185:5;;;19209:130;19246:3;19236:8;19233:17;19230:43;;;19253:18;;:::i;:::-;-1:-1:-1;;19309:1:40;19295:16;;19324:5;;19121:218;;19423:2;19413:8;19410:16;19404:3;19398:4;19395:13;19391:36;19385:2;19375:8;19372:16;19367:2;19361:4;19358:12;19354:35;19351:77;19348:159;;;-1:-1:-1;19460:19:40;;;19492:5;;19348:159;19539:34;19564:8;19558:4;19539:34;:::i;:::-;19609:6;19605:1;19601:6;19597:19;19588:7;19585:32;19582:58;;;19620:18;;:::i;:::-;19658:20;;18878:806;-1:-1:-1;;;18878:806:40:o;19689:140::-;19747:5;19776:47;19817:4;19807:8;19803:19;19797:4;19776:47;:::i;20554:188::-;-1:-1:-1;;;;;20667:10:40;;;20679;;;20663:27;;20702:11;;;20699:37;;;20716:18;;:::i;:::-;20699:37;20554:188;;;;:::o;20747:311::-;20835:19;;;20817:3;-1:-1:-1;;;;;20866:31:40;;20863:51;;;20910:1;20907;20900:12;20863:51;20946:6;20943:1;20939:14;20998:8;20991:5;20984:4;20979:3;20975:14;20962:45;21027:18;;;;21047:4;21023:29;;20747:311;-1:-1:-1;;;20747:311:40:o;21063:385::-;-1:-1:-1;;;;;21280:32:40;;21262:51;;21349:2;21344;21329:18;;21322:30;;;-1:-1:-1;;21369:73:40;;21423:18;;21415:6;21407;21369:73;:::i;:::-;21361:81;21063:385;-1:-1:-1;;;;;21063:385:40:o;21453:288::-;21642:2;21631:9;21624:21;21605:4;21662:73;21731:2;21720:9;21716:18;21708:6;21700;21662:73;:::i;:::-;21654:81;21453:288;-1:-1:-1;;;;21453:288:40:o;22922:127::-;22983:10;22978:3;22974:20;22971:1;22964:31;23014:4;23011:1;23004:15;23038:4;23035:1;23028:15

Swarm Source

ipfs://2ae42060f5d42233332e37d8e2d9179a8d49b5f140565c3fe41903989c7775d9
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.