ETH Price: $2,214.16 (-8.38%)

Contract

0x49598aae06f8ed6D82Cb9DFa503e731221fBf7E6

Overview

ETH Balance

0 ETH

ETH Value

$0.00

Token Holdings

More Info

Private Name Tags

TokenTracker

Multichain Info

No addresses found
Transaction Hash
Block
From
To
Configure Fee Bp...4059986802025-12-01 9:21:0862 days ago1764580868IN
0x49598aae...221fBf7E6
0 ETH0.00000060.023545
Configure Fee Bp...3973711322025-11-06 10:33:4687 days ago1762425226IN
0x49598aae...221fBf7E6
0 ETH0.000000330.01
Grant Operator3973710552025-11-06 10:33:2787 days ago1762425207IN
0x49598aae...221fBf7E6
0 ETH0.000000540.01
Grant Operator3968144372025-11-04 19:57:2889 days ago1762286248IN
0x49598aae...221fBf7E6
0 ETH0.000005360.103755
Grant Operator3967424982025-11-04 14:58:2489 days ago1762268304IN
0x49598aae...221fBf7E6
0 ETH0.000006350.115712
Grant Operator3966842362025-11-04 10:56:1389 days ago1762253773IN
0x49598aae...221fBf7E6
0 ETH0.000000640.011876
Grant Operator3963529212025-11-03 11:57:3790 days ago1762171057IN
0x49598aae...221fBf7E6
0 ETH0.000000520.01
Grant Operator3962985122025-11-03 8:11:2390 days ago1762157483IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Operator3962502002025-11-03 4:50:2591 days ago1762145425IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Operator3962497772025-11-03 4:48:3991 days ago1762145319IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Operator3954037772025-10-31 18:08:0593 days ago1761934085IN
0x49598aae...221fBf7E6
0 ETH0.000000520.01
Grant Operator3954036062025-10-31 18:07:2293 days ago1761934042IN
0x49598aae...221fBf7E6
0 ETH0.000000520.01
Renounce Role3951909272025-10-31 3:22:5194 days ago1761880971IN
0x49598aae...221fBf7E6
0 ETH0.000000250.01
Grant Operator3951906232025-10-31 3:21:3694 days ago1761880896IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Admin3949620812025-10-30 11:30:3494 days ago1761823834IN
0x49598aae...221fBf7E6
0 ETH0.000000520.01
Grant Whitelist3943553192025-10-28 17:26:3196 days ago1761672391IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Whitelist3943553012025-10-28 17:26:2696 days ago1761672386IN
0x49598aae...221fBf7E6
0 ETH0.000000510.01
Grant Operator3943552852025-10-28 17:26:2296 days ago1761672382IN
0x49598aae...221fBf7E6
0 ETH0.000000520.01

Parent Transaction Hash Block From To
View All Internal Transactions

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ConditionalTokens

Compiler Version
v0.8.25+commit.b61c2a91

Optimization Enabled:
Yes with 200 runs

Other Settings:
london EvmVersion
//SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.25;

import "@/extensions/Roles.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {SafeMath} from "@openzeppelin/contracts/utils/math/SafeMath.sol";
import {CTHelpers} from "@/ctf/libraries/CTHelpers.sol";
import {FeeManager} from "@/extensions/FeeManager.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";

contract ConditionalTokens is Roles, ERC1155, FeeManager {
    using SafeMath for uint256;

    /// @dev Emitted upon the successful preparation of a condition.
    /// @param conditionId The condition's ID. This ID may be derived from the other three parameters via ``keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))``.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    event ConditionPreparation(
        bytes32 indexed conditionId,
        address indexed oracle,
        bytes32 indexed questionId,
        uint256 outcomeSlotCount
    );

    event ConditionResolution(
        bytes32 indexed conditionId,
        address indexed oracle,
        bytes32 indexed questionId,
        uint256 outcomeSlotCount,
        uint256[] payoutNumerators
    );

    /// @dev Emitted when a position is successfully split.
    event PositionSplit(
        address indexed stakeholder,
        IERC20 collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint256[] partition,
        uint256 amount
    );
    /// @dev Emitted when positions are successfully merged.
    event PositionsMerge(
        address indexed stakeholder,
        IERC20 collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint256[] partition,
        uint256 amount
    );
    event PayoutRedemption(
        address indexed redeemer,
        IERC20 indexed collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 conditionId,
        uint256[] indexSets,
        uint256 payout,
        uint256 fee
    );

    /// Mapping key is an condition ID. Value represents numerators of the payout vector associated with the condition. This array is initialized with a length equal to the outcome slot count. E.g. Condition with 3 outcomes [A, B, C] and two of those correct [0.5, 0.5, 0]. In Ethereum there are no decimal values, so here, 0.5 is represented by fractions like 1/2 == 0.5. That's why we need numerator and denominator values. Payout numerators are also used as a check of initialization. If the numerators array is empty (has length zero), the condition was not created/prepared. See getOutcomeSlotCount.
    mapping(bytes32 => uint256[]) public payoutNumerators;
    /// Denominator is also used for checking if the condition has been resolved. If the denominator is non-zero, then the condition has been resolved.
    mapping(bytes32 => uint256) public payoutDenominator;

    constructor(
        uint256 configuredFeeBps,
        address configuredFeeReceiver
    )
        ERC1155("")
        Roles()
        EIP712("ConditionalTokens", "1.0.0")
        FeeManager(configuredFeeBps, configuredFeeReceiver)
    {}

    /// @dev This function prepares a condition by initializing a payout vector associated with the condition.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function prepareCondition(
        address oracle,
        bytes32 questionId,
        uint256 outcomeSlotCount
    ) external onlyRole(OPERATOR_ROLE) {
        // Limit of 256 because we use a partition array that is a number of 256 bits.
        require(outcomeSlotCount <= 256, "too many outcome slots");
        require(
            outcomeSlotCount > 1,
            "there should be more than one outcome slot"
        );
        bytes32 conditionId = CTHelpers.getConditionId(
            oracle,
            questionId,
            outcomeSlotCount
        );
        require(
            payoutNumerators[conditionId].length == 0,
            "condition already prepared"
        );
        payoutNumerators[conditionId] = new uint256[](outcomeSlotCount);
        emit ConditionPreparation(
            conditionId,
            oracle,
            questionId,
            outcomeSlotCount
        );
    }

    /// @dev Called by the oracle for reporting results of conditions. Will set the payout vector for the condition with the ID ``keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))``, where oracle is the message sender, questionId is one of the parameters of this function, and outcomeSlotCount is the length of the payouts parameter, which contains the payoutNumerators for each outcome slot of the condition.
    /// @param questionId The question ID the oracle is answering for
    /// @param payouts The oracle's answer
    function reportPayouts(
        bytes32 questionId,
        uint256[] calldata payouts
    ) external {
        uint256 outcomeSlotCount = payouts.length;
        require(
            outcomeSlotCount > 1,
            "there should be more than one outcome slot"
        );
        // IMPORTANT, the oracle is enforced to be the sender because it's part of the hash.
        bytes32 conditionId = CTHelpers.getConditionId(
            msg.sender,
            questionId,
            outcomeSlotCount
        );
        require(
            payoutNumerators[conditionId].length == outcomeSlotCount,
            "condition not prepared or found"
        );
        require(
            payoutDenominator[conditionId] == 0,
            "payout denominator already set"
        );

        uint256 den = 0;
        for (uint256 i = 0; i < outcomeSlotCount; i++) {
            uint256 num = payouts[i];
            den = den.add(num);

            require(
                payoutNumerators[conditionId][i] == 0,
                "payout numerator already set"
            );
            payoutNumerators[conditionId][i] = num;
        }
        require(den > 0, "payout is all zeroes");
        payoutDenominator[conditionId] = den;
        emit ConditionResolution(
            conditionId,
            msg.sender,
            questionId,
            outcomeSlotCount,
            payoutNumerators[conditionId]
        );
    }

    /// @dev This function splits a position. If splitting from the collateral, this contract will attempt to transfer `amount` collateral from the message sender to itself. Otherwise, this contract will burn `amount` stake held by the message sender in the position being split worth of EIP 1155 tokens. Regardless, if successful, `amount` stake will be minted in the split target positions. If any of the transfers, mints, or burns fail, the transaction will revert. The transaction will also revert if the given partition is trivial, invalid, or refers to more slots than the condition is prepared with.
    /// @param collateralToken The address of the positions' backing collateral token.
    /// @param parentCollectionId The ID of the outcome collections common to the position being split and the split target positions. May be null, in which only the collateral is shared.
    /// @param conditionId The ID of the condition to split on.
    /// @param partition An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.g. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.g. 0b110 is A|B, 0b010 is B, etc.
    /// @param amount The amount of collateral or stake to split.
    function splitPosition(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata partition,
        uint256 amount
    ) external {
        require(partition.length > 1, "got empty or singleton partition");
        uint256 outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        // For a condition with 4 outcomes fullIndexSet's 0b1111; for 5 it's 0b11111...
        uint256 fullIndexSet = (1 << outcomeSlotCount) - 1;
        // freeIndexSet starts as the full collection
        uint256 freeIndexSet = fullIndexSet;
        // This loop checks that all condition sets are disjoint (the same outcome is not part of more than 1 set)
        uint256[] memory positionIds = new uint256[](partition.length);
        uint256[] memory amounts = new uint256[](partition.length);
        for (uint256 i = 0; i < partition.length; i++) {
            uint256 indexSet = partition[i];
            require(
                indexSet > 0 && indexSet < fullIndexSet,
                "got invalid index set"
            );
            require(
                (indexSet & freeIndexSet) == indexSet,
                "partition not disjoint"
            );
            freeIndexSet ^= indexSet;
            positionIds[i] = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(
                    parentCollectionId,
                    conditionId,
                    indexSet
                )
            );
            amounts[i] = amount;
        }

        if (freeIndexSet == 0) {
            // Partitioning the full set of outcomes for the condition in this branch
            if (parentCollectionId == bytes32(0)) {
                require(
                    collateralToken.transferFrom(
                        msg.sender,
                        address(this),
                        amount
                    ),
                    "could not receive collateral tokens"
                );
            } else {
                _burn(
                    msg.sender,
                    CTHelpers.getPositionId(
                        collateralToken,
                        parentCollectionId
                    ),
                    amount
                );
            }
        } else {
            // Partitioning a subset of outcomes for the condition in this branch.
            // For example, for a condition with three outcomes A, B, and C, this branch
            // allows the splitting of a position $:(A|C) to positions $:(A) and $:(C).
            _burn(
                msg.sender,
                CTHelpers.getPositionId(
                    collateralToken,
                    CTHelpers.getCollectionId(
                        parentCollectionId,
                        conditionId,
                        fullIndexSet ^ freeIndexSet
                    )
                ),
                amount
            );
        }

        _mintBatch(
            msg.sender,
            // position ID is the ERC 1155 token ID
            positionIds,
            amounts,
            ""
        );
        emit PositionSplit(
            msg.sender,
            collateralToken,
            parentCollectionId,
            conditionId,
            partition,
            amount
        );
    }

    function mergePositions(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata partition,
        uint256 amount
    ) external {
        require(partition.length > 1, "got empty or singleton partition");
        uint256 outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        uint256 fullIndexSet = (1 << outcomeSlotCount) - 1;
        uint256 freeIndexSet = fullIndexSet;
        uint256[] memory positionIds = new uint256[](partition.length);
        uint256[] memory amounts = new uint256[](partition.length);
        for (uint256 i = 0; i < partition.length; i++) {
            uint256 indexSet = partition[i];
            require(
                indexSet > 0 && indexSet < fullIndexSet,
                "got invalid index set"
            );
            require(
                (indexSet & freeIndexSet) == indexSet,
                "partition not disjoint"
            );
            freeIndexSet ^= indexSet;
            positionIds[i] = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(
                    parentCollectionId,
                    conditionId,
                    indexSet
                )
            );
            amounts[i] = amount;
        }
        _burnBatch(msg.sender, positionIds, amounts);

        if (freeIndexSet == 0) {
            if (parentCollectionId == bytes32(0)) {
                require(
                    collateralToken.transfer(msg.sender, amount),
                    "could not send collateral tokens"
                );
            } else {
                _mint(
                    msg.sender,
                    CTHelpers.getPositionId(
                        collateralToken,
                        parentCollectionId
                    ),
                    amount,
                    ""
                );
            }
        } else {
            _mint(
                msg.sender,
                CTHelpers.getPositionId(
                    collateralToken,
                    CTHelpers.getCollectionId(
                        parentCollectionId,
                        conditionId,
                        fullIndexSet ^ freeIndexSet
                    )
                ),
                amount,
                ""
            );
        }

        emit PositionsMerge(
            msg.sender,
            collateralToken,
            parentCollectionId,
            conditionId,
            partition,
            amount
        );
    }

    function redeemPositions(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata indexSets
    ) external {
        uint256 den = payoutDenominator[conditionId];
        require(den > 0, "result for condition not received yet");
        uint256 outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        uint256 totalPayout = 0;

        uint256 fullIndexSet = (1 << outcomeSlotCount) - 1;
        for (uint256 i = 0; i < indexSets.length; i++) {
            uint256 indexSet = indexSets[i];
            require(
                indexSet > 0 && indexSet < fullIndexSet,
                "got invalid index set"
            );
            uint256 positionId = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(
                    parentCollectionId,
                    conditionId,
                    indexSet
                )
            );

            uint256 payoutNumerator = 0;
            for (uint256 j = 0; j < outcomeSlotCount; j++) {
                if (indexSet & (1 << j) != 0) {
                    payoutNumerator = payoutNumerator.add(
                        payoutNumerators[conditionId][j]
                    );
                }
            }

            uint256 payoutStake = balanceOf(msg.sender, positionId);
            if (payoutStake > 0) {
                totalPayout = totalPayout.add(
                    payoutStake.mul(payoutNumerator).div(den)
                );
                _burn(msg.sender, positionId, payoutStake);
            }
        }

        uint256 fee;
        if (totalPayout > 0) {
            if (parentCollectionId == bytes32(0)) {
                fee = _calculateFee(msg.sender, totalPayout);
                if (fee > 0) {
                    require(
                        collateralToken.transfer(feeReceiver, fee),
                        "could not transfer fee to fee receiver"
                    );
                }

                require(
                    collateralToken.transfer(msg.sender, totalPayout - fee),
                    "could not transfer payout to message sender"
                );
            } else {
                _mint(
                    msg.sender,
                    CTHelpers.getPositionId(
                        collateralToken,
                        parentCollectionId
                    ),
                    totalPayout,
                    ""
                );
            }
        }

        emit PayoutRedemption(
            msg.sender,
            collateralToken,
            parentCollectionId,
            conditionId,
            indexSets,
            totalPayout,
            fee
        );
    }

    function isTransferAllowed(
        address sender,
        address recipient
    ) public view returns (bool) {
        (sender, recipient);

        if (hasRole(WHITELIST_ROLE, msg.sender)) {
            return true;
        }

        return false;
    }

    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal override {
        require(isTransferAllowed(from, to), "transfer is not allowed");

        super._safeTransferFrom(from, to, id, amount, data);
    }

    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal override {
        require(isTransferAllowed(from, to), "transfer is not allowed");

        super._safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    function isFeeOperator(
        address account
    ) internal view override returns (bool) {
        return hasRole(OPERATOR_ROLE, account);
    }

    /// @dev Gets the outcome slot count of a condition.
    /// @param conditionId ID of the condition.
    /// @return Number of outcome slots associated with a condition, or zero if condition has not been prepared yet.
    function getOutcomeSlotCount(
        bytes32 conditionId
    ) external view returns (uint256) {
        return payoutNumerators[conditionId].length;
    }

    /// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function getConditionId(
        address oracle,
        bytes32 questionId,
        uint256 outcomeSlotCount
    ) external pure returns (bytes32) {
        return CTHelpers.getConditionId(oracle, questionId, outcomeSlotCount);
    }

    /// @dev Constructs an outcome collection ID from a parent collection and an outcome collection.
    /// @param parentCollectionId Collection ID of the parent outcome collection, or bytes32(0) if there's no parent.
    /// @param conditionId Condition ID of the outcome collection to combine with the parent outcome collection.
    /// @param indexSet Index set of the outcome collection to combine with the parent outcome collection.
    function getCollectionId(
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256 indexSet
    ) external view returns (bytes32) {
        return
            CTHelpers.getCollectionId(
                parentCollectionId,
                conditionId,
                indexSet
            );
    }

    /// @dev Constructs a position ID from a collateral token and an outcome collection. These IDs are used as the ERC-1155 ID for this contract.
    /// @param collateralToken Collateral token which backs the position.
    /// @param collectionId ID of the outcome collection associated with this position.
    function getPositionId(
        IERC20 collateralToken,
        bytes32 collectionId
    ) external pure returns (uint256) {
        return CTHelpers.getPositionId(collateralToken, collectionId);
    }

    function supportsInterface(
        bytes4 interfaceId
    ) public view virtual override(ERC1155, AccessControl) returns (bool) {
        return super.supportsInterface(interfaceId);
    }

    function calculateRedeemFee(
        uint256 amount
    ) internal view returns (uint256) {
        return (amount * feeBps) / BPS_DIVISOR;
    }
}

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

