Token EventNamelbqH7L

Overview ERC-1155

Total Supply:
0 OAZIZ#UFS

Holders:
3 addresses

Transfers:
-

Profile Summary

 
Contract:
0x28a95d3f15b70c03e12760557d62063c48b7cf3e0x28a95d3F15B70C03e12760557d62063c48b7Cf3E

Loading
[ Download CSV Export  ] 
Loading
Loading

Click here to update the token ICO / general information
# Exchange Pair Price  24H Volume % Volume
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0x669b7668aC60712dFa2f961dBa1B17463121304c

Contract Name:
EventTicketsNFT

Compiler Version
v0.8.16+commit.07a7930e

Optimization Enabled:
Yes with 10 runs

Other Settings:
default evmVersion, MIT license
File 1 of 32 : IAccessControl.sol
// 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;
}

File 2 of 32 : IAccessControlEnumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)

pragma solidity ^0.8.0;

import "./IAccessControl.sol";

/**
 * @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
 */
interface IAccessControlEnumerable is IAccessControl {
    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) external view returns (address);

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) external view returns (uint256);
}

File 3 of 32 : ERC1155.sol
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;

import "./interface/IERC1155.sol";
import "./interface/IERC1155Metadata.sol";
import "./interface/IERC1155Receiver.sol";

contract ERC1155 is IERC1155, IERC1155Metadata {
    /*//////////////////////////////////////////////////////////////
                        State variables
    //////////////////////////////////////////////////////////////*/

    string public name;
    string public symbol;

    /*//////////////////////////////////////////////////////////////
                            Mappings
    //////////////////////////////////////////////////////////////*/

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

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    mapping(uint256 => string) internal _uri;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(string memory _name, string memory _symbol) {
        name = _name;
        symbol = _symbol;
    }

    /*//////////////////////////////////////////////////////////////
                            View functions
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

    function uri(uint256 tokenId) public view virtual override returns (string memory) {
        return _uri[tokenId];
    }

    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "LENGTH_MISMATCH");

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf[accounts[i]][ids[i]];
        }

        return batchBalances;
    }

    /*//////////////////////////////////////////////////////////////
                            ERC1155 logic
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public virtual override {
        address owner = msg.sender;
        require(owner != operator, "APPROVING_SELF");
        isApprovedForAll[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED");
        _safeTransferFrom(from, to, id, amount, data);
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(from == msg.sender || isApprovedForAll[from][msg.sender], "!OWNER_OR_APPROVED");
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /*//////////////////////////////////////////////////////////////
                            Internal logic
    //////////////////////////////////////////////////////////////*/

    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);

        uint256 fromBalance = balanceOf[from][id];
        require(fromBalance >= amount, "INSUFFICIENT_BAL");
        unchecked {
            balanceOf[from][id] = fromBalance - amount;
        }
        balanceOf[to][id] += amount;

        emit TransferSingle(operator, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);
    }

    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "LENGTH_MISMATCH");
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = balanceOf[from][id];
            require(fromBalance >= amount, "INSUFFICIENT_BAL");
            unchecked {
                balanceOf[from][id] = fromBalance - amount;
            }
            balanceOf[to][id] += amount;
        }

        emit TransferBatch(operator, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);
    }

    function _setTokenURI(uint256 tokenId, string memory newuri) internal virtual {
        _uri[tokenId] = newuri;
    }

    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);

        balanceOf[to][id] += amount;
        emit TransferSingle(operator, address(0), to, id, amount);

        _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);
    }

    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "TO_ZERO_ADDR");
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);

        for (uint256 i = 0; i < ids.length; i++) {
            balanceOf[to][ids[i]] += amounts[i];
        }

        emit TransferBatch(operator, address(0), to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);
    }

    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "FROM_ZERO_ADDR");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), "");

        uint256 fromBalance = balanceOf[from][id];
        require(fromBalance >= amount, "INSUFFICIENT_BAL");
        unchecked {
            balanceOf[from][id] = fromBalance - amount;
        }

        emit TransferSingle(operator, from, address(0), id, amount);
    }

    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "FROM_ZERO_ADDR");
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        address operator = msg.sender;

        _beforeTokenTransfer(operator, from, address(0), ids, amounts, "");

        for (uint256 i = 0; i < ids.length; i++) {
            uint256 id = ids[i];
            uint256 amount = amounts[i];

            uint256 fromBalance = balanceOf[from][id];
            require(fromBalance >= amount, "INSUFFICIENT_BAL");
            unchecked {
                balanceOf[from][id] = fromBalance - amount;
            }
        }

        emit TransferBatch(operator, from, address(0), ids, amounts);
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("TOKENS_REJECTED");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("!ERC1155RECEIVER");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("TOKENS_REJECTED");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("!ERC1155RECEIVER");
            }
        }
    }

    function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {
        uint256[] memory array = new uint256[](1);
        array[0] = element;

        return array;
    }
}

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

pragma solidity ^0.8.0;

import "./interface/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;
    }
}

File 5 of 32 : IERC1155.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
    @title ERC-1155 Multi Token Standard
    @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1155.md
    Note: The ERC-165 identifier for this interface is 0xd9b67a26.
 */
interface IERC1155 {
    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
        The `_operator` argument MUST be msg.sender.
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_id` argument MUST be the token type being transferred.
        The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
    */
    event TransferSingle(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256 _id,
        uint256 _value
    );

    /**
        @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
        The `_operator` argument MUST be msg.sender.
        The `_from` argument MUST be the address of the holder whose balance is decreased.
        The `_to` argument MUST be the address of the recipient whose balance is increased.
        The `_ids` argument MUST be the list of tokens being transferred.
        The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by.
        When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
        When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
    */
    event TransferBatch(
        address indexed _operator,
        address indexed _from,
        address indexed _to,
        uint256[] _ids,
        uint256[] _values
    );

    /**
        @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled).
    */
    event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);

    /**
        @dev MUST emit when the URI is updated for a token ID.
        URIs are defined in RFC 3986.
        The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
    */
    event URI(string _value, uint256 indexed _id);

    /**
        @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if balance of holder for token `_id` is lower than the `_value` sent.
        MUST revert on any other error.
        MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard).
        After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
        @param _from    Source address
        @param _to      Target address
        @param _id      ID of the token type
        @param _value   Transfer amount
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
    */
    function safeTransferFrom(
        address _from,
        address _to,
        uint256 _id,
        uint256 _value,
        bytes calldata _data
    ) external;

    /**
        @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call).
        @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
        MUST revert if `_to` is the zero address.
        MUST revert if length of `_ids` is not the same as length of `_values`.
        MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient.
        MUST revert on any other error.
        MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard).
        Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc).
        After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
        @param _from    Source address
        @param _to      Target address
        @param _ids     IDs of each token type (order and length must match _values array)
        @param _values  Transfer amounts per token type (order and length must match _ids array)
        @param _data    Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`
    */
    function safeBatchTransferFrom(
        address _from,
        address _to,
        uint256[] calldata _ids,
        uint256[] calldata _values,
        bytes calldata _data
    ) external;

    /**
        @notice Get the balance of an account's Tokens.
        @param _owner  The address of the token holder
        @param _id     ID of the Token
        @return        The _owner's balance of the Token type requested
     */
    function balanceOf(address _owner, uint256 _id) external view returns (uint256);

    /**
        @notice Get the balance of multiple account/token pairs
        @param _owners The addresses of the token holders
        @param _ids    ID of the Tokens
        @return        The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair)
     */
    function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids)
        external
        view
        returns (uint256[] memory);

    /**
        @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
        @dev MUST emit the ApprovalForAll event on success.
        @param _operator  Address to add to the set of authorized operators
        @param _approved  True if the operator is approved, false to revoke approval
    */
    function setApprovalForAll(address _operator, bool _approved) external;

    /**
        @notice Queries the approval status of an operator for a given owner.
        @param _owner     The owner of the Tokens
        @param _operator  Address of authorized operator
        @return           True if the operator is approved, false if not
    */
    function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}

File 6 of 32 : IERC1155Metadata.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
    Note: The ERC-165 identifier for this interface is 0x0e89341c.
*/
interface IERC1155Metadata {
    /**
        @notice A distinct Uniform Resource Identifier (URI) for a given token.
        @dev URIs are defined in RFC 3986.
        The URI may point to a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
        @return URI string
    */
    function uri(uint256 _id) external view returns (string memory);
}

File 7 of 32 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev _Available since v3.1._
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

File 8 of 32 : IERC165.sol
// 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
 * [EIP](https://eips.ethereum.org/EIPS/eip-165).
 *
 * 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
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * 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);
}