pragma solidity ^0.8.0;

import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";

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

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role, _msgSender());
        _;
    }

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

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

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

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

import "./IERC1155.sol";
import "./IERC1155Receiver.sol";
import "./extensions/IERC1155MetadataURI.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 *
 * _Available since v3.1._
 */
contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;

    // Mapping from token ID to account balances
    mapping(uint256 => mapping(address => uint256)) private _balances;

    // Mapping from account to operator approvals
    mapping(address => mapping(address => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256) public view virtual override returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {
        require(account != address(0), "ERC1155: balance query for the zero address");
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] memory accounts, uint256[] memory ids)
        public
        view
        virtual
        override
        returns (uint256[] memory)
    {
        require(accounts.length == ids.length, "ERC1155: accounts and ids 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;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual override {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

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

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: caller is not owner nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) public virtual override {
        require(
            from == _msgSender() || isApprovedForAll(from, _msgSender()),
            "ERC1155: transfer caller is not owner nor approved"
        );
        _safeBatchTransferFrom(from, to, ids, amounts, data);
    }

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

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

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }
        _balances[id][to] += amount;

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

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

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");
        require(to != address(0), "ERC1155: transfer to the zero address");

        address operator = _msgSender();

        _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 = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: insufficient balance for transfer");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
            _balances[id][to] += amount;
        }

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

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

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the amounts in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");

        address operator = _msgSender();

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

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

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

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        require(to != address(0), "ERC1155: mint to the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

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

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

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

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

    /**
     * @dev Destroys `amount` tokens of token type `id` from `from`
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `amount` tokens of token type `id`.
     */
    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");

        address operator = _msgSender();

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

        uint256 fromBalance = _balances[id][from];
        require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
        unchecked {
            _balances[id][from] = fromBalance - amount;
        }

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

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     */
    function _burnBatch(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        require(from != address(0), "ERC1155: burn from the zero address");
        require(ids.length == amounts.length, "ERC1155: ids and amounts length mismatch");

        address operator = _msgSender();

        _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 = _balances[id][from];
            require(fromBalance >= amount, "ERC1155: burn amount exceeds balance");
            unchecked {
                _balances[id][from] = fromBalance - amount;
            }
        }

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits a {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    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.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }

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

        return array;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/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.
        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. 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);
}

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

pragma solidity ^0.8.0;

import "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

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

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

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://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);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    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);
    }
}

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

pragma solidity ^0.8.0;

import "../Strings.sol";

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

    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;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 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", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

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

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

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        return a + b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        return a * b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b <= a, errorMessage);
            return a - b;
        }
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(
        uint256 a,
        uint256 b,
        string memory errorMessage
    ) internal pure returns (uint256) {
        unchecked {
            require(b > 0, errorMessage);
            return a % b;
        }
    }
}

//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;

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

library CTHelpers {
    /// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function getConditionId(address oracle, bytes32 questionId, uint outcomeSlotCount) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount));
    }

    uint constant P = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
    uint constant B = 3;

    function sqrt(uint x) private pure returns (uint y) {
        uint p = P;
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            // add chain generated via https://crypto.stackexchange.com/q/27179/71252
            // and transformed to the following program:

            // x=1; y=x+x; z=y+y; z=z+z; y=y+z; x=x+y; y=y+x; z=y+y; t=z+z; t=z+t; t=t+t;
            // t=t+t; z=z+t; x=x+z; z=x+x; z=z+z; y=y+z; z=y+y; z=z+z; z=z+z; z=y+z; x=x+z;
            // z=x+x; z=z+z; z=z+z; z=x+z; y=y+z; x=x+y; z=x+x; z=z+z; y=y+z; z=y+y; t=z+z;
            // t=t+t; t=t+t; z=z+t; x=x+z; y=y+x; z=y+y; z=z+z; z=z+z; x=x+z; z=x+x; z=z+z;
            // z=x+z; z=z+z; z=z+z; z=x+z; y=y+z; z=y+y; t=z+z; t=t+t; t=z+t; t=y+t; t=t+t;
            // t=t+t; t=t+t; t=t+t; z=z+t; x=x+z; z=x+x; z=x+z; y=y+z; z=y+y; z=y+z; z=z+z;
            // t=z+z; t=z+t; w=t+t; w=w+w; w=w+w; w=w+w; w=w+w; t=t+w; z=z+t; x=x+z; y=y+x;
            // z=y+y; x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; z=x+x; z=x+z; z=z+z; y=y+z; z=y+y;
            // z=z+z; x=x+z; y=y+x; z=y+y; z=y+z; x=x+z; y=y+x; x=x+y; y=y+x; z=y+y; z=z+z;
            // z=y+z; x=x+z; z=x+x; z=x+z; y=y+z; x=x+y; y=y+x; x=x+y; y=y+x; z=y+y; z=y+z;
            // z=z+z; x=x+z; y=y+x; z=y+y; z=y+z; z=z+z; x=x+z; z=x+x; t=z+z; t=t+t; t=z+t;
            // t=x+t; t=t+t; t=t+t; t=t+t; t=t+t; z=z+t; y=y+z; x=x+y; y=y+x; x=x+y; z=x+x;
            // z=x+z; z=z+z; z=z+z; z=z+z; z=x+z; y=y+z; z=y+y; z=y+z; z=z+z; x=x+z; z=x+x;
            // z=x+z; y=y+z; x=x+y; z=x+x; z=z+z; y=y+z; x=x+y; z=x+x; y=y+z; x=x+y; y=y+x;
            // z=y+y; z=y+z; x=x+z; y=y+x; z=y+y; z=y+z; z=z+z; z=z+z; x=x+z; z=x+x; z=z+z;
            // z=z+z; z=x+z; y=y+z; x=x+y; z=x+x; t=x+z; t=t+t; t=t+t; z=z+t; y=y+z; z=y+y;
            // x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; y=y+x; z=y+y; t=y+z; z=y+t; z=z+z; z=z+z;
            // z=t+z; x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; z=x+x; z=x+z; y=y+z; x=x+y; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; res=y+x
            // res == (P + 1) // 4

            y := mulmod(x, x, p)
            {
                let z := mulmod(y, y, p)
                z := mulmod(z, z, p)
                y := mulmod(y, z, p)
                x := mulmod(x, y, p)
                y := mulmod(y, x, p)
                z := mulmod(y, y, p)
                {
                    let t := mulmod(z, z, p)
                    t := mulmod(z, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(z, t, p)
                    t := mulmod(y, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    t := mulmod(z, z, p)
                    t := mulmod(z, t, p)
                    {
                        let w := mulmod(t, t, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        t := mulmod(t, w, p)
                    }
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(z, t, p)
                    t := mulmod(x, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    t := mulmod(x, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    t := mulmod(y, z, p)
                    z := mulmod(y, t, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(t, z, p)
                }
                x := mulmod(x, z, p)
                y := mulmod(y, x, p)
                x := mulmod(x, y, p)
                y := mulmod(y, x, p)
                x := mulmod(x, y, p)
                z := mulmod(x, x, p)
                z := mulmod(x, z, p)
                y := mulmod(y, z, p)
            }
            x := mulmod(x, y, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            y := mulmod(y, x, p)
        }
    }

    /// @dev Constructs an outcome collection ID from a parent collection and an outcome collection.
    /// @param parentCollectionId Collection ID of the parent outcome collection, or bytes32(0) if there's no parent.
    /// @param conditionId Condition ID of the outcome collection to combine with the parent outcome collection.
    /// @param indexSet Index set of the outcome collection to combine with the parent outcome collection.
    function getCollectionId(bytes32 parentCollectionId, bytes32 conditionId, uint indexSet) internal view returns (bytes32) {
        uint x1 = uint(keccak256(abi.encodePacked(conditionId, indexSet)));
        bool odd = x1 >> 255 != 0;
        uint y1;
        uint yy;
        do {
            x1 = addmod(x1, 1, P);
            yy = addmod(mulmod(x1, mulmod(x1, x1, P), P), B, P);
            y1 = sqrt(yy);
        } while(mulmod(y1, y1, P) != yy);
        if(odd && y1 % 2 == 0 || !odd && y1 % 2 == 1)
            y1 = P - y1;

        uint x2 = uint(parentCollectionId);
        if(x2 != 0) {
            odd = x2 >> 254 != 0;
            x2 = (x2 << 2) >> 2;
            yy = addmod(mulmod(x2, mulmod(x2, x2, P), P), B, P);
            uint y2 = sqrt(yy);
            if(odd && y2 % 2 == 0 || !odd && y2 % 2 == 1)
                y2 = P - y2;
            require(mulmod(y2, y2, P) == yy, "invalid parent collection ID");

            (bool success, bytes memory ret) = address(6).staticcall(abi.encode(x1, y1, x2, y2));
            require(success, "ecadd failed");
            (x1, y1) = abi.decode(ret, (uint, uint));
        }

        if(y1 % 2 == 1)
            x1 ^= 1 << 254;

        return bytes32(x1);
    }

    /// @dev Constructs a position ID from a collateral token and an outcome collection. These IDs are used as the ERC-1155 ID for this contract.
    /// @param collateralToken Collateral token which backs the position.
    /// @param collectionId ID of the outcome collection associated with this position.
    function getPositionId(IERC20 collateralToken, bytes32 collectionId) internal pure returns (uint) {
        return uint(keccak256(abi.encodePacked(collateralToken, collectionId)));
    }
}

// SPDX-License-Identifier: UNLICENSED

import {EIP712} from "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";

pragma solidity 0.8.25;

abstract contract FeeManager is EIP712 {
    struct FeeReduction {
        uint256 percent;
        uint256 expiration;
    }

    struct FeeReductionMsg {
        address account;
        uint256 percent;
        uint256 expiration;
    }

    bytes32 constant REDUCTION_TYPEHASH =
        keccak256(
            "FeeReductionMsg(address account,uint256 percent,uint256 expiration)"
        );

    uint256 internal constant BPS_DIVISOR = 10_000;
    uint256 internal constant MAX_FEE_RATE_BPS = 1000; // 1000 bps or 10%

    uint256 public feeBps;
    address public feeReceiver;

    mapping(address => FeeReduction) public feeReductions;

    event FeeBpsUpdated(uint256 oldFeeBps, uint256 newFeeBps);
    event FeeReceiverUpdated(address oldFeeReceiver, address newFeeReceiver);
    event FeeReductionConfigured(
        address indexed operator,
        address indexed account,
        uint256 bps,
        uint256 expiration
    );

    error NullFeeReceiver();
    error ConfiguredFeeTooHigh(uint256 passed, uint256 max);
    error NotTheFeeOperator(address account);
    error ReductionPercentExceedMaximum(uint256 percent);

    constructor(uint256 configuredFeeBps, address configuredFeeReceiver) {
        if (configuredFeeReceiver == address(0)) revert NullFeeReceiver();

        feeBps = configuredFeeBps;
        feeReceiver = configuredFeeReceiver;
    }

    function _calculateFee(
        address account,
        uint256 amount
    ) internal view returns (uint256) {
        FeeReduction memory reduction = feeReductions[account];

        uint256 appliedFeeBps = feeBps;

        if (reduction.percent != 0 && block.timestamp <= reduction.expiration) {
            appliedFeeBps = (feeBps * (100 - reduction.percent)) / 100;
        }

        return (amount * appliedFeeBps) / BPS_DIVISOR;
    }

    function configureFeeBps(uint256 newFeeBps) public {
        if (!isFeeOperator(msg.sender)) {
            revert NotTheFeeOperator(msg.sender);
        }

        if (newFeeBps > MAX_FEE_RATE_BPS)
            revert ConfiguredFeeTooHigh(newFeeBps, MAX_FEE_RATE_BPS);

        uint256 current = feeBps;

        feeBps = newFeeBps;

        emit FeeBpsUpdated(current, newFeeBps);
    }

    function configureFeeReceiver(address newReceiver) public {
        if (!isFeeOperator(msg.sender)) {
            revert NotTheFeeOperator(msg.sender);
        }

        if (newReceiver == address(0)) revert NullFeeReceiver();

        address current = feeReceiver;

        feeReceiver = newReceiver;

        emit FeeReceiverUpdated(current, newReceiver);
    }

    function configureFeeReduction(
        address account,
        uint256 percent,
        uint256 expiration
    ) public {
        if (!isFeeOperator(msg.sender)) {
            revert NotTheFeeOperator(msg.sender);
        }

        if (percent > 100) {
            revert ReductionPercentExceedMaximum(percent);
        }

        feeReductions[account] = FeeReduction(percent, expiration);

        emit FeeReductionConfigured(msg.sender, account, percent, expiration);
    }

    function configureFeeReductionWithSig(
        FeeReductionMsg memory reductionMsg,
        bytes memory signature
    ) public {
        if (reductionMsg.percent > 100) {
            revert ReductionPercentExceedMaximum(reductionMsg.percent);
        }

        bytes32 typehash = hashReductionMsg(reductionMsg);
        address signer = ECDSA.recover(typehash, signature);

        if (!isFeeOperator(signer)) {
            revert NotTheFeeOperator(signer);
        }

        feeReductions[reductionMsg.account] = FeeReduction(
            reductionMsg.percent,
            reductionMsg.expiration
        );

        emit FeeReductionConfigured(
            signer,
            reductionMsg.account,
            reductionMsg.percent,
            reductionMsg.expiration
        );
    }

    function isFeeOperator(
        address account
    ) internal view virtual returns (bool);

    function hashReductionMsg(
        FeeReductionMsg memory reductionMsg
    ) public view returns (bytes32) {
        bytes32 msgHash = keccak256(
            abi.encode(
                REDUCTION_TYPEHASH,
                reductionMsg.account,
                reductionMsg.percent,
                reductionMsg.expiration
            )
        );

        bytes32 typehash = _hashTypedDataV4(msgHash);

        return typehash;
    }
}

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

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

contract Roles is AccessControl {
    // keccak256("ADMIN_ROLE")
    bytes32 public constant ADMIN_ROLE =
        0xa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775;
    // keccak256("OPERATOR_ROLE")
    bytes32 public constant OPERATOR_ROLE =
        0x97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929;
    // keccak256("WHITELIST_ROLE")
    bytes32 public constant WHITELIST_ROLE =
        0xdc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be6760;

    constructor() {
        _setRoleAdmin(ADMIN_ROLE, ADMIN_ROLE);
        _setRoleAdmin(OPERATOR_ROLE, ADMIN_ROLE);
        _setRoleAdmin(WHITELIST_ROLE, ADMIN_ROLE);
        _setupRole(ADMIN_ROLE, msg.sender);
    }

    function grantAdmin(
        address newAdmin
    ) external onlyRole(getRoleAdmin(ADMIN_ROLE)) {
        require(newAdmin != address(0), "Admin address is invalid!");
        _grantRole(ADMIN_ROLE, newAdmin);
    }

    function grantOperator(
        address newOperator
    ) external onlyRole(getRoleAdmin(OPERATOR_ROLE)) {
        require(newOperator != address(0), "Guardian address is invalid!");
        _grantRole(OPERATOR_ROLE, newOperator);
    }

    function grantWhitelist(
        address _whitelist
    ) external onlyRole(getRoleAdmin(WHITELIST_ROLE)) {
        require(_whitelist != address(0), "Whitelist address is invalid!");
        _grantRole(WHITELIST_ROLE, _whitelist);
    }

    function isAdmin(address admin) public view returns (bool) {
        return hasRole(ADMIN_ROLE, admin);
    }

    function isOperator(address guardian) public view returns (bool) {
        return hasRole(OPERATOR_ROLE, guardian);
    }

    function isWhitelist(address whitelist) public view returns (bool) {
        return hasRole(WHITELIST_ROLE, whitelist);
    }
}

Settings
{
  "evmVersion": "london",
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [
    ":@/=src/",
    ":@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    ":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
    ":ds-test/=lib/solmate/lib/ds-test/src/",
    ":forge-std/=lib/forge-std/src/",
    ":openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
    ":openzeppelin-contracts/=lib/openzeppelin-contracts/contracts/",
    ":solmate/=lib/solmate/src/"
  ],
  "viaIR": true,
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"uint256","name":"configuredFeeBps","type":"uint256"},{"internalType":"address","name":"configuredFeeReceiver","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"passed","type":"uint256"},{"internalType":"uint256","name":"max","type":"uint256"}],"name":"ConfiguredFeeTooHigh","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"NotTheFeeOperator","type":"error"},{"inputs":[],"name":"NullFeeReceiver","type":"error"},{"inputs":[{"internalType":"uint256","name":"percent","type":"uint256"}],"name":"ReductionPercentExceedMaximum","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","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":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"ConditionPreparation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"payoutNumerators","type":"uint256[]"}],"name":"ConditionResolution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldFeeBps","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFeeBps","type":"uint256"}],"name":"FeeBpsUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldFeeReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"newFeeReceiver","type":"address"}],"name":"FeeReceiverUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"bps","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"FeeReductionConfigured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"indexSets","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"PayoutRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsMerge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","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":[],"name":"ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WHITELIST_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","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":"uint256","name":"newFeeBps","type":"uint256"}],"name":"configureFeeBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newReceiver","type":"address"}],"name":"configureFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"name":"configureFeeReduction","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct FeeManager.FeeReductionMsg","name":"reductionMsg","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"configureFeeReductionWithSig","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"feeReductions","outputs":[{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256","name":"indexSet","type":"uint256"}],"name":"getCollectionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracle","type":"address"},{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"getConditionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"conditionId","type":"bytes32"}],"name":"getOutcomeSlotCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"collectionId","type":"bytes32"}],"name":"getPositionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"grantAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"grantOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_whitelist","type":"address"}],"name":"grantWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"percent","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"}],"internalType":"struct FeeManager.FeeReductionMsg","name":"reductionMsg","type":"tuple"}],"name":"hashReductionMsg","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"guardian","type":"address"}],"name":"isOperator","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"isTransferAllowed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"whitelist","type":"address"}],"name":"isWhitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"payoutDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"payoutNumerators","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracle","type":"address"},{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"prepareCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"indexSets","type":"uint256[]"}],"name":"redeemPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256[]","name":"payouts","type":"uint256[]"}],"name":"reportPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","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":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

610140346104aa57601f61637638819003918201601f19168301916001600160401b038311848410176103225780849260409485528339810103126104aa5780516020909101516001600160a01b03811681036104aa5760405190610063826104af565b6011825270436f6e646974696f6e616c546f6b656e7360781b60208301526040519161008e836104af565b60058352640312e302e360dc1b60208401526040516020810181811060018060401b0382111761032257604052600081527fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c217758060005260006020528060016040600020018181549155817fbd79b86ffe0ab8e8776151514217cd7cacd52c909f66475c3af44e129f0b00ff918183600080a4817f97667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b92980600052600160406000200190828254925583600080a47fdc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be6760806000526001604060002001918383549355600080a48060005260406000203360005260205260ff6040600020541615610456575b508051906001600160401b0382116103225760035490600182811c9216801561044c575b60208310146104365781601f8493116103c9575b50602090601f831160011461034357600092610338575b50508160011b916000199060031b1c1916176003555b602081519101209160208151910120928260e052610100938085524660a0526040519060208201907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f95868352604084015260608301524660808301523060a083015260a0825260c082019180831060018060401b038411176103225760408390525190206080523060c0526101209384526001600160a01b03831615610313575060045560018060a01b031660018060a01b0319600554161760055560405190615eab92836104cb843960805183615c52015260a05183615d07015260c05183615c1c015260e05183615ca101525182615cc701525181615c7e0152f35b6314e175f560e21b8152600490fd5b634e487b7160e01b600052604160045260246000fd5b0151905038806101fe565b600360009081527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b9350601f198516905b8181106103b15750908460019594939210610398575b505050811b01600355610214565b015160001960f88460031b161c1916905538808061038a565b92936020600181928786015181550195019301610374565b60036000529091507fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b601f840160051c81016020851061042f575b90849392915b601f830160051c820181106104205750506101e7565b6000815585945060010161040a565b5080610404565b634e487b7160e01b600052602260045260246000fd5b91607f16916101d3565b8060005260006020526040600020336000526020526040600020600160ff19825416179055339033907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d600080a4386101af565b600080fd5b604081019081106001600160401b038211176103225760405256fe6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102c657806301b7037c146102c157806301ffc9a7146102bc5780630504c814146102b75780630e89341c146102b25780631becf587146102ad578063248a9ca3146102a857806324a9d853146102a357806324d7806c1461029e5780632eb2c2d6146102995780632f2ff15d1461029457806335bb3e161461028f57806336568abe1461028a57806339dd7530146102855780634e1273f4146102805780635b0636221461027b5780636d70f7ae1461027657806372ce42751461027157806375b238fc1461026c5780637a997ab714610267578063852c6ae214610262578063856296f71461025d57806391d148541461025857806397e2b9af146102535780639e7212ad1461024e5780639ecc0436146102495780639ed06a3514610244578063a217fddf1461023f578063a22cb4651461023a578063b3f0067414610235578063b78a81ae14610230578063c49298ac1461022b578063c683630d14610226578063d260549714610221578063d42dc0c21461021c578063d547741f14610217578063d96ee75414610212578063dd34de671461020d578063e348da1314610208578063e52c525f14610203578063e985e9c5146101fe578063f242432a146101f95763f5b541a6146101f457600080fd5b61231b565b61222a565b6121ec565b6120f5565b612037565b61200b565b611f12565b611ece565b611ea2565b611dd7565b611d81565b611c08565b611b44565b611b1b565b611a23565b6119fd565b6119d9565b611983565b6117a7565b611783565b611714565b6116f0565b6116d7565b61168b565b611662565b611438565b61139a565b6112dc565b611220565b6111b0565b61111a565b61105c565b610f92565b610d5d565b610c84565b610c66565b610c37565b610aaa565b610833565b610790565b6106d5565b610344565b6102e1565b6001600160a01b038116036102dc57565b600080fd5b346102dc5760403660031901126102dc57602061030c600435610303816102cb565b60243590612344565b604051908152f35b9181601f840112156102dc578235916001600160401b0383116102dc576020808501948460051b0101116102dc57565b346102dc5760803660031901126102dc57600435610361816102cb565b602435906044356064356001600160401b0381116102dc57610387903690600401610314565b61039e839492946000526008602052604060002090565b54916103ab8315156123d8565b6103bf846000526007602052604060002090565b54926103cc841515612432565b6000936001916103de6001831b612494565b91865b88878b8d8285106105df57918b84918b60008361043b575b610436907fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c69460405194859460018060a01b031698339886612638565b0390a4005b86610597575061044b8333613344565b9283610514575b83602061046261048996846124c4565b60405163a9059cbb60e01b8152336004820152602481019190915295869081906044820190565b038160006001600160a01b0388165af191821561050f576104d7610436937fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c6976000916104e0575b506125b4565b945090506103f9565b610502915060203d602011610508575b6104fa81836109de565b810190612538565b8b6104d1565b503d6104f0565b61254d565b60055460405163a9059cbb60e01b81526001600160a01b03909116600482015260248101859052936020858060448101038160006001600160a01b0388165af194851561050f576104899561057191600091610578575b50612559565b9350610452565b610591915060203d602011610508576104fa81836109de565b8a61056b565b610436907fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c6946105da6105ca8a86612f76565b826105d3612525565b91336131a4565b6104d7565b6105f0856106119461060b946124d1565b35938491821515806106ba575b610606906124e1565b612d49565b88612f76565b9060009087825b8681106106705750505061062c8233612344565b908161063d575b50505084016103e1565b906106618894939b61065b886106566106689686612bc1565b612fb4565b90612fa7565b9a3361306e565b903880610633565b8d82821b8416610684575b50018890610618565b9361065b6106a9836106a46106b395986000526007602052604060002090565b610773565b90549060031b1c90565b928d61067b565b508983106105fd565b6001600160e01b03198116036102dc57565b346102dc5760203660031901126102dc5760206004356106f4816106c3565b63ffffffff60e01b16636cdb3d1360e11b811490811561074c575b8115610721575b506040519015158152f35b637965db0b60e01b81149150811561073b575b5038610716565b6301ffc9a760e01b14905038610734565b6303a24d0760e21b8114915061070f565b634e487b7160e01b600052603260045260246000fd5b805482101561078b5760005260206000200190600090565b61075d565b346102dc5760403660031901126102dc576024356004356000526007602052604060002080548210156102dc576020916107c991610773565b90546040519160031b1c8152f35b60005b8381106107ea5750506000910152565b81810151838201526020016107da565b90602091610813815180928185528580860191016107d7565b601f01601f1916010190565b9060206108309281815201906107fa565b90565b346102dc576020806003193601126102dc57604051906000906003546001918160011c9260018316928315610932575b60208510841461091e5784875260208701939081156108ff57506001146108a5575b6108a186610895818803826109de565b6040519182918261081f565b0390f35b6003600090815294509192917fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8386106108ee5750505091019050610895826108a138610885565b8054858701529482019481016108d3565b60ff1916845250505090151560051b019050610895826108a138610885565b634e487b7160e01b86526022600452602486fd5b93607f1693610863565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b0382111761096d57604052565b61093c565b604081019081106001600160401b0382111761096d57604052565b602081019081106001600160401b0382111761096d57604052565b608081019081106001600160401b0382111761096d57604052565b60c081019081106001600160401b0382111761096d57604052565b90601f801991011681019081106001600160401b0382111761096d57604052565b60405190610a0c82610972565b565b60609060031901126102dc5760405190610a2782610952565b81600435610a34816102cb565b815260243560208201526040604435910152565b6001600160401b03811161096d57601f01601f191660200190565b81601f820112156102dc57803590610a7a82610a48565b92610a8860405194856109de565b828452602083830101116102dc57816000926020809301838601378301015290565b346102dc5760803660031901126102dc57610ac436610a0e565b6064356001600160401b0381116102dc57610ae3903690600401610a63565b906020810191825160648111610c1d5750610b0690610b01836128fb565b6133ed565b91610b3d610b39846001600160a01b03166000908152600080516020615e36833981519152602052604090205460ff1690565b1590565b610bf85780610bca7f886e6691f2040a5611e224ba17ceb93013694020d3f8d0a6b6961c821ec1d51b925193610bbd60408201958651610b7b6109ff565b91825260208201528251610bac906001600160a01b03166001600160a01b0316600090815260066020526040902090565b906020600191805184550151910155565b516001600160a01b031690565b905192516040805194855260208501919091526001600160a01b03918216949091169290819081015b0390a3005b604051632fcc186160e21b81526001600160a01b0384166004820152602490fd5b0390fd5b604051636e7eb25b60e11b81526004810191909152602490fd5b346102dc5760203660031901126102dc5760043560005260006020526020600160406000200154604051908152f35b346102dc5760003660031901126102dc576020600454604051908152f35b346102dc5760203660031901126102dc57602060ff610cda600435610ca8816102cb565b600080516020615e568339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b6001600160401b03811161096d5760051b60200190565b9080601f830112156102dc576020908235610d1781610ce6565b93610d2560405195866109de565b81855260208086019260051b8201019283116102dc57602001905b828210610d4e575050505090565b81358152908301908301610d40565b346102dc5760a03660031901126102dc57600435610d7a816102cb565b60243590610d87826102cb565b6001600160401b03906044358281116102dc57610da8903690600401610cfd565b916064358181116102dc57610dc1903690600401610cfd565b906084359081116102dc57610dda903690600401610a63565b6001600160a01b038381169491903386148015610f6f575b15610f0f57610e07610e02612870565b613402565b610e1483518551146137df565b8616610e218115156158aa565b60005b8351811015610ec95780610e3a60019286612693565b51610ec1610eb98b610e6e610e4f868c612693565b51948c610ea887610e8583610e6e866000526001602052604060002090565b9060018060a01b0316600052602052604060002090565b54610e9282821015615904565b0391610e6e846000526001602052604060002090565b556000526001602052604060002090565b918254612fa7565b905501610e24565b5093869194610f0d966040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180610f048a8a8361383c565b0390a433615b80565b005b60405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608490fd5b50600086815260026020908152604080832033845290915290205460ff16610df2565b346102dc5760403660031901126102dc57600435602435610fb2816102cb565b60009180835282602052610fce60016040852001543390613547565b808352602083815260408085206001600160a01b0385166000908152925290205460ff1615610ffb578280f35b808352602083815260408085206001600160a01b038516600090815292529020805460ff1916600117905533916001600160a01b0316907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8480a438808280f35b346102dc5760203660031901126102dc57600435611079816102cb565b600080516020615e5683398151915260009081526020527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ed546110bd903390613547565b6001600160a01b038116156110d557610f0d90613615565b60405162461bcd60e51b815260206004820152601960248201527f41646d696e206164647265737320697320696e76616c696421000000000000006044820152606490fd5b346102dc5760403660031901126102dc57602435611137816102cb565b336001600160a01b0382160361115357610f0d90600435613755565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346102dc5760403660031901126102dc57602061030c6004356111d2816102cb565b60243590612f76565b90815180825260208080930193019160005b8281106111fb575050505090565b8351855293810193928101926001016111ed565b9060206108309281815201906111db565b346102dc5760403660031901126102dc576004356001600160401b038082116102dc57366023830112156102dc57816004013561125c81610ce6565b9261126a60405194856109de565b8184526020916024602086019160051b830101913683116102dc57602401905b8282106112c357856024358681116102dc576108a1916112b16112b7923690600401610cfd565b906126a7565b6040519182918261120f565b83809183356112d1816102cb565b81520191019061128a565b346102dc5760203660031901126102dc576004356112f9816102cb565b600080516020615df683398151915260009081526020527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e97445461133d903390613547565b6001600160a01b0381161561135557610f0d906136c9565b60405162461bcd60e51b815260206004820152601d60248201527f57686974656c697374206164647265737320697320696e76616c6964210000006044820152606490fd5b346102dc5760203660031901126102dc57602060ff610cda6004356113be816102cb565b600080516020615e168339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b9060a06003198301126102dc57600435611409816102cb565b916024359160443591606435906001600160401b0382116102dc5761143091600401610314565b909160843590565b346102dc57611446366113f0565b916001959395926114596001841161275d565b6114846001611472896000526007602052604060002090565b5461147e811515612432565b1b612494565b9086888361149187612661565b9461149b88612661565b9860005b89898183106115f5575050505081156000146115b15750505061156f576040516323b872dd60e01b8152336004820152306024820152604481018290529160208360648160006001600160a01b038c165af190811561050f577f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a74786298966115336115429361043696600091611550575b506127ed565b61153b612525565b9133613861565b604051938493339785612845565b611569915060203d602011610508576104fa81836109de565b3861152d565b611542610436927f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a74786298966115ac846115a68c8c612f76565b3361306e565b611533565b846115a66115ef6115429661043699967f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989d966115ac961891612d49565b8c612f76565b9483959661160d846115ef946116369697989a6124d1565b35809281151580611659575b611622906124e1565b61162f82828116146127a8565b1898612d49565b6116408289612693565b528561164c828c612693565b5201918a93918c9361149f565b50898210611619565b346102dc5760003660031901126102dc576020604051600080516020615e568339815191528152f35b346102dc5760003660031901126102dc576020604051600080516020615df68339815191528152f35b60609060031901126102dc576004356116cc816102cb565b906024359060443590565b346102dc57602061030c6116ea366116b4565b91613a0a565b346102dc5760603660031901126102dc57602061030c604435602435600435612d49565b346102dc5760403660031901126102dc57602060ff610cda602435611738816102cb565b6004356000526000845260406000209060018060a01b0316600052602052604060002090565b60409060031901126102dc57600435611776816102cb565b90602435610830816102cb565b346102dc576117913661175e565b5050602061179d612870565b6040519015158152f35b346102dc576117b5366113f0565b9160019593956117c76001841161275d565b6117e06001611472896000526007602052604060002090565b9081906117ec85612661565b886117f687612661565b9260005b8c898981841061191c57505050505050906118159133613a40565b816118e4575050846118ad5760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b038a165af190811561050f57611542610436927f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca9660009161188e575b506128b0565b6118a7915060203d602011610508576104fa81836109de565b38611888565b6104367f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca936118df6105ca8888612f76565b611542565b936118df6105ca61060b610436947f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca98188b8b612d49565b9861195a92611931856115ef9488999d6124d1565b3580928115158061197a575b611946906124e1565b61195382828116146127a8565b189a612d49565b6119648286612693565b52896119708287612693565b5201908a916117fa565b508b821061193d565b346102dc5760203660031901126102dc576004356119a0816102cb565b60018060a01b03166000526006602052604060002060018154910154906108a16040519283928360209093929193604081019481520152565b346102dc5760603660031901126102dc57602061030c6119f836610a0e565b6128fb565b346102dc5760003660031901126102dc57602060405160008152f35b801515036102dc57565b346102dc5760403660031901126102dc57600435611a40816102cb565b602435611a4c81611a19565b6001600160a01b03821691338314611ac457336000908152600260205260409020611a8e918391611a7d9190610e6e565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31908060208101610bf3565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608490fd5b346102dc5760003660031901126102dc576005546040516001600160a01b039091168152602090f35b346102dc5760203660031901126102dc57336000908152600080516020615e3683398151915260205260409020546004359060ff1615611bf0576103e88111611bcf577f5ec5620e288c4be955ccb6cfb3d55431a8fed5c4c96ffacc4b9506360695f64e90600454611bb582600455565b60408051918252602082019290925290819081015b0390a1005b60405162746d8160e01b815260048101919091526103e86024820152604490fd5b604051632fcc186160e21b8152336004820152602490fd5b346102dc5760403660031901126102dc576004356024356001600160401b0381116102dc57611c3b903690600401610314565b90600190611c4b600184116129a2565b611c56838533613a0a565b91611c7684611c6f856000526007602052604060002090565b5414612a01565b611c94611c8d846000526008602052604060002090565b5415612a4d565b60009160005b858110611d0a57505050611caf811515612ae5565b611cc3826000526008602052604060002090565b557fb44d84d3289691f71497564b85d4233648d9dbae8cbdbb4329f301c3a0185894610436611cfc836000526007602052604060002090565b604051918291339683612b28565b80611d7b611d25611d1d86948a876124d1565b358097612fa7565b95611d4a611d446106a9856106a48c6000526007602052604060002090565b15612a99565b611d62836106a48a6000526007602052604060002090565b90919082549060031b91821b91600019901b1916179055565b01611c9a565b346102dc5760203660031901126102dc57602060ff610cda600435611da5816102cb565b600080516020615df68339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b346102dc5760203660031901126102dc57600435611df4816102cb565b336000908152600080516020615e3683398151915260205260409020611e2090610b39905b5460ff1690565b611bf0576001600160a01b03811615611e9057600580546001600160a01b039283166001600160a01b0319821681179092556040805193909116835260208301919091527fa92ff4390fe6943f0b30e8fe715dde86f85ab79b2b2c640a10fc094cc4036cc8919081908101611bca565b6040516314e175f560e21b8152600490fd5b346102dc5760203660031901126102dc5760043560005260076020526020604060002054604051908152f35b346102dc5760403660031901126102dc57610f0d602435600435611ef1826102cb565b806000526000602052611f0d6001604060002001543390613547565b613755565b346102dc57611f20366116b4565b9091611f2b33613465565b6101008211611fcd57611f40600183116129a2565b7fab3760c3bd2bb38b5bcf54dc79802ed67338b4cf29f3054ded67ed24661e4177610436611f6f848685613a0a565b92611f8e611f87856000526007602052604060002090565b5415612b75565b611fb3611f9a86612661565b611fae866000526007602052604060002090565b612bd4565b6040519485526001600160a01b0316939081906020820190565b60405162461bcd60e51b8152602060048201526016602482015275746f6f206d616e79206f7574636f6d6520736c6f747360501b6044820152606490fd5b346102dc5760203660031901126102dc5760043560005260086020526020604060002054604051908152f35b346102dc5760203660031901126102dc57600435612054816102cb565b600080516020615e1683398151915260009081526020527fee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f31a054612098903390613547565b6001600160a01b038116156120b057610f0d90613718565b60405162461bcd60e51b815260206004820152601c60248201527f477561726469616e206164647265737320697320696e76616c696421000000006044820152606490fd5b346102dc5760603660031901126102dc57600435612112816102cb565b600080516020615e168339815191526000908152602052604435906024359061214f610b39611e1933600080516020615e36833981519152610e6e565b611bf057606482116121d357610bf37f886e6691f2040a5611e224ba17ceb93013694020d3f8d0a6b6961c821ec1d51b916121b061218b6109ff565b858152866020820152610bac8360018060a01b03166000526006602052604060002090565b6040805194855260208501959095526001600160a01b0316933393918291820190565b604051636e7eb25b60e11b815260048101839052602490fd5b346102dc57602060ff610cda6122013661175e565b6001600160a01b0391821660009081526002865260408082209290931681526020919091522090565b346102dc5760a03660031901126102dc57600435612247816102cb565b602435612253816102cb565b6084356001600160401b0381116102dc57612272903690600401610a63565b906001600160a01b0383163381149081156122f6575b501561229f57610f0d926064359160443591613b18565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608490fd5b6000908152600260209081526040808320338452909152902060ff9150541638612288565b346102dc5760003660031901126102dc576020604051600080516020615e168339815191528152f35b6001600160a01b0381161561237f5761237b91600052600160205260406000209060018060a01b0316600052602052604060002090565b5490565b60405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b6064820152608490fd5b156123df57565b60405162461bcd60e51b815260206004820152602560248201527f726573756c7420666f7220636f6e646974696f6e206e6f74207265636569766560448201526419081e595d60da1b6064820152608490fd5b1561243957565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e206e6f74207072657061726564207965740000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6000198101919082116124a357565b61247e565b90600080516020615dd68339815191529182039182116124a357565b919082039182116124a357565b919081101561078b5760051b0190565b156124e857565b60405162461bcd60e51b815260206004820152601560248201527419dbdd081a5b9d985b1a59081a5b99195e081cd95d605a1b6044820152606490fd5b604051906125328261098d565b60008252565b908160209103126102dc575161083081611a19565b6040513d6000823e3d90fd5b1561256057565b60405162461bcd60e51b815260206004820152602660248201527f636f756c64206e6f74207472616e736665722066656520746f2066656520726560448201526531b2b4bb32b960d11b6064820152608490fd5b156125bb57565b60405162461bcd60e51b815260206004820152602b60248201527f636f756c64206e6f74207472616e73666572207061796f757420746f206d657360448201526a39b0b3b29039b2b73232b960a91b6064820152608490fd5b81835290916001600160fb1b0383116102dc5760209260051b809284830137010190565b9160609361265792979695978452608060208501526080840191612614565b9460408201520152565b9061266b82610ce6565b61267860405191826109de565b8281528092612689601f1991610ce6565b0190602036910137565b805182101561078b5760209160051b010190565b9190918051835103612706576126bd8151612661565b9060005b81518110156126ff57806126ee6126dd610bbd60019486612693565b6126e78389612693565b5190612344565b6126f88286612693565b52016126c1565b5090925050565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608490fd5b1561276457565b606460405162461bcd60e51b815260206004820152602060248201527f676f7420656d707479206f722073696e676c65746f6e20706172746974696f6e6044820152fd5b156127af57565b60405162461bcd60e51b81526020600482015260166024820152751c185c9d1a5d1a5bdb881b9bdd08191a5cda9bda5b9d60521b6044820152606490fd5b156127f457565b60405162461bcd60e51b815260206004820152602360248201527f636f756c64206e6f74207265636569766520636f6c6c61746572616c20746f6b604482015262656e7360e81b6064820152608490fd5b9493929160409261286b9260018060a01b03168752606060208801526060870191612614565b930152565b3360009081527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e9743602052604090205460ff166128ab57600090565b600190565b156128b757565b606460405162461bcd60e51b815260206004820152602060248201527f636f756c64206e6f742073656e6420636f6c6c61746572616c20746f6b656e736044820152fd5b60018060a01b0381511690604060208201519101516040519160208301937fbb3cd1701df33b62b2ad3ef7e29ba87a2a234e3dac5539d66f07afdaeb164b3585526040840152606083015260808201526080815260a081018181106001600160401b0382111761096d57604052519020612973615c19565b9060405190602082019261190160f01b8452602283015260428201526042815261299c816109a8565b51902090565b156129a957565b60405162461bcd60e51b815260206004820152602a60248201527f74686572652073686f756c64206265206d6f7265207468616e206f6e65206f756044820152691d18dbdb59481cdb1bdd60b21b6064820152608490fd5b15612a0857565b60405162461bcd60e51b815260206004820152601f60248201527f636f6e646974696f6e206e6f74207072657061726564206f7220666f756e64006044820152606490fd5b15612a5457565b60405162461bcd60e51b815260206004820152601e60248201527f7061796f75742064656e6f6d696e61746f7220616c72656164792073657400006044820152606490fd5b15612aa057565b60405162461bcd60e51b815260206004820152601c60248201527f7061796f7574206e756d657261746f7220616c726561647920736574000000006044820152606490fd5b15612aec57565b60405162461bcd60e51b81526020600482015260146024820152737061796f757420697320616c6c207a65726f657360601b6044820152606490fd5b9060408201908252606060209260406020820152845480935201926000526020600020916000905b828210612b5e575050505090565b835485529384019360019384019390910190612b50565b15612b7c57565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e20616c72656164792070726570617265640000000000006044820152606490fd5b818102929181159184041417156124a357565b8151916001600160401b03831161096d5768010000000000000000831161096d578154838355808410612c3b575b50612c17602080920192600052602060002090565b9060005b848110612c29575050505050565b83518382015592810192600101612c1b565b60008360005284602060002092830192015b828110612c5b575050612c02565b818155600101612c4d565b634e487b7160e01b600052601260045260246000fd5b15612c8357565b60405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420706172656e7420636f6c6c656374696f6e204944000000006044820152606490fd5b3d15612cf3573d90612cd982610a48565b91612ce760405193846109de565b82523d6000602084013e565b606090565b15612cff57565b60405162461bcd60e51b815260206004820152600c60248201526b1958d859190819985a5b195960a21b6044820152606490fd5b91908260409103126102dc576020825192015190565b6040805160208101938452808201949094528352601f19939092909190612d716060826109de565b5190209260ff84901c1592600091841583808060015b15612dd4575b505050600093612dcf57600196600080516020615dd683398151915297889108958497600381808a80098a090888612dc482613ca0565b969996929899612d87565b612c66565b612dcf57600080516020615dd683398151915282800914612df6578085612d8d565b94969581612f6a575b8115612f50575b50612f40575b81612e2b575b505050600180911614612e225790565b600160fe1b1890565b6001600160fe1b0382169460fe9290921c15801594919391929091612dcf57600195612ed9612eff95600095612ecd8a998897600080516020615dd68339815191529182600381808b80098b090890612e8382613ca0565b9281612f35575b8115612f1c575b50612f09575b819282612ea5930914612c7c565b6040519586936020850198899094939260609260808301968352602083015260408201520152565b039081018352826109de565b519060065afa612ef0612eea612cc8565b91612cf8565b60208082518301019101612d33565b9290929138612e12565b612f15612ea5926124a8565b9150612e97565b905080612f2a575b38612e91565b508c80831614612f24565b838f16159150612e8a565b92612f4a906124a8565b92612e0c565b905080612f5e575b38612e06565b50600180851614612f58565b60018616159150612dff565b906040519060208201926bffffffffffffffffffffffff199060601b16835260348201526034815261299c81610952565b919082018092116124a357565b8115612dcf570490565b15612fc557565b60405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561301d57565b60405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608490fd5b916001600160a01b03831691907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290613149906130ac851515612fbe565b6130b5846154db565b506130bf816154db565b50604051956130cd8761098d565b6000809752848752600160205261312f826130fd8360408b209060018060a01b0316600052602052604060002090565b5461310a82821015613016565b878a5260016020520391604089209060018060a01b0316600052602052604060002090565b556040805194855260208501919091523393918291820190565b0390a4565b1561315557565b60405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b9290916001600160a01b038416916131bd83151561314e565b6131c6846154db565b506131d0826154db565b508360005260016020526040946131fc81876000209060018060a01b0316600052602052604060002090565b8054908482018092116124a35755855185815260208101849052849060009033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290604090a43b613250575b5050505050565b613277926020926000875180968195829463f23a6e6160e01b9a8b85523360048601615515565b03925af160009181613313575b506132e257826132926155c2565b6308c379a0146132b4575b5162461bcd60e51b815280610c196004820161564e565b6132bc6155e0565b806132c7575061329d565b905162461bcd60e51b8152908190610c19906004830161081f565b6001600160e01b031916036132fc57503880808080613249565b5162461bcd60e51b815280610c1960048201615579565b61333691925060203d60201161333d575b61332e81836109de565b810190615500565b9038613284565b503d613324565b6001600160a01b0316600090815260066020526040908190208151918201916001600160401b0383118184101761096d576020926040526001825492838352015492839101526004549181151590816133e2575b506133b4575b506133ac9061083092612bc1565b612710900490565b60640391606483116124a3576133da6133d3610830946133ac94612bc1565b6064900490565b91509161339e565b905042111538613398565b610830916133fa916156a3565b919091615729565b1561340957565b60405162461bcd60e51b815260206004820152601760248201527f7472616e73666572206973206e6f7420616c6c6f7765640000000000000000006044820152606490fd5b90613461602092828151948592016107d7565b0190565b6001600160a01b0381166000908152600080516020615e36833981519152602052604090205460ff16156134965750565b610c199060489061352f906134b3906001600160a01b0316615a04565b6135216134be615a84565b6040519485937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000060208601526134fe8151809260206037890191016107d7565b84017001034b99036b4b9b9b4b733903937b6329607d1b6037820152019061344e565b03601f1981018352826109de565b60405162461bcd60e51b81529182916004830161081f565b9081600052600060205260ff6135738260406000209060018060a01b0316600052602052604060002090565b54161561357e575050565b613590906001600160a01b0316615a04565b613598615963565b9160306135a48461597e565b5360786135b08461598b565b5360415b600181116135d357610c19604861352f85613521886134be88156159b9565b90600f811690601082101561078b57613610916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848761599b565b5360041c916159ac565b6135b4565b6001600160a01b03811660009081527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ec60205260408120600080516020615e568339815191529060ff905b54161561366c57505050565b808252602082815260408084206001600160a01b038616600090815292529020805460ff1916600117905533926001600160a01b0316917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4565b6001600160a01b03811660009081527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e974360205260408120600080516020615df68339815191529060ff90613660565b6001600160a01b0381166000908152600080516020615e3683398151915260205260408120600080516020615e168339815191529060ff90613660565b6000818152602081815260408083206001600160a01b038616845290915281205490919060ff1661378557505050565b808252602082815260408084206001600160a01b038616600090815292529020805460ff1916905533926001600160a01b0316917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4565b156137e657565b60405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608490fd5b9091613853610830936040845260408401906111db565b9160208184039101526111db565b90939091906001600160a01b03831661387b81151561314e565b61388886518451146137df565b60005b86518110156138d95761389e8185612693565b51906138c286610e6e6138b1848c612693565b516000526001602052604060002090565b9182549081018091116124a357600192550161388b565b5092949390948360006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180613914898c8361383c565b0390a43b613923575b50505050565b61394b92602092600060405180968195829463bc197c8160e01b9a8b85523360048601615b03565b03925af1600091816139e9575b506139b8576139656155c2565b6308c379a014613989575b60405162461bcd60e51b815280610c196004820161564e565b6139916155e0565b8061399c5750613970565b60405162461bcd60e51b8152908190610c19906004830161081f565b6001600160e01b031916036139d0573880808061391d565b60405162461bcd60e51b815280610c1960048201615579565b613a0391925060203d60201161333d5761332e81836109de565b9038613958565b916040519160208301936bffffffffffffffffffffffff199060601b168452603483015260548201526054815261299c816109a8565b6001600160a01b03811693909190613a59851515612fbe565b613a6682518551146137df565b6000604051613a748161098d565b5260005b8251811015613adf5780613a8e60019285612693565b51613ad886610e6e613aa0858b612693565b51613ab983610e6e876000526001602052604060002090565b54613ac682821015613016565b03936000526001602052604060002090565b5501613a78565b509391507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb61314960009460405191829133958361383c565b9291613b25610e02612870565b6001600160a01b0394828616613b3c8115156158aa565b613b45836154db565b50613b4f856154db565b50600093838552600160205260409786613b7d898b89209060018060a01b0316600052602052604060002090565b54613b8a82821015615904565b868852600160205203613bb1898b89209060018060a01b0316600052602052604060002090565b55613bca82610e6e876000526001602052604060002090565b9081548881018091116124a357909155885185815260208101889052839189169033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290604090a43b613c22575b50505050505050565b613c49948460209489519788958694859363f23a6e6160e01b9c8d86523360048701615546565b03925af1909181613c7f575b50613c6357826132926155c2565b6001600160e01b031916036132fc575038808080808080613c19565b613c9991925060203d60201161333d5761332e81836109de565b9038613c55565b600080516020615dd6833981519152818009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152818009600080516020615dd683398151915290820980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd6833981519152908209600080516020615dd683398151915290840980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152818009600080516020615dd6833981519152908209600080516020615dd683398151915281800980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd68339815191529109600080516020615dd6833981519152818309600080516020615dd683398151915282840990600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd683398151915282840990600080516020615dd68339815191529109600080516020615dd683398151915290820991600080516020615dd6833981519152838009600080516020615dd683398151915290840991600080516020615dd6833981519152910990600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd6833981519152908209600080516020615dd683398151915290840980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281840980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915281840980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd68339815191529109600080516020615dd6833981519152818309600080516020615dd6833981519152908209600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd68339815191529109600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd68339815191529109600080516020615dd683398151915282840990600080516020615dd68339815191529109600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910991600080516020615dd6833981519152828209600080516020615dd6833981519152908309600080516020615dd6833981519152838309600080516020615dd683398151915290840990600080516020615dd68339815191529109600080516020615dd6833981519152838309600080516020615dd683398151915290840990600080516020615dd6833981519152910991600080516020615dd6833981519152910990600080516020615dd6833981519152910990600080516020615dd6833981519152910990565b604051906154e882610972565b6001825260208201602036823782511561078b575290565b908160209103126102dc5751610830816106c3565b909260a0926108309594600180861b03168352600060208401526040830152606082015281608082015201906107fa565b919261083095949160a094600180871b0380921685521660208401526040830152606082015281608082015201906107fa565b60809060208152602860208201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b60608201520190565b60009060033d116155cf57565b905060046000803e60005160e01c90565b600060443d1061083057604051600319913d83016004833e81516001600160401b03918282113d60248401111761563d57818401948551938411615645573d8501016020848701011161563d5750610830929101602001906109de565b949350505050565b50949350505050565b60809060208152603460208201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356040820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60608201520190565b8151604181036156d05750906156cc916020820151906060604084015193015160001a90615d2d565b9091565b6040036156ff5760208201516040909201516156cc926001600160ff1b03821692909160ff1c601b0190615d2d565b5050600090600290565b6005111561571357565b634e487b7160e01b600052602160045260246000fd5b61573281615709565b8061573a5750565b61574381615709565b600181036157905760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b61579981615709565b600281036157e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6157ef81615709565b600381036158475760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b80615853600492615709565b1461585a57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b156158b157565b60405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b1561590b57565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608490fd5b60405190615970826109a8565b604282526060366020840137565b80511561078b5760200190565b80516001101561078b5760210190565b90815181101561078b570160200190565b80156124a3576000190190565b156159c057565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b60405190615a1182610952565b602a825260403660208401376030615a288361597e565b536078615a348361598b565b536029905b60018211615a4c576108309150156159b9565b600f811690601082101561078b57615a7e916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848661599b565b90615a39565b600080516020615e16833981519152615a9b615963565b906030615aa78361597e565b536078615ab38361598b565b536041905b60018211615acb576108309150156159b9565b600f811690601082101561078b57615afd916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848661599b565b90615ab8565b92615b326108309593615b409360018060a01b031686526000602087015260a0604087015260a08601906111db565b9084820360608601526111db565b9160808184039101526107fa565b93906108309593615b3291615b409460018060a01b03809216885216602087015260a0604087015260a08601906111db565b9493919092813b615b94575b505050505050565b6000602094615bbb6040519788968795869463bc197c8160e01b9c8d875260048701615b4e565b03926001600160a01b03165af160009181615bf8575b50615bde576139656155c2565b6001600160e01b031916036139d057388080808080615b8c565b615c1291925060203d60201161333d5761332e81836109de565b9038615bd1565b307f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03161480615d04575b15615c74577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f000000000000000000000000000000000000000000000000000000000000000082527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815261299c816109c3565b507f00000000000000000000000000000000000000000000000000000000000000004614615c4b565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311615dc95760ff16601b81141580615dbe575b615db2579160809493916020936040519384528484015260408301526060820152600093849182805260015afa1561050f5781516001600160a01b03811615615dac579190565b50600190565b50505050600090600490565b50601c811415615d65565b5050505060009060039056fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47dc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be676097667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929ee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f319fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220bf6e5fec7eb630a30e250545b943f2b86552169784a2a72fe9e9545b6bc2fda864736f6c6343000819003300000000000000000000000000000000000000000000000000000000000000190000000000000000000000005d1fde3b1edd9e8bc24b96dd6d051def5039def8

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c8062fdd58e146102c657806301b7037c146102c157806301ffc9a7146102bc5780630504c814146102b75780630e89341c146102b25780631becf587146102ad578063248a9ca3146102a857806324a9d853146102a357806324d7806c1461029e5780632eb2c2d6146102995780632f2ff15d1461029457806335bb3e161461028f57806336568abe1461028a57806339dd7530146102855780634e1273f4146102805780635b0636221461027b5780636d70f7ae1461027657806372ce42751461027157806375b238fc1461026c5780637a997ab714610267578063852c6ae214610262578063856296f71461025d57806391d148541461025857806397e2b9af146102535780639e7212ad1461024e5780639ecc0436146102495780639ed06a3514610244578063a217fddf1461023f578063a22cb4651461023a578063b3f0067414610235578063b78a81ae14610230578063c49298ac1461022b578063c683630d14610226578063d260549714610221578063d42dc0c21461021c578063d547741f14610217578063d96ee75414610212578063dd34de671461020d578063e348da1314610208578063e52c525f14610203578063e985e9c5146101fe578063f242432a146101f95763f5b541a6146101f457600080fd5b61231b565b61222a565b6121ec565b6120f5565b612037565b61200b565b611f12565b611ece565b611ea2565b611dd7565b611d81565b611c08565b611b44565b611b1b565b611a23565b6119fd565b6119d9565b611983565b6117a7565b611783565b611714565b6116f0565b6116d7565b61168b565b611662565b611438565b61139a565b6112dc565b611220565b6111b0565b61111a565b61105c565b610f92565b610d5d565b610c84565b610c66565b610c37565b610aaa565b610833565b610790565b6106d5565b610344565b6102e1565b6001600160a01b038116036102dc57565b600080fd5b346102dc5760403660031901126102dc57602061030c600435610303816102cb565b60243590612344565b604051908152f35b9181601f840112156102dc578235916001600160401b0383116102dc576020808501948460051b0101116102dc57565b346102dc5760803660031901126102dc57600435610361816102cb565b602435906044356064356001600160401b0381116102dc57610387903690600401610314565b61039e839492946000526008602052604060002090565b54916103ab8315156123d8565b6103bf846000526007602052604060002090565b54926103cc841515612432565b6000936001916103de6001831b612494565b91865b88878b8d8285106105df57918b84918b60008361043b575b610436907fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c69460405194859460018060a01b031698339886612638565b0390a4005b86610597575061044b8333613344565b9283610514575b83602061046261048996846124c4565b60405163a9059cbb60e01b8152336004820152602481019190915295869081906044820190565b038160006001600160a01b0388165af191821561050f576104d7610436937fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c6976000916104e0575b506125b4565b945090506103f9565b610502915060203d602011610508575b6104fa81836109de565b810190612538565b8b6104d1565b503d6104f0565b61254d565b60055460405163a9059cbb60e01b81526001600160a01b03909116600482015260248101859052936020858060448101038160006001600160a01b0388165af194851561050f576104899561057191600091610578575b50612559565b9350610452565b610591915060203d602011610508576104fa81836109de565b8a61056b565b610436907fdbf154397cd87c66beac8fefd4ab247ce6ec6f5253f70f5a335a18ad583980c6946105da6105ca8a86612f76565b826105d3612525565b91336131a4565b6104d7565b6105f0856106119461060b946124d1565b35938491821515806106ba575b610606906124e1565b612d49565b88612f76565b9060009087825b8681106106705750505061062c8233612344565b908161063d575b50505084016103e1565b906106618894939b61065b886106566106689686612bc1565b612fb4565b90612fa7565b9a3361306e565b903880610633565b8d82821b8416610684575b50018890610618565b9361065b6106a9836106a46106b395986000526007602052604060002090565b610773565b90549060031b1c90565b928d61067b565b508983106105fd565b6001600160e01b03198116036102dc57565b346102dc5760203660031901126102dc5760206004356106f4816106c3565b63ffffffff60e01b16636cdb3d1360e11b811490811561074c575b8115610721575b506040519015158152f35b637965db0b60e01b81149150811561073b575b5038610716565b6301ffc9a760e01b14905038610734565b6303a24d0760e21b8114915061070f565b634e487b7160e01b600052603260045260246000fd5b805482101561078b5760005260206000200190600090565b61075d565b346102dc5760403660031901126102dc576024356004356000526007602052604060002080548210156102dc576020916107c991610773565b90546040519160031b1c8152f35b60005b8381106107ea5750506000910152565b81810151838201526020016107da565b90602091610813815180928185528580860191016107d7565b601f01601f1916010190565b9060206108309281815201906107fa565b90565b346102dc576020806003193601126102dc57604051906000906003546001918160011c9260018316928315610932575b60208510841461091e5784875260208701939081156108ff57506001146108a5575b6108a186610895818803826109de565b6040519182918261081f565b0390f35b6003600090815294509192917fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b5b8386106108ee5750505091019050610895826108a138610885565b8054858701529482019481016108d3565b60ff1916845250505090151560051b019050610895826108a138610885565b634e487b7160e01b86526022600452602486fd5b93607f1693610863565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b0382111761096d57604052565b61093c565b604081019081106001600160401b0382111761096d57604052565b602081019081106001600160401b0382111761096d57604052565b608081019081106001600160401b0382111761096d57604052565b60c081019081106001600160401b0382111761096d57604052565b90601f801991011681019081106001600160401b0382111761096d57604052565b60405190610a0c82610972565b565b60609060031901126102dc5760405190610a2782610952565b81600435610a34816102cb565b815260243560208201526040604435910152565b6001600160401b03811161096d57601f01601f191660200190565b81601f820112156102dc57803590610a7a82610a48565b92610a8860405194856109de565b828452602083830101116102dc57816000926020809301838601378301015290565b346102dc5760803660031901126102dc57610ac436610a0e565b6064356001600160401b0381116102dc57610ae3903690600401610a63565b906020810191825160648111610c1d5750610b0690610b01836128fb565b6133ed565b91610b3d610b39846001600160a01b03166000908152600080516020615e36833981519152602052604090205460ff1690565b1590565b610bf85780610bca7f886e6691f2040a5611e224ba17ceb93013694020d3f8d0a6b6961c821ec1d51b925193610bbd60408201958651610b7b6109ff565b91825260208201528251610bac906001600160a01b03166001600160a01b0316600090815260066020526040902090565b906020600191805184550151910155565b516001600160a01b031690565b905192516040805194855260208501919091526001600160a01b03918216949091169290819081015b0390a3005b604051632fcc186160e21b81526001600160a01b0384166004820152602490fd5b0390fd5b604051636e7eb25b60e11b81526004810191909152602490fd5b346102dc5760203660031901126102dc5760043560005260006020526020600160406000200154604051908152f35b346102dc5760003660031901126102dc576020600454604051908152f35b346102dc5760203660031901126102dc57602060ff610cda600435610ca8816102cb565b600080516020615e568339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b6001600160401b03811161096d5760051b60200190565b9080601f830112156102dc576020908235610d1781610ce6565b93610d2560405195866109de565b81855260208086019260051b8201019283116102dc57602001905b828210610d4e575050505090565b81358152908301908301610d40565b346102dc5760a03660031901126102dc57600435610d7a816102cb565b60243590610d87826102cb565b6001600160401b03906044358281116102dc57610da8903690600401610cfd565b916064358181116102dc57610dc1903690600401610cfd565b906084359081116102dc57610dda903690600401610a63565b6001600160a01b038381169491903386148015610f6f575b15610f0f57610e07610e02612870565b613402565b610e1483518551146137df565b8616610e218115156158aa565b60005b8351811015610ec95780610e3a60019286612693565b51610ec1610eb98b610e6e610e4f868c612693565b51948c610ea887610e8583610e6e866000526001602052604060002090565b9060018060a01b0316600052602052604060002090565b54610e9282821015615904565b0391610e6e846000526001602052604060002090565b556000526001602052604060002090565b918254612fa7565b905501610e24565b5093869194610f0d966040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180610f048a8a8361383c565b0390a433615b80565b005b60405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f74206044820152711bdddb995c881b9bdc88185c1c1c9bdd995960721b6064820152608490fd5b50600086815260026020908152604080832033845290915290205460ff16610df2565b346102dc5760403660031901126102dc57600435602435610fb2816102cb565b60009180835282602052610fce60016040852001543390613547565b808352602083815260408085206001600160a01b0385166000908152925290205460ff1615610ffb578280f35b808352602083815260408085206001600160a01b038516600090815292529020805460ff1916600117905533916001600160a01b0316907f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8480a438808280f35b346102dc5760203660031901126102dc57600435611079816102cb565b600080516020615e5683398151915260009081526020527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ed546110bd903390613547565b6001600160a01b038116156110d557610f0d90613615565b60405162461bcd60e51b815260206004820152601960248201527f41646d696e206164647265737320697320696e76616c696421000000000000006044820152606490fd5b346102dc5760403660031901126102dc57602435611137816102cb565b336001600160a01b0382160361115357610f0d90600435613755565b60405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608490fd5b346102dc5760403660031901126102dc57602061030c6004356111d2816102cb565b60243590612f76565b90815180825260208080930193019160005b8281106111fb575050505090565b8351855293810193928101926001016111ed565b9060206108309281815201906111db565b346102dc5760403660031901126102dc576004356001600160401b038082116102dc57366023830112156102dc57816004013561125c81610ce6565b9261126a60405194856109de565b8184526020916024602086019160051b830101913683116102dc57602401905b8282106112c357856024358681116102dc576108a1916112b16112b7923690600401610cfd565b906126a7565b6040519182918261120f565b83809183356112d1816102cb565b81520191019061128a565b346102dc5760203660031901126102dc576004356112f9816102cb565b600080516020615df683398151915260009081526020527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e97445461133d903390613547565b6001600160a01b0381161561135557610f0d906136c9565b60405162461bcd60e51b815260206004820152601d60248201527f57686974656c697374206164647265737320697320696e76616c6964210000006044820152606490fd5b346102dc5760203660031901126102dc57602060ff610cda6004356113be816102cb565b600080516020615e168339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b9060a06003198301126102dc57600435611409816102cb565b916024359160443591606435906001600160401b0382116102dc5761143091600401610314565b909160843590565b346102dc57611446366113f0565b916001959395926114596001841161275d565b6114846001611472896000526007602052604060002090565b5461147e811515612432565b1b612494565b9086888361149187612661565b9461149b88612661565b9860005b89898183106115f5575050505081156000146115b15750505061156f576040516323b872dd60e01b8152336004820152306024820152604481018290529160208360648160006001600160a01b038c165af190811561050f577f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a74786298966115336115429361043696600091611550575b506127ed565b61153b612525565b9133613861565b604051938493339785612845565b611569915060203d602011610508576104fa81836109de565b3861152d565b611542610436927f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a74786298966115ac846115a68c8c612f76565b3361306e565b611533565b846115a66115ef6115429661043699967f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989d966115ac961891612d49565b8c612f76565b9483959661160d846115ef946116369697989a6124d1565b35809281151580611659575b611622906124e1565b61162f82828116146127a8565b1898612d49565b6116408289612693565b528561164c828c612693565b5201918a93918c9361149f565b50898210611619565b346102dc5760003660031901126102dc576020604051600080516020615e568339815191528152f35b346102dc5760003660031901126102dc576020604051600080516020615df68339815191528152f35b60609060031901126102dc576004356116cc816102cb565b906024359060443590565b346102dc57602061030c6116ea366116b4565b91613a0a565b346102dc5760603660031901126102dc57602061030c604435602435600435612d49565b346102dc5760403660031901126102dc57602060ff610cda602435611738816102cb565b6004356000526000845260406000209060018060a01b0316600052602052604060002090565b60409060031901126102dc57600435611776816102cb565b90602435610830816102cb565b346102dc576117913661175e565b5050602061179d612870565b6040519015158152f35b346102dc576117b5366113f0565b9160019593956117c76001841161275d565b6117e06001611472896000526007602052604060002090565b9081906117ec85612661565b886117f687612661565b9260005b8c898981841061191c57505050505050906118159133613a40565b816118e4575050846118ad5760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b038a165af190811561050f57611542610436927f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca9660009161188e575b506128b0565b6118a7915060203d602011610508576104fa81836109de565b38611888565b6104367f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca936118df6105ca8888612f76565b611542565b936118df6105ca61060b610436947f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca98188b8b612d49565b9861195a92611931856115ef9488999d6124d1565b3580928115158061197a575b611946906124e1565b61195382828116146127a8565b189a612d49565b6119648286612693565b52896119708287612693565b5201908a916117fa565b508b821061193d565b346102dc5760203660031901126102dc576004356119a0816102cb565b60018060a01b03166000526006602052604060002060018154910154906108a16040519283928360209093929193604081019481520152565b346102dc5760603660031901126102dc57602061030c6119f836610a0e565b6128fb565b346102dc5760003660031901126102dc57602060405160008152f35b801515036102dc57565b346102dc5760403660031901126102dc57600435611a40816102cb565b602435611a4c81611a19565b6001600160a01b03821691338314611ac457336000908152600260205260409020611a8e918391611a7d9190610e6e565b9060ff801983541691151516179055565b604051901515815233907f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31908060208101610bf3565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b6064820152608490fd5b346102dc5760003660031901126102dc576005546040516001600160a01b039091168152602090f35b346102dc5760203660031901126102dc57336000908152600080516020615e3683398151915260205260409020546004359060ff1615611bf0576103e88111611bcf577f5ec5620e288c4be955ccb6cfb3d55431a8fed5c4c96ffacc4b9506360695f64e90600454611bb582600455565b60408051918252602082019290925290819081015b0390a1005b60405162746d8160e01b815260048101919091526103e86024820152604490fd5b604051632fcc186160e21b8152336004820152602490fd5b346102dc5760403660031901126102dc576004356024356001600160401b0381116102dc57611c3b903690600401610314565b90600190611c4b600184116129a2565b611c56838533613a0a565b91611c7684611c6f856000526007602052604060002090565b5414612a01565b611c94611c8d846000526008602052604060002090565b5415612a4d565b60009160005b858110611d0a57505050611caf811515612ae5565b611cc3826000526008602052604060002090565b557fb44d84d3289691f71497564b85d4233648d9dbae8cbdbb4329f301c3a0185894610436611cfc836000526007602052604060002090565b604051918291339683612b28565b80611d7b611d25611d1d86948a876124d1565b358097612fa7565b95611d4a611d446106a9856106a48c6000526007602052604060002090565b15612a99565b611d62836106a48a6000526007602052604060002090565b90919082549060031b91821b91600019901b1916179055565b01611c9a565b346102dc5760203660031901126102dc57602060ff610cda600435611da5816102cb565b600080516020615df68339815191526000526000845260406000209060018060a01b0316600052602052604060002090565b346102dc5760203660031901126102dc57600435611df4816102cb565b336000908152600080516020615e3683398151915260205260409020611e2090610b39905b5460ff1690565b611bf0576001600160a01b03811615611e9057600580546001600160a01b039283166001600160a01b0319821681179092556040805193909116835260208301919091527fa92ff4390fe6943f0b30e8fe715dde86f85ab79b2b2c640a10fc094cc4036cc8919081908101611bca565b6040516314e175f560e21b8152600490fd5b346102dc5760203660031901126102dc5760043560005260076020526020604060002054604051908152f35b346102dc5760403660031901126102dc57610f0d602435600435611ef1826102cb565b806000526000602052611f0d6001604060002001543390613547565b613755565b346102dc57611f20366116b4565b9091611f2b33613465565b6101008211611fcd57611f40600183116129a2565b7fab3760c3bd2bb38b5bcf54dc79802ed67338b4cf29f3054ded67ed24661e4177610436611f6f848685613a0a565b92611f8e611f87856000526007602052604060002090565b5415612b75565b611fb3611f9a86612661565b611fae866000526007602052604060002090565b612bd4565b6040519485526001600160a01b0316939081906020820190565b60405162461bcd60e51b8152602060048201526016602482015275746f6f206d616e79206f7574636f6d6520736c6f747360501b6044820152606490fd5b346102dc5760203660031901126102dc5760043560005260086020526020604060002054604051908152f35b346102dc5760203660031901126102dc57600435612054816102cb565b600080516020615e1683398151915260009081526020527fee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f31a054612098903390613547565b6001600160a01b038116156120b057610f0d90613718565b60405162461bcd60e51b815260206004820152601c60248201527f477561726469616e206164647265737320697320696e76616c696421000000006044820152606490fd5b346102dc5760603660031901126102dc57600435612112816102cb565b600080516020615e168339815191526000908152602052604435906024359061214f610b39611e1933600080516020615e36833981519152610e6e565b611bf057606482116121d357610bf37f886e6691f2040a5611e224ba17ceb93013694020d3f8d0a6b6961c821ec1d51b916121b061218b6109ff565b858152866020820152610bac8360018060a01b03166000526006602052604060002090565b6040805194855260208501959095526001600160a01b0316933393918291820190565b604051636e7eb25b60e11b815260048101839052602490fd5b346102dc57602060ff610cda6122013661175e565b6001600160a01b0391821660009081526002865260408082209290931681526020919091522090565b346102dc5760a03660031901126102dc57600435612247816102cb565b602435612253816102cb565b6084356001600160401b0381116102dc57612272903690600401610a63565b906001600160a01b0383163381149081156122f6575b501561229f57610f0d926064359160443591613b18565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201526808185c1c1c9bdd995960ba1b6064820152608490fd5b6000908152600260209081526040808320338452909152902060ff9150541638612288565b346102dc5760003660031901126102dc576020604051600080516020615e168339815191528152f35b6001600160a01b0381161561237f5761237b91600052600160205260406000209060018060a01b0316600052602052604060002090565b5490565b60405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201526a65726f206164647265737360a81b6064820152608490fd5b156123df57565b60405162461bcd60e51b815260206004820152602560248201527f726573756c7420666f7220636f6e646974696f6e206e6f74207265636569766560448201526419081e595d60da1b6064820152608490fd5b1561243957565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e206e6f74207072657061726564207965740000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b6000198101919082116124a357565b61247e565b90600080516020615dd68339815191529182039182116124a357565b919082039182116124a357565b919081101561078b5760051b0190565b156124e857565b60405162461bcd60e51b815260206004820152601560248201527419dbdd081a5b9d985b1a59081a5b99195e081cd95d605a1b6044820152606490fd5b604051906125328261098d565b60008252565b908160209103126102dc575161083081611a19565b6040513d6000823e3d90fd5b1561256057565b60405162461bcd60e51b815260206004820152602660248201527f636f756c64206e6f74207472616e736665722066656520746f2066656520726560448201526531b2b4bb32b960d11b6064820152608490fd5b156125bb57565b60405162461bcd60e51b815260206004820152602b60248201527f636f756c64206e6f74207472616e73666572207061796f757420746f206d657360448201526a39b0b3b29039b2b73232b960a91b6064820152608490fd5b81835290916001600160fb1b0383116102dc5760209260051b809284830137010190565b9160609361265792979695978452608060208501526080840191612614565b9460408201520152565b9061266b82610ce6565b61267860405191826109de565b8281528092612689601f1991610ce6565b0190602036910137565b805182101561078b5760209160051b010190565b9190918051835103612706576126bd8151612661565b9060005b81518110156126ff57806126ee6126dd610bbd60019486612693565b6126e78389612693565b5190612344565b6126f88286612693565b52016126c1565b5090925050565b60405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b6064820152608490fd5b1561276457565b606460405162461bcd60e51b815260206004820152602060248201527f676f7420656d707479206f722073696e676c65746f6e20706172746974696f6e6044820152fd5b156127af57565b60405162461bcd60e51b81526020600482015260166024820152751c185c9d1a5d1a5bdb881b9bdd08191a5cda9bda5b9d60521b6044820152606490fd5b156127f457565b60405162461bcd60e51b815260206004820152602360248201527f636f756c64206e6f74207265636569766520636f6c6c61746572616c20746f6b604482015262656e7360e81b6064820152608490fd5b9493929160409261286b9260018060a01b03168752606060208801526060870191612614565b930152565b3360009081527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e9743602052604090205460ff166128ab57600090565b600190565b156128b757565b606460405162461bcd60e51b815260206004820152602060248201527f636f756c64206e6f742073656e6420636f6c6c61746572616c20746f6b656e736044820152fd5b60018060a01b0381511690604060208201519101516040519160208301937fbb3cd1701df33b62b2ad3ef7e29ba87a2a234e3dac5539d66f07afdaeb164b3585526040840152606083015260808201526080815260a081018181106001600160401b0382111761096d57604052519020612973615c19565b9060405190602082019261190160f01b8452602283015260428201526042815261299c816109a8565b51902090565b156129a957565b60405162461bcd60e51b815260206004820152602a60248201527f74686572652073686f756c64206265206d6f7265207468616e206f6e65206f756044820152691d18dbdb59481cdb1bdd60b21b6064820152608490fd5b15612a0857565b60405162461bcd60e51b815260206004820152601f60248201527f636f6e646974696f6e206e6f74207072657061726564206f7220666f756e64006044820152606490fd5b15612a5457565b60405162461bcd60e51b815260206004820152601e60248201527f7061796f75742064656e6f6d696e61746f7220616c72656164792073657400006044820152606490fd5b15612aa057565b60405162461bcd60e51b815260206004820152601c60248201527f7061796f7574206e756d657261746f7220616c726561647920736574000000006044820152606490fd5b15612aec57565b60405162461bcd60e51b81526020600482015260146024820152737061796f757420697320616c6c207a65726f657360601b6044820152606490fd5b9060408201908252606060209260406020820152845480935201926000526020600020916000905b828210612b5e575050505090565b835485529384019360019384019390910190612b50565b15612b7c57565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e20616c72656164792070726570617265640000000000006044820152606490fd5b818102929181159184041417156124a357565b8151916001600160401b03831161096d5768010000000000000000831161096d578154838355808410612c3b575b50612c17602080920192600052602060002090565b9060005b848110612c29575050505050565b83518382015592810192600101612c1b565b60008360005284602060002092830192015b828110612c5b575050612c02565b818155600101612c4d565b634e487b7160e01b600052601260045260246000fd5b15612c8357565b60405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420706172656e7420636f6c6c656374696f6e204944000000006044820152606490fd5b3d15612cf3573d90612cd982610a48565b91612ce760405193846109de565b82523d6000602084013e565b606090565b15612cff57565b60405162461bcd60e51b815260206004820152600c60248201526b1958d859190819985a5b195960a21b6044820152606490fd5b91908260409103126102dc576020825192015190565b6040805160208101938452808201949094528352601f19939092909190612d716060826109de565b5190209260ff84901c1592600091841583808060015b15612dd4575b505050600093612dcf57600196600080516020615dd683398151915297889108958497600381808a80098a090888612dc482613ca0565b969996929899612d87565b612c66565b612dcf57600080516020615dd683398151915282800914612df6578085612d8d565b94969581612f6a575b8115612f50575b50612f40575b81612e2b575b505050600180911614612e225790565b600160fe1b1890565b6001600160fe1b0382169460fe9290921c15801594919391929091612dcf57600195612ed9612eff95600095612ecd8a998897600080516020615dd68339815191529182600381808b80098b090890612e8382613ca0565b9281612f35575b8115612f1c575b50612f09575b819282612ea5930914612c7c565b6040519586936020850198899094939260609260808301968352602083015260408201520152565b039081018352826109de565b519060065afa612ef0612eea612cc8565b91612cf8565b60208082518301019101612d33565b9290929138612e12565b612f15612ea5926124a8565b9150612e97565b905080612f2a575b38612e91565b508c80831614612f24565b838f16159150612e8a565b92612f4a906124a8565b92612e0c565b905080612f5e575b38612e06565b50600180851614612f58565b60018616159150612dff565b906040519060208201926bffffffffffffffffffffffff199060601b16835260348201526034815261299c81610952565b919082018092116124a357565b8115612dcf570490565b15612fc557565b60405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b6064820152608490fd5b1561301d57565b60405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b6064820152608490fd5b916001600160a01b03831691907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290613149906130ac851515612fbe565b6130b5846154db565b506130bf816154db565b50604051956130cd8761098d565b6000809752848752600160205261312f826130fd8360408b209060018060a01b0316600052602052604060002090565b5461310a82821015613016565b878a5260016020520391604089209060018060a01b0316600052602052604060002090565b556040805194855260208501919091523393918291820190565b0390a4565b1561315557565b60405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b6064820152608490fd5b9290916001600160a01b038416916131bd83151561314e565b6131c6846154db565b506131d0826154db565b508360005260016020526040946131fc81876000209060018060a01b0316600052602052604060002090565b8054908482018092116124a35755855185815260208101849052849060009033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290604090a43b613250575b5050505050565b613277926020926000875180968195829463f23a6e6160e01b9a8b85523360048601615515565b03925af160009181613313575b506132e257826132926155c2565b6308c379a0146132b4575b5162461bcd60e51b815280610c196004820161564e565b6132bc6155e0565b806132c7575061329d565b905162461bcd60e51b8152908190610c19906004830161081f565b6001600160e01b031916036132fc57503880808080613249565b5162461bcd60e51b815280610c1960048201615579565b61333691925060203d60201161333d575b61332e81836109de565b810190615500565b9038613284565b503d613324565b6001600160a01b0316600090815260066020526040908190208151918201916001600160401b0383118184101761096d576020926040526001825492838352015492839101526004549181151590816133e2575b506133b4575b506133ac9061083092612bc1565b612710900490565b60640391606483116124a3576133da6133d3610830946133ac94612bc1565b6064900490565b91509161339e565b905042111538613398565b610830916133fa916156a3565b919091615729565b1561340957565b60405162461bcd60e51b815260206004820152601760248201527f7472616e73666572206973206e6f7420616c6c6f7765640000000000000000006044820152606490fd5b90613461602092828151948592016107d7565b0190565b6001600160a01b0381166000908152600080516020615e36833981519152602052604090205460ff16156134965750565b610c199060489061352f906134b3906001600160a01b0316615a04565b6135216134be615a84565b6040519485937f416363657373436f6e74726f6c3a206163636f756e742000000000000000000060208601526134fe8151809260206037890191016107d7565b84017001034b99036b4b9b9b4b733903937b6329607d1b6037820152019061344e565b03601f1981018352826109de565b60405162461bcd60e51b81529182916004830161081f565b9081600052600060205260ff6135738260406000209060018060a01b0316600052602052604060002090565b54161561357e575050565b613590906001600160a01b0316615a04565b613598615963565b9160306135a48461597e565b5360786135b08461598b565b5360415b600181116135d357610c19604861352f85613521886134be88156159b9565b90600f811690601082101561078b57613610916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848761599b565b5360041c916159ac565b6135b4565b6001600160a01b03811660009081527f7d7ffb7a348e1c6a02869081a26547b49160dd3df72d1d75a570eb9b698292ec60205260408120600080516020615e568339815191529060ff905b54161561366c57505050565b808252602082815260408084206001600160a01b038616600090815292529020805460ff1916600117905533926001600160a01b0316917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4565b6001600160a01b03811660009081527f93a5fb3339da335a7ad6c66d91123a2908806997157dd0ec9b9dec56779e974360205260408120600080516020615df68339815191529060ff90613660565b6001600160a01b0381166000908152600080516020615e3683398151915260205260408120600080516020615e168339815191529060ff90613660565b6000818152602081815260408083206001600160a01b038616845290915281205490919060ff1661378557505050565b808252602082815260408084206001600160a01b038616600090815292529020805460ff1916905533926001600160a01b0316917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4565b156137e657565b60405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b6064820152608490fd5b9091613853610830936040845260408401906111db565b9160208184039101526111db565b90939091906001600160a01b03831661387b81151561314e565b61388886518451146137df565b60005b86518110156138d95761389e8185612693565b51906138c286610e6e6138b1848c612693565b516000526001602052604060002090565b9182549081018091116124a357600192550161388b565b5092949390948360006040517f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb339180613914898c8361383c565b0390a43b613923575b50505050565b61394b92602092600060405180968195829463bc197c8160e01b9a8b85523360048601615b03565b03925af1600091816139e9575b506139b8576139656155c2565b6308c379a014613989575b60405162461bcd60e51b815280610c196004820161564e565b6139916155e0565b8061399c5750613970565b60405162461bcd60e51b8152908190610c19906004830161081f565b6001600160e01b031916036139d0573880808061391d565b60405162461bcd60e51b815280610c1960048201615579565b613a0391925060203d60201161333d5761332e81836109de565b9038613958565b916040519160208301936bffffffffffffffffffffffff199060601b168452603483015260548201526054815261299c816109a8565b6001600160a01b03811693909190613a59851515612fbe565b613a6682518551146137df565b6000604051613a748161098d565b5260005b8251811015613adf5780613a8e60019285612693565b51613ad886610e6e613aa0858b612693565b51613ab983610e6e876000526001602052604060002090565b54613ac682821015613016565b03936000526001602052604060002090565b5501613a78565b509391507f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb61314960009460405191829133958361383c565b9291613b25610e02612870565b6001600160a01b0394828616613b3c8115156158aa565b613b45836154db565b50613b4f856154db565b50600093838552600160205260409786613b7d898b89209060018060a01b0316600052602052604060002090565b54613b8a82821015615904565b868852600160205203613bb1898b89209060018060a01b0316600052602052604060002090565b55613bca82610e6e876000526001602052604060002090565b9081548881018091116124a357909155885185815260208101889052839189169033907fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6290604090a43b613c22575b50505050505050565b613c49948460209489519788958694859363f23a6e6160e01b9c8d86523360048701615546565b03925af1909181613c7f575b50613c6357826132926155c2565b6001600160e01b031916036132fc575038808080808080613c19565b613c9991925060203d60201161333d5761332e81836109de565b9038613c55565b600080516020615dd6833981519152818009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152818009600080516020615dd683398151915290820980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd6833981519152908209600080516020615dd683398151915290840980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152818009600080516020615dd6833981519152908209600080516020615dd683398151915281800980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd68339815191529109600080516020615dd6833981519152818309600080516020615dd683398151915282840990600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd683398151915282840990600080516020615dd68339815191529109600080516020615dd683398151915290820991600080516020615dd6833981519152838009600080516020615dd683398151915290840991600080516020615dd6833981519152910990600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281800980600080516020615dd68339815191529109600080516020615dd6833981519152908209600080516020615dd683398151915290840980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915290830980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd683398151915282800980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd6833981519152908309600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915281840980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd6833981519152910990600080516020615dd6833981519152828009600080516020615dd6833981519152908309600080516020615dd683398151915281840980600080516020615dd6833981519152910980600080516020615dd68339815191529109600080516020615dd68339815191529109600080516020615dd683398151915291099081600080516020615dd683398151915291099081600080516020615dd68339815191529109600080516020615dd6833981519152818309600080516020615dd6833981519152908209600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd68339815191529109600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd68339815191529109600080516020615dd683398151915282840990600080516020615dd68339815191529109600080516020615dd6833981519152828409600080516020615dd683398151915290830990600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910980600080516020615dd6833981519152910991600080516020615dd6833981519152828209600080516020615dd6833981519152908309600080516020615dd6833981519152838309600080516020615dd683398151915290840990600080516020615dd68339815191529109600080516020615dd6833981519152838309600080516020615dd683398151915290840990600080516020615dd6833981519152910991600080516020615dd6833981519152910990600080516020615dd6833981519152910990600080516020615dd6833981519152910990565b604051906154e882610972565b6001825260208201602036823782511561078b575290565b908160209103126102dc5751610830816106c3565b909260a0926108309594600180861b03168352600060208401526040830152606082015281608082015201906107fa565b919261083095949160a094600180871b0380921685521660208401526040830152606082015281608082015201906107fa565b60809060208152602860208201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b60608201520190565b60009060033d116155cf57565b905060046000803e60005160e01c90565b600060443d1061083057604051600319913d83016004833e81516001600160401b03918282113d60248401111761563d57818401948551938411615645573d8501016020848701011161563d5750610830929101602001906109de565b949350505050565b50949350505050565b60809060208152603460208201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356040820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60608201520190565b8151604181036156d05750906156cc916020820151906060604084015193015160001a90615d2d565b9091565b6040036156ff5760208201516040909201516156cc926001600160ff1b03821692909160ff1c601b0190615d2d565b5050600090600290565b6005111561571357565b634e487b7160e01b600052602160045260246000fd5b61573281615709565b8061573a5750565b61574381615709565b600181036157905760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b61579981615709565b600281036157e65760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6157ef81615709565b600381036158475760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b80615853600492615709565b1461585a57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b156158b157565b60405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b6064820152608490fd5b1561590b57565b60405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b6064820152608490fd5b60405190615970826109a8565b604282526060366020840137565b80511561078b5760200190565b80516001101561078b5760210190565b90815181101561078b570160200190565b80156124a3576000190190565b156159c057565b606460405162461bcd60e51b815260206004820152602060248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152fd5b60405190615a1182610952565b602a825260403660208401376030615a288361597e565b536078615a348361598b565b536029905b60018211615a4c576108309150156159b9565b600f811690601082101561078b57615a7e916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848661599b565b90615a39565b600080516020615e16833981519152615a9b615963565b906030615aa78361597e565b536078615ab38361598b565b536041905b60018211615acb576108309150156159b9565b600f811690601082101561078b57615afd916f181899199a1a9b1b9c1cb0b131b232b360811b901a613606848661599b565b90615ab8565b92615b326108309593615b409360018060a01b031686526000602087015260a0604087015260a08601906111db565b9084820360608601526111db565b9160808184039101526107fa565b93906108309593615b3291615b409460018060a01b03809216885216602087015260a0604087015260a08601906111db565b9493919092813b615b94575b505050505050565b6000602094615bbb6040519788968795869463bc197c8160e01b9c8d875260048701615b4e565b03926001600160a01b03165af160009181615bf8575b50615bde576139656155c2565b6001600160e01b031916036139d057388080808080615b8c565b615c1291925060203d60201161333d5761332e81836109de565b9038615bd1565b307f00000000000000000000000049598aae06f8ed6d82cb9dfa503e731221fbf7e66001600160a01b03161480615d04575b15615c74577fbc79a4e9dbf53e0c2781f13369faddbbb04c27f8aa4eec10a6a84e9289f78c0490565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527fcbffdf1456998219bf0ed2dc81e6b6e867e4bc0c3d814453e012776e226d597260408201527f06c015bd22b4c69690933c1058878ebdfef31f9aaae40bbe86d8a09fe1b2972c60608201524660808201523060a082015260a0815261299c816109c3565b507f000000000000000000000000000000000000000000000000000000000000a4b14614615c4b565b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311615dc95760ff16601b81141580615dbe575b615db2579160809493916020936040519384528484015260408301526060820152600093849182805260015afa1561050f5781516001600160a01b03811615615dac579190565b50600190565b50505050600090600490565b50601c811415615d65565b5050505060009060039056fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47dc72ed553f2544c34465af23b847953efeb813428162d767f9ba5f4013be676097667070c54ef182b0f5858b034beac1b6f3089aa2d3188bb1e8929f4fa9b929ee57cd81e84075558e8fcc182a1f4393f91fc97f963a136e66b7f949a62f319fa49807205ce4d355092ef5a8a18f56e8913cf4a201fbe287825b095693c21775a2646970667358221220bf6e5fec7eb630a30e250545b943f2b86552169784a2a72fe9e9545b6bc2fda864736f6c63430008190033

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

00000000000000000000000000000000000000000000000000000000000000190000000000000000000000005d1fde3b1edd9e8bc24b96dd6d051def5039def8

-----Decoded View---------------
Arg [0] : configuredFeeBps (uint256): 25
Arg [1] : configuredFeeReceiver (address): 0x5d1Fde3b1edD9e8Bc24b96Dd6d051deF5039deF8

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000019
Arg [1] : 0000000000000000000000005d1fde3b1edd9e8bc24b96dd6d051def5039def8


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.