File 9 of 32 : IERC20.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
interface IERC20 {
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 10 of 32 : IERC2981.sol
// SPDX-License-Identifier: Apache 2.0
pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Interface for the NFT Royalty Standard.
 *
 * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
 * support for royalty payments across all NFT marketplaces and ecosystem participants.
 *
 * _Available since v4.5._
 */
interface IERC2981 is IERC165 {
    /**
     * @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
     * exchange. The royalty amount is denominated and should be payed in that same unit of exchange.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        returns (address receiver, uint256 royaltyAmount);
}

File 11 of 32 : BatchMintMetadata.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
 *  @title   Batch-mint Metadata
 *  @notice  The `BatchMintMetadata` is a contract extension for any base NFT contract. It lets the smart contract
 *           using this extension set metadata for `n` number of NFTs all at once. This is enabled by storing a single
 *           base URI for a batch of `n` NFTs, where the metadata for each NFT in a relevant batch is `baseURI/tokenId`.
 */

contract BatchMintMetadata {
    /// @dev Largest tokenId of each batch of tokens with the same baseURI.
    uint256[] private batchIds;

    /// @dev Mapping from id of a batch of tokens => to base URI for the respective batch of tokens.
    mapping(uint256 => string) private baseURI;

    /**
     *  @notice         Returns the count of batches of NFTs.
     *  @dev            Each batch of tokens has an in ID and an associated `baseURI`.
     *                  See {batchIds}.
     */
    function getBaseURICount() public view returns (uint256) {
        return batchIds.length;
    }

    /**
     *  @notice         Returns the ID for the batch of tokens the given tokenId belongs to.
     *  @dev            See {getBaseURICount}.
     *  @param _index   ID of a token.
     */
    function getBatchIdAtIndex(uint256 _index) public view returns (uint256) {
        if (_index >= getBaseURICount()) {
            revert("Invalid index");
        }
        return batchIds[_index];
    }

    /// @dev Returns the id for the batch of tokens the given tokenId belongs to.
    function _getBatchId(uint256 _tokenId) internal view returns (uint256 batchId, uint256 index) {
        uint256 numOfTokenBatches = getBaseURICount();
        uint256[] memory indices = batchIds;

        for (uint256 i = 0; i < numOfTokenBatches; i += 1) {
            if (_tokenId < indices[i]) {
                index = i;
                batchId = indices[i];

                return (batchId, index);
            }
        }

        revert("Invalid tokenId");
    }

    /// @dev Returns the baseURI for a token. The intended metadata URI for the token is baseURI + tokenId.
    function _getBaseURI(uint256 _tokenId) internal view returns (string memory) {
        uint256 numOfTokenBatches = getBaseURICount();
        uint256[] memory indices = batchIds;

        for (uint256 i = 0; i < numOfTokenBatches; i += 1) {
            if (_tokenId < indices[i]) {
                return baseURI[indices[i]];
            }
        }
        revert("Invalid tokenId");
    }

    /// @dev Sets the base URI for the batch of tokens with the given batchId.
    function _setBaseURI(uint256 _batchId, string memory _baseURI) internal {
        baseURI[_batchId] = _baseURI;
    }

    /// @dev Mints a batch of tokenIds and associates a common baseURI to all those Ids.
    function _batchMintMetadata(
        uint256 _startId,
        uint256 _amountToMint,
        string memory _baseURIForTokens
    ) internal returns (uint256 nextTokenIdToMint, uint256 batchId) {
        batchId = _startId + _amountToMint;
        nextTokenIdToMint = batchId;

        batchIds.push(batchId);

        baseURI[batchId] = _baseURIForTokens;
    }
}

File 12 of 32 : Multicall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

import "../lib/TWAddress.sol";
import "./interface/IMulticall.sol";

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
contract Multicall is IMulticall {
    /**
     *  @notice Receives and executes a batch of function calls on this contract.
     *  @dev Receives and executes a batch of function calls on this contract.
     *
     *  @param data The bytes data that makes up the batch of function calls to execute.
     *  @return results The bytes data that makes up the result of the batch of function calls executed.
     */
    function multicall(bytes[] calldata data) external virtual override returns (bytes[] memory results) {
        results = new bytes[](data.length);
        for (uint256 i = 0; i < data.length; i++) {
            results[i] = TWAddress.functionDelegateCall(address(this), data[i]);
        }
        return results;
    }
}

File 13 of 32 : Ownable.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./interface/IOwnable.sol";

/**
 *  @title   Ownable
 *  @notice  Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading
 *           who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses
 *           information about who the contract's owner is.
 */

abstract contract Ownable is IOwnable {
    /// @dev Owner of the contract (purpose: OpenSea compatibility)
    address private _owner;

    /// @dev Reverts if caller is not the owner.
    modifier onlyOwner() {
        if (msg.sender != _owner) {
            revert("Not authorized");
        }
        _;
    }

    /**
     *  @notice Returns the owner of the contract.
     */
    function owner() public view override returns (address) {
        return _owner;
    }

    /**
     *  @notice Lets an authorized wallet set a new owner for the contract.
     *  @param _newOwner The address to set as the new owner of the contract.
     */
    function setOwner(address _newOwner) external override {
        if (!_canSetOwner()) {
            revert("Not authorized");
        }
        _setupOwner(_newOwner);
    }

    /// @dev Lets a contract admin set a new owner for the contract. The new owner must be a contract admin.
    function _setupOwner(address _newOwner) internal {
        address _prevOwner = _owner;
        _owner = _newOwner;

        emit OwnerUpdated(_prevOwner, _newOwner);
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual returns (bool);
}

File 14 of 32 : Royalty.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "./interface/IRoyalty.sol";

/**
 *  @title   Royalty
 *  @notice  Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading
 *           the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic
 *           that uses information about royalty fees, if desired.
 *
 *  @dev     The `Royalty` contract is ERC2981 compliant.
 */

abstract contract Royalty is IRoyalty {
    /// @dev The (default) address that receives all royalty value.
    address private royaltyRecipient;

    /// @dev The (default) % of a sale to take as royalty (in basis points).
    uint16 private royaltyBps;

    /// @dev Token ID => royalty recipient and bps for token
    mapping(uint256 => RoyaltyInfo) private royaltyInfoForToken;

    /**
     *  @notice   View royalty info for a given token and sale price.
     *  @dev      Returns royalty amount and recipient for `tokenId` and `salePrice`.
     *  @param tokenId          The tokenID of the NFT for which to query royalty info.
     *  @param salePrice        Sale price of the token.
     *
     *  @return receiver        Address of royalty recipient account.
     *  @return royaltyAmount   Royalty amount calculated at current royaltyBps value.
     */
    function royaltyInfo(uint256 tokenId, uint256 salePrice)
        external
        view
        virtual
        override
        returns (address receiver, uint256 royaltyAmount)
    {
        (address recipient, uint256 bps) = getRoyaltyInfoForToken(tokenId);
        receiver = recipient;
        royaltyAmount = (salePrice * bps) / 10_000;
    }

    /**
     *  @notice          View royalty info for a given token.
     *  @dev             Returns royalty recipient and bps for `_tokenId`.
     *  @param _tokenId  The tokenID of the NFT for which to query royalty info.
     */
    function getRoyaltyInfoForToken(uint256 _tokenId) public view override returns (address, uint16) {
        RoyaltyInfo memory royaltyForToken = royaltyInfoForToken[_tokenId];

        return
            royaltyForToken.recipient == address(0)
                ? (royaltyRecipient, uint16(royaltyBps))
                : (royaltyForToken.recipient, uint16(royaltyForToken.bps));
    }

    /**
     *  @notice Returns the defualt royalty recipient and BPS for this contract's NFTs.
     */
    function getDefaultRoyaltyInfo() external view override returns (address, uint16) {
        return (royaltyRecipient, uint16(royaltyBps));
    }

    /**
     *  @notice         Updates default royalty recipient and bps.
     *  @dev            Caller should be authorized to set royalty info.
     *                  See {_canSetRoyaltyInfo}.
     *                  Emits {DefaultRoyalty Event}; See {_setupDefaultRoyaltyInfo}.
     *
     *  @param _royaltyRecipient   Address to be set as default royalty recipient.
     *  @param _royaltyBps         Updated royalty bps.
     */
    function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external override {
        if (!_canSetRoyaltyInfo()) {
            revert("Not authorized");
        }

        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /// @dev Lets a contract admin update the default royalty recipient and bps.
    function _setupDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) internal {
        if (_royaltyBps > 10_000) {
            revert("Exceeds max bps");
        }

        royaltyRecipient = _royaltyRecipient;
        royaltyBps = uint16(_royaltyBps);

        emit DefaultRoyalty(_royaltyRecipient, _royaltyBps);
    }

    /**
     *  @notice         Updates default royalty recipient and bps for a particular token.
     *  @dev            Sets royalty info for `_tokenId`. Caller should be authorized to set royalty info.
     *                  See {_canSetRoyaltyInfo}.
     *                  Emits {RoyaltyForToken Event}; See {_setupRoyaltyInfoForToken}.
     *
     *  @param _recipient   Address to be set as royalty recipient for given token Id.
     *  @param _bps         Updated royalty bps for the token Id.
     */
    function setRoyaltyInfoForToken(
        uint256 _tokenId,
        address _recipient,
        uint256 _bps
    ) external override {
        if (!_canSetRoyaltyInfo()) {
            revert("Not authorized");
        }

        _setupRoyaltyInfoForToken(_tokenId, _recipient, _bps);
    }

    /// @dev Lets a contract admin set the royalty recipient and bps for a particular token Id.
    function _setupRoyaltyInfoForToken(
        uint256 _tokenId,
        address _recipient,
        uint256 _bps
    ) internal {
        if (_bps > 10_000) {
            revert("Exceeds max bps");
        }

        royaltyInfoForToken[_tokenId] = RoyaltyInfo({ recipient: _recipient, bps: _bps });

        emit RoyaltyForToken(_tokenId, _recipient, _bps);
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual returns (bool);
}

File 15 of 32 : IMulticall.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a function to batch together multiple calls in a single external call.
 *
 * _Available since v4.1._
 */
interface IMulticall {
    /**
     * @dev Receives and executes a batch of function calls on this contract.
     */
    function multicall(bytes[] calldata data) external returns (bytes[] memory results);
}

File 16 of 32 : IOwnable.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
 *  Thirdweb's `Ownable` is a contract extension to be used with any base contract. It exposes functions for setting and reading
 *  who the 'owner' of the inheriting smart contract is, and lets the inheriting contract perform conditional logic that uses
 *  information about who the contract's owner is.
 */

interface IOwnable {
    /// @dev Returns the owner of the contract.
    function owner() external view returns (address);

    /// @dev Lets a module admin set a new owner for the contract. The new owner must be a module admin.
    function setOwner(address _newOwner) external;

    /// @dev Emitted when a new Owner is set.
    event OwnerUpdated(address indexed prevOwner, address indexed newOwner);
}

File 17 of 32 : IRoyalty.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "../../eip/interface/IERC2981.sol";

/**
 *  Thirdweb's `Royalty` is a contract extension to be used with any base contract. It exposes functions for setting and reading
 *  the recipient of royalty fee and the royalty fee basis points, and lets the inheriting contract perform conditional logic
 *  that uses information about royalty fees, if desired.
 *
 *  The `Royalty` contract is ERC2981 compliant.
 */

interface IRoyalty is IERC2981 {
    struct RoyaltyInfo {
        address recipient;
        uint256 bps;
    }

    /// @dev Returns the royalty recipient and fee bps.
    function getDefaultRoyaltyInfo() external view returns (address, uint16);

    /// @dev Lets a module admin update the royalty bps and recipient.
    function setDefaultRoyaltyInfo(address _royaltyRecipient, uint256 _royaltyBps) external;

    /// @dev Lets a module admin set the royalty recipient for a particular token Id.
    function setRoyaltyInfoForToken(
        uint256 tokenId,
        address recipient,
        uint256 bps
    ) external;

    /// @dev Returns the royalty recipient for a particular token Id.
    function getRoyaltyInfoForToken(uint256 tokenId) external view returns (address, uint16);

    /// @dev Emitted when royalty info is updated.
    event DefaultRoyalty(address indexed newRoyaltyRecipient, uint256 newRoyaltyBps);

    /// @dev Emitted when royalty recipient for tokenId is set
    event RoyaltyForToken(uint256 indexed tokenId, address indexed royaltyRecipient, uint256 royaltyBps);
}

File 18 of 32 : IWETH.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

interface IWETH {
    function deposit() external payable;

    function withdraw(uint256 amount) external;

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

File 19 of 32 : CurrencyTransferLib.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

// Helper interfaces
import { IWETH } from "../interfaces/IWETH.sol";

import "../openzeppelin-presets/token/ERC20/utils/SafeERC20.sol";

library CurrencyTransferLib {
    using SafeERC20 for IERC20;

    /// @dev The address interpreted as native token of the chain.
    address public constant NATIVE_TOKEN = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /// @dev Transfers a given amount of currency.
    function transferCurrency(
        address _currency,
        address _from,
        address _to,
        uint256 _amount
    ) internal {
        if (_amount == 0) {
            return;
        }

        if (_currency == NATIVE_TOKEN) {
            safeTransferNativeToken(_to, _amount);
        } else {
            safeTransferERC20(_currency, _from, _to, _amount);
        }
    }

    /// @dev Transfers a given amount of currency. (With native token wrapping)
    function transferCurrencyWithWrapper(
        address _currency,
        address _from,
        address _to,
        uint256 _amount,
        address _nativeTokenWrapper
    ) internal {
        if (_amount == 0) {
            return;
        }

        if (_currency == NATIVE_TOKEN) {
            if (_from == address(this)) {
                // withdraw from weth then transfer withdrawn native token to recipient
                IWETH(_nativeTokenWrapper).withdraw(_amount);
                safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);
            } else if (_to == address(this)) {
                // store native currency in weth
                require(_amount == msg.value, "msg.value != amount");
                IWETH(_nativeTokenWrapper).deposit{ value: _amount }();
            } else {
                safeTransferNativeTokenWithWrapper(_to, _amount, _nativeTokenWrapper);
            }
        } else {
            safeTransferERC20(_currency, _from, _to, _amount);
        }
    }

    /// @dev Transfer `amount` of ERC20 token from `from` to `to`.
    function safeTransferERC20(
        address _currency,
        address _from,
        address _to,
        uint256 _amount
    ) internal {
        if (_from == _to) {
            return;
        }

        if (_from == address(this)) {
            IERC20(_currency).safeTransfer(_to, _amount);
        } else {
            IERC20(_currency).safeTransferFrom(_from, _to, _amount);
        }
    }

    /// @dev Transfers `amount` of native token to `to`.
    function safeTransferNativeToken(address to, uint256 value) internal {
        // solhint-disable avoid-low-level-calls
        // slither-disable-next-line low-level-calls
        (bool success, ) = to.call{ value: value }("");
        require(success, "native token transfer failed");
    }

    /// @dev Transfers `amount` of native token to `to`. (With native token wrapping)
    function safeTransferNativeTokenWithWrapper(
        address to,
        uint256 value,
        address _nativeTokenWrapper
    ) internal {
        // solhint-disable avoid-low-level-calls
        // slither-disable-next-line low-level-calls
        (bool success, ) = to.call{ value: value }("");
        if (!success) {
            IWETH(_nativeTokenWrapper).deposit{ value: value }();
            IERC20(_nativeTokenWrapper).safeTransfer(to, value);
        }
    }
}

File 20 of 32 : TWAddress.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library TWAddress {
    /**
     * @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
     * ====
     *
     * [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.
     *
     * [EIP1884](https://eips.ethereum.org/EIPS/eip-1884) 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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(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) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason 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 {
            // 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

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 21 of 32 : TWStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library TWStrings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @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] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 22 of 32 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../../../../eip/interface/IERC20.sol";
import "../../../../lib/TWAddress.sol";

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

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

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

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 23 of 32 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.0;

import "./ERC1155Receiver.sol";

/**
 * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 *
 * @dev _Available since v3.1._
 */
contract ERC1155Holder is ERC1155Receiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 24 of 32 : ERC1155Receiver.sol
// SPDX-License-Identifier: Apache 2.0
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../../eip/interface/IERC1155Receiver.sol";
import "../../../eip/ERC165.sol";

/**
 * @dev _Available since v3.1._
 */
abstract contract ERC1155Receiver is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }
}

File 25 of 32 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../../../lib/TWStrings.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
    }

    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");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' 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) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        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.
            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 if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } 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 (v != 27 && v != 28) {
            return (address(0), RecoverError.InvalidSignatureV);
        }

        // 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) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @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", TWStrings.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) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 26 of 32 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)

pragma solidity ^0.8.0;

import "./ECDSA.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].
 *
 * _Available since v3.4._
 */
abstract contract EIP712 {
    /* solhint-disable var-name-mixedcase */
    // 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 _CACHED_DOMAIN_SEPARATOR;
    uint256 private immutable _CACHED_CHAIN_ID;
    address private immutable _CACHED_THIS;

    bytes32 private immutable _HASHED_NAME;
    bytes32 private immutable _HASHED_VERSION;
    bytes32 private immutable _TYPE_HASH;

    /* solhint-enable var-name-mixedcase */

    /**
     * @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) {
        bytes32 hashedName = keccak256(bytes(name));
        bytes32 hashedVersion = keccak256(bytes(version));
        bytes32 typeHash = keccak256(
            "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
        );
        _HASHED_NAME = hashedName;
        _HASHED_VERSION = hashedVersion;
        _CACHED_CHAIN_ID = block.chainid;
        _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion);
        _CACHED_THIS = address(this);
        _TYPE_HASH = typeHash;
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) {
            return _CACHED_DOMAIN_SEPARATOR;
        } else {
            return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION);
        }
    }

    function _buildDomainSeparator(
        bytes32 typeHash,
        bytes32 nameHash,
        bytes32 versionHash
    ) private view returns (bytes32) {
        return keccak256(abi.encode(typeHash, nameHash, versionHash, 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);
    }
}

File 27 of 32 : EventTicketsNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/lib/CurrencyTransferLib.sol";
import "@thirdweb-dev/contracts/openzeppelin-presets/utils/ERC1155/ERC1155Holder.sol";

import "./extension/EventOrgAccess.sol";
import "./extension/SignatureMintERC1155.sol";
import "./extension/ERC1155Short.sol";

/**
 *      BASE:      ERC1155Base
 *      EXTENSION: overridden SignatureMintERC1155
 *
 *  The `ERC1155SignatureMint` contract uses the `ERC1155Base` contract, along with the `SignatureMintERC1155` extension.
 *
 *  The 'signature minting' mechanism in the `SignatureMintERC1155` extension uses EIP 712, and is a way for a contract
 *  admin to authorize an external party's request to mint tokens on the admin's contract. At a high level, this means
 *  you can authorize some external party to mint tokens on your contract, and specify what exactly will be minted by
 *  that external party.
 *
 */

contract EventTicketsNFT is ERC1155Short, SignatureMintERC1155, EventOrgAccess, ERC1155Holder {

    uint128 private _oazizCommission;

    /**
     *  @notice Returns the max remaining supply of NFTs of a given tokenId
     *  @dev Mapping from tokenId => total remaining supply of NFTs of that tokenId.
     */
    mapping(string => uint256) public soldTicketCount;
    mapping(string => uint256) public maxTicketCount;
    /**
     *  @notice Returns the tokenId by external off-chain id
     *  @dev Mapping from id(off-chain) => NFT tokenId
     */
    mapping(string => uint256) public tokenIdByTicketExternalId;

    mapping(string => mapping(uint256 => uint256)) public balanceOfByEmail;
    mapping(uint => string[]) private emailsByTokenId ;

    struct CancelTicket {
        address owner;
        uint256 tokenId;
        uint256 quantity;
    }

    constructor(
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps,
        address _primarySaleRecipient,
        address _organizationOwner,
        address _oazizOrganization,
        uint128 _commission
    )
    ERC1155Short(_name, _symbol, _royaltyRecipient, _royaltyBps)
    EventOrgAccess(_organizationOwner, _oazizOrganization)
    {
        setOazizCommission(_commission);
        nextTokenIdToMint_ = 1;
    }

    function getemailsByTokenId(uint256 _tokenId) external view returns(string[] memory) {
        return emailsByTokenId[_tokenId];
    }

    function setOazizCommission(uint128 _commission) public onlyOwner {
        require(_commission <= 10000, "Commission in percentage can't be more than 10000");
        _oazizCommission = _commission;
    }

    function getOazizCommissionByPrice(uint256 totalPrice) internal view returns (uint256) {
        return totalPrice == 0 ? 0 : (totalPrice * _oazizCommission) / 10_000;
    }

    function setupTicket(
        string memory externalId,
        uint256 quantity,
        address[] memory addAddressesToWhitelist,
        string memory uri_
    ) external onlyOwner {
        require(quantity > 0, "Invalid quantity");
        require(maxTicketCount[externalId] >= soldTicketCount[externalId], "You mustn't set maxTickets less than sold tickets");
        maxTicketCount[externalId] = quantity;
        setExistProductExternalId(externalId);

        if (tokenIdByTicketExternalId[externalId] > 0 && bytes(uri_).length > 0) {
            _setTokenURI(tokenIdByTicketExternalId[externalId], uri_);
        }

        if (addAddressesToWhitelist.length > 0) {
            grandAccessForUsers(addAddressesToWhitelist, externalId);
            toggleWhitelistLogic(true);
        }
    }

    function getRemainingTickets(string memory externalId) public view returns (uint256) {
        return maxTicketCount[externalId] - soldTicketCount[externalId];
    }

    function makeGift(MintRequest calldata _req) external onlyAdminOrContributorOrgMembers {
        _mintProcess(_req, msg.sender);
    }

    //    /**
    //     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenId.
    //     *
    //     *  @param _owner   The owner of the NFT to burn.
    //     *  @param _tokenId The tokenId of the NFT to burn.
    //     *  @param _amount  The amount of the NFT to burn.
    //     */

    function cancelTicketByOrg(CancelTicket[] memory cancelTickets) external onlyAdminOrContributorOrgMembers {
        for (uint256 i = 0; i < cancelTickets.length; i++) {
            CancelTicket memory cancelTicket = cancelTickets[i];
            _burn(cancelTicket.owner, cancelTicket.tokenId, cancelTicket.quantity);
        }
    }

    /**
     *  @notice           Mints tokens according to the provided mint request.
     *
     *  @param _req       The payload / mint request.
     *  @param _signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(MintRequest calldata _req, bytes calldata _signature)
    external
    payable
    virtual
    override
    returns (address signer)
    {
        // Verify and process payload.
        signer = _processRequest(_req, _signature);
        _mintProcess(_req, signer);
    }

    /*
     *  @notice           Mints tokens according to the provided mint request.
     *  @todo             Can be optimized for create oly one call for price transfer
     *  @param _reqs      List of the payloads / mint requests.
     *  @param _signature List of the signatures produced by an account signing the mint requests.
     */
    function batchMintWithSignature(MintRequest[] calldata _reqs, bytes[] calldata _signatures)
    external
    payable
    {
        require(_reqs.length == _signatures.length, "Length between mintReqs and signatures are mismatch");
        for (uint i = 0; i < _reqs.length; i++) {
            this.mintWithSignature{value : _reqs[i].pricePerToken * _reqs[i].quantity}(_reqs[i], _signatures[i]);
        }
    }

    /*//////////////////////////////////////////////////////////////
    //                            Internal functions(copied)
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual override returns (bool) {
        return _signer == owner();
    }

    function _mintProcess(MintRequest calldata _req, address signerOrMinter) internal {
        require(_req.quantity > 0, "Minting zero tokens");

        // Retrieve tokenId by request
        uint256 tokenIdToMint = _checkAndRetrieveTokenId(_req);

        address receiver;
        if (_req.to == address(0)) {
            require(bytes(_req.email).length > 0, "Email must be set");
            balanceOfByEmail[_req.email][tokenIdToMint] += _req.quantity;
            emailsByTokenId[tokenIdToMint].push(_req.email);
            receiver = address(this);
        }
        else {
            receiver = _req.to;
        }

        require(isAddressHasAccessToTicket(receiver, _req.externalId), 'Not in community');

        // Collect price
        _collectPriceOnClaim(_req.quantity, _req.currency, _req.pricePerToken);

        // Set royalties, if applicable.
        if (_req.royaltyRecipient != address(0)) {
            _setupRoyaltyInfoForToken(tokenIdToMint, _req.royaltyRecipient, _req.royaltyBps);
        }

        // Set URI
        if (_req.tokenId == type(uint256).max) {
            _setTokenURI(tokenIdToMint, _req.uri);
        }

        // Mint tokens.
        _mint(receiver, tokenIdToMint, _req.quantity, "");

        emit TokensMintedWithSignature(signerOrMinter, receiver, tokenIdToMint, _req);
    }

    function transferFromEmail(string memory email, address _to, uint tokenId) external {
        require(checkAdminOrContributor(organizationOaziz), "Not enough permission");
        uint amount = balanceOfByEmail[email][tokenId];
        _safeTransferFrom(address(this), _to, tokenId, amount, "");
        balanceOfByEmail[email][tokenId] -= amount;
    }

    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        for (uint256 i = 0; i < ids.length; i++) {
            require(ids[i] != 0, "Can not use tokenId=0");
        }
        return super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
    }

    /// @dev Collects and distributes the primary sale value of NFTs being claimed.
    function _collectPriceOnClaim(
        uint256 _quantityToClaim,
        address _currency,
        uint256 _pricePerToken
    ) internal virtual {
        if (_pricePerToken == 0) {
            return;
        }

        uint256 totalPrice = _quantityToClaim * _pricePerToken;

        if (_currency == CurrencyTransferLib.NATIVE_TOKEN) {
            require(msg.value == totalPrice, "Must send total price.");
        }

        uint256 oazizCommission = getOazizCommissionByPrice(totalPrice);

        address oazizPayoutAddress = organizationOaziz.getPayoutAddress();
        address orgPayoutAddress = organizationOwner.getPayoutAddress();

        address commissionRecipient = oazizPayoutAddress == address(0) ? owner() : oazizPayoutAddress;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, commissionRecipient, oazizCommission);

        address saleRecipient = orgPayoutAddress == address(0) ? owner() : orgPayoutAddress;
        CurrencyTransferLib.transferCurrency(_currency, msg.sender, saleRecipient, totalPrice - oazizCommission);
    }

    /// @dev Collects and distributes the primary sale value of NFTs being claimed.
    /// @notice This function return one of this station:
    /// (savedTokenId, reqTokenId):
    /// (0, maxInt) -> store new tokenId
    /// (n, max) -> return n
    /// (n(x), n(x)) -> return n(x)
    /// otherwise -> exception
    function _checkAndRetrieveTokenId(MintRequest calldata _req)
    internal
    returns (uint256 solvedTokenId) {

        require(
            _req.quantity <= getRemainingTickets(_req.externalId),
            "Not enough remaining balance for the token"
        );
        soldTicketCount[_req.externalId] += _req.quantity;

        uint savedTokenIdToMint = tokenIdByTicketExternalId[_req.externalId];
        uint reqTokenId = _req.tokenId;

        if (savedTokenIdToMint == 0 && reqTokenId == type(uint256).max) {
            solvedTokenId = nextTokenIdToMint();
            tokenIdByTicketExternalId[_req.externalId] = solvedTokenId;
            nextTokenIdToMint_ += 1;
        } else if (
            (savedTokenIdToMint != 0 && reqTokenId == type(uint256).max)
            || savedTokenIdToMint == reqTokenId
        ) {
            solvedTokenId = savedTokenIdToMint;
        }

        require(solvedTokenId != 0, "TokenId should be chosen");
        return solvedTokenId;
    }

    function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC1155Short, ERC1155Receiver)
    returns (bool) {
        return
        ERC1155Short.supportsInterface(interfaceId) ||
        ERC1155Receiver.supportsInterface(interfaceId) ||
        interfaceId == 0xf23a6e61 ||
        interfaceId == 0xbc197c81;
    }

    function getSoldTickets(string[] memory externalIds) public view returns (uint256[] memory) {
        uint256[] memory result = new uint256[](externalIds.length);
        for (uint i = 0; i < externalIds.length; i++) {
            result[i] = soldTicketCount[externalIds[i]];
        }
        return result;
    }

}

File 28 of 32 : ERC1155Short.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import { ERC1155 } from "@thirdweb-dev/contracts/eip/ERC1155.sol";

import "@thirdweb-dev/contracts/extension/Multicall.sol";
import "@thirdweb-dev/contracts/extension/Ownable.sol";
import "@thirdweb-dev/contracts/extension/Royalty.sol";
import "@thirdweb-dev/contracts/extension/BatchMintMetadata.sol";

import "@thirdweb-dev/contracts/lib/TWStrings.sol";

/**
 *  The `ERC1155Base` smart contract implements the ERC1155 NFT standard.
 *  It includes the following additions to standard ERC1155 logic:
 *
 *      - Ability to mint NFTs via the provided `mintTo` and `batchMintTo` functions.
 *
 *      - Contract metadata for royalty support on platforms such as OpenSea that use
 *        off-chain information to distribute roaylties.
 *
 *      - Ownership of the contract, with the ability to restrict certain functions to
 *        only be called by the contract's owner.
 *
 *      - Multicall capability to perform multiple actions atomically
 *
 *      - EIP 2981 compliance for royalty support on NFT marketplaces.
 */

contract ERC1155Short is ERC1155, Ownable, Royalty, Multicall, BatchMintMetadata {
    using TWStrings for uint256;

    /*//////////////////////////////////////////////////////////////
                        State variables
    //////////////////////////////////////////////////////////////*/

    /// @dev The tokenId of the next NFT to mint.
    uint256 internal nextTokenIdToMint_;

    /*//////////////////////////////////////////////////////////////
                        Mappings
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice Returns the total supply of NFTs of a given tokenId
     *  @dev Mapping from tokenId => total circulating supply of NFTs of that tokenId.
     */
    mapping(uint256 => uint256) public totalSupply;

    /*//////////////////////////////////////////////////////////////
                            Constructor
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        address _royaltyRecipient,
        uint128 _royaltyBps
    ) ERC1155(_name, _symbol) {
        _setupOwner(msg.sender);
        _setupDefaultRoyaltyInfo(_royaltyRecipient, _royaltyBps);
    }

    /*//////////////////////////////////////////////////////////////
                    Overriden metadata logic
    //////////////////////////////////////////////////////////////*/

    /// @notice Returns the metadata URI for the given tokenId.
    function uri(uint256 _tokenId) public view virtual override returns (string memory) {
        string memory uriForToken = _uri[_tokenId];
        if (bytes(uriForToken).length > 0) {
            return uriForToken;
        }

        string memory batchUri = _getBaseURI(_tokenId);
        return string(abi.encodePacked(batchUri, _tokenId.toString()));
    }

    /*//////////////////////////////////////////////////////////////
                        Mint / burn logic
    //////////////////////////////////////////////////////////////*/

    /**
     *  @notice          Lets an authorized address mint NFTs to a recipient.
     *  @dev             - The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *                   - If `_tokenId == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given
     *                     `tokenId < nextTokenIdToMint`, then additional supply of an existing NFT is being minted.
     *
     *  @param _to       The recipient of the NFTs to mint.
     *  @param _tokenId  The tokenId of the NFT to mint.
     *  @param _tokenURI The full metadata URI for the NFTs minted (if a new NFT is being minted).
     *  @param _amount   The amount of the same NFT to mint.
     */
    function mintTo(
        address _to,
        uint256 _tokenId,
        string memory _tokenURI,
        uint256 _amount
    ) public virtual {
        require(_canMint(), "Not authorized to mint.");

        uint256 tokenIdToMint;
        uint256 nextIdToMint = nextTokenIdToMint();

        if (_tokenId == type(uint256).max) {
            tokenIdToMint = nextIdToMint;
            nextTokenIdToMint_ += 1;
            _setTokenURI(nextIdToMint, _tokenURI);
        } else {
            require(_tokenId < nextIdToMint, "invalid id");
            tokenIdToMint = _tokenId;
        }

        _mint(_to, tokenIdToMint, _amount, "");
    }

    /**
     *  @notice          Lets an authorized address mint multiple NEW NFTs at once to a recipient.
     *  @dev             The logic in the `_canMint` function determines whether the caller is authorized to mint NFTs.
     *                   If `_tokenIds[i] == type(uint256).max` a new NFT at tokenId `nextTokenIdToMint` is minted. If the given
     *                   `tokenIds[i] < nextTokenIdToMint`, then additional supply of an existing NFT is minted.
     *                   The metadata for each new NFT is stored at `baseURI/{tokenID of NFT}`
     *
     *  @param _to       The recipient of the NFT to mint.
     *  @param _tokenIds The tokenIds of the NFTs to mint.
     *  @param _amounts  The amounts of each NFT to mint.
     *  @param _baseURI  The baseURI for the `n` number of NFTs minted. The metadata for each NFT is `baseURI/tokenId`
     */
    function batchMintTo(
        address _to,
        uint256[] memory _tokenIds,
        uint256[] memory _amounts,
        string memory _baseURI
    ) public virtual {
        require(_canMint(), "Not authorized to mint.");
        require(_amounts.length > 0, "Minting zero tokens.");
        require(_tokenIds.length == _amounts.length, "Length mismatch.");

        uint256 nextIdToMint = nextTokenIdToMint();
        uint256 startNextIdToMint = nextIdToMint;

        uint256 numOfNewNFTs;

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            if (_tokenIds[i] == type(uint256).max) {
                _tokenIds[i] = nextIdToMint;

                nextIdToMint += 1;
                numOfNewNFTs += 1;
            } else {
                require(_tokenIds[i] < nextIdToMint, "invalid id");
            }
        }

        if (numOfNewNFTs > 0) {
            _batchMintMetadata(startNextIdToMint, numOfNewNFTs, _baseURI);
        }

        nextTokenIdToMint_ = nextIdToMint;
        _mintBatch(_to, _tokenIds, _amounts, "");
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenId.
     *
     *  @param _owner   The owner of the NFT to burn.
     *  @param _tokenId The tokenId of the NFT to burn.
     *  @param _amount  The amount of the NFT to burn.
     */
    function burn(
        address _owner,
        uint256 _tokenId,
        uint256 _amount
    ) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(balanceOf[_owner][_tokenId] >= _amount, "Not enough tokens owned");

        _burn(_owner, _tokenId, _amount);
    }

    /**
     *  @notice         Lets an owner or approved operator burn NFTs of the given tokenIds.
     *
     *  @param _owner    The owner of the NFTs to burn.
     *  @param _tokenIds The tokenIds of the NFTs to burn.
     *  @param _amounts  The amounts of the NFTs to burn.
     */
    function burnBatch(
        address _owner,
        uint256[] memory _tokenIds,
        uint256[] memory _amounts
    ) external virtual {
        address caller = msg.sender;

        require(caller == _owner || isApprovedForAll[_owner][caller], "Unapproved caller");
        require(_tokenIds.length == _amounts.length, "Length mismatch");

        for (uint256 i = 0; i < _tokenIds.length; i += 1) {
            require(balanceOf[_owner][_tokenIds[i]] >= _amounts[i], "Not enough tokens owned");
        }

        _burnBatch(_owner, _tokenIds, _amounts);
    }

    /*//////////////////////////////////////////////////////////////
                            ERC165 Logic
    //////////////////////////////////////////////////////////////*/

    /// @notice Returns whether this contract supports the given interface.
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155, IERC165) returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c || // ERC165 Interface ID for ERC1155MetadataURI
            interfaceId == type(IERC2981).interfaceId; // ERC165 ID for ERC2981
    }

    /*//////////////////////////////////////////////////////////////
                            View functions
    //////////////////////////////////////////////////////////////*/

    /// @notice The tokenId assigned to the next new NFT to be minted.
    function nextTokenIdToMint() public view virtual returns (uint256) {
        return nextTokenIdToMint_;
    }

    /*//////////////////////////////////////////////////////////////
                    Internal (overrideable) functions
    //////////////////////////////////////////////////////////////*/

    /// @dev Returns whether a token can be minted in the given execution context.
    function _canMint() internal view virtual returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether owner can be set in the given execution context.
    function _canSetOwner() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Returns whether royalty info can be set in the given execution context.
    function _canSetRoyaltyInfo() internal view virtual override returns (bool) {
        return msg.sender == owner();
    }

    /// @dev Runs before every token transfer / mint / burn.
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual override {
        super._beforeTokenTransfer(operator, from, to, ids, amounts, data);

        if (from == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] += amounts[i];
            }
        }

        if (to == address(0)) {
            for (uint256 i = 0; i < ids.length; ++i) {
                totalSupply[ids[i]] -= amounts[i];
            }
        }
    }
}

File 29 of 32 : EventOrgAccess.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/extension/Ownable.sol";
import "../interfaces/IOazizOrganization.sol";


abstract contract EventOrgAccess is Ownable {

    IOazizOrganization public organizationOwner;
    IOazizOrganization public organizationOaziz;

    bool public isWhitelistEnable;
    mapping(string => bool) public existProductExternalId;
    mapping(address => mapping(string => bool)) private isAccessGrantedByAddressForProduct;


    function _checkOneOfRole(IOazizOrganization orgSc, bytes32[] memory roleIds) private view returns (bool isMember) {
        isMember = false;
        for (uint i = 0; i < roleIds.length; i++) {
            if (orgSc.hasRole(roleIds[i], msg.sender)) {
                isMember = true;
                break;
            }
        }
    }

    function checkAdminOrContributor(IOazizOrganization orgSc) internal view returns (bool) {
        bytes32[] memory roleIds = new bytes32[](2);
        roleIds[0] = organizationOwner.ADMIN_ROLE();
        roleIds[1] = organizationOwner.CONTRIBUTOR();
        return _checkOneOfRole(orgSc, roleIds);
    }

    modifier onlyAdminOrContributorOrgMembers() {
        require(
            checkAdminOrContributor(organizationOwner),
            "Not enough permission"
        );
        _;
    }

    function onlyOrgAdminOrContributorOrOazizMembers() internal view {
        require(
            owner() == msg.sender
            ||
            checkAdminOrContributor(organizationOwner)
            ||
            checkAdminOrContributor(organizationOaziz)
        ,
            "Not enough permission"
        );
    }

    constructor(address _organizationOwner, address _organizationOaziz){
        organizationOwner = IOazizOrganization(_organizationOwner);
        organizationOaziz = IOazizOrganization(_organizationOaziz);
    }

    function setExistProductExternalId(string memory _productExternalId) public {
        onlyOrgAdminOrContributorOrOazizMembers();
        existProductExternalId[_productExternalId] = true;
    }

    function grandAccessForUsers(address[] memory _addresses, string memory externalProductId) public {
        onlyOrgAdminOrContributorOrOazizMembers();
        require(existProductExternalId[externalProductId], "Product should be exist");
        for (uint i = 0; i < _addresses.length; i++) {
            isAccessGrantedByAddressForProduct[_addresses[i]][externalProductId] = true;
        }
    }

    function removeAccessForUsers(address[] memory _addresses, string memory externalProductId) public {
        onlyOrgAdminOrContributorOrOazizMembers();
        require(existProductExternalId[externalProductId], "Product should be exist");
        for (uint i = 0; i < _addresses.length; i++) {
            if (isAccessGrantedByAddressForProduct[_addresses[i]][externalProductId]) {
                isAccessGrantedByAddressForProduct[_addresses[i]][externalProductId] = false;
            }
        }
    }

    function isAddressHasAccessToTicket(address _address, string memory externalProductId) public view returns (bool) {
        if (!isWhitelistEnable || _address == address(0)) return true;
        return isAccessGrantedByAddressForProduct[_address][externalProductId];
    }

    function toggleWhitelistLogic(bool isEnable) public {
        onlyOrgAdminOrContributorOrOazizMembers();
        isWhitelistEnable = isEnable;
    }

}

File 30 of 32 : SignatureMintERC1155.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "@thirdweb-dev/contracts/openzeppelin-presets/utils/cryptography/EIP712.sol";
import "./interfaces/ISignatureMintERC1155.sol";

abstract contract SignatureMintERC1155 is EIP712, ISignatureMintERC1155 {
    using ECDSA for bytes32;

    bytes32 internal constant TYPEHASH =
        keccak256(
            "MintRequest(address to,address royaltyRecipient,uint256 royaltyBps,uint256 tokenId,string uri,uint256 quantity,uint256 pricePerToken,address currency,uint128 validityStartTimestamp,uint128 validityEndTimestamp,bytes32 uid,string externalId,string email)"
        );

    /// @dev Mapping from mint request UID => whether the mint request is processed.
    mapping(bytes32 => bool) private minted;

    constructor() EIP712("SignatureMintERC1155", "1") {}

    /// @dev Verifies that a mint request is signed by an account holding MINTER_ROLE (at the time of the function call).
    function verify(MintRequest calldata _req, bytes calldata _signature)
        public
        view
        override
        returns (bool success, address signer)
    {
        signer = _recoverAddress(_req, _signature);
        success = !minted[_req.uid] && _canSignMintRequest(signer);
    }

    /// @dev Returns whether a given address is authorized to sign mint requests.
    function _canSignMintRequest(address _signer) internal view virtual returns (bool);

    /// @dev Verifies a mint request and marks the request as minted.
    function _processRequest(MintRequest calldata _req, bytes calldata _signature) internal returns (address signer) {
        bool success;
        (success, signer) = verify(_req, _signature);

        require(success, "Invalid request");
        require(
            _req.validityStartTimestamp <= block.timestamp && block.timestamp <= _req.validityEndTimestamp,
            "Request expired"
        );
        require(_req.to != address(0) || bytes(_req.email).length > 0, "recipient undefined");
        require(_req.quantity > 0, "0 qty");

        minted[_req.uid] = true;
    }

    /// @dev Returns the address of the signer of the mint request.
    function _recoverAddress(MintRequest calldata _req, bytes calldata _signature) internal view returns (address) {
        return _hashTypedDataV4(keccak256(_encodeRequest(_req))).recover(_signature);
    }

    /// @dev Resolves 'stack too deep' error in `recoverAddress`.
    function _encodeRequest(MintRequest calldata _req) internal pure returns (bytes memory) {
        return
            abi.encode(
                TYPEHASH,
                _req.to,
                _req.royaltyRecipient,
                _req.royaltyBps,
                _req.tokenId,
                keccak256(bytes(_req.uri)),
                _req.quantity,
                _req.pricePerToken,
                _req.currency,
                _req.validityStartTimestamp,
                _req.validityEndTimestamp,
                _req.uid,
                keccak256(bytes(_req.externalId)),
                keccak256(bytes(_req.email))
            );
    }
}

File 31 of 32 : ISignatureMintERC1155.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

/**
 *  The 'signature minting' mechanism used in thirdweb Token smart contracts is a way for a contract admin to authorize an external party's
 *  request to mint tokens on the admin's contract.
 *
 *  At a high level, this means you can authorize some external party to mint tokens on your contract, and specify what exactly will be
 *  minted by that external party.
 */
interface ISignatureMintERC1155 {
    /**
     *  @notice The body of a request to mint tokens.
     *
     *  @param to The receiver of the tokens to mint.
     *  @param royaltyRecipient The recipient of the minted token's secondary sales royalties. (Not applicable for ERC20 tokens)
     *  @param royaltyBps The percentage of the minted token's secondary sales to take as royalties. (Not applicable for ERC20 tokens)
     *  @param primarySaleRecipient The recipient of the minted token's primary sales proceeds.
     *  @param tokenId The tokenId of the token to mint. (Only applicable for ERC1155 tokens)
     *  @param uri The metadata URI of the token to mint. (Not applicable for ERC20 tokens)
     *  @param quantity The quantity of tokens to mint.
     *  @param pricePerToken The price to pay per quantity of tokens minted.
     *  @param currency The currency in which to pay the price per token minted.
     *  @param validityStartTimestamp The unix timestamp after which the payload is valid.
     *  @param validityEndTimestamp The unix timestamp at which the payload expires.
     *  @param uid A unique identifier for the payload.
     */
    struct MintRequest {
        address to;
        address royaltyRecipient;
        uint256 royaltyBps;
//        address primarySaleRecipient;
        uint256 tokenId;
        string uri;
        uint256 quantity;
        uint256 pricePerToken;
        address currency;
        uint128 validityStartTimestamp;
        uint128 validityEndTimestamp;
        bytes32 uid;
        string externalId;
        string email;
    }

    /// @dev Emitted when tokens are minted.
    event TokensMintedWithSignature(
        address indexed signer,
        address indexed mintedTo,
        uint256 indexed tokenIdMinted,
        MintRequest mintRequest
    );

    /**
     *  @notice Verifies that a mint request is signed by an account holding
     *          MINTER_ROLE (at the time of the function call).
     *
     *  @param req The payload / mint request.
     *  @param signature The signature produced by an account signing the mint request.
     *
     *  returns (success, signer) Result of verification and the recovered address.
     */
    function verify(MintRequest calldata req, bytes calldata signature)
        external
        view
        returns (bool success, address signer);

    /**
     *  @notice Mints tokens according to the provided mint request.
     *
     *  @param req The payload / mint request.
     *  @param signature The signature produced by an account signing the mint request.
     */
    function mintWithSignature(MintRequest calldata req, bytes calldata signature)
        external
        payable
        returns (address signer);
}

File 32 of 32 : IOazizOrganization.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/IAccessControlEnumerable.sol";


abstract contract IOazizOrganization is IAccessControlEnumerable {

    // DEFAULT_ADMIN_ROLE exist in AccessControl
    bytes32 public constant ADMIN_ROLE = 0x00;
    bytes32 public constant CONTRIBUTOR = keccak256("CONTRIBUTOR");
    bytes32 public constant SCANNER = keccak256("SCANNER");

    function getPayoutAddress() external view virtual returns (address);

}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 10
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint128","name":"_royaltyBps","type":"uint128"},{"internalType":"address","name":"_primarySaleRecipient","type":"address"},{"internalType":"address","name":"_organizationOwner","type":"address"},{"internalType":"address","name":"_oazizOrganization","type":"address"},{"internalType":"uint128","name":"_commission","type":"uint128"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_owner","type":"address"},{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":false,"internalType":"bool","name":"_approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"newRoyaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"newRoyaltyBps","type":"uint256"}],"name":"DefaultRoyalty","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"prevOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"address","name":"royaltyRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"royaltyBps","type":"uint256"}],"name":"RoyaltyForToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"signer","type":"address"},{"indexed":true,"internalType":"address","name":"mintedTo","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenIdMinted","type":"uint256"},{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"string","name":"externalId","type":"string"},{"internalType":"string","name":"email","type":"string"}],"indexed":false,"internalType":"struct ISignatureMintERC1155.MintRequest","name":"mintRequest","type":"tuple"}],"name":"TokensMintedWithSignature","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"_ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"_values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"},{"indexed":true,"internalType":"address","name":"_from","type":"address"},{"indexed":true,"internalType":"address","name":"_to","type":"address"},{"indexed":false,"internalType":"uint256","name":"_id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"_value","type":"string"},{"indexed":true,"internalType":"uint256","name":"_id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"balanceOfByEmail","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"},{"internalType":"string","name":"_baseURI","type":"string"}],"name":"batchMintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"string","name":"externalId","type":"string"},{"internalType":"string","name":"email","type":"string"}],"internalType":"struct ISignatureMintERC1155.MintRequest[]","name":"_reqs","type":"tuple[]"},{"internalType":"bytes[]","name":"_signatures","type":"bytes[]"}],"name":"batchMintWithSignature","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"},{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_amounts","type":"uint256[]"}],"name":"burnBatch","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"quantity","type":"uint256"}],"internalType":"struct EventTicketsNFT.CancelTicket[]","name":"cancelTickets","type":"tuple[]"}],"name":"cancelTicketByOrg","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"existProductExternalId","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getBaseURICount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_index","type":"uint256"}],"name":"getBatchIdAtIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDefaultRoyaltyInfo","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"externalId","type":"string"}],"name":"getRemainingTickets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getRoyaltyInfoForToken","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"externalIds","type":"string[]"}],"name":"getSoldTickets","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"getemailsByTokenId","outputs":[{"internalType":"string[]","name":"","type":"string[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"string","name":"externalProductId","type":"string"}],"name":"grandAccessForUsers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"string","name":"externalProductId","type":"string"}],"name":"isAddressHasAccessToTicket","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isWhitelistEnable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"string","name":"externalId","type":"string"},{"internalType":"string","name":"email","type":"string"}],"internalType":"struct ISignatureMintERC1155.MintRequest","name":"_req","type":"tuple"}],"name":"makeGift","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"maxTicketCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"string","name":"_tokenURI","type":"string"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"mintTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"string","name":"externalId","type":"string"},{"internalType":"string","name":"email","type":"string"}],"internalType":"struct ISignatureMintERC1155.MintRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"mintWithSignature","outputs":[{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenIdToMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"organizationOaziz","outputs":[{"internalType":"contract IOazizOrganization","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"organizationOwner","outputs":[{"internalType":"contract IOazizOrganization","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"},{"internalType":"string","name":"externalProductId","type":"string"}],"name":"removeAccessForUsers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"salePrice","type":"uint256"}],"name":"royaltyInfo","outputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint256","name":"royaltyAmount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_royaltyRecipient","type":"address"},{"internalType":"uint256","name":"_royaltyBps","type":"uint256"}],"name":"setDefaultRoyaltyInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_productExternalId","type":"string"}],"name":"setExistProductExternalId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"_commission","type":"uint128"}],"name":"setOazizCommission","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"internalType":"address","name":"_recipient","type":"address"},{"internalType":"uint256","name":"_bps","type":"uint256"}],"name":"setRoyaltyInfoForToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"externalId","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"address[]","name":"addAddressesToWhitelist","type":"address[]"},{"internalType":"string","name":"uri_","type":"string"}],"name":"setupTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"soldTicketCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bool","name":"isEnable","type":"bool"}],"name":"toggleWhitelistLogic","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"tokenIdByTicketExternalId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"email","type":"string"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFromEmail","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"royaltyRecipient","type":"address"},{"internalType":"uint256","name":"royaltyBps","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"uri","type":"string"},{"internalType":"uint256","name":"quantity","type":"uint256"},{"internalType":"uint256","name":"pricePerToken","type":"uint256"},{"internalType":"address","name":"currency","type":"address"},{"internalType":"uint128","name":"validityStartTimestamp","type":"uint128"},{"internalType":"uint128","name":"validityEndTimestamp","type":"uint128"},{"internalType":"bytes32","name":"uid","type":"bytes32"},{"internalType":"string","name":"externalId","type":"string"},{"internalType":"string","name":"email","type":"string"}],"internalType":"struct ISignatureMintERC1155.MintRequest","name":"_req","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"verify","outputs":[{"internalType":"bool","name":"success","type":"bool"},{"internalType":"address","name":"signer","type":"address"}],"stateMutability":"view","type":"function"}]

6101406040523480156200001257600080fd5b506040516200670738038062006707833981016040819052620000359162000492565b82826040518060400160405280601481526020017f5369676e61747572654d696e7445524331313535000000000000000000000000815250604051806040016040528060018152602001603160f81b8152508b8b8b8b838381600090816200009e9190620005fb565b506001620000ad8282620005fb565b505050620000c133620001b460201b60201c565b620000d6826001600160801b03831662000206565b5050835160209485012083519385019390932060e08490526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818a01819052818301989098526060810194909452608080850193909352308483018190528151808603909301835260c094850190915281519190970120905293909352506101205250600d80546001600160a01b039384166001600160a01b031991821617909155600e8054929093169116179055620001a081620002b2565b50506001600a5550620006c7945050505050565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a35050565b612710811115620002505760405162461bcd60e51b815260206004820152600f60248201526e45786365656473206d61782062707360881b60448201526064015b60405180910390fd5b600680546001600160a01b0384166001600160b01b03199091168117600160a01b61ffff851602179091556040518281527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb9060200160405180910390a25050565b6005546001600160a01b03163314620002ff5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b604482015260640162000247565b612710816001600160801b03161115620003765760405162461bcd60e51b815260206004820152603160248201527f436f6d6d697373696f6e20696e2070657263656e746167652063616e27742062604482015270065206d6f7265207468616e20313030303607c1b606482015260840162000247565b601180546001600160801b0319166001600160801b0392909216919091179055565b634e487b7160e01b600052604160045260246000fd5b600082601f830112620003c057600080fd5b81516001600160401b0380821115620003dd57620003dd62000398565b604051601f8301601f19908116603f0116810190828211818310171562000408576200040862000398565b816040528381526020925086838588010111156200042557600080fd5b600091505b838210156200044957858201830151818301840152908201906200042a565b600093810190920192909252949350505050565b80516001600160a01b03811681146200047557600080fd5b919050565b80516001600160801b03811681146200047557600080fd5b600080600080600080600080610100898b031215620004b057600080fd5b88516001600160401b0380821115620004c857600080fd5b620004d68c838d01620003ae565b995060208b0151915080821115620004ed57600080fd5b50620004fc8b828c01620003ae565b9750506200050d60408a016200045d565b95506200051d60608a016200047a565b94506200052d60808a016200045d565b93506200053d60a08a016200045d565b92506200054d60c08a016200045d565b91506200055d60e08a016200047a565b90509295985092959890939650565b600181811c908216806200058157607f821691505b602082108103620005a257634e487b7160e01b600052602260045260246000fd5b50919050565b601f821115620005f657600081815260208120601f850160051c81016020861015620005d15750805b601f850160051c820191505b81811015620005f257828155600101620005dd565b5050505b505050565b81516001600160401b0381111562000617576200061762000398565b6200062f816200062884546200056c565b84620005a8565b602080601f8311600181146200066757600084156200064e5750858301515b600019600386901b1c1916600185901b178555620005f2565b600085815260208120601f198616915b82811015620006985788860151825594840194600190910190840162000677565b5085821015620006b75787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a05160c05160e0516101005161012051615ff06200071760003960006140aa015260006140f9015260006140d40152600061402d01526000614057015260006140810152615ff06000f3fe60806040526004361061024e5760003560e01c8062fdd58e14610253578063012dce281461029e57806301ffc9a7146102c057806306fdde03146102f05780630e89341c1461031257806313af4035146103325780632419f51b146103525780632a55205a146103725780632bd5b3d9146103a05780632eb2c2d6146103cd5780633b1475a7146103ed5780634173f8831461040257806344b9fab5146104225780634cc157df1461045a5780634e1273f41461049c57806352b3a42e146104bc5780635341acfe146104dc578063600dd5ea1461051457806363b45e2d146105345780636b20c45414610549578063759c46d3146105695780637da246d81461058957806388df38b21461059c5780638da5cb5b146105c957806390201049146105f6578063949c09f71461061657806395d89b41146106365780639bcf7a151461064b578063a22cb4651461066b578063a7ee06db1461068b578063a8c156be146106ac578063a8d14131146106e7578063ac9650d81461072f578063ad3a2fea1461075c578063ae387fd71461077c578063b03f45281461078f578063b19ffaf3146107af578063b24f2d39146107cf578063bc197c81146107fa578063bd85b0391461083f578063c7d10f361461086c578063e436ad7d1461088c578063e467fa2b146108ac578063e93eaa8f146108cc578063e985e9c5146108ec578063eb331c2814610927578063ee30fe1614610947578063efca85ea14610986578063f23a6e61146109a6578063f242432a146109d2578063f5298aca146109f2578063f585c91b14610a12575b600080fd5b34801561025f57600080fd5b5061028b61026e3660046147d8565b600260209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b3480156102aa57600080fd5b506102be6102b936600461497b565b610a4a565b005b3480156102cc57600080fd5b506102e06102db366004614a22565b610c0d565b6040519015158152602001610295565b3480156102fc57600080fd5b50610305610c63565b6040516102959190614a8f565b34801561031e57600080fd5b5061030561032d366004614aa2565b610cf1565b34801561033e57600080fd5b506102be61034d366004614abb565b610ddf565b34801561035e57600080fd5b5061028b61036d366004614aa2565b610e0f565b34801561037e57600080fd5b5061039261038d366004614ad8565b610e7d565b604051610295929190614b07565b3480156103ac57600080fd5b506103c06103bb366004614b20565b610eba565b6040516102959190614c16565b3480156103d957600080fd5b506102be6103e8366004614c8f565b610f7d565b3480156103f957600080fd5b50600a5461028b565b34801561040e57600080fd5b506102be61041d366004614d3c565b610fe7565b34801561042e57600080fd5b5061028b61043d366004614d3c565b805160208183018101805160138252928201919093012091525481565b34801561046657600080fd5b5061047a610475366004614aa2565b611024565b604080516001600160a01b03909316835261ffff909116602083015201610295565b3480156104a857600080fd5b506103c06104b7366004614d70565b61108f565b3480156104c857600080fd5b506102e06104d7366004614dd3565b6111a3565b3480156104e857600080fd5b5061028b6104f7366004614d3c565b805160208183018101805160148252928201919093012091525481565b34801561052057600080fd5b506102be61052f3660046147d8565b611215565b34801561054057600080fd5b5060085461028b565b34801561055557600080fd5b506102be610564366004614e18565b611247565b34801561057557600080fd5b506102be610584366004614e8d565b611395565b6102be610597366004614f97565b61141a565b3480156105a857600080fd5b506105bc6105b7366004614aa2565b6115ac565b6040516102959190615002565b3480156105d557600080fd5b506105de611698565b6040516001600160a01b039091168152602001610295565b34801561060257600080fd5b5061028b610611366004614d3c565b6116a7565b34801561062257600080fd5b506102be610631366004615064565b6116f1565b34801561064257600080fd5b506103056118a5565b34801561065757600080fd5b506102be6106663660046150cf565b6118b2565b34801561067757600080fd5b506102be610686366004615115565b6118e6565b34801561069757600080fd5b50600e546102e090600160a01b900460ff1681565b3480156106b857600080fd5b506102e06106c7366004614d3c565b8051602081830181018051600f8252928201919093012091525460ff1681565b3480156106f357600080fd5b5061028b61070236600461514e565b81516020818401810180516015825292820194820194909420919093529091526000908152604090205481565b34801561073b57600080fd5b5061074f61074a366004615192565b61199e565b60405161029591906151d3565b34801561076857600080fd5b506102be610777366004615241565b611a8b565b6105de61078a366004615275565b611ac6565b34801561079b57600080fd5b506102be6107aa36600461530b565b611ae6565b3480156107bb57600080fd5b506102be6107ca36600461536b565b611b92565b3480156107db57600080fd5b506006546001600160a01b03811690600160a01b900461ffff1661047a565b34801561080657600080fd5b50610826610815366004614c8f565b63bc197c8160e01b95945050505050565b6040516001600160e01b03199091168152602001610295565b34801561084b57600080fd5b5061028b61085a366004614aa2565b600b6020526000908152604090205481565b34801561087857600080fd5b506102be6108873660046153b3565b611c5d565b34801561089857600080fd5b506102be6108a73660046153d0565b611c83565b3480156108b857600080fd5b50600d546105de906001600160a01b031681565b3480156108d857600080fd5b50600e546105de906001600160a01b031681565b3480156108f857600080fd5b506102e0610907366004615429565b600360209081526000928352604080842090915290825290205460ff1681565b34801561093357600080fd5b506102be61094236600461546e565b611dbb565b34801561095357600080fd5b50610967610962366004615275565b611e7c565b6040805192151583526001600160a01b03909116602083015201610295565b34801561099257600080fd5b506102be6109a13660046153d0565b611ec0565b3480156109b257600080fd5b506108266109c1366004615489565b63f23a6e6160e01b95945050505050565b3480156109de57600080fd5b506102be6109ed366004615489565b611f93565b3480156109fe57600080fd5b506102be610a0d3660046154f1565b611ff6565b348015610a1e57600080fd5b5061028b610a2d366004614d3c565b805160208183018101805160128252928201919093012091525481565b6005546001600160a01b03163314610a7d5760405162461bcd60e51b8152600401610a7490615526565b60405180910390fd5b60008311610ac05760405162461bcd60e51b815260206004820152601060248201526f496e76616c6964207175616e7469747960801b6044820152606401610a74565b601284604051610ad0919061554e565b908152602001604051809103902054601385604051610aef919061554e565b9081526020016040518091039020541015610b665760405162461bcd60e51b815260206004820152603160248201527f596f75206d7573746e277420736574206d61785469636b657473206c657373206044820152707468616e20736f6c64207469636b65747360781b6064820152608401610a74565b82601385604051610b77919061554e565b90815260405190819003602001902055610b9084610fe7565b6000601485604051610ba2919061554e565b908152602001604051809103902054118015610bbf575060008151115b15610bec57610bec601485604051610bd7919061554e565b9081526020016040518091039020548261209d565b815115610c0757610bfd8285611ec0565b610c076001611c5d565b50505050565b6000610c18826120b5565b80610c275750610c2782612121565b80610c42575063f23a6e6160e01b6001600160e01b03198316145b80610c5d575063bc197c8160e01b6001600160e01b03198316145b92915050565b60008054610c709061556a565b80601f0160208091040260200160405190810160405280929190818152602001828054610c9c9061556a565b8015610ce95780601f10610cbe57610100808354040283529160200191610ce9565b820191906000526020600020905b815481529060010190602001808311610ccc57829003601f168201915b505050505081565b600081815260046020526040812080546060929190610d0f9061556a565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3b9061556a565b8015610d885780601f10610d5d57610100808354040283529160200191610d88565b820191906000526020600020905b815481529060010190602001808311610d6b57829003601f168201915b50505050509050600081511115610d9f5792915050565b6000610daa84612156565b905080610db6856122f2565b604051602001610dc792919061559e565b60405160208183030381529060405292505050919050565b610de76123fa565b610e035760405162461bcd60e51b8152600401610a7490615526565b610e0c8161241d565b50565b6000610e1a60085490565b8210610e585760405162461bcd60e51b815260206004820152600d60248201526c092dcecc2d8d2c840d2dcc8caf609b1b6044820152606401610a74565b60088281548110610e6b57610e6b6155cd565b90600052602060002001549050919050565b600080600080610e8c86611024565b90945084925061ffff169050612710610ea582876155f9565b610eaf919061562e565b925050509250929050565b6060600082516001600160401b03811115610ed757610ed7614804565b604051908082528060200260200182016040528015610f00578160200160208202803683370190505b50905060005b8351811015610f76576012848281518110610f2357610f236155cd565b6020026020010151604051610f38919061554e565b908152602001604051809103902054828281518110610f5957610f596155cd565b602090810291909101015280610f6e81615642565b915050610f06565b5092915050565b6001600160a01b038516331480610fb757506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b610fd35760405162461bcd60e51b8152600401610a749061565b565b610fe0858585858561246f565b5050505050565b610fef612610565b6001600f82604051611001919061554e565b908152604051908190036020019020805491151560ff1990921691909117905550565b6000818152600760209081526040808320815180830190925280546001600160a01b03168083526001909101549282019290925282911561106b5780516020820151611085565b6006546001600160a01b03811690600160a01b900461ffff165b9250925050915091565b606081518351146110b25760405162461bcd60e51b8152600401610a7490615687565b600083516001600160401b038111156110cd576110cd614804565b6040519080825280602002602001820160405280156110f6578160200160208202803683370190505b50905060005b845181101561119b576002600086838151811061111b5761111b6155cd565b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206000858381518110611157576111576155cd565b6020026020010151815260200190815260200160002054828281518110611180576111806155cd565b602090810291909101015261119481615642565b90506110fc565b509392505050565b600e54600090600160a01b900460ff1615806111c657506001600160a01b038316155b156111d357506001610c5d565b6001600160a01b0383166000908152601060205260409081902090516111fa90849061554e565b9081526040519081900360200190205460ff16905092915050565b61121d6123fa565b6112395760405162461bcd60e51b8152600401610a7490615526565b6112438282612677565b5050565b336001600160a01b03841681148061128457506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b6112a05760405162461bcd60e51b8152600401610a74906156b0565b81518351146112e35760405162461bcd60e51b815260206004820152600f60248201526e098cadccee8d040dad2e6dac2e8c6d608b1b6044820152606401610a74565b60005b835181101561138957828181518110611301576113016155cd565b602002602001015160026000876001600160a01b03166001600160a01b031681526020019081526020016000206000868481518110611342576113426155cd565b602002602001015181526020019081526020016000205410156113775760405162461bcd60e51b8152600401610a74906156db565b61138260018261570c565b90506112e6565b50610c078484846126fb565b600d546113aa906001600160a01b031661287d565b6113c65760405162461bcd60e51b8152600401610a749061571f565b60005b81518110156112435760008282815181106113e6576113e66155cd565b602002602001015190506114078160000151826020015183604001516129c2565b508061141281615642565b9150506113c9565b8281146114855760405162461bcd60e51b815260206004820152603360248201527f4c656e677468206265747765656e206d696e745265717320616e64207369676e6044820152720c2e8eae4cae640c2e4ca40dad2e6dac2e8c6d606b1b6064820152608401610a74565b60005b83811015610fe0573063ae387fd78686848181106114a8576114a86155cd565b90506020028101906114ba919061574e565b60a001358787858181106114d0576114d06155cd565b90506020028101906114e2919061574e565b60c001356114f091906155f9565b878785818110611502576115026155cd565b9050602002810190611514919061574e565b868686818110611526576115266155cd565b90506020028101906115389190615765565b6040518563ffffffff1660e01b815260040161155693929190615947565b60206040518083038185885af1158015611574573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611599919061596d565b50806115a481615642565b915050611488565b606060166000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b8282101561168d5783829060005260206000200180546116009061556a565b80601f016020809104026020016040519081016040528092919081815260200182805461162c9061556a565b80156116795780601f1061164e57610100808354040283529160200191611679565b820191906000526020600020905b81548152906001019060200180831161165c57829003601f168201915b5050505050815260200190600101906115e1565b505050509050919050565b6005546001600160a01b031690565b60006012826040516116b9919061554e565b9081526020016040518091039020546013836040516116d8919061554e565b908152602001604051809103902054610c5d919061598a565b6116f96123fa565b6117155760405162461bcd60e51b8152600401610a749061599d565b600082511161175d5760405162461bcd60e51b815260206004820152601460248201527326b4b73a34b733903d32b937903a37b5b2b7399760611b6044820152606401610a74565b81518351146117a15760405162461bcd60e51b815260206004820152601060248201526f2632b733ba341036b4b9b6b0ba31b41760811b6044820152606401610a74565b60006117ac600a5490565b9050806000805b8651811015611865576000198782815181106117d1576117d16155cd565b60200260200101510361181b57838782815181106117f1576117f16155cd565b602090810291909101015261180760018561570c565b935061181460018361570c565b9150611853565b8387828151811061182e5761182e6155cd565b6020026020010151106118535760405162461bcd60e51b8152600401610a74906159ce565b61185e60018261570c565b90506117b3565b50801561187a57611877828286612ab4565b50505b82600a8190555061189c87878760405180602001604052806000815250612b18565b50505050505050565b60018054610c709061556a565b6118ba6123fa565b6118d65760405162461bcd60e51b8152600401610a7490615526565b6118e1838383612c61565b505050565b336001600160a01b03831681036119305760405162461bcd60e51b815260206004820152600e60248201526d20a8282927ab24a723afa9a2a62360911b6044820152606401610a74565b6001600160a01b03818116600081815260036020908152604080832094881680845294825291829020805460ff191687151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3191015b60405180910390a3505050565b6060816001600160401b038111156119b8576119b8614804565b6040519080825280602002602001820160405280156119eb57816020015b60608152602001906001900390816119d65790505b50905060005b82811015610f7657611a5b30858584818110611a0f57611a0f6155cd565b9050602002810190611a219190615765565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250612d0092505050565b828281518110611a6d57611a6d6155cd565b60200260200101819052508080611a8390615642565b9150506119f1565b600d54611aa0906001600160a01b031661287d565b611abc5760405162461bcd60e51b8152600401610a749061571f565b610e0c8133612d25565b6000611ad384848461303f565b9050611adf8482612d25565b9392505050565b611aee6123fa565b611b0a5760405162461bcd60e51b8152600401610a749061599d565b600080611b16600a5490565b90506000198503611b4c578091506001600a6000828254611b37919061570c565b90915550611b479050818561209d565b611b6f565b808510611b6b5760405162461bcd60e51b8152600401610a74906159ce565b8491505b611b8a868385604051806020016040528060008152506131ec565b505050505050565b600e54611ba7906001600160a01b031661287d565b611bc35760405162461bcd60e51b8152600401610a749061571f565b6000601584604051611bd5919061554e565b90815260200160405180910390206000838152602001908152602001600020549050611c1330848484604051806020016040528060008152506132b3565b80601585604051611c24919061554e565b908152602001604051809103902060008481526020019081526020016000206000828254611c52919061598a565b909155505050505050565b611c65612610565b600e8054911515600160a01b0260ff60a01b19909216919091179055565b611c8b612610565b600f81604051611c9b919061554e565b9081526040519081900360200190205460ff16611cca5760405162461bcd60e51b8152600401610a74906159f2565b60005b82518110156118e15760106000848381518110611cec57611cec6155cd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002082604051611d22919061554e565b9081526040519081900360200190205460ff1615611da957600060106000858481518110611d5257611d526155cd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002083604051611d88919061554e565b908152604051908190036020019020805491151560ff199092169190911790555b80611db381615642565b915050611ccd565b6005546001600160a01b03163314611de55760405162461bcd60e51b8152600401610a7490615526565b612710816001600160801b03161115611e5a5760405162461bcd60e51b815260206004820152603160248201527f436f6d6d697373696f6e20696e2070657263656e746167652063616e27742062604482015270065206d6f7265207468616e20313030303607c1b6064820152608401610a74565b601180546001600160801b0319166001600160801b0392909216919091179055565b600080611e8a8585856133c7565b6101408601356000908152600c602052604090205490915060ff16158015611eb65750611eb681613423565b9150935093915050565b611ec8612610565b600f81604051611ed8919061554e565b9081526040519081900360200190205460ff16611f075760405162461bcd60e51b8152600401610a74906159f2565b60005b82518110156118e157600160106000858481518110611f2b57611f2b6155cd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002083604051611f61919061554e565b908152604051908190036020019020805491151560ff1990921691909117905580611f8b81615642565b915050611f0a565b6001600160a01b038516331480611fcd57506001600160a01b038516600090815260036020908152604080832033845290915290205460ff165b611fe95760405162461bcd60e51b8152600401610a749061565b565b610fe085858585856132b3565b336001600160a01b03841681148061203357506001600160a01b0380851660009081526003602090815260408083209385168352929052205460ff165b61204f5760405162461bcd60e51b8152600401610a74906156b0565b6001600160a01b03841660009081526002602090815260408083208684529091529020548211156120925760405162461bcd60e51b8152600401610a74906156db565b610c078484846129c2565b60008281526004602052604090206118e18282615a7e565b60006301ffc9a760e01b6001600160e01b0319831614806120e65750636cdb3d1360e11b6001600160e01b03198316145b8061210157506303a24d0760e21b6001600160e01b03198316145b80610c5d57506001600160e01b0319821663152a902d60e11b1492915050565b60006001600160e01b03198216630271189760e51b1480610c5d57506301ffc9a760e01b6001600160e01b0319831614610c5d565b6060600061216360085490565b9050600060088054806020026020016040519081016040528092919081815260200182805480156121b357602002820191906000526020600020905b81548152602001906001019080831161219f575b5050505050905060005b828110156122b7578181815181106121d7576121d76155cd565b60200260200101518510156122a557600960008383815181106121fc576121fc6155cd565b60200260200101518152602001908152602001600020805461221d9061556a565b80601f01602080910402602001604051908101604052809291908181526020018280546122499061556a565b80156122965780601f1061226b57610100808354040283529160200191612296565b820191906000526020600020905b81548152906001019060200180831161227957829003601f168201915b50505050509350505050919050565b6122b060018261570c565b90506121bd565b5060405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081d1bdad95b9259608a1b6044820152606401610a74565b6060816000036123195750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612343578061232d81615642565b915061233c9050600a8361562e565b915061231d565b6000816001600160401b0381111561235d5761235d614804565b6040519080825280601f01601f191660200182016040528015612387576020820181803683370190505b5090505b84156123f25761239c60018361598a565b91506123a9600a86615b37565b6123b490603061570c565b60f81b8183815181106123c9576123c96155cd565b60200101906001600160f81b031916908160001a9053506123eb600a8661562e565b945061238b565b949350505050565b6000612404611698565b6001600160a01b0316336001600160a01b031614905090565b600580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8292fce18fa69edf4db7b94ea2e58241df0ae57f97e0a6c9b29067028bf92d7690600090a35050565b81518351146124905760405162461bcd60e51b8152600401610a7490615687565b6001600160a01b0384166124b65760405162461bcd60e51b8152600401610a7490615b4b565b336124c5818787878787613448565b60005b84518110156125bc5760008582815181106124e5576124e56155cd565b602002602001015190506000858381518110612503576125036155cd565b6020908102919091018101516001600160a01b038b1660009081526002835260408082208683529093529190912054909150818110156125555760405162461bcd60e51b8152600401610a7490615b71565b6001600160a01b03808b16600090815260026020818152604080842088855282528084208787039055938d168352908152828220868352905290812080548492906125a190849061570c565b92505081905550505050806125b590615642565b90506124c8565b50846001600160a01b0316866001600160a01b0316826001600160a01b0316600080516020615f5483398151915287876040516125fa929190615b9b565b60405180910390a4611b8a8187878787876134d6565b33612619611698565b6001600160a01b0316148061263e5750600d5461263e906001600160a01b031661287d565b806126595750600e54612659906001600160a01b031661287d565b6126755760405162461bcd60e51b8152600401610a749061571f565b565b6127108111156126995760405162461bcd60e51b8152600401610a7490615bc9565b600680546001600160a01b0384166001600160b01b03199091168117600160a01b61ffff851602179091556040518281527f90d7ec04bcb8978719414f82e52e4cb651db41d0e6f8cea6118c2191e6183adb9060200160405180910390a25050565b6001600160a01b0383166127215760405162461bcd60e51b8152600401610a7490615bf2565b80518251146127425760405162461bcd60e51b8152600401610a7490615687565b600033905061276581856000868660405180602001604052806000815250613448565b60005b8351811015612830576000848281518110612785576127856155cd565b6020026020010151905060008483815181106127a3576127a36155cd565b6020908102919091018101516001600160a01b03891660009081526002835260408082208683529093529190912054909150818110156127f55760405162461bcd60e51b8152600401610a7490615b71565b6001600160a01b038816600090815260026020908152604080832095835294905292909220910390558061282881615642565b915050612768565b5060006001600160a01b0316846001600160a01b0316826001600160a01b0316600080516020615f54833981519152868660405161286f929190615b9b565b60405180910390a450505050565b604080516002808252606082018352600092839291906020830190803683375050600d5460408051631d6c8e3f60e21b815290519394506001600160a01b03909116926375b238fc925060048083019260209291908290030181865afa1580156128eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061290f9190615c1a565b81600081518110612922576129226155cd565b602090810291909101810191909152600d546040805163187e903760e21b815290516001600160a01b03909216926361fa40dc926004808401938290030181865afa158015612975573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129999190615c1a565b816001815181106129ac576129ac6155cd565b602002602001018181525050611adf8382613607565b6001600160a01b0383166129e85760405162461bcd60e51b8152600401610a7490615bf2565b33612a17818560006129f9876136ce565b612a02876136ce565b60405180602001604052806000815250613448565b6001600160a01b038416600090815260026020908152604080832086845290915290205482811015612a5b5760405162461bcd60e51b8152600401610a7490615b71565b6001600160a01b0385811660008181526002602090815260408083208984528252808320888703905580518981529182018890529193861691600080516020615f74833981519152910160405180910390a45050505050565b600080612ac1848661570c565b60088054600181019091557ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3018190556000818152600960205260409020909250829150612b0f8482615a7e565b50935093915050565b6001600160a01b038416612b3e5760405162461bcd60e51b8152600401610a7490615b4b565b8151835114612b5f5760405162461bcd60e51b8152600401610a7490615687565b33612b6f81600087878787613448565b60005b8451811015612c0b57838181518110612b8d57612b8d6155cd565b602002602001015160026000886001600160a01b03166001600160a01b031681526020019081526020016000206000878481518110612bce57612bce6155cd565b602002602001015181526020019081526020016000206000828254612bf3919061570c565b90915550819050612c0381615642565b915050612b72565b50846001600160a01b031660006001600160a01b0316826001600160a01b0316600080516020615f548339815191528787604051612c4a929190615b9b565b60405180910390a4610fe0816000878787876134d6565b612710811115612c835760405162461bcd60e51b8152600401610a7490615bc9565b6040805180820182526001600160a01b038481168083526020808401868152600089815260078352869020945185546001600160a01b031916941693909317845591516001909301929092559151838152909185917f7365cf4122f072a3365c20d54eff9b38d73c096c28e1892ec8f5b0e403a0f12d9101611991565b6060611adf8383604051806060016040528060278152602001615f9460279139613719565b60008260a0013511612d6f5760405162461bcd60e51b81526020600482015260136024820152724d696e74696e67207a65726f20746f6b656e7360681b6044820152606401610a74565b6000612d7a836137f4565b9050600080612d8c6020860186614abb565b6001600160a01b031603612e88576000612daa610180860186615765565b905011612ded5760405162461bcd60e51b8152602060048201526011602482015270115b585a5b081b5d5cdd081899481cd95d607a1b6044820152606401610a74565b60a08401356015612e02610180870187615765565b604051612e10929190615c33565b908152602001604051809103902060008481526020019081526020016000206000828254612e3e919061570c565b90915550506000828152601660205260409020612e5f610180860186615765565b82546001810184556000938452602090932090920191612e7f9183615c43565b50309050612e98565b612e956020850185614abb565b90505b612ee481612eaa610160870187615765565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506111a392505050565b612f235760405162461bcd60e51b815260206004820152601060248201526f4e6f7420696e20636f6d6d756e69747960801b6044820152606401610a74565b612f4660a0850135612f3c610100870160e08801614abb565b8660c00135613a01565b6000612f586040860160208701614abb565b6001600160a01b031614612f8457612f8482612f7a6040870160208801614abb565b8660400135612c61565b600019846060013503612fdc57612fdc82612fa26080870187615765565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061209d92505050565b612ffb81838660a00135604051806020016040528060008152506131ec565b81816001600160a01b0316846001600160a01b03167ff372d31716cb33effc8cf1d15d75067c0c8c010e832db6a6e43541c743fd16d98760405161286f9190615cfc565b60008061304d858585611e7c565b92509050806130905760405162461bcd60e51b815260206004820152600f60248201526e125b9d985b1a59081c995c5d595cdd608a1b6044820152606401610a74565b426130a36101208701610100880161546e565b6001600160801b0316111580156130d457506130c76101408601610120870161546e565b6001600160801b03164211155b6131125760405162461bcd60e51b815260206004820152600f60248201526e14995c5d595cdd08195e1c1a5c9959608a1b6044820152606401610a74565b60006131216020870187614abb565b6001600160a01b031614158061314657506000613142610180870187615765565b9050115b6131885760405162461bcd60e51b81526020600482015260136024820152721c9958da5c1a595b9d081d5b9919599a5b9959606a1b6044820152606401610a74565b60008560a00135116131c45760405162461bcd60e51b8152602060048201526005602482015264302071747960d81b6044820152606401610a74565b50610140909301356000908152600c60205260409020805460ff191660011790555090919050565b6001600160a01b0384166132125760405162461bcd60e51b8152600401610a7490615b4b565b3361323281600087613223886136ce565b61322c886136ce565b87613448565b6001600160a01b03851660009081526002602090815260408083208784529091528120805485929061326590849061570c565b909155505060408051858152602081018590526001600160a01b038088169260009291851691600080516020615f74833981519152910160405180910390a4610fe081600087878787613bfa565b6001600160a01b0384166132d95760405162461bcd60e51b8152600401610a7490615b4b565b336132e9818787613223886136ce565b6001600160a01b03861660009081526002602090815260408083208784529091529020548381101561332d5760405162461bcd60e51b8152600401610a7490615b71565b6001600160a01b0380881660009081526002602081815260408084208a855282528084208987039055938a1683529081528282208883529052908120805486929061337990849061570c565b909155505060408051868152602081018690526001600160a01b03808916928a82169291861691600080516020615f74833981519152910160405180910390a461189c828888888888613bfa565b60006123f283838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061341d92506134119150889050613cb5565b80519060200120613de3565b90613e31565b600061342d611698565b6001600160a01b0316826001600160a01b0316149050919050565b60005b83518110156134c757838181518110613466576134666155cd565b60200260200101516000036134b55760405162461bcd60e51b8152602060048201526015602482015274043616e206e6f742075736520746f6b656e49643d3605c1b6044820152606401610a74565b806134bf81615642565b91505061344b565b50611b8a868686868686613e4d565b6001600160a01b0384163b15611b8a5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061351a9089908990889088908890600401615d0f565b6020604051808303816000875af1925050508015613555575060408051601f3d908101601f1916820190925261355291810190615d6d565b60015b6135d757613561615d8a565b806308c379a00361359a5750613575615da5565b80613580575061359c565b8060405162461bcd60e51b8152600401610a749190614a8f565b505b60405162461bcd60e51b815260206004820152601060248201526f10a2a92198989a9aa922a1a2a4ab22a960811b6044820152606401610a74565b6001600160e01b0319811663bc197c8160e01b1461189c5760405162461bcd60e51b8152600401610a7490615e2e565b6000805b8251811015610f7657836001600160a01b03166391d14854848381518110613635576136356155cd565b6020026020010151336040518363ffffffff1660e01b815260040161366d9291909182526001600160a01b0316602082015260400190565b602060405180830381865afa15801561368a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136ae9190615e57565b156136bc5760019150610f76565b806136c681615642565b91505061360b565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613708576137086155cd565b602090810291909101015292915050565b606061372484613f59565b61377f5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610a74565b600080856001600160a01b03168560405161379a919061554e565b600060405180830381855af49150503d80600081146137d5576040519150601f19603f3d011682016040523d82523d6000602084013e6137da565b606091505b50915091506137ea828286613f68565b9695505050505050565b6000613841613807610160840184615765565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506116a792505050565b8260a0013511156138a75760405162461bcd60e51b815260206004820152602a60248201527f4e6f7420656e6f7567682072656d61696e696e672062616c616e636520666f72604482015269103a3432903a37b5b2b760b11b6064820152608401610a74565b60a082013560126138bc610160850185615765565b6040516138ca929190615c33565b908152602001604051809103902060008282546138e7919061570c565b909155506000905060146138ff610160850185615765565b60405161390d929190615c33565b908152604051908190036020019020549050606083013581158015613933575060001981145b1561398c57600a54925082601461394e610160870187615765565b60405161395c929190615c33565b9081526020016040518091039020819055506001600a6000828254613981919061570c565b909155506139af9050565b811580159061399c575060001981145b806139a657508082145b156139af578192505b826000036139fa5760405162461bcd60e51b81526020600482015260186024820152772a37b5b2b724b21039b437bab6321031329031b437b9b2b760411b6044820152606401610a74565b5050919050565b80600003613a0e57505050565b6000613a1a82856155f9565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b03841601613a8957803414613a895760405162461bcd60e51b815260206004820152601660248201527526bab9ba1039b2b732103a37ba30b610383934b1b29760511b6044820152606401610a74565b6000613a9482613fa1565b90506000600e60009054906101000a90046001600160a01b03166001600160a01b031663e554d2346040518163ffffffff1660e01b8152600401602060405180830381865afa158015613aeb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b0f919061596d565b90506000600d60009054906101000a90046001600160a01b03166001600160a01b031663e554d2346040518163ffffffff1660e01b8152600401602060405180830381865afa158015613b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613b8a919061596d565b905060006001600160a01b03831615613ba35782613bab565b613bab611698565b9050613bb987338387613fda565b60006001600160a01b03831615613bd05782613bd8565b613bd8611698565b9050613bef883383613bea898b61598a565b613fda565b505050505050505050565b6001600160a01b0384163b15611b8a5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190613c3e9089908990889088908890600401615e74565b6020604051808303816000875af1925050508015613c79575060408051601f3d908101601f19168201909252613c7691810190615d6d565b60015b613c8557613561615d8a565b6001600160e01b0319811663f23a6e6160e01b1461189c5760405162461bcd60e51b8152600401610a7490615e2e565b60607ff9aff737886d0b896c08772a2ada25ff0a962cb02d110e827bb5eb9c8ac2dc31613ce56020840184614abb565b613cf56040850160208601614abb565b60408501356060860135613d0c6080880188615765565b604051613d1a929190615c33565b60405190819003902060a088013560c0890135613d3e6101008b0160e08c01614abb565b613d506101208c016101008d0161546e565b613d626101408d016101208e0161546e565b6101408d0135613d766101608f018f615765565b604051613d84929190615c33565b60405180910390208e806101800190613d9d9190615765565b604051613dab929190615c33565b604051908190038120613dcd9e9d9c9b9a999897969594939291602001615eae565b6040516020818303038152906040529050919050565b6000610c5d613df0614020565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b6000806000613e40858561414a565b9150915061119b816141b8565b6001600160a01b038516613ed45760005b8351811015613ed257828181518110613e7957613e796155cd565b6020026020010151600b6000868481518110613e9757613e976155cd565b602002602001015181526020019081526020016000206000828254613ebc919061570c565b90915550613ecb905081615642565b9050613e5e565b505b6001600160a01b038416611b8a5760005b835181101561189c57828181518110613f0057613f006155cd565b6020026020010151600b6000868481518110613f1e57613f1e6155cd565b602002602001015181526020019081526020016000206000828254613f43919061598a565b90915550613f52905081615642565b9050613ee5565b6001600160a01b03163b151590565b60608315613f77575081611adf565b825115613f875782518084602001fd5b8160405162461bcd60e51b8152600401610a749190614a8f565b60008115613fd25760115461271090613fc3906001600160801b0316846155f9565b613fcd919061562e565b610c5d565b600092915050565b8015610c075773eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeed196001600160a01b038516016140145761400f8282614369565b610c07565b610c078484848461440b565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614801561407957507f000000000000000000000000000000000000000000000000000000000000000046145b156140a357507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b90565b60008082516041036141805760208301516040840151606085015160001a6141748782858561445e565b945094505050506141b1565b82516040036141a9576020830151604084015161419e868383614541565b9350935050506141b1565b506000905060025b9250929050565b60008160048111156141cc576141cc615f3d565b036141d45750565b60018160048111156141e8576141e8615f3d565b036142305760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b6044820152606401610a74565b600281600481111561424457614244615f3d565b036142915760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610a74565b60038160048111156142a5576142a5615f3d565b036142fd5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610a74565b600481600481111561431157614311615f3d565b03610e0c5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608401610a74565b6000826001600160a01b03168260405160006040518083038185875af1925050503d80600081146143b6576040519150601f19603f3d011682016040523d82523d6000602084013e6143bb565b606091505b50509050806118e15760405162461bcd60e51b815260206004820152601c60248201527b1b985d1a5d99481d1bdad95b881d1c985b9cd9995c8819985a5b195960221b6044820152606401610a74565b816001600160a01b0316836001600160a01b03160315610c0757306001600160a01b038416036144495761400f6001600160a01b038516838361457a565b610c076001600160a01b0385168484846145d0565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b0383111561448b5750600090506003614538565b8460ff16601b141580156144a357508460ff16601c14155b156144b45750600090506004614538565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015614508573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661453157600060019250925050614538565b9150600090505b94509492505050565b6000806001600160ff1b0383168161455e60ff86901c601b61570c565b905061456c8782888561445e565b935093505050935093915050565b6118e18363a9059cbb60e01b8484604051602401614599929190614b07565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614608565b6040516001600160a01b0380851660248301528316604482015260648101829052610c079085906323b872dd60e01b90608401614599565b600061465d826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166146da9092919063ffffffff16565b8051909150156118e1578080602001905181019061467b9190615e57565b6118e15760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a74565b60606123f28484600085856146ee85613f59565b61473a5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a74565b600080866001600160a01b03168587604051614756919061554e565b60006040518083038185875af1925050503d8060008114614793576040519150601f19603f3d011682016040523d82523d6000602084013e614798565b606091505b50915091506147a8828286613f68565b979650505050505050565b6001600160a01b0381168114610e0c57600080fd5b80356147d3816147b3565b919050565b600080604083850312156147eb57600080fd5b82356147f6816147b3565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b606081016001600160401b038111828210171561483957614839614804565b60405250565b601f8201601f191681016001600160401b038111828210171561486457614864614804565b6040525050565b600082601f83011261487c57600080fd5b81356001600160401b0381111561489557614895614804565b6040516148ac601f8301601f19166020018261483f565b8181528460208386010111156148c157600080fd5b816020850160208301376000918101602001919091529392505050565b60006001600160401b038211156148f7576148f7614804565b5060051b60200190565b600082601f83011261491257600080fd5b8135602061491f826148de565b60405161492c828261483f565b83815260059390931b850182019282810191508684111561494c57600080fd5b8286015b84811015614970578035614963816147b3565b8352918301918301614950565b509695505050505050565b6000806000806080858703121561499157600080fd5b84356001600160401b03808211156149a857600080fd5b6149b48883890161486b565b95506020870135945060408701359150808211156149d157600080fd5b6149dd88838901614901565b935060608701359150808211156149f357600080fd5b50614a008782880161486b565b91505092959194509250565b6001600160e01b031981168114610e0c57600080fd5b600060208284031215614a3457600080fd5b8135611adf81614a0c565b60005b83811015614a5a578181015183820152602001614a42565b50506000910152565b60008151808452614a7b816020860160208601614a3f565b601f01601f19169290920160200192915050565b602081526000611adf6020830184614a63565b600060208284031215614ab457600080fd5b5035919050565b600060208284031215614acd57600080fd5b8135611adf816147b3565b60008060408385031215614aeb57600080fd5b50508035926020909101359150565b6001600160a01b03169052565b6001600160a01b03929092168252602082015260400190565b60006020808385031215614b3357600080fd5b82356001600160401b0380821115614b4a57600080fd5b818501915085601f830112614b5e57600080fd5b8135614b69816148de565b604051614b76828261483f565b82815260059290921b8401850191858101915088831115614b9657600080fd5b8585015b83811015614bce57803585811115614bb25760008081fd5b614bc08b89838a010161486b565b845250918601918601614b9a565b5098975050505050505050565b600081518084526020808501945080840160005b83811015614c0b57815187529582019590820190600101614bef565b509495945050505050565b602081526000611adf6020830184614bdb565b600082601f830112614c3a57600080fd5b81356020614c47826148de565b604051614c54828261483f565b83815260059390931b8501820192828101915086841115614c7457600080fd5b8286015b848110156149705780358352918301918301614c78565b600080600080600060a08688031215614ca757600080fd5b8535614cb2816147b3565b94506020860135614cc2816147b3565b935060408601356001600160401b0380821115614cde57600080fd5b614cea89838a01614c29565b94506060880135915080821115614d0057600080fd5b614d0c89838a01614c29565b93506080880135915080821115614d2257600080fd5b50614d2f8882890161486b565b9150509295509295909350565b600060208284031215614d4e57600080fd5b81356001600160401b03811115614d6457600080fd5b6123f28482850161486b565b60008060408385031215614d8357600080fd5b82356001600160401b0380821115614d9a57600080fd5b614da686838701614901565b93506020850135915080821115614dbc57600080fd5b50614dc985828601614c29565b9150509250929050565b60008060408385031215614de657600080fd5b8235614df1816147b3565b915060208301356001600160401b03811115614e0c57600080fd5b614dc98582860161486b565b600080600060608486031215614e2d57600080fd5b8335614e38816147b3565b925060208401356001600160401b0380821115614e5457600080fd5b614e6087838801614c29565b93506040860135915080821115614e7657600080fd5b50614e8386828701614c29565b9150509250925092565b60006020808385031215614ea057600080fd5b82356001600160401b03811115614eb657600080fd5b8301601f81018513614ec757600080fd5b8035614ed2816148de565b60408051614ee0838261483f565b83815260609384028501860193868201935089851115614eff57600080fd5b948601945b84861015614bce5780868b031215614f1c5760008081fd5b8251614f278161481a565b8635614f32816147b3565b81528688013588820152838701358482015284529485019492860192614f04565b60008083601f840112614f6557600080fd5b5081356001600160401b03811115614f7c57600080fd5b6020830191508360208260051b85010111156141b157600080fd5b60008060008060408587031215614fad57600080fd5b84356001600160401b0380821115614fc457600080fd5b614fd088838901614f53565b90965094506020870135915080821115614fe957600080fd5b50614ff687828801614f53565b95989497509550505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561505757603f19888603018452615045858351614a63565b94509285019290850190600101615029565b5092979650505050505050565b6000806000806080858703121561507a57600080fd5b8435615085816147b3565b935060208501356001600160401b03808211156150a157600080fd5b6150ad88838901614c29565b945060408701359150808211156150c357600080fd5b6149dd88838901614c29565b6000806000606084860312156150e457600080fd5b8335925060208401356150f6816147b3565b929592945050506040919091013590565b8015158114610e0c57600080fd5b6000806040838503121561512857600080fd5b8235615133816147b3565b9150602083013561514381615107565b809150509250929050565b6000806040838503121561516157600080fd5b82356001600160401b0381111561517757600080fd5b6151838582860161486b565b95602094909401359450505050565b600080602083850312156151a557600080fd5b82356001600160401b038111156151bb57600080fd5b6151c785828601614f53565b90969095509350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561505757603f19888603018452615216858351614a63565b945092850192908501906001016151fa565b60006101a0828403121561523b57600080fd5b50919050565b60006020828403121561525357600080fd5b81356001600160401b0381111561526957600080fd5b6123f284828501615228565b60008060006040848603121561528a57600080fd5b83356001600160401b03808211156152a157600080fd5b6152ad87838801615228565b945060208601359150808211156152c357600080fd5b818601915086601f8301126152d757600080fd5b8135818111156152e657600080fd5b8760208285010111156152f857600080fd5b6020830194508093505050509250925092565b6000806000806080858703121561532157600080fd5b843561532c816147b3565b93506020850135925060408501356001600160401b0381111561534e57600080fd5b61535a8782880161486b565b949793965093946060013593505050565b60008060006060848603121561538057600080fd5b83356001600160401b0381111561539657600080fd5b6153a28682870161486b565b93505060208401356150f6816147b3565b6000602082840312156153c557600080fd5b8135611adf81615107565b600080604083850312156153e357600080fd5b82356001600160401b03808211156153fa57600080fd5b61540686838701614901565b9350602085013591508082111561541c57600080fd5b50614dc98582860161486b565b6000806040838503121561543c57600080fd5b8235615447816147b3565b91506020830135615143816147b3565b80356001600160801b03811681146147d357600080fd5b60006020828403121561548057600080fd5b611adf82615457565b600080600080600060a086880312156154a157600080fd5b85356154ac816147b3565b945060208601356154bc816147b3565b9350604086013592506060860135915060808601356001600160401b038111156154e557600080fd5b614d2f8882890161486b565b60008060006060848603121561550657600080fd5b8335615511816147b3565b95602085013595506040909401359392505050565b6020808252600e908201526d139bdd08185d5d1a1bdc9a5e995960921b604082015260600190565b60008251615560818460208701614a3f565b9190910192915050565b600181811c9082168061557e57607f821691505b60208210810361523b57634e487b7160e01b600052602260045260246000fd5b600083516155b0818460208801614a3f565b8351908301906155c4818360208801614a3f565b01949350505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615615613576156136155e3565b500290565b634e487b7160e01b600052601260045260246000fd5b60008261563d5761563d615618565b500490565b600060018201615654576156546155e3565b5060010190565b6020808252601290820152710853d5d3915497d3d497d054141493d5915160721b604082015260600190565b6020808252600f908201526e0988a9c8ea890be9a92a69a82a8869608b1b604082015260600190565b6020808252601190820152702ab730b8383937bb32b21031b0b63632b960791b604082015260600190565b602080825260179082015276139bdd08195b9bdd59da081d1bdad95b9cc81bdddb9959604a1b604082015260600190565b80820180821115610c5d57610c5d6155e3565b6020808252601590820152742737ba1032b737bab3b4103832b936b4b9b9b4b7b760591b604082015260600190565b6000823561019e1983360301811261556057600080fd5b6000808335601e1984360301811261577c57600080fd5b8301803591506001600160401b0382111561579657600080fd5b6020019150368190038213156141b157600080fd5b6000808335601e198436030181126157c257600080fd5b83016020810192503590506001600160401b038111156157e157600080fd5b8036038213156141b157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160801b03169052565b60006101a061583d84615838856147c8565b614afa565b615849602084016147c8565b6158566020860182614afa565b50604083013560408501526060830135606085015261587860808401846157ab565b82608087015261588b83870182846157f0565b9250505060a083013560a085015260c083013560c08501526158af60e084016147c8565b6158bc60e0860182614afa565b506101006158cb818501615457565b6158d782870182615819565b50506101206158e7818501615457565b6158f382870182615819565b5050610140838101359085015261016061590f818501856157ab565b868403838801526159218482846157f0565b9350505050610180615935818501856157ab565b868403838801526147a88482846157f0565b60408152600061595a6040830186615826565b82810360208401526137ea8185876157f0565b60006020828403121561597f57600080fd5b8151611adf816147b3565b81810381811115610c5d57610c5d6155e3565b6020808252601790820152762737ba1030baba3437b934bd32b2103a379036b4b73a1760491b604082015260600190565b6020808252600a90820152691a5b9d985b1a59081a5960b21b604082015260600190565b602080825260179082015276141c9bd91d58dd081cda1bdd5b1908189948195e1a5cdd604a1b604082015260600190565b601f8211156118e157600081815260208120601f850160051c81016020861015615a4a5750805b601f850160051c820191505b81811015611b8a57828155600101615a56565b600019600383901b1c191660019190911b1790565b81516001600160401b03811115615a9757615a97614804565b615aab81615aa5845461556a565b84615a23565b602080601f831160018114615ada5760008415615ac85750858301515b615ad28582615a69565b865550611b8a565b600085815260208120601f198616915b82811015615b0957888601518255948401946001909101908401615aea565b5085821015615b275787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600082615b4657615b46615618565b500690565b6020808252600c908201526b2a27afad22a927afa0a2222960a11b604082015260600190565b60208082526010908201526f125394d551919250d251539517d0905360821b604082015260600190565b604081526000615bae6040830185614bdb565b8281036020840152615bc08185614bdb565b95945050505050565b6020808252600f908201526e45786365656473206d61782062707360881b604082015260600190565b6020808252600e908201526d232927a6afad22a927afa0a2222960911b604082015260600190565b600060208284031215615c2c57600080fd5b5051919050565b8183823760009101908152919050565b6001600160401b03831115615c5a57615c5a614804565b615c6e83615c68835461556a565b83615a23565b6000601f841160018114615c9c5760008515615c8a5750838201355b615c948682615a69565b845550610fe0565b600083815260209020601f19861690835b82811015615ccd5786850135825560209485019460019092019101615cad565b5086821015615cea5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b602081526000611adf6020830184615826565b6001600160a01b0386811682528516602082015260a060408201819052600090615d3b90830186614bdb565b8281036060840152615d4d8186614bdb565b90508281036080840152615d618185614a63565b98975050505050505050565b600060208284031215615d7f57600080fd5b8151611adf81614a0c565b600060033d11156141475760046000803e5060005160e01c90565b600060443d1015615db35790565b6040516003193d81016004833e81513d6001600160401b038083116024840183101715615de257505050505090565b8285019150815181811115615dfa5750505050505090565b843d8701016020828501011115615e145750505050505090565b615e236020828601018761483f565b509095945050505050565b6020808252600f908201526e1513d2d15394d7d491529150d51151608a1b604082015260600190565b600060208284031215615e6957600080fd5b8151611adf81615107565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906147a890830184614a63565b8e81526001600160a01b038e811660208301528d81166040830152606082018d9052608082018c905260a082018b905260c082018a905260e0820189905287166101008201526101c08101615f07610120830188615819565b615f15610140830187615819565b8461016083015283610180830152826101a08301529f9e505050505050505050505050505050565b634e487b7160e01b600052602160045260246000fdfe4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fbc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e6d1d32a6384eb14e2fc8be54a1579d9e294e14288545c8407356dfa0a9bfd7864736f6c63430008100033000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001400000000000000000000000004f04f82e392501e14354b751445cd9ff57c44dd300000000000000000000000000000000000000000000000000000000000000000000000000000000000000004f04f82e392501e14354b751445cd9ff57c44dd3000000000000000000000000b7e276237d17e59d970d73319167ce2064dbb56d000000000000000000000000478d2e4945edd971a420dd8f43a5c04a8448959300000000000000000000000000000000000000000000000000000000000001f4000000000000000000000000000000000000000000000000000000000000001453757065724576656e74466f72546573744f726700000000000000000000000000000000000000000000000000000000000000000000000000000000000000037858780000000000000000000000000000000000000000000000000000000000

Loading