POL Price: $0.54917 (-13.72%)
 

Overview

POL Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 POL

POL Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Pop Merge595021192024-07-18 7:56:14145 days ago1721289374IN
0x035cc6b7...f98803F7e
0 POL0.0007251630.00001692
Start Merge595019922024-07-18 7:51:42145 days ago1721289102IN
0x035cc6b7...f98803F7e
0.011 POL0.0102711435.52431269
Pop Merge595018962024-07-18 7:48:18145 days ago1721288898IN
0x035cc6b7...f98803F7e
0 POL0.0007251630.00000019
Start Merge595017682024-07-18 7:43:46145 days ago1721288626IN
0x035cc6b7...f98803F7e
0.011 POL0.0062307530.65685007
Start Merge595017302024-07-18 7:42:26145 days ago1721288546IN
0x035cc6b7...f98803F7e
0.011 POL0.0069292331.04970009
Start Merge595017132024-07-18 7:41:50145 days ago1721288510IN
0x035cc6b7...f98803F7e
0.011 POL0.0069562530.00000009
Start Merge582773962024-06-17 16:48:18176 days ago1718642898IN
0x035cc6b7...f98803F7e
0.011 POL0.0075872334
Start Merge582773822024-06-17 16:47:48176 days ago1718642868IN
0x035cc6b7...f98803F7e
0.011 POL0.0075872334
Start Merge582773602024-06-17 16:47:02176 days ago1718642822IN
0x035cc6b7...f98803F7e
0.011 POL0.0075876434
Start Merge582772972024-06-17 16:44:48176 days ago1718642688IN
0x035cc6b7...f98803F7e
0.011 POL0.0078103935
Start Merge574258142024-05-26 21:12:13197 days ago1716757933IN
0x035cc6b7...f98803F7e
0.011 POL0.0029686530.00000003
Start Merge572386752024-05-21 23:09:03202 days ago1716332943IN
0x035cc6b7...f98803F7e
0.011 POL0.0066946230.00000003
Pop Merge572386572024-05-21 23:08:15202 days ago1716332895IN
0x035cc6b7...f98803F7e
0 POL0.0007251630.00000002
Start Merge572386282024-05-21 23:07:13202 days ago1716332833IN
0x035cc6b7...f98803F7e
0.011 POL0.0060976230.00000003
Start Merge572367582024-05-21 21:53:45202 days ago1716328425IN
0x035cc6b7...f98803F7e
0.011 POL0.0071416932
Start Merge571124652024-05-18 15:30:31206 days ago1716046231IN
0x035cc6b7...f98803F7e
0.011 POL0.0092513241.4571269
Pop Merge571124422024-05-18 15:29:41206 days ago1716046181IN
0x035cc6b7...f98803F7e
0 POL0.0008008533.13132992
Start Merge571123902024-05-18 15:27:51206 days ago1716046071IN
0x035cc6b7...f98803F7e
0.011 POL0.0097434743.66023226
Start Merge571123722024-05-18 15:27:13206 days ago1716046033IN
0x035cc6b7...f98803F7e
0.011 POL0.0097480844.16976102
Start Merge571123462024-05-18 15:25:45206 days ago1716045945IN
0x035cc6b7...f98803F7e
0.011 POL0.0086203442.41420911
Pop Merge571123132024-05-18 15:24:35206 days ago1716045875IN
0x035cc6b7...f98803F7e
0 POL0.0008233234.06116575
Pop Merge571122292024-05-18 15:21:37206 days ago1716045697IN
0x035cc6b7...f98803F7e
0 POL0.0008758936.23608937
Start Merge571122292024-05-18 15:21:37206 days ago1716045697IN
0x035cc6b7...f98803F7e
0.011 POL0.0104883646.99803476
Start Merge571121492024-05-18 15:18:14206 days ago1716045494IN
0x035cc6b7...f98803F7e
0.011 POL0.0094435142.31610593
Start Merge571119112024-05-18 15:09:16206 days ago1716044956IN
0x035cc6b7...f98803F7e
0.011 POL0.0095499442.79298999
View all transactions

Latest 25 internal transactions (View All)

Parent Transaction Hash Block From To
595019922024-07-18 7:51:42145 days ago1721289102
0x035cc6b7...f98803F7e
0.011 POL
595017682024-07-18 7:43:46145 days ago1721288626
0x035cc6b7...f98803F7e
0.011 POL
595017302024-07-18 7:42:26145 days ago1721288546
0x035cc6b7...f98803F7e
0.011 POL
595017132024-07-18 7:41:50145 days ago1721288510
0x035cc6b7...f98803F7e
0.011 POL
582773962024-06-17 16:48:18176 days ago1718642898
0x035cc6b7...f98803F7e
0.011 POL
582773822024-06-17 16:47:48176 days ago1718642868
0x035cc6b7...f98803F7e
0.011 POL
582773602024-06-17 16:47:02176 days ago1718642822
0x035cc6b7...f98803F7e
0.011 POL
582772972024-06-17 16:44:48176 days ago1718642688
0x035cc6b7...f98803F7e
0.011 POL
574258142024-05-26 21:12:13197 days ago1716757933
0x035cc6b7...f98803F7e
0.011 POL
572386752024-05-21 23:09:03202 days ago1716332943
0x035cc6b7...f98803F7e
0.011 POL
572386282024-05-21 23:07:13202 days ago1716332833
0x035cc6b7...f98803F7e
0.011 POL
572367582024-05-21 21:53:45202 days ago1716328425
0x035cc6b7...f98803F7e
0.011 POL
571124652024-05-18 15:30:31206 days ago1716046231
0x035cc6b7...f98803F7e
0.011 POL
571123902024-05-18 15:27:51206 days ago1716046071
0x035cc6b7...f98803F7e
0.011 POL
571123722024-05-18 15:27:13206 days ago1716046033
0x035cc6b7...f98803F7e
0.011 POL
571123462024-05-18 15:25:45206 days ago1716045945
0x035cc6b7...f98803F7e
0.011 POL
571122292024-05-18 15:21:37206 days ago1716045697
0x035cc6b7...f98803F7e
0.011 POL
571121492024-05-18 15:18:14206 days ago1716045494
0x035cc6b7...f98803F7e
0.011 POL
571119112024-05-18 15:09:16206 days ago1716044956
0x035cc6b7...f98803F7e
0.011 POL
571118192024-05-18 15:06:00206 days ago1716044760
0x035cc6b7...f98803F7e
0.011 POL
571117922024-05-18 15:05:04206 days ago1716044704
0x035cc6b7...f98803F7e
0.011 POL
571117872024-05-18 15:04:44206 days ago1716044684
0x035cc6b7...f98803F7e
0.011 POL
571117222024-05-18 15:02:02206 days ago1716044522
0x035cc6b7...f98803F7e
0.011 POL
571115072024-05-18 14:53:52206 days ago1716044032
0x035cc6b7...f98803F7e
0.011 POL
570255662024-05-16 7:08:00208 days ago1715843280
0x035cc6b7...f98803F7e
0.011 POL
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GHGameplay

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity)

/**
 *Submitted for verification at polygonscan.com on 2022-12-21
*/

// SPDX-License-Identifier: MIT
// File: @openzeppelin/contracts/utils/Context.sol


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

// File: @openzeppelin/contracts/security/Pausable.sol


// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;


/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// File: GHGameplay.sol


pragma solidity ^0.8.9;


pragma solidity ^0.8.0;

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

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

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

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

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

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

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

                // Move the last value to the index where the value to delete is
                set._values[toDeleteIndex] = lastValue;
                // Update the index for the moved value
                set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex
            }

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

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

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

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

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

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

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }

    // UintSet

    struct UintSet {
        Set _inner;
    }

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

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

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

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

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

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

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

        return result;
    }
}

// File: @openzeppelin/contracts/utils/math/SafeMath.sol


// OpenZeppelin Contracts (last updated v4.6.0) (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 subtraction 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;
        }
    }
}

// File: @openzeppelin/contracts/utils/Counters.sol


// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

// File: @openzeppelin/contracts/access/IAccessControl.sol


// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC20/IERC20.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.0;


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

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

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

// File: @openzeppelin/contracts/utils/math/Math.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/utils/Strings.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;


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

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

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

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

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

// File: @openzeppelin/contracts/utils/Context.sol


// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)



// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.0;




/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20, IERC20Metadata {
    mapping(address => uint256) private _balances;

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

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

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

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

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

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

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

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

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

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

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

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

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

        return true;
    }

    /**
     * @dev Moves `amount` of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `from` must have a balance of at least `amount`.
     */
    function _transfer(
        address from,
        address to,
        uint256 amount
    ) internal virtual {
        require(from != address(0), "ERC20: transfer from the zero address");
        require(to != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(from, to, amount);

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

        emit Transfer(from, to, amount);

        _afterTokenTransfer(from, to, amount);
    }

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

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

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

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

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

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

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

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

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

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(
        address owner,
        address spender,
        uint256 amount
    ) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

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

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

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

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

// File: @openzeppelin/contracts/utils/Address.sol


// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol


// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)

pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol


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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol


// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;


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

// File: @openzeppelin/contracts/access/AccessControl.sol


// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;





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

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

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

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

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

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

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

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

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

        _revokeRole(role, account);
    }

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

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

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

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

// File: @openzeppelin/contracts/token/ERC721/IERC721.sol


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;


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

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

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

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

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

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

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

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

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

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

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

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

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol


// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;


/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

// File: @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol


// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)

pragma solidity ^0.8.0;


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

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

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

// File: @openzeppelin/contracts/token/ERC721/ERC721.sol


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;








/**
 * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
 * the Metadata extension, but not including the Enumerable extension, which is available separately as
 * {ERC721Enumerable}.
 */
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
    using Address for address;
    using Strings for uint256;

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

    // Mapping owner address to token count
    mapping(address => uint256) private _balances;

    // Mapping from token ID to approved address
    mapping(uint256 => address) private _tokenApprovals;

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

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

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

    /**
     * @dev See {IERC721-balanceOf}.
     */
    function balanceOf(address owner) public view virtual override returns (uint256) {
        require(owner != address(0), "ERC721: address zero is not a valid owner");
        return _balances[owner];
    }

    /**
     * @dev See {IERC721-ownerOf}.
     */
    function ownerOf(uint256 tokenId) public view virtual override returns (address) {
        address owner = _ownerOf(tokenId);
        require(owner != address(0), "ERC721: invalid token ID");
        return owner;
    }

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

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

    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        _requireMinted(tokenId);

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

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

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

        require(
            _msgSender() == owner || isApprovedForAll(owner, _msgSender()),
            "ERC721: approve caller is not token owner or approved for all"
        );

        _approve(to, tokenId);
    }

    /**
     * @dev See {IERC721-getApproved}.
     */
    function getApproved(uint256 tokenId) public view virtual override returns (address) {
        _requireMinted(tokenId);

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

    /**
     * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist
     */
    function _ownerOf(uint256 tokenId) internal view virtual returns (address) {
        return _owners[tokenId];
    }

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

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

    /**
     * @dev Safely mints `tokenId` and transfers it to `to`.
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function _safeMint(address to, uint256 tokenId) internal virtual {
        _safeMint(to, tokenId, "");
    }

    /**
     * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
     * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
     */
    function _safeMint(
        address to,
        uint256 tokenId,
        bytes memory data
    ) internal virtual {
        _mint(to, tokenId);
        require(
            _checkOnERC721Received(address(0), to, tokenId, data),
            "ERC721: transfer to non ERC721Receiver implementer"
        );
    }

    /**
     * @dev Mints `tokenId` and transfers it to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
     *
     * Requirements:
     *
     * - `tokenId` must not exist.
     * - `to` cannot be the zero address.
     *
     * Emits a {Transfer} event.
     */
    function _mint(address to, uint256 tokenId) internal virtual {
        require(to != address(0), "ERC721: mint to the zero address");
        require(!_exists(tokenId), "ERC721: token already minted");

        _beforeTokenTransfer(address(0), to, tokenId, 1);

        // Check that tokenId was not minted by `_beforeTokenTransfer` hook
        require(!_exists(tokenId), "ERC721: token already minted");

        unchecked {
            // Will not overflow unless all 2**256 token ids are minted to the same owner.
            // Given that tokens are minted one by one, it is impossible in practice that
            // this ever happens. Might change if we allow batch minting.
            // The ERC fails to describe this case.
            _balances[to] += 1;
        }

        _owners[tokenId] = to;

        emit Transfer(address(0), to, tokenId);

        _afterTokenTransfer(address(0), to, tokenId, 1);
    }

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     * This is an internal function that does not check if the sender is authorized to operate on the token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

        _beforeTokenTransfer(owner, address(0), tokenId, 1);

        // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook
        owner = ERC721.ownerOf(tokenId);

        // Clear approvals
        delete _tokenApprovals[tokenId];

        unchecked {
            // Cannot overflow, as that would require more tokens to be burned/transferred
            // out than the owner initially received through minting and transferring in.
            _balances[owner] -= 1;
        }
        delete _owners[tokenId];

        emit Transfer(owner, address(0), tokenId);

        _afterTokenTransfer(owner, address(0), tokenId, 1);
    }

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

        _beforeTokenTransfer(from, to, tokenId, 1);

        // Check that tokenId was not transferred by `_beforeTokenTransfer` hook
        require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");

        // Clear approvals from the previous owner
        delete _tokenApprovals[tokenId];

        unchecked {
            // `_balances[from]` cannot overflow for the same reason as described in `_burn`:
            // `from`'s balance is the number of token held, which is at least one before the current
            // transfer.
            // `_balances[to]` could overflow in the conditions described in `_mint`. That would require
            // all 2**256 token ids to be minted, which in practice is impossible.
            _balances[from] -= 1;
            _balances[to] += 1;
        }
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

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

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

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     */
    function _setApprovalForAll(
        address owner,
        address operator,
        bool approved
    ) internal virtual {
        require(owner != operator, "ERC721: approve to caller");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Reverts if the `tokenId` has not been minted yet.
     */
    function _requireMinted(uint256 tokenId) internal view virtual {
        require(_exists(tokenId), "ERC721: invalid token ID");
    }

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

    /**
     * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.
     * - When `from` is zero, the tokens will be minted for `to`.
     * - When `to` is zero, ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256, /* firstTokenId */
        uint256 batchSize
    ) internal virtual {
        if (batchSize > 1) {
            if (from != address(0)) {
                _balances[from] -= batchSize;
            }
            if (to != address(0)) {
                _balances[to] += batchSize;
            }
        }
    }

    /**
     * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is
     * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.
     *
     * Calling conditions:
     *
     * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.
     * - When `from` is zero, the tokens were minted for `to`.
     * - When `to` is zero, ``from``'s tokens were burned.
     * - `from` and `to` are never both zero.
     * - `batchSize` is non-zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual {}
}

// File: @openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol


// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;



/**
 * @dev This implements an optional extension of {ERC721} defined in the EIP that adds
 * enumerability of all the token ids in the contract as well as all token ids owned by each
 * account.
 */
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
    // Mapping from owner to list of owned token IDs
    mapping(address => mapping(uint256 => uint256)) private _ownedTokens;

    // Mapping from token ID to index of the owner tokens list
    mapping(uint256 => uint256) private _ownedTokensIndex;

    // Array with all token ids, used for enumeration
    uint256[] private _allTokens;

    // Mapping from token id to position in the allTokens array
    mapping(uint256 => uint256) private _allTokensIndex;

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

    /**
     * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
        return _ownedTokens[owner][index];
    }

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

    /**
     * @dev See {IERC721Enumerable-tokenByIndex}.
     */
    function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
        require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
        return _allTokens[index];
    }

    /**
     * @dev See {ERC721-_beforeTokenTransfer}.
     */
    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 firstTokenId,
        uint256 batchSize
    ) internal virtual override {
        super._beforeTokenTransfer(from, to, firstTokenId, batchSize);

        if (batchSize > 1) {
            // Will only trigger during construction. Batch transferring (minting) is not available afterwards.
            revert("ERC721Enumerable: consecutive transfers not supported");
        }

        uint256 tokenId = firstTokenId;

        if (from == address(0)) {
            _addTokenToAllTokensEnumeration(tokenId);
        } else if (from != to) {
            _removeTokenFromOwnerEnumeration(from, tokenId);
        }
        if (to == address(0)) {
            _removeTokenFromAllTokensEnumeration(tokenId);
        } else if (to != from) {
            _addTokenToOwnerEnumeration(to, tokenId);
        }
    }

    /**
     * @dev Private function to add a token to this extension's ownership-tracking data structures.
     * @param to address representing the new owner of the given token ID
     * @param tokenId uint256 ID of the token to be added to the tokens list of the given address
     */
    function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
        uint256 length = ERC721.balanceOf(to);
        _ownedTokens[to][length] = tokenId;
        _ownedTokensIndex[tokenId] = length;
    }

    /**
     * @dev Private function to add a token to this extension's token tracking data structures.
     * @param tokenId uint256 ID of the token to be added to the tokens list
     */
    function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
        _allTokensIndex[tokenId] = _allTokens.length;
        _allTokens.push(tokenId);
    }

    /**
     * @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
     * while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
     * gas optimizations e.g. when performing a transfer operation (avoiding double writes).
     * This has O(1) time complexity, but alters the order of the _ownedTokens array.
     * @param from address representing the previous owner of the given token ID
     * @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
     */
    function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
        // To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
        uint256 tokenIndex = _ownedTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary
        if (tokenIndex != lastTokenIndex) {
            uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];

            _ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
            _ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
        }

        // This also deletes the contents at the last position of the array
        delete _ownedTokensIndex[tokenId];
        delete _ownedTokens[from][lastTokenIndex];
    }

    /**
     * @dev Private function to remove a token from this extension's token tracking data structures.
     * This has O(1) time complexity, but alters the order of the _allTokens array.
     * @param tokenId uint256 ID of the token to be removed from the tokens list
     */
    function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
        // To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
        // then delete the last slot (swap and pop).

        uint256 lastTokenIndex = _allTokens.length - 1;
        uint256 tokenIndex = _allTokensIndex[tokenId];

        // When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
        // rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
        // an 'if' statement (like in _removeTokenFromOwnerEnumeration)
        uint256 lastTokenId = _allTokens[lastTokenIndex];

        _allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
        _allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index

        // This also deletes the contents at the last position of the array
        delete _allTokensIndex[tokenId];
        _allTokens.pop();
    }
}

// File: GHItem_flatter.sol


pragma solidity ^0.8.17;









/// @custom:security-contact [email protected]
contract GotchiHeroItemPack is ERC721, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;
    using EnumerableSet for EnumerableSet.UintSet;
    using Counters for Counters.Counter;
    using SafeMath for uint256;
    using Strings for uint256;

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

    Counters.Counter private packIds;

    GotchiHeroItem public gotchi;
    IERC20 public currency;

    uint256 public packPrice;
    string public packName;
    string public packDesc;
    uint256 public sterPackPrice;
    string public sterPackName;
    string public sterPackDesc;
    EnumerableSet.AddressSet private _admins;
    mapping(address => uint256) private adminShares;
    uint256 private totalShares = 0;
    EnumerableSet.AddressSet private _payers;
    mapping(address => uint256) public whiteList;

    mapping(uint256 => uint256[]) private tokenIdsOfPack;
    mapping(bool => EnumerableSet.UintSet) private tokenIdsOfType;
    mapping(address => uint256[]) private tokenIdsOfOwner;

    string private baseURI;
    mapping(uint256 => string[]) private packData; 

    // initialize contract while deployment with contract's collection name and token
    constructor(
        address gotchi_,
        IERC20 ghst_,
        address[] memory admins_,
        uint256[] memory shares_,
        address minter_
    ) ERC721("GOTCHI HEROES PACK", "GHP") {
        require(admins_.length == shares_.length, "shares length must match admin length");
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(MINTER_ROLE,minter_);
        gotchi = GotchiHeroItem(gotchi_);

        setPackPrice(5*(10**18), 15*(10**18));
        currency = ghst_;
        
        for(uint i=0 ; i<admins_.length ; i++) {
            _admins.add(admins_[i]);
            adminShares[admins_[i]] = shares_[i];
            totalShares += shares_[i];
        }

        whiteList[msg.sender] = whiteList[msg.sender].add(100);

        packName = "Gotchi Heroes Pack";
        packDesc = "Each Gotchi Heroes Pack contains 5 items randomly selected from the Gotchi Heroes item pool. Each pack is guaranteed to contain at least one item that is Rare or better.";
        sterPackName = "Gotchi Heroes Starter Pack";
        sterPackDesc = "Each Gotchi Heroes Starter Pack contains 10 items randomly selected from the Gotchi Heroes item pool and a play token to gain access to the game. Each pack is guaranteed to contain at least one Weapon, one Skill and one Area.";
    }

    function setCurrency(IERC20 currency_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        currency = currency_;
    }

    function setGotchi(address gotchi_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        gotchi = GotchiHeroItem(gotchi_);
    }

    function addAdmin(address admin_, uint256 shares_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if(!_admins.contains(admin_)){
            _admins.add(admin_);
        } else {
            totalShares -= adminShares[admin_];
        }
        
        adminShares[admin_] = shares_;
        totalShares += shares_;
    }

    function removeAdmin(address admin_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _admins.remove(admin_);
        totalShares -= adminShares[admin_];
        delete adminShares[admin_];
    }

    //used for free packs
    function addWhiteList(address account_, uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        whiteList[account_] = whiteList[account_].add(amount_);
    }

    //used for free packs
    function removeWhiteList(address account_, uint256 amount_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        whiteList[account_] = whiteList[account_].sub(amount_);
    }

    //function to get whitelist count for user
    function getWhiteList(address account_) external view returns(uint256) {
        return whiteList[account_];
    }

    /**
     * @notice set the common pack and the starter pack prices.
     * @param packPrice_ common pack price
     * @param starterPack_ starter pack price
     */
    function setPackPrice(uint256 packPrice_, uint256 starterPack_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        packPrice = packPrice_;
        sterPackPrice = starterPack_;
    }

    function setMeta(string calldata packName_, string calldata packDesc_, string calldata strPackName_, string calldata strPackDesc_) external onlyRole("DEFAULT_ADMIN_ROLE") {
        packName = packName_;
        packDesc = packDesc_;
        sterPackName = strPackName_;
        sterPackDesc = strPackDesc_;
    }

    /**
     * @notice pay ghero token to mint new nfts and register new NFT's count
     * @param count_ new NFT's count
     * @param isStarterPack_ if it is true, it is the starter pack, has 10 NFTs
     */
    function mint(uint count_, bool isStarterPack_) external{

        require(canMint(isStarterPack_, count_), "That many packs of this type are not available");

        uint256 _payableCount = 0;
        
        if(whiteList[msg.sender]>count_){
            whiteList[msg.sender] = whiteList[msg.sender].sub(count_);
        } else if(whiteList[msg.sender]>0){
            _payableCount = count_ - whiteList[msg.sender];
            whiteList[msg.sender] = whiteList[msg.sender].sub(count_);
        } else {
            _payableCount = count_;
        }

        uint256 _price = packPrice * _payableCount;
        if(isStarterPack_) {
            _price = sterPackPrice * _payableCount;
        }

        uint256 allowance = currency.allowance(msg.sender,address(this));
        require(
            allowance >= _price,
            string(
                abi.encodePacked(
                    "Not enough allowance:",
                    Strings.toString(allowance),
                    "-",
                    Strings.toString(_price)
                )
            )
        );

        if(_price > 0) {
            uint256 _adminReward = 0;
            for(uint i=0 ; i<_admins.length(); i++) {
                unchecked {
                    uint256 payment = (_price * adminShares[_admins.at(i)])/totalShares;
                    currency.transferFrom(msg.sender, _admins.at(i), payment);
                    _adminReward += payment;
                }
            }
            uint256 leftover = _price - _adminReward;
            if(leftover > 0){
                currency.transferFrom(msg.sender, _admins.at(0), leftover);
            }
        }
        
        uint256[] memory _ids = new uint256[](count_);
        for(uint i=0 ; i<count_ ; i++) {
            uint256 _tokenId = tokenIdsOfType[isStarterPack_].at(i);
            _ids[i] = _tokenId;
            if(isStarterPack_){
                packData[_tokenId] = [sterPackName,sterPackDesc,Strings.toString(tokenIdsOfPack[_tokenId].length),Strings.toString(sterPackPrice)];
            } else {
                packData[_tokenId] = [packName,packDesc,Strings.toString(tokenIdsOfPack[_tokenId].length),Strings.toString(packPrice)];
            }
            _mint(msg.sender, _tokenId);
            //tokenIdsOfOwner[msg.sender].push(_tokenId);
        }

        for(uint i=0 ; i<_ids.length ; i++) {
            tokenIdsOfType[isStarterPack_].remove(_ids[i]);
        }

    }

    function canMint(bool isStarterPack_, uint count_) public view returns (bool) {

        return tokenIdsOfType[isStarterPack_].length() >= count_;
        
    }

    //get saved pack metadata
    function getDataOfPack(uint256 id_) public view returns (string[] memory) {
        return packData[id_];
    }

    //setTokenURI but also pass data
    function issueTokenData(
        bool isStarter_,
        string[][] calldata data_,
        string[][] calldata itemTypes_
    ) external onlyRole(MINTER_ROLE) {
        // check if thic function caller is not an zero address account
        uint256 itemID = gotchi.newId();

        for(uint pId=0 ; pId<data_.length ; pId++){
        
            uint256 _tokenId = packIds.current();

            // set token URI (bind token id with the passed in token URI)
            tokenIdsOfType[isStarter_].add(_tokenId);
            uint _unit = data_[pId].length;

            uint256[] memory _ids = new uint256[](_unit);
            for(uint i=0 ; i<_unit ; i++) {
                require(
                    itemTypes_[pId].length == data_[pId].length,
                    "Item/Types Mismatch"
                );
                gotchi.setTokenData(itemTypes_[pId][i], data_[pId][i]);
                _ids[i] = itemID;
                itemID += 1;
            }
            tokenIdsOfPack[_tokenId] = _ids;
            tokenIdsOfOwner[address(0)].push(_tokenId);
            packIds.increment();
        }

    }

    function getIdsByType(bool type_) external view returns (uint256[] memory) {
        uint _length = tokenIdsOfType[type_].length();
        uint256[] memory _result = new uint256[](_length);
        for(uint i=0 ; i<_length; i++) {
            _result[i] = tokenIdsOfType[type_].at(i);
        }
        return _result;
    }

    function availableCounts() public view returns(uint256, uint256) {
        return (tokenIdsOfType[true].length(), tokenIdsOfType[false].length());
    }

    /**
     * @notice burn pack and then transfer gochi tokens to pack's owner.
     * @param packId_ Pack NFT id to burn
     */
    function openPack(uint256 packId_) external {
        require(ownerOf(packId_) == msg.sender, "This pack is not yours");
        uint256[] memory _tokenIds = getIdsOfPack(packId_);

        for(uint i=0 ; i<_tokenIds.length ; i++) {
            gotchi.mint(msg.sender, _tokenIds[i]);
        }

        delete tokenIdsOfPack[packId_];
        delete packData[packId_];
        _burn(packId_);
    }

    function burn(uint256 id_) external {
        require(ERC721.ownerOf(id_) == msg.sender, "ERC721: transfer of token that is not own"); // internal owner

        delete tokenIdsOfPack[id_];
        delete packData[id_];
        _burn(id_);
    }

    /**
     * @notice get NFT id array that current pack includes
     * @param id_ pack id
     */
    function getIdsOfPack(uint256 id_) public view returns(uint256[] memory) {

        uint256 _tokenCount = tokenIdsOfPack[id_].length;
        uint256[] memory _ids = new uint256[](_tokenCount);

        for(uint256 i=0 ; i<_tokenCount ; i++) {
            _ids[i] = tokenIdsOfPack[id_][i];
        }

        return _ids;
    }

    /**
     * @notice check if the token already exists
     * @param id_ token id for checking the exist
     */
    function packExists(uint256 id_) public view returns(bool) {
        return _exists(id_);
    }

    /**
     * @notice get next token id
     */
    function newId() public view returns(uint256) {
        return packIds.current();
    }
    
    /**
     * @notice get all token id array of account
     * @param account_ holder address
     */
    function holderTokenIds(address account_) public view returns(uint256[] memory) {
        return tokenIdsOfOwner[account_];
    }

    //used to pay admins on pack purchase
    function admins() external view returns(address[] memory, uint256[] memory) {
        address[] memory admins_ = new address[](_admins.length());
        uint256[] memory _shares = new uint256[](_admins.length());
        for(uint i=0 ; i<_admins.length() ; i++) {
            admins_[i] = _admins.at(i);
            _shares[i] = adminShares[admins_[i]];
        }
        return (admins_, _shares);
    }

    /*function destroy(address apocalypse) public onlyRole(DEFAULT_ADMIN_ROLE){
		selfdestruct(payable(apocalypse));
    }*/

    // The following functions are overrides required by Solidity.
    function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
        internal
        override(ERC721)
    {
        super._beforeTokenTransfer(from, to, tokenId, batchSize);

        if(from != address(0) && tokenIdsOfOwner[from].length>1){
            uint256 _current = 0;
            for(uint256 i=0; i<tokenIdsOfOwner[from].length-1; i++){
                if(tokenIdsOfOwner[from][i]==tokenId){
                    _current += 1;
                }
                tokenIdsOfOwner[from][i] = tokenIdsOfOwner[from][_current];
                _current += 1;
            }
            tokenIdsOfOwner[from].pop();
        } else if(from != address(0) && tokenIdsOfOwner[from].length==1){
            tokenIdsOfOwner[from].pop();
        }
        
        if(to != address(0)){
            tokenIdsOfOwner[to].push(tokenId);
        }
    }

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

contract GotchiHeroItemLender is AccessControl {
    bytes32 public constant LENDER_ROLE = keccak256("LENDER_ROLE");

    GotchiHeroItem GHItem;

    mapping(uint256 => address) private loanOwner;
    mapping(uint256 => address) private loanLender;

    constructor(
        address items_
    ) {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        GHItem = GotchiHeroItem(items_);
    }

    //transfer ownership to new owner but keep previous owner to pop back to
    function lend (
        uint256 tokenId_,
        address to_
     ) external onlyRole(LENDER_ROLE) {
        address _owner = GHItem.ownerOf(tokenId_);
        require(
            loanLender[tokenId_] == msg.sender || _owner == tx.origin,
            "You don't have permission to loan item on another's behalf"
        );
        require(
            loanOwner[tokenId_] == address(0),
            "Item already loaned"
        );
        GHItem.lendTransfer(_owner, to_, tokenId_);
        loanOwner[tokenId_] = _owner;
    }

    //grants approval for lender to lend item
    function approveLender (uint256 tokenId_, address lender_) external {
        require(
            GHItem.ownerOf(tokenId_) == tx.origin,
            "You do not own this token"
        );
        loanLender[tokenId_] = lender_;
    }

    //returns loaned token to original owner
    function returnLoan (uint256 tokenId_) external {
        address _owner = GHItem.ownerOf(tokenId_);
        require(
            loanLender[tokenId_] == msg.sender || _owner == tx.origin || loanOwner[tokenId_] == tx.origin,
            "You don't have permission to loan item on another's behalf"
        );
        require(
            loanOwner[tokenId_] != address(0),
            "Item not loaned"
        );
        GHItem.lendTransfer(_owner, loanOwner[tokenId_], tokenId_);
        delete loanOwner[tokenId_];
        delete loanLender[tokenId_];
    }

    //Gets currently approved lender of item
    function getLender (uint256 tokenId_) external view returns(address) {
        return loanLender[tokenId_];
    }

    //Gets original loaner of lent item
    function getLoanOwner (uint256 tokenId_) external view returns(address) {
        require(
            loanOwner[tokenId_] != address(0),
            "Item is currently not loaned!"
        );
        return loanOwner[tokenId_];
    }

    function isLoaned (uint256 tokenId_) external view returns(bool) {
        return loanOwner[tokenId_] != address(0);
    }

    function setItemAddress (address item_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        GHItem = GotchiHeroItem(item_);
    }

    function destroy(address apocalypse) public onlyRole(DEFAULT_ADMIN_ROLE){
		selfdestruct(payable(apocalypse));
    }
}

contract GotchiHeroItemData is AccessControl {
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant GAME_ROLE = keccak256("GAME_ROLE");

    mapping(uint256 => string) private itemData;

    mapping(uint256 => address) private approval;

    constructor() {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    //approves game to update data

    //retrieves token data
    function getData (
        uint256 tokenId_
    ) external view returns (string memory){
        bytes memory _test = bytes(itemData[tokenId_]);
        require(
            _test.length > 0,
            "Token Not Set"
        );

        return itemData[tokenId_];
    }

    //Change data value of item, minter only
    function setData(
        uint256 tokenId_,
        string calldata data_
    ) external allowedAccess {
        itemData[tokenId_] = data_;
    }

    /*function destroy(address apocalypse) public onlyRole(DEFAULT_ADMIN_ROLE){
		selfdestruct(payable(apocalypse));
    }*/

    modifier allowedAccess() {
        if (!hasRole(MINTER_ROLE,msg.sender) && !hasRole(GAME_ROLE,msg.sender)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(uint160(msg.sender), 20),
                        " does not have permission to edit"
                    )
                )
            );
        }
        _;
    }
}

/// @custom:security-contact [email protected]
contract GotchiHeroItem is ERC721, ERC721Enumerable, AccessControl {
    using Counters for Counters.Counter;

    mapping(uint256 => string) private itemTotype;
    mapping(string => uint256[]) private typeToitem;
    mapping(uint256 => address) private graveyard;
    mapping(uint256 => string) private lastData;

    GotchiHeroItemPack public GHIPack;
    GotchiHeroItemLender public GHILender;
    GotchiHeroItemData public GHIData;

    string[] public types;
    mapping(string => bool) private typeExists;

    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant LENDER_ROLE = keccak256("LENDER_ROLE");
    bytes32 public constant GAME_ROLE = keccak256("GAME_ROLE");
    
    mapping(address => bool) private payers;

    string public baseURI = "https://";

    Counters.Counter private tokenIdCounter;

    address private minter;
    uint256 public mergeCost;

    constructor(
        address data_,
        address minter_,
        uint256 mergeCost_
    ) ERC721("Aavegotchi Hero Item", "GHI") {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        GHIData = GotchiHeroItemData(data_);
        minter = minter_;
        mergeCost = mergeCost_;
    }

    //minter handle to mint token with string data
    function safeMint(
        address to_,
        string calldata data_,
        string calldata itemType_
    ) external onlyRole(MINTER_ROLE) {
        uint256 _tokenId = tokenIdCounter.current();
        _safeMint(to_, _tokenId);
        tokenIdCounter.increment();
        addType(itemType_);
        itemTotype[_tokenId]=itemType_;
        typeToitem[itemType_].push(_tokenId);
        GHIData.setData(_tokenId ,data_);
    }

    //burn function to send item to graveyard for emergency retrieval
    function burn(
        uint256 tokenId_
    ) external {
        require(
            ownerOf(tokenId_)==tx.origin || hasRole(GAME_ROLE,msg.sender),
            "Unauthorized burn request"
        );
        require(
            !GHILender.isLoaned(tokenId_),
            "Unable to burn loaned item"
        );
        graveyard[tokenId_] = ERC721.ownerOf(tokenId_);
        _burn(tokenId_);
    }

    function merge(uint256[] calldata items_) external payable {
        for(uint256 i=0; i<items_.length; i++) {
            require(
                ownerOf(items_[i])==tx.origin,
                "Unauthorized burn request"
            );
            require(
                !GHILender.isLoaned(items_[i]),
                "Unable to burn loaned item"
            );
        }
        require(msg.value >= mergeCost, "Not enough sent to start merge.");

        (bool sent, bytes memory data) = payable(minter).call{value: msg.value}("");
        require(sent, "Failed to send MATIC");

        emit saveMerge(items_, data);
    }

    event saveMerge(uint256[] items_, bytes data_);

    function setMinter(address minter_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        minter = minter_;
    }

    function setMergeCost(uint256 cost_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        mergeCost = cost_;
    }

    //Return all items of type for all users
    function getItemsByType(
        string calldata type_
    ) external view returns(string[] memory, uint256[] memory) {
        uint256[] memory _typeData = typeToitem[type_];
        uint _tokenCount = _typeData.length;
        string[] memory _data = new string[](_tokenCount);
        uint256[] memory _ids = new uint256[](_tokenCount);

        for(uint256 i=0 ; i<_tokenCount ; i++) {
            if(!tokenExists(_typeData[i])) continue;
            //data[i] = getData(typeData[i]);
            _ids[i] = _typeData[i];
        }

        return (_data, _ids);
    }

    //Returns all token ids for a account
    function holderTokenIds(
        address account_
    ) public view returns(uint256[] memory) {
        uint256 _count = balanceOf(account_);
        uint256[] memory _ids = new uint256[](_count);

        for(uint256 i=0 ; i<_count ; i++) {
            _ids[i] = tokenOfOwnerByIndex(account_, i);
        }

        return _ids;        
    }

    //Returns next tokenId
    function newId() view external returns (uint256 id_){
        return  tokenIdCounter.current();
    }

    //check if token Exists on chain
    function tokenExists(
        uint256 tokenId_
    ) public view returns(bool) {
        return _exists(tokenId_);
    }

    //mint item after uri creation
    function mint(
        address to_,
        uint256 tokenId_
    ) external onlyRole(MINTER_ROLE) {
        require(to_ != address(0), "Invalid account");
        require(tokenIdCounter.current() > tokenId_, "Token URI does not exist");
        _safeMint(to_, tokenId_);
        tokenIdCounter.increment();
    }

    //revive item to owner from graveyard
    function revive (
        uint256 tokenId_
    ) external {
        require(
            hasRole(GAME_ROLE, msg.sender),
            "You do not have the authority to revive Item."
        );
        require(
            !tokenExists(tokenId_),
            "Token does not need revival"
        );

        _mint(graveyard[tokenId_], tokenId_);
        delete graveyard[tokenId_];
    }

    //set Pack Address(allows pack controls to smart contract)
    function setPack (address packAddress_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if(address(GHIPack)!=address(0)){
            revokeRole(MINTER_ROLE,address(GHIPack));
        }
        GHIPack = GotchiHeroItemPack(packAddress_);
        grantRole(MINTER_ROLE,address(GHIPack));
    }

    //set Pack Address(allows pack controls to smart contract)
    function setData (address dataAddress_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        GHIData = GotchiHeroItemData(dataAddress_);
    }

    //set Pack Address(allows pack controls to smart contract)
    function setLender (address lenderAddress_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if(address(GHILender)!=address(0)){
            revokeRole(LENDER_ROLE,address(GHILender));
        }
        GHILender = GotchiHeroItemLender(lenderAddress_);
        grantRole(LENDER_ROLE,address(GHILender));
    }

    function lendTransfer(
        address from_,
        address to_,
        uint256 tokenId_
    ) external onlyRole(LENDER_ROLE){
        _transfer(from_, to_, tokenId_);
    }

    //marks address as kind of admin, compatibility use only
    function addPayer(address payer_) external onlyRole(MINTER_ROLE) {
        payers[payer_] = true;
    }

    //marks address as kind of admin, compatibility use only
    function removePayer(address payer_) external onlyRole(MINTER_ROLE) {
        delete payers[payer_];
    }

    //returns a blank holderTokenURIs for compatibility
    function holderTokenURIs(address account_) external view returns(string[] memory) {
        uint256 _count = balanceOf(account_);
        uint256[] memory _ids = holderTokenIds(account_);
        string[] memory _URIs = new string[](_count);

        for(uint256 i=0 ; i<_count ; i++) {
            _URIs[i] = tokenURI(_ids[i]);
        }

        return _URIs;
    }

    //returns token uris of ids
    function tokenURIs(uint256[] calldata ids_) external view returns(string[] memory) {
        uint256 _count = ids_.length;
        string[] memory _URIs = new string[](_count);

        for(uint256 i=0 ; i<_count ; i++) {
            _URIs[i] = tokenURI(ids_[i]);
        }

        return _URIs;
    }

    //changes baseURI if admin
    function setBaseURI(string calldata URI_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        baseURI = URI_;
    }

    //add type to types and create unminted token on it
    function setTokenURI(string calldata type_) external onlyRole(MINTER_ROLE){
        uint256 _tokenId = tokenIdCounter.current();
        addType(type_);
        typeToitem[type_].push(_tokenId);
        tokenIdCounter.increment();
    }

    //add type to types and save data for unminted token
    function setTokenData(
        string calldata type_,
        string calldata data_
    ) external onlyRole(MINTER_ROLE) {
        uint256 _tokenId = tokenIdCounter.current();
        addType(type_);
        typeToitem[type_].push(_tokenId);
        GHIData.setData(_tokenId, data_);
        tokenIdCounter.increment();
    }

    //create type if not exists
    function addType(string memory type_) internal {
        if(!typeExists[type_]) {
            typeExists[type_] = true;
            types.push(type_);
        }
    }

    /*function destroy(address apocalypse) public onlyRole(DEFAULT_ADMIN_ROLE){
		selfdestruct(payable(apocalypse));
    }*/

    // The following functions are overrides required by Solidity.
    function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
        internal
        override(ERC721, ERC721Enumerable)
    {
        super._beforeTokenTransfer(from, to, tokenId, batchSize);
    }

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

abstract contract AdminPayable is Context, AccessControl {
    using EnumerableSet for EnumerableSet.AddressSet;

    EnumerableSet.AddressSet private _admins;
    mapping(address => uint256) private adminShares;
    uint256 private totalShares = 0;

    function addAdmin(address admin_, uint256 shares_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        if(!_admins.contains(admin_)){
            _admins.add(admin_);
        } else {
            totalShares -= adminShares[admin_];
        }
        
        adminShares[admin_] = shares_;
        totalShares += shares_;
    }

    function removeAdmin(address admin_) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _admins.remove(admin_);
        totalShares -= adminShares[admin_];
        delete adminShares[admin_];
    }

    function getAdminsShare(uint256 amount_) public view returns (address[] memory admins, uint256[] memory values){
        uint256 _adminReward = 0;
        address[] memory admins_ = new address[](_admins.length());
        uint256[] memory values_ = new uint256[](_admins.length());
        for(uint i=0 ; i<_admins.length(); i++) {
            admins_[i] = _admins.at(i);
            values_[i] = 0;
            unchecked {
                uint256 payment = (amount_ * adminShares[_admins.at(i)])/totalShares;
                values_[i] = payment;
                _adminReward += payment;
            }
        }
        uint256 leftover = amount_ - _adminReward;
        if(leftover > 0){
            values_[0]+= leftover;
        }
        return (admins_,values_);
    }
}

/// @custom:security-contact [email protected]
contract GHGameplay is Pausable, AccessControl, AdminPayable {
    bytes32 public constant PAUSER_ROLE = keccak256("PAUSER_ROLE");
    bytes32 public constant POPPER_ROLE = keccak256("POPPER_ROLE");
    GotchiHeroItem public gotchi;
    struct Currency {
        address contractAddress;
        uint256 burnPercent;
    }
    mapping(string => Currency) public currencies;
    address dead = address(0x0000dead);
    mapping(uint256 => bool) public isMerged;
    address public popper;
    string public resetToken;

    constructor(address gotchi_) {
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(PAUSER_ROLE, msg.sender);
        gotchi = GotchiHeroItem(gotchi_);
    }

    //takes in values equal to length of currency array and then sends to item to invoke merge
    function startMerge(string[] calldata tokens_, uint256[] calldata amounts_, uint256[] calldata items_) public payable {
        require(
            tokens_.length == amounts_.length,
            "tokens and amounts length mismatched"
        );
        for(uint256 i = 0; i < tokens_.length; i++) {
            require(
                currencies[tokens_[i]].contractAddress != address(0),
                string.concat("Unknown Currency ",tokens_[i]) 
            );
            ERC20 target = ERC20(currencies[tokens_[i]].contractAddress);
            uint256 remaining = amounts_[i];
            unchecked {
                uint256 toBurn = (remaining * currencies[tokens_[i]].burnPercent)/100;
                remaining -= toBurn;
                target.transferFrom(msg.sender,dead,toBurn);
            } 
            address[] memory _admins;
            uint256[] memory _values;
            (_admins,_values) = getAdminsShare(remaining);
            for(uint256 j =0; j<_admins.length; j++){
                target.transferFrom(msg.sender,_admins[j],_values[j]);
            }
        }
        for(uint256 i = 0; i < items_.length; i++){
            isMerged[items_[i]] = true;
        }
        gotchi.merge{value: msg.value}(items_);
        emit MergeStarted(msg.sender,tokens_,amounts_,items_);
    }

    event MergeStarted(address,string[],uint256[],uint256[]);

    function pointBurn(uint256 token_) external {
        require(
            gotchi.ownerOf(token_)==msg.sender,
            "You can only burn your own items for points"
        );
        gotchi.burn(token_);
        emit PointBurn(msg.sender,token_);
    }

    event PointBurn(address,uint256);

    function resetSkills(uint256 cost_) external {
        require (
            currencies[resetToken].contractAddress != address(0),
            "contract hasn't been set up for skill reset"
        );

        ERC20 target = ERC20(currencies[resetToken].contractAddress);
        uint256 remaining = cost_;
        unchecked {
            uint256 toBurn = (remaining * currencies[resetToken].burnPercent)/100;
            remaining -= toBurn;
            target.transferFrom(msg.sender,dead,toBurn);
        }
        address[] memory _admins;
        uint256[] memory _values;
        (_admins,_values) = getAdminsShare(remaining);
        for(uint256 j =0; j<_admins.length; j++){
            target.transferFrom(msg.sender,_admins[j],_values[j]);
        }

        emit ResetSkills(msg.sender,cost_);
    }

    event ResetSkills(address,uint256);

    //pop merged items for selling
    function popMerge(uint256 id_) public onlyRole(POPPER_ROLE) {
        delete isMerged[id_];
    }

    //add or replacy ERC20 currency to contract
    function addCurrency(string calldata name_, address contract_, uint256 burnPercent_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        require (
            burnPercent_ <= 100,
            "Value needs to between 0 and 100"
        );
        currencies[name_] = Currency(contract_, burnPercent_);
    }

    //remove ERC20 currency from contract
    function removeCurrency(string calldata name_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        delete currencies[name_];
    }

    //set item contract
    function setGotchi(address gotchi_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        gotchi = GotchiHeroItem(gotchi_);
    }

    //set skill Reset Cost
    function setResetCosts(string calldata token_) public onlyRole(DEFAULT_ADMIN_ROLE) {
        resetToken = token_;
    }

    //administrative functions
    function pause() public onlyRole(PAUSER_ROLE) {
        _pause();
    }

    function unpause() public onlyRole(PAUSER_ROLE) {
        _unpause();
    }

    function destroy(address payable safe_) public payable onlyRole(DEFAULT_ADMIN_ROLE) {
        selfdestruct(safe_);
    }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"gotchi_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"string[]","name":"","type":"string[]"},{"indexed":false,"internalType":"uint256[]","name":"","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"","type":"uint256[]"}],"name":"MergeStarted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"PointBurn","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"uint256","name":"","type":"uint256"}],"name":"ResetSkills","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":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"POPPER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin_","type":"address"},{"internalType":"uint256","name":"shares_","type":"uint256"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"address","name":"contract_","type":"address"},{"internalType":"uint256","name":"burnPercent_","type":"uint256"}],"name":"addCurrency","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"currencies","outputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"burnPercent","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"safe_","type":"address"}],"name":"destroy","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount_","type":"uint256"}],"name":"getAdminsShare","outputs":[{"internalType":"address[]","name":"admins","type":"address[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gotchi","outputs":[{"internalType":"contract GotchiHeroItem","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"isMerged","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"token_","type":"uint256"}],"name":"pointBurn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"id_","type":"uint256"}],"name":"popMerge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"popper","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"admin_","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"}],"name":"removeCurrency","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":"uint256","name":"cost_","type":"uint256"}],"name":"resetSkills","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"resetToken","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"gotchi_","type":"address"}],"name":"setGotchi","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"token_","type":"string"}],"name":"setResetCosts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string[]","name":"tokens_","type":"string[]"},{"internalType":"uint256[]","name":"amounts_","type":"uint256[]"},{"internalType":"uint256[]","name":"items_","type":"uint256[]"}],"name":"startMerge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040526000600555600880546001600160a01b03191661dead1790553480156200002a57600080fd5b5060405162002622380380620026228339810160408190526200004d916200013e565b6000805460ff19168155620000639033620000b5565b6200008f7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a33620000b5565b600680546001600160a01b0319166001600160a01b039290921691909117905562000170565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200013a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45b5050565b6000602082840312156200015157600080fd5b81516001600160a01b03811681146200016957600080fd5b9392505050565b6124a280620001806000396000f3fe6080604052600436106101c15760003560e01c80635c975abb116100f7578063a999d09a11610095578063c8f5bc0611610064578063c8f5bc0614610525578063d418254c1461058f578063d547741f146105af578063e63ab1e9146105cf57600080fd5b8063a999d09a14610494578063ae3decf7146104b4578063b458cccf146104e4578063bdeedc4d146104f757600080fd5b80638456cb59116100d15780638456cb591461042a5780639096c29a1461043f57806391d148541461045f578063a217fddf1461047f57600080fd5b80635c975abb146103d25780635f419c8b146103ea5780637fcb29c91461040a57600080fd5b806331456495116101645780633f4ba83a1161013e5780633f4ba83a1461035d57806345866100146103725780634f4aa70914610392578063541e3e43146103b257600080fd5b806331456495146102e55780633573d1b61461030557806336568abe1461033d57600080fd5b8063248a9ca3116101a0578063248a9ca31461023057806324b1bfdf1461026f5780632af68ceb146102915780632f2ff15d146102c557600080fd5b8062f55d9d146101c657806301ffc9a7146101db5780631785f53c14610210575b600080fd5b6101d96101d4366004611b15565b610603565b005b3480156101e757600080fd5b506101fb6101f6366004611b32565b61061a565b60405190151581526020015b60405180910390f35b34801561021c57600080fd5b506101d961022b366004611b15565b610651565b34801561023c57600080fd5b5061026161024b366004611b5c565b6000908152600160208190526040909120015490565b604051908152602001610207565b34801561027b57600080fd5b506102846106b4565b6040516102079190611b99565b34801561029d57600080fd5b506102617f267725edca8c9860dd0b3cd25f5fb287c380b88f33386785047bbe37e95212c081565b3480156102d157600080fd5b506101d96102e0366004611bcc565b610742565b3480156102f157600080fd5b506101d9610300366004611b5c565b61076d565b34801561031157600080fd5b50600a54610325906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b34801561034957600080fd5b506101d9610358366004611bcc565b610a09565b34801561036957600080fd5b506101d9610a87565b34801561037e57600080fd5b506101d961038d366004611b15565b610abc565b34801561039e57600080fd5b506101d96103ad366004611c45565b610aea565b3480156103be57600080fd5b50600654610325906001600160a01b031681565b3480156103de57600080fd5b5060005460ff166101fb565b3480156103f657600080fd5b506101d9610405366004611ca2565b610bb2565b34801561041657600080fd5b506101d9610425366004611ce4565b610bd0565b34801561043657600080fd5b506101d9610c64565b34801561044b57600080fd5b506101d961045a366004611ca2565b610c96565b34801561046b57600080fd5b506101fb61047a366004611bcc565b610cdd565b34801561048b57600080fd5b50610261600081565b3480156104a057600080fd5b506101d96104af366004611b5c565b610d08565b3480156104c057600080fd5b506101fb6104cf366004611b5c565b60096020526000908152604090205460ff1681565b6101d96104f2366004611d55565b610e7a565b34801561050357600080fd5b50610517610512366004611b5c565b6112e2565b604051610207929190611def565b34801561053157600080fd5b50610570610540366004611e89565b8051602081830181018051600782529282019190930120915280546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610207565b34801561059b57600080fd5b506101d96105aa366004611b5c565b6114bf565b3480156105bb57600080fd5b506101d96105ca366004611bcc565b611502565b3480156105db57600080fd5b506102617f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b600061060e81611528565b816001600160a01b0316ff5b60006001600160e01b03198216637965db0b60e01b148061064b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061065c81611528565b610667600283611532565b506001600160a01b0382166000908152600460205260408120546005805491929091610694908490611f50565b9091555050506001600160a01b0316600090815260046020526040812055565b600b80546106c190611f63565b80601f01602080910402602001604051908101604052809291908181526020018280546106ed90611f63565b801561073a5780601f1061070f5761010080835404028352916020019161073a565b820191906000526020600020905b81548152906001019060200180831161071d57829003601f168201915b505050505081565b6000828152600160208190526040909120015461075e81611528565b610768838361154e565b505050565b60006001600160a01b03166007600b6040516107899190611f9d565b908152604051908190036020019020546001600160a01b0316036108085760405162461bcd60e51b815260206004820152602b60248201527f636f6e7472616374206861736e2774206265656e2073657420757020666f722060448201526a1cdada5b1b081c995cd95d60aa1b60648201526084015b60405180910390fd5b60006007600b60405161081b9190611f9d565b908152604051908190036020018120546001600160a01b03169150829060009060649060079061084d90600b90611f9d565b90815260200160405180910390206001015483028161086e5761086e612013565b6008546040516323b872dd60e01b815292909104938490039392506001600160a01b03808616926323b872dd926108ae9233929116908690600401612029565b6020604051808303816000875af11580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f1919061204d565b50506060806108ff836112e2565b909250905060005b82518110156109c857846001600160a01b03166323b872dd338584815181106109325761093261206f565b602002602001015185858151811061094c5761094c61206f565b60200260200101516040518463ffffffff1660e01b815260040161097293929190612029565b6020604051808303816000875af1158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b5919061204d565b50806109c081612085565b915050610907565b5060408051338152602081018790527f8d1c81e9a703b2351836034ca64db40b6a2b46b4d4cc8ed00079d7ab82f539c8910160405180910390a15050505050565b6001600160a01b0381163314610a795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107ff565b610a8382826115b9565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ab181611528565b610ab9611620565b50565b6000610ac781611528565b50600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000610af581611528565b6064821115610b465760405162461bcd60e51b815260206004820181905260248201527f56616c7565206e6565647320746f206265747765656e203020616e642031303060448201526064016107ff565b6040518060400160405280846001600160a01b031681526020018381525060078686604051610b7692919061209e565b90815260405160209181900382019020825181546001600160a01b0319166001600160a01b039091161781559101516001909101555050505050565b6000610bbd81611528565b600b610bca8385836120fc565b50505050565b6000610bdb81611528565b610be6600284611672565b610bfb57610bf5600284611694565b50610c2d565b6001600160a01b0383166000908152600460205260408120546005805491929091610c27908490611f50565b90915550505b6001600160a01b038316600090815260046020526040812083905560058054849290610c5a9084906121bd565b9091555050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c8e81611528565b610ab96116a9565b6000610ca181611528565b60078383604051610cb392919061209e565b90815260405190819003602001902080546001600160a01b03191681556000600190910155505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6006546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7591906121d0565b6001600160a01b031614610ddf5760405162461bcd60e51b815260206004820152602b60248201527f596f752063616e206f6e6c79206275726e20796f7572206f776e206974656d7360448201526a20666f7220706f696e747360a81b60648201526084016107ff565b600654604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b505060408051338152602081018590527fb114a8feb67377626612aaa01364595b3eefb402a3c6aa8c8c49e132e5c47fd6935001905060405180910390a150565b848314610ed55760405162461bcd60e51b8152602060048201526024808201527f746f6b656e7320616e6420616d6f756e7473206c656e677468206d69736d617460448201526318da195960e21b60648201526084016107ff565b60005b858110156111cd5760006007888884818110610ef657610ef661206f565b9050602002810190610f0891906121ed565b604051610f1692919061209e565b908152604051908190036020019020546001600160a01b03161415878783818110610f4357610f4361206f565b9050602002810190610f5591906121ed565b604051602001610f66929190612234565b60405160208183030381529060405290610f935760405162461bcd60e51b81526004016107ff9190611b99565b5060006007888884818110610faa57610faa61206f565b9050602002810190610fbc91906121ed565b604051610fca92919061209e565b908152604051908190036020019020546001600160a01b031690506000868684818110610ff957610ff961206f565b9050602002013590506000606460078b8b8781811061101a5761101a61206f565b905060200281019061102c91906121ed565b60405161103a92919061209e565b90815260200160405180910390206001015483028161105b5761105b612013565b6008546040516323b872dd60e01b815292909104938490039392506001600160a01b03808616926323b872dd9261109b9233929116908690600401612029565b6020604051808303816000875af11580156110ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110de919061204d565b50506060806110ec836112e2565b909250905060005b82518110156111b557846001600160a01b03166323b872dd3385848151811061111f5761111f61206f565b60200260200101518585815181106111395761113961206f565b60200260200101516040518463ffffffff1660e01b815260040161115f93929190612029565b6020604051808303816000875af115801561117e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a2919061204d565b50806111ad81612085565b9150506110f4565b505050505080806111c590612085565b915050610ed8565b5060005b81811015611230576001600960008585858181106111f1576111f161206f565b90506020020135815260200190815260200160002060006101000a81548160ff021916908315150217905550808061122890612085565b9150506111d1565b50600654604051636f316c2160e11b81526001600160a01b039091169063de62d8429034906112659086908690600401612293565b6000604051808303818588803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b50505050507fa7cc1743a1d523b279a417bec12c337f4304eb97a7d682c4eec0c62021799e9c338787878787876040516112d297969594939291906122d8565b60405180910390a1505050505050565b6060806000806112f260026116e6565b67ffffffffffffffff81111561130a5761130a611e73565b604051908082528060200260200182016040528015611333578160200160208202803683370190505b509050600061134260026116e6565b67ffffffffffffffff81111561135a5761135a611e73565b604051908082528060200260200182016040528015611383578160200160208202803683370190505b50905060005b61139360026116e6565b811015611472576113a56002826116f0565b8382815181106113b7576113b761206f565b60200260200101906001600160a01b031690816001600160a01b03168152505060008282815181106113eb576113eb61206f565b602090810291909101015260055460009060048261140a6002866116f0565b6001600160a01b03166001600160a01b031681526020019081526020016000205489028161143a5761143a612013565b049050808383815181106114505761145061206f565b602090810291909101015293909301928061146a81612085565b915050611389565b50600061147f8488611f50565b905080156114b357808260008151811061149b5761149b61206f565b602002602001018181516114af91906121bd565b9052505b50909590945092505050565b7f267725edca8c9860dd0b3cd25f5fb287c380b88f33386785047bbe37e95212c06114e981611528565b506000908152600960205260409020805460ff19169055565b6000828152600160208190526040909120015461151e81611528565b61076883836115b9565b610ab981336116fc565b6000611547836001600160a01b038416611755565b9392505050565b6115588282610cdd565b610a835760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115c38282610cdd565b15610a835760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611628611848565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03811660009081526001830160205260408120541515611547565b6000611547836001600160a01b038416611893565b6116b16118e2565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116553390565b600061064b825490565b60006115478383611928565b6117068282610cdd565b610a835761171381611952565b61171e836020611964565b60405160200161172f9291906123b3565b60408051601f198184030181529082905262461bcd60e51b82526107ff91600401611b99565b6000818152600183016020526040812054801561183e576000611779600183611f50565b855490915060009061178d90600190611f50565b90508181146117f25760008660000182815481106117ad576117ad61206f565b90600052602060002001549050808760000184815481106117d0576117d061206f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061180357611803612428565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061064b565b600091505061064b565b60005460ff166118915760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107ff565b565b60008181526001830160205260408120546118da5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561064b565b50600061064b565b60005460ff16156118915760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016107ff565b600082600001828154811061193f5761193f61206f565b9060005260206000200154905092915050565b606061064b6001600160a01b03831660145b6060600061197383600261243e565b61197e9060026121bd565b67ffffffffffffffff81111561199657611996611e73565b6040519080825280601f01601f1916602001820160405280156119c0576020820181803683370190505b509050600360fc1b816000815181106119db576119db61206f565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611a0a57611a0a61206f565b60200101906001600160f81b031916908160001a9053506000611a2e84600261243e565b611a399060016121bd565b90505b6001811115611ab1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611a6d57611a6d61206f565b1a60f81b828281518110611a8357611a8361206f565b60200101906001600160f81b031916908160001a90535060049490941c93611aaa81612455565b9050611a3c565b5083156115475760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107ff565b6001600160a01b0381168114610ab957600080fd5b600060208284031215611b2757600080fd5b813561154781611b00565b600060208284031215611b4457600080fd5b81356001600160e01b03198116811461154757600080fd5b600060208284031215611b6e57600080fd5b5035919050565b60005b83811015611b90578181015183820152602001611b78565b50506000910152565b6020815260008251806020840152611bb8816040850160208701611b75565b601f01601f19169190910160400192915050565b60008060408385031215611bdf57600080fd5b823591506020830135611bf181611b00565b809150509250929050565b60008083601f840112611c0e57600080fd5b50813567ffffffffffffffff811115611c2657600080fd5b602083019150836020828501011115611c3e57600080fd5b9250929050565b60008060008060608587031215611c5b57600080fd5b843567ffffffffffffffff811115611c7257600080fd5b611c7e87828801611bfc565b9095509350506020850135611c9281611b00565b9396929550929360400135925050565b60008060208385031215611cb557600080fd5b823567ffffffffffffffff811115611ccc57600080fd5b611cd885828601611bfc565b90969095509350505050565b60008060408385031215611cf757600080fd5b8235611d0281611b00565b946020939093013593505050565b60008083601f840112611d2257600080fd5b50813567ffffffffffffffff811115611d3a57600080fd5b6020830191508360208260051b8501011115611c3e57600080fd5b60008060008060008060608789031215611d6e57600080fd5b863567ffffffffffffffff80821115611d8657600080fd5b611d928a838b01611d10565b90985096506020890135915080821115611dab57600080fd5b611db78a838b01611d10565b90965094506040890135915080821115611dd057600080fd5b50611ddd89828a01611d10565b979a9699509497509295939492505050565b604080825283519082018190526000906020906060840190828701845b82811015611e315781516001600160a01b031684529284019290840190600101611e0c565b5050508381038285015284518082528583019183019060005b81811015611e6657835183529284019291840191600101611e4a565b5090979650505050505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611e9b57600080fd5b813567ffffffffffffffff80821115611eb357600080fd5b818401915084601f830112611ec757600080fd5b813581811115611ed957611ed9611e73565b604051601f8201601f19908116603f01168101908382118183101715611f0157611f01611e73565b81604052828152876020848701011115611f1a57600080fd5b826020860160208301376000928101602001929092525095945050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561064b5761064b611f3a565b600181811c90821680611f7757607f821691505b602082108103611f9757634e487b7160e01b600052602260045260246000fd5b50919050565b6000808354611fab81611f63565b60018281168015611fc35760018114611fd857612007565b60ff1984168752821515830287019450612007565b8760005260208060002060005b85811015611ffe5781548a820152908401908201611fe5565b50505082870194505b50929695505050505050565b634e487b7160e01b600052601260045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561205f57600080fd5b8151801515811461154757600080fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161209757612097611f3a565b5060010190565b8183823760009101908152919050565b601f82111561076857600081815260208120601f850160051c810160208610156120d55750805b601f850160051c820191505b818110156120f4578281556001016120e1565b505050505050565b67ffffffffffffffff83111561211457612114611e73565b612128836121228354611f63565b836120ae565b6000601f84116001811461215c57600085156121445750838201355b600019600387901b1c1916600186901b1783556121b6565b600083815260209020601f19861690835b8281101561218d578685013582556020948501946001909201910161216d565b50868210156121aa5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8082018082111561064b5761064b611f3a565b6000602082840312156121e257600080fd5b815161154781611b00565b6000808335601e1984360301811261220457600080fd5b83018035915067ffffffffffffffff82111561221f57600080fd5b602001915036819003821315611c3e57600080fd5b7002ab735b737bbb71021bab93932b731bc9607d1b81528183601183013760009101601101908152919050565b81835260006001600160fb1b0383111561227a57600080fd5b8260051b80836020870137939093016020019392505050565b6020815260006122a7602083018486612261565b949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03881681526080602080830182905290820187905260009060a0600589901b84018101919084018a845b8b81101561237957868503609f190183528135368e9003601e1901811261232f57600080fd5b8d01848101903567ffffffffffffffff81111561234b57600080fd5b80360382131561235a57600080fd5b6123658782846122af565b965050509183019190830190600101612309565b505050508281036040840152612390818789612261565b905082810360608401526123a5818587612261565b9a9950505050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516123eb816017850160208801611b75565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161241c816028840160208801611b75565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b808202811582820484141761064b5761064b611f3a565b60008161246457612464611f3a565b50600019019056fea2646970667358221220a93d2005c0851f3244ef82a11c29733fa99f76c73ad23d09cdab58fd59e4365464736f6c634300081100330000000000000000000000007fb60450e7fad82e60ea7539c60d65397c13f112

Deployed Bytecode

0x6080604052600436106101c15760003560e01c80635c975abb116100f7578063a999d09a11610095578063c8f5bc0611610064578063c8f5bc0614610525578063d418254c1461058f578063d547741f146105af578063e63ab1e9146105cf57600080fd5b8063a999d09a14610494578063ae3decf7146104b4578063b458cccf146104e4578063bdeedc4d146104f757600080fd5b80638456cb59116100d15780638456cb591461042a5780639096c29a1461043f57806391d148541461045f578063a217fddf1461047f57600080fd5b80635c975abb146103d25780635f419c8b146103ea5780637fcb29c91461040a57600080fd5b806331456495116101645780633f4ba83a1161013e5780633f4ba83a1461035d57806345866100146103725780634f4aa70914610392578063541e3e43146103b257600080fd5b806331456495146102e55780633573d1b61461030557806336568abe1461033d57600080fd5b8063248a9ca3116101a0578063248a9ca31461023057806324b1bfdf1461026f5780632af68ceb146102915780632f2ff15d146102c557600080fd5b8062f55d9d146101c657806301ffc9a7146101db5780631785f53c14610210575b600080fd5b6101d96101d4366004611b15565b610603565b005b3480156101e757600080fd5b506101fb6101f6366004611b32565b61061a565b60405190151581526020015b60405180910390f35b34801561021c57600080fd5b506101d961022b366004611b15565b610651565b34801561023c57600080fd5b5061026161024b366004611b5c565b6000908152600160208190526040909120015490565b604051908152602001610207565b34801561027b57600080fd5b506102846106b4565b6040516102079190611b99565b34801561029d57600080fd5b506102617f267725edca8c9860dd0b3cd25f5fb287c380b88f33386785047bbe37e95212c081565b3480156102d157600080fd5b506101d96102e0366004611bcc565b610742565b3480156102f157600080fd5b506101d9610300366004611b5c565b61076d565b34801561031157600080fd5b50600a54610325906001600160a01b031681565b6040516001600160a01b039091168152602001610207565b34801561034957600080fd5b506101d9610358366004611bcc565b610a09565b34801561036957600080fd5b506101d9610a87565b34801561037e57600080fd5b506101d961038d366004611b15565b610abc565b34801561039e57600080fd5b506101d96103ad366004611c45565b610aea565b3480156103be57600080fd5b50600654610325906001600160a01b031681565b3480156103de57600080fd5b5060005460ff166101fb565b3480156103f657600080fd5b506101d9610405366004611ca2565b610bb2565b34801561041657600080fd5b506101d9610425366004611ce4565b610bd0565b34801561043657600080fd5b506101d9610c64565b34801561044b57600080fd5b506101d961045a366004611ca2565b610c96565b34801561046b57600080fd5b506101fb61047a366004611bcc565b610cdd565b34801561048b57600080fd5b50610261600081565b3480156104a057600080fd5b506101d96104af366004611b5c565b610d08565b3480156104c057600080fd5b506101fb6104cf366004611b5c565b60096020526000908152604090205460ff1681565b6101d96104f2366004611d55565b610e7a565b34801561050357600080fd5b50610517610512366004611b5c565b6112e2565b604051610207929190611def565b34801561053157600080fd5b50610570610540366004611e89565b8051602081830181018051600782529282019190930120915280546001909101546001600160a01b039091169082565b604080516001600160a01b039093168352602083019190915201610207565b34801561059b57600080fd5b506101d96105aa366004611b5c565b6114bf565b3480156105bb57600080fd5b506101d96105ca366004611bcc565b611502565b3480156105db57600080fd5b506102617f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b600061060e81611528565b816001600160a01b0316ff5b60006001600160e01b03198216637965db0b60e01b148061064b57506301ffc9a760e01b6001600160e01b03198316145b92915050565b600061065c81611528565b610667600283611532565b506001600160a01b0382166000908152600460205260408120546005805491929091610694908490611f50565b9091555050506001600160a01b0316600090815260046020526040812055565b600b80546106c190611f63565b80601f01602080910402602001604051908101604052809291908181526020018280546106ed90611f63565b801561073a5780601f1061070f5761010080835404028352916020019161073a565b820191906000526020600020905b81548152906001019060200180831161071d57829003601f168201915b505050505081565b6000828152600160208190526040909120015461075e81611528565b610768838361154e565b505050565b60006001600160a01b03166007600b6040516107899190611f9d565b908152604051908190036020019020546001600160a01b0316036108085760405162461bcd60e51b815260206004820152602b60248201527f636f6e7472616374206861736e2774206265656e2073657420757020666f722060448201526a1cdada5b1b081c995cd95d60aa1b60648201526084015b60405180910390fd5b60006007600b60405161081b9190611f9d565b908152604051908190036020018120546001600160a01b03169150829060009060649060079061084d90600b90611f9d565b90815260200160405180910390206001015483028161086e5761086e612013565b6008546040516323b872dd60e01b815292909104938490039392506001600160a01b03808616926323b872dd926108ae9233929116908690600401612029565b6020604051808303816000875af11580156108cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f1919061204d565b50506060806108ff836112e2565b909250905060005b82518110156109c857846001600160a01b03166323b872dd338584815181106109325761093261206f565b602002602001015185858151811061094c5761094c61206f565b60200260200101516040518463ffffffff1660e01b815260040161097293929190612029565b6020604051808303816000875af1158015610991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109b5919061204d565b50806109c081612085565b915050610907565b5060408051338152602081018790527f8d1c81e9a703b2351836034ca64db40b6a2b46b4d4cc8ed00079d7ab82f539c8910160405180910390a15050505050565b6001600160a01b0381163314610a795760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016107ff565b610a8382826115b9565b5050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610ab181611528565b610ab9611620565b50565b6000610ac781611528565b50600680546001600160a01b0319166001600160a01b0392909216919091179055565b6000610af581611528565b6064821115610b465760405162461bcd60e51b815260206004820181905260248201527f56616c7565206e6565647320746f206265747765656e203020616e642031303060448201526064016107ff565b6040518060400160405280846001600160a01b031681526020018381525060078686604051610b7692919061209e565b90815260405160209181900382019020825181546001600160a01b0319166001600160a01b039091161781559101516001909101555050505050565b6000610bbd81611528565b600b610bca8385836120fc565b50505050565b6000610bdb81611528565b610be6600284611672565b610bfb57610bf5600284611694565b50610c2d565b6001600160a01b0383166000908152600460205260408120546005805491929091610c27908490611f50565b90915550505b6001600160a01b038316600090815260046020526040812083905560058054849290610c5a9084906121bd565b9091555050505050565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a610c8e81611528565b610ab96116a9565b6000610ca181611528565b60078383604051610cb392919061209e565b90815260405190819003602001902080546001600160a01b03191681556000600190910155505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6006546040516331a9108f60e11b81526004810183905233916001600160a01b031690636352211e90602401602060405180830381865afa158015610d51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7591906121d0565b6001600160a01b031614610ddf5760405162461bcd60e51b815260206004820152602b60248201527f596f752063616e206f6e6c79206275726e20796f7572206f776e206974656d7360448201526a20666f7220706f696e747360a81b60648201526084016107ff565b600654604051630852cd8d60e31b8152600481018390526001600160a01b03909116906342966c6890602401600060405180830381600087803b158015610e2557600080fd5b505af1158015610e39573d6000803e3d6000fd5b505060408051338152602081018590527fb114a8feb67377626612aaa01364595b3eefb402a3c6aa8c8c49e132e5c47fd6935001905060405180910390a150565b848314610ed55760405162461bcd60e51b8152602060048201526024808201527f746f6b656e7320616e6420616d6f756e7473206c656e677468206d69736d617460448201526318da195960e21b60648201526084016107ff565b60005b858110156111cd5760006007888884818110610ef657610ef661206f565b9050602002810190610f0891906121ed565b604051610f1692919061209e565b908152604051908190036020019020546001600160a01b03161415878783818110610f4357610f4361206f565b9050602002810190610f5591906121ed565b604051602001610f66929190612234565b60405160208183030381529060405290610f935760405162461bcd60e51b81526004016107ff9190611b99565b5060006007888884818110610faa57610faa61206f565b9050602002810190610fbc91906121ed565b604051610fca92919061209e565b908152604051908190036020019020546001600160a01b031690506000868684818110610ff957610ff961206f565b9050602002013590506000606460078b8b8781811061101a5761101a61206f565b905060200281019061102c91906121ed565b60405161103a92919061209e565b90815260200160405180910390206001015483028161105b5761105b612013565b6008546040516323b872dd60e01b815292909104938490039392506001600160a01b03808616926323b872dd9261109b9233929116908690600401612029565b6020604051808303816000875af11580156110ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110de919061204d565b50506060806110ec836112e2565b909250905060005b82518110156111b557846001600160a01b03166323b872dd3385848151811061111f5761111f61206f565b60200260200101518585815181106111395761113961206f565b60200260200101516040518463ffffffff1660e01b815260040161115f93929190612029565b6020604051808303816000875af115801561117e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111a2919061204d565b50806111ad81612085565b9150506110f4565b505050505080806111c590612085565b915050610ed8565b5060005b81811015611230576001600960008585858181106111f1576111f161206f565b90506020020135815260200190815260200160002060006101000a81548160ff021916908315150217905550808061122890612085565b9150506111d1565b50600654604051636f316c2160e11b81526001600160a01b039091169063de62d8429034906112659086908690600401612293565b6000604051808303818588803b15801561127e57600080fd5b505af1158015611292573d6000803e3d6000fd5b50505050507fa7cc1743a1d523b279a417bec12c337f4304eb97a7d682c4eec0c62021799e9c338787878787876040516112d297969594939291906122d8565b60405180910390a1505050505050565b6060806000806112f260026116e6565b67ffffffffffffffff81111561130a5761130a611e73565b604051908082528060200260200182016040528015611333578160200160208202803683370190505b509050600061134260026116e6565b67ffffffffffffffff81111561135a5761135a611e73565b604051908082528060200260200182016040528015611383578160200160208202803683370190505b50905060005b61139360026116e6565b811015611472576113a56002826116f0565b8382815181106113b7576113b761206f565b60200260200101906001600160a01b031690816001600160a01b03168152505060008282815181106113eb576113eb61206f565b602090810291909101015260055460009060048261140a6002866116f0565b6001600160a01b03166001600160a01b031681526020019081526020016000205489028161143a5761143a612013565b049050808383815181106114505761145061206f565b602090810291909101015293909301928061146a81612085565b915050611389565b50600061147f8488611f50565b905080156114b357808260008151811061149b5761149b61206f565b602002602001018181516114af91906121bd565b9052505b50909590945092505050565b7f267725edca8c9860dd0b3cd25f5fb287c380b88f33386785047bbe37e95212c06114e981611528565b506000908152600960205260409020805460ff19169055565b6000828152600160208190526040909120015461151e81611528565b61076883836115b9565b610ab981336116fc565b6000611547836001600160a01b038416611755565b9392505050565b6115588282610cdd565b610a835760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b6115c38282610cdd565b15610a835760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b611628611848565b6000805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b6001600160a01b03811660009081526001830160205260408120541515611547565b6000611547836001600160a01b038416611893565b6116b16118e2565b6000805460ff191660011790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586116553390565b600061064b825490565b60006115478383611928565b6117068282610cdd565b610a835761171381611952565b61171e836020611964565b60405160200161172f9291906123b3565b60408051601f198184030181529082905262461bcd60e51b82526107ff91600401611b99565b6000818152600183016020526040812054801561183e576000611779600183611f50565b855490915060009061178d90600190611f50565b90508181146117f25760008660000182815481106117ad576117ad61206f565b90600052602060002001549050808760000184815481106117d0576117d061206f565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061180357611803612428565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061064b565b600091505061064b565b60005460ff166118915760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b60448201526064016107ff565b565b60008181526001830160205260408120546118da5750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561064b565b50600061064b565b60005460ff16156118915760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b60448201526064016107ff565b600082600001828154811061193f5761193f61206f565b9060005260206000200154905092915050565b606061064b6001600160a01b03831660145b6060600061197383600261243e565b61197e9060026121bd565b67ffffffffffffffff81111561199657611996611e73565b6040519080825280601f01601f1916602001820160405280156119c0576020820181803683370190505b509050600360fc1b816000815181106119db576119db61206f565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110611a0a57611a0a61206f565b60200101906001600160f81b031916908160001a9053506000611a2e84600261243e565b611a399060016121bd565b90505b6001811115611ab1576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110611a6d57611a6d61206f565b1a60f81b828281518110611a8357611a8361206f565b60200101906001600160f81b031916908160001a90535060049490941c93611aaa81612455565b9050611a3c565b5083156115475760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107ff565b6001600160a01b0381168114610ab957600080fd5b600060208284031215611b2757600080fd5b813561154781611b00565b600060208284031215611b4457600080fd5b81356001600160e01b03198116811461154757600080fd5b600060208284031215611b6e57600080fd5b5035919050565b60005b83811015611b90578181015183820152602001611b78565b50506000910152565b6020815260008251806020840152611bb8816040850160208701611b75565b601f01601f19169190910160400192915050565b60008060408385031215611bdf57600080fd5b823591506020830135611bf181611b00565b809150509250929050565b60008083601f840112611c0e57600080fd5b50813567ffffffffffffffff811115611c2657600080fd5b602083019150836020828501011115611c3e57600080fd5b9250929050565b60008060008060608587031215611c5b57600080fd5b843567ffffffffffffffff811115611c7257600080fd5b611c7e87828801611bfc565b9095509350506020850135611c9281611b00565b9396929550929360400135925050565b60008060208385031215611cb557600080fd5b823567ffffffffffffffff811115611ccc57600080fd5b611cd885828601611bfc565b90969095509350505050565b60008060408385031215611cf757600080fd5b8235611d0281611b00565b946020939093013593505050565b60008083601f840112611d2257600080fd5b50813567ffffffffffffffff811115611d3a57600080fd5b6020830191508360208260051b8501011115611c3e57600080fd5b60008060008060008060608789031215611d6e57600080fd5b863567ffffffffffffffff80821115611d8657600080fd5b611d928a838b01611d10565b90985096506020890135915080821115611dab57600080fd5b611db78a838b01611d10565b90965094506040890135915080821115611dd057600080fd5b50611ddd89828a01611d10565b979a9699509497509295939492505050565b604080825283519082018190526000906020906060840190828701845b82811015611e315781516001600160a01b031684529284019290840190600101611e0c565b5050508381038285015284518082528583019183019060005b81811015611e6657835183529284019291840191600101611e4a565b5090979650505050505050565b634e487b7160e01b600052604160045260246000fd5b600060208284031215611e9b57600080fd5b813567ffffffffffffffff80821115611eb357600080fd5b818401915084601f830112611ec757600080fd5b813581811115611ed957611ed9611e73565b604051601f8201601f19908116603f01168101908382118183101715611f0157611f01611e73565b81604052828152876020848701011115611f1a57600080fd5b826020860160208301376000928101602001929092525095945050505050565b634e487b7160e01b600052601160045260246000fd5b8181038181111561064b5761064b611f3a565b600181811c90821680611f7757607f821691505b602082108103611f9757634e487b7160e01b600052602260045260246000fd5b50919050565b6000808354611fab81611f63565b60018281168015611fc35760018114611fd857612007565b60ff1984168752821515830287019450612007565b8760005260208060002060005b85811015611ffe5781548a820152908401908201611fe5565b50505082870194505b50929695505050505050565b634e487b7160e01b600052601260045260246000fd5b6001600160a01b039384168152919092166020820152604081019190915260600190565b60006020828403121561205f57600080fd5b8151801515811461154757600080fd5b634e487b7160e01b600052603260045260246000fd5b60006001820161209757612097611f3a565b5060010190565b8183823760009101908152919050565b601f82111561076857600081815260208120601f850160051c810160208610156120d55750805b601f850160051c820191505b818110156120f4578281556001016120e1565b505050505050565b67ffffffffffffffff83111561211457612114611e73565b612128836121228354611f63565b836120ae565b6000601f84116001811461215c57600085156121445750838201355b600019600387901b1c1916600186901b1783556121b6565b600083815260209020601f19861690835b8281101561218d578685013582556020948501946001909201910161216d565b50868210156121aa5760001960f88860031b161c19848701351681555b505060018560011b0183555b5050505050565b8082018082111561064b5761064b611f3a565b6000602082840312156121e257600080fd5b815161154781611b00565b6000808335601e1984360301811261220457600080fd5b83018035915067ffffffffffffffff82111561221f57600080fd5b602001915036819003821315611c3e57600080fd5b7002ab735b737bbb71021bab93932b731bc9607d1b81528183601183013760009101601101908152919050565b81835260006001600160fb1b0383111561227a57600080fd5b8260051b80836020870137939093016020019392505050565b6020815260006122a7602083018486612261565b949350505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03881681526080602080830182905290820187905260009060a0600589901b84018101919084018a845b8b81101561237957868503609f190183528135368e9003601e1901811261232f57600080fd5b8d01848101903567ffffffffffffffff81111561234b57600080fd5b80360382131561235a57600080fd5b6123658782846122af565b965050509183019190830190600101612309565b505050508281036040840152612390818789612261565b905082810360608401526123a5818587612261565b9a9950505050505050505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516123eb816017850160208801611b75565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161241c816028840160208801611b75565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b808202811582820484141761064b5761064b611f3a565b60008161246457612464611f3a565b50600019019056fea2646970667358221220a93d2005c0851f3244ef82a11c29733fa99f76c73ad23d09cdab58fd59e4365464736f6c63430008110033

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

0000000000000000000000007fb60450e7fad82e60ea7539c60d65397c13f112

-----Decoded View---------------
Arg [0] : gotchi_ (address): 0x7Fb60450e7FAd82E60ea7539c60D65397c13f112

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000007fb60450e7fad82e60ea7539c60d65397c13f112


Deployed Bytecode Sourcemap

141072:4748:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;145695:122;;;;;;:::i;:::-;;:::i;:::-;;75515:204;;;;;;;;;;-1:-1:-1;75515:204:0;;;;;:::i;:::-;;:::i;:::-;;;882:14:1;;875:22;857:41;;845:2;830:18;75515:204:0;;;;;;;;140011:198;;;;;;;;;;-1:-1:-1;140011:198:0;;;;;:::i;:::-;;:::i;77338:131::-;;;;;;;;;;-1:-1:-1;77338:131:0;;;;;:::i;:::-;77412:7;77439:12;;;:6;:12;;;;;;;;:22;;;77338:131;;;;1500:25:1;;;1488:2;1473:18;77338:131:0;1354:177:1;141575:24:0;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;141209:62::-;;;;;;;;;;;;141247:24;141209:62;;77779:147;;;;;;;;;;-1:-1:-1;77779:147:0;;;;;:::i;:::-;;:::i;143620:830::-;;;;;;;;;;-1:-1:-1;143620:830:0;;;;;:::i;:::-;;:::i;141547:21::-;;;;;;;;;;-1:-1:-1;141547:21:0;;;;-1:-1:-1;;;;;141547:21:0;;;;;;-1:-1:-1;;;;;2869:32:1;;;2851:51;;2839:2;2824:18;141547:21:0;2705:203:1;78923:218:0;;;;;;;;;;-1:-1:-1;78923:218:0;;;;;:::i;:::-;;:::i;145610:77::-;;;;;;;;;;;;;:::i;145209:123::-;;;;;;;;;;-1:-1:-1;145209:123:0;;;;;:::i;:::-;;:::i;144693:306::-;;;;;;;;;;-1:-1:-1;144693:306:0;;;;;:::i;:::-;;:::i;141278:28::-;;;;;;;;;;-1:-1:-1;141278:28:0;;;;-1:-1:-1;;;;;141278:28:0;;;2599:86;;;;;;;;;;-1:-1:-1;2646:4:0;2670:7;;;2599:86;;145368:121;;;;;;;;;;-1:-1:-1;145368:121:0;;;;;:::i;:::-;;:::i;139671:332::-;;;;;;;;;;-1:-1:-1;139671:332:0;;;;;:::i;:::-;;:::i;145529:73::-;;;;;;;;;;;;;:::i;145050:126::-;;;;;;;;;;-1:-1:-1;145050:126:0;;;;;:::i;:::-;;:::i;75811:147::-;;;;;;;;;;-1:-1:-1;75811:147:0;;;;;:::i;:::-;;:::i;74916:49::-;;;;;;;;;;-1:-1:-1;74916:49:0;74961:4;74916:49;;143307:264;;;;;;;;;;-1:-1:-1;143307:264:0;;;;;:::i;:::-;;:::i;141500:40::-;;;;;;;;;;-1:-1:-1;141500:40:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;141891:1343;;;;;;:::i;:::-;;:::i;140217:793::-;;;;;;;;;;-1:-1:-1;140217:793:0;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;141407:45::-;;;;;;;;;;-1:-1:-1;141407:45:0;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;141407:45:0;;;;;;;;;;-1:-1:-1;;;;;8811:32:1;;;8793:51;;8875:2;8860:18;;8853:34;;;;8766:18;141407:45:0;8619:274:1;144537:99:0;;;;;;;;;;-1:-1:-1;144537:99:0;;;;;:::i;:::-;;:::i;78219:149::-;;;;;;;;;;-1:-1:-1;78219:149:0;;;;;:::i;:::-;;:::i;141140:62::-;;;;;;;;;;;;141178:24;141140:62;;145695:122;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;145803:5:::1;-1:-1:-1::0;;;;;145790:19:0::1;;75515:204:::0;75600:4;-1:-1:-1;;;;;;75624:47:0;;-1:-1:-1;;;75624:47:0;;:87;;-1:-1:-1;;;;;;;;;;72883:40:0;;;75675:36;75617:94;75515:204;-1:-1:-1;;75515:204:0:o;140011:198::-;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;140097:22:::1;:7;140112:6:::0;140097:14:::1;:22::i;:::-;-1:-1:-1::0;;;;;;140145:19:0;::::1;;::::0;;;:11:::1;:19;::::0;;;;;140130:11:::1;:34:::0;;140145:19;;140130:11;;:34:::1;::::0;140145:19;;140130:34:::1;:::i;:::-;::::0;;;-1:-1:-1;;;;;;;;140182:19:0::1;;::::0;;;:11:::1;:19;::::0;;;;140175:26;140011:198::o;141575:24::-;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;77779:147::-;77412:7;77439:12;;;:6;:12;;;;;;;;:22;;75407:16;75418:4;75407:10;:16::i;:::-;77893:25:::1;77904:4;77910:7;77893:10;:25::i;:::-;77779:147:::0;;;:::o;143620:830::-;143749:1;-1:-1:-1;;;;;143699:52:0;:10;143710;143699:22;;;;;;:::i;:::-;;;;;;;;;;;;;;:38;-1:-1:-1;;;;;143699:38:0;:52;143676:146;;;;-1:-1:-1;;;143676:146:0;;10723:2:1;143676:146:0;;;10705:21:1;10762:2;10742:18;;;10735:30;10801:34;10781:18;;;10774:62;-1:-1:-1;;;10852:18:1;;;10845:41;10903:19;;143676:146:0;;;;;;;;;143835:12;143856:10;143867;143856:22;;;;;;:::i;:::-;;;;;;;;;;;;;;:38;-1:-1:-1;;;;;143856:38:0;;-1:-1:-1;143926:5:0;;143856:38;;144033:3;;143997:10;;:22;;144008:10;;143997:22;:::i;:::-;;;;;;;;;;;;;:34;;;143985:9;:46;143984:52;;;;;:::i;:::-;144116:4;;144085:43;;-1:-1:-1;;;144085:43:0;;143984:52;;;;144051:19;;;;;143984:52;-1:-1:-1;;;;;;144085:19:0;;;;;;:43;;144105:10;;144116:4;;;143984:52;;144085:43;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;143942:198;144150:24;144185;144240:25;144255:9;144240:14;:25::i;:::-;144220:45;;-1:-1:-1;144220:45:0;-1:-1:-1;144280:9:0;144276:120;144296:7;:14;144294:1;:16;144276:120;;;144331:6;-1:-1:-1;;;;;144331:19:0;;144351:10;144362:7;144370:1;144362:10;;;;;;;;:::i;:::-;;;;;;;144373:7;144381:1;144373:10;;;;;;;;:::i;:::-;;;;;;;144331:53;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;144312:3:0;;;;:::i;:::-;;;;144276:120;;;-1:-1:-1;144413:29:0;;;144425:10;8793:51:1;;8875:2;8860:18;;8853:34;;;144413:29:0;;8766:18:1;144413:29:0;;;;;;;143665:785;;;;143620:830;:::o;78923:218::-;-1:-1:-1;;;;;79019:23:0;;792:10;79019:23;79011:83;;;;-1:-1:-1;;;79011:83:0;;12201:2:1;79011:83:0;;;12183:21:1;12240:2;12220:18;;;12213:30;12279:34;12259:18;;;12252:62;-1:-1:-1;;;12330:18:1;;;12323:45;12385:19;;79011:83:0;11999:411:1;79011:83:0;79107:26;79119:4;79125:7;79107:11;:26::i;:::-;78923:218;;:::o;145610:77::-;141178:24;75407:16;75418:4;75407:10;:16::i;:::-;145669:10:::1;:8;:10::i;:::-;145610:77:::0;:::o;145209:123::-;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;-1:-1:-1;145292:6:0::1;:32:::0;;-1:-1:-1;;;;;;145292:32:0::1;-1:-1:-1::0;;;;;145292:32:0;;;::::1;::::0;;;::::1;::::0;;145209:123::o;144693:306::-;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;144864:3:::1;144848:12;:19;;144825:102;;;::::0;-1:-1:-1;;;144825:102:0;;12617:2:1;144825:102:0::1;::::0;::::1;12599:21:1::0;;;12636:18;;;12629:30;12695:34;12675:18;;;12668:62;12747:18;;144825:102:0::1;12415:356:1::0;144825:102:0::1;144958:33;;;;;;;;144967:9;-1:-1:-1::0;;;;;144958:33:0::1;;;;;144978:12;144958:33;;::::0;144938:10:::1;144949:5;;144938:17;;;;;;;:::i;:::-;::::0;;;::::1;::::0;::::1;::::0;;;;;;;;:53;;;;-1:-1:-1;;;;;;144938:53:0::1;-1:-1:-1::0;;;;;144938:53:0;;::::1;;::::0;;;::::1;::::0;-1:-1:-1;144938:53:0;;::::1;::::0;-1:-1:-1;;;;;144693:306:0:o;145368:121::-;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;145462:10:::1;:19;145475:6:::0;;145462:10;:19:::1;:::i;:::-;;145368:121:::0;;;:::o;139671:332::-;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;139775:24:::1;:7;139792:6:::0;139775:16:::1;:24::i;:::-;139771:142;;139815:19;:7;139827:6:::0;139815:11:::1;:19::i;:::-;;139771:142;;;-1:-1:-1::0;;;;;139882:19:0;::::1;;::::0;;;:11:::1;:19;::::0;;;;;139867:11:::1;:34:::0;;139882:19;;139867:11;;:34:::1;::::0;139882:19;;139867:34:::1;:::i;:::-;::::0;;;-1:-1:-1;;139771:142:0::1;-1:-1:-1::0;;;;;139933:19:0;::::1;;::::0;;;:11:::1;:19;::::0;;;;:29;;;139973:11:::1;:22:::0;;139955:7;;139933:19;139973:22:::1;::::0;139955:7;;139973:22:::1;:::i;:::-;::::0;;;-1:-1:-1;;;;;139671:332:0:o;145529:73::-;141178:24;75407:16;75418:4;75407:10;:16::i;:::-;145586:8:::1;:6;:8::i;145050:126::-:0;74961:4;75407:16;74961:4;75407:10;:16::i;:::-;145151:10:::1;145162:5;;145151:17;;;;;;;:::i;:::-;::::0;;;::::1;::::0;;;;;::::1;::::0;;;145144:24;;-1:-1:-1;;;;;;145144:24:0::1;::::0;;145151:17:::1;145144:24:::0;;;::::1;::::0;-1:-1:-1;;;145050:126:0:o;75811:147::-;75897:4;75921:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;75921:29:0;;;;;;;;;;;;;;;75811:147::o;143307:264::-;143384:6;;:22;;-1:-1:-1;;;143384:22:0;;;;;1500:25:1;;;143408:10:0;;-1:-1:-1;;;;;143384:6:0;;:14;;1473:18:1;;143384:22:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;143384:34:0;;143362:127;;;;-1:-1:-1;;;143362:127:0;;15764:2:1;143362:127:0;;;15746:21:1;15803:2;15783:18;;;15776:30;15842:34;15822:18;;;15815:62;-1:-1:-1;;;15893:18:1;;;15886:41;15944:19;;143362:127:0;15562:407:1;143362:127:0;143500:6;;:19;;-1:-1:-1;;;143500:19:0;;;;;1500:25:1;;;-1:-1:-1;;;;;143500:6:0;;;;:11;;1473:18:1;;143500:19:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;143535:28:0;;;143545:10;8793:51:1;;8875:2;8860:18;;8853:34;;;143535:28:0;;-1:-1:-1;8766:18:1;;-1:-1:-1;143535:28:0;;;;;;;143307:264;:::o;141891:1343::-;142042:33;;;142020:119;;;;-1:-1:-1;;;142020:119:0;;16176:2:1;142020:119:0;;;16158:21:1;16215:2;16195:18;;;16188:30;16254:34;16234:18;;;16227:62;-1:-1:-1;;;16305:18:1;;;16298:34;16349:19;;142020:119:0;15974:400:1;142020:119:0;142154:9;142150:859;142169:18;;;142150:859;;;142285:1;142235:10;142246:7;;142254:1;142246:10;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;142235:22;;;;;;;:::i;:::-;;;;;;;;;;;;;;:38;-1:-1:-1;;;;;142235:38:0;:52;;142340:7;;142348:1;142340:10;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;142306:45;;;;;;;;;:::i;:::-;;;;;;;;;;;;;142209:158;;;;;-1:-1:-1;;;142209:158:0;;;;;;;;:::i;:::-;;142382:12;142403:10;142414:7;;142422:1;142414:10;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;142403:22;;;;;;;:::i;:::-;;;;;;;;;;;;;;:38;-1:-1:-1;;;;;142403:38:0;;-1:-1:-1;142403:38:0;142477:8;;142486:1;142477:11;;;;;;;:::i;:::-;;;;;;;142457:31;;142532:14;142598:3;142562:10;142573:7;;142581:1;142573:10;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;142562:22;;;;;;;:::i;:::-;;;;;;;;;;;;;:34;;;142550:9;:46;142549:52;;;;;:::i;:::-;142689:4;;142658:43;;-1:-1:-1;;;142658:43:0;;142549:52;;;;142620:19;;;;;142549:52;-1:-1:-1;;;;;;142658:19:0;;;;;;:43;;142678:10;;142689:4;;;142549:52;;142658:43;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;142503:214;142732:24;142771;142830:25;142845:9;142830:14;:25::i;:::-;142810:45;;-1:-1:-1;142810:45:0;-1:-1:-1;142874:9:0;142870:128;142890:7;:14;142888:1;:16;142870:128;;;142929:6;-1:-1:-1;;;;;142929:19:0;;142949:10;142960:7;142968:1;142960:10;;;;;;;;:::i;:::-;;;;;;;142971:7;142979:1;142971:10;;;;;;;;:::i;:::-;;;;;;;142929:53;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;142906:3:0;;;;:::i;:::-;;;;142870:128;;;;142194:815;;;;142189:3;;;;;:::i;:::-;;;;142150:859;;;;143023:9;143019:95;143038:17;;;143019:95;;;143098:4;143076:8;:19;143085:6;;143092:1;143085:9;;;;;;;:::i;:::-;;;;;;;143076:19;;;;;;;;;;;;:26;;;;;;;;;;;;;;;;;;143057:3;;;;;:::i;:::-;;;;143019:95;;;-1:-1:-1;143124:6:0;;:38;;-1:-1:-1;;;143124:38:0;;-1:-1:-1;;;;;143124:6:0;;;;:12;;143144:9;;143124:38;;143155:6;;;;143124:38;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;143178:48;143191:10;143202:7;;143210:8;;143219:6;;143178:48;;;;;;;;;;;;:::i;:::-;;;;;;;;141891:1343;;;;;;:::o;140217:793::-;140279:23;140304;140339:20;140374:24;140415:16;:7;:14;:16::i;:::-;140401:31;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;140401:31:0;;140374:58;;140443:24;140484:16;:7;:14;:16::i;:::-;140470:31;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;140470:31:0;;140443:58;;140516:6;140512:330;140529:16;:7;:14;:16::i;:::-;140527:1;:18;140512:330;;;140580:13;:7;140591:1;140580:10;:13::i;:::-;140567:7;140575:1;140567:10;;;;;;;;:::i;:::-;;;;;;:26;-1:-1:-1;;;;;140567:26:0;;;-1:-1:-1;;;;;140567:26:0;;;;;140621:1;140608:7;140616:1;140608:10;;;;;;;;:::i;:::-;;;;;;;;;;:14;140723:11;;140666:15;;140695:11;140666:15;140707:13;:7;140718:1;140707:10;:13::i;:::-;-1:-1:-1;;;;;140695:26:0;-1:-1:-1;;;;;140695:26:0;;;;;;;;;;;;;140685:7;:36;140684:50;;;;;:::i;:::-;;140666:68;;140766:7;140753;140761:1;140753:10;;;;;;;;:::i;:::-;;;;;;;;;;:20;140792:23;;;;;140547:3;;;;:::i;:::-;;;;140512:330;;;-1:-1:-1;140852:16:0;140871:22;140881:12;140871:7;:22;:::i;:::-;140852:41;-1:-1:-1;140907:12:0;;140904:64;;140948:8;140935:7;140943:1;140935:10;;;;;;;;:::i;:::-;;;;;;:21;;;;;;;:::i;:::-;;;-1:-1:-1;140904:64:0;-1:-1:-1;140986:7:0;;140994;;-1:-1:-1;140217:793:0;-1:-1:-1;;;140217:793:0:o;144537:99::-;141247:24;75407:16;75418:4;75407:10;:16::i;:::-;-1:-1:-1;144615:13:0::1;::::0;;;:8:::1;:13;::::0;;;;144608:20;;-1:-1:-1;;144608:20:0::1;::::0;;144537:99::o;78219:149::-;77412:7;77439:12;;;:6;:12;;;;;;;;:22;;75407:16;75418:4;75407:10;:16::i;:::-;78334:26:::1;78346:4;78352:7;78334:11;:26::i;76262:105::-:0;76329:30;76340:4;792:10;76329;:30::i;12297:158::-;12370:4;12394:53;12402:3;-1:-1:-1;;;;;12422:23:0;;12394:7;:53::i;:::-;12387:60;12297:158;-1:-1:-1;;;12297:158:0:o;80520:238::-;80604:22;80612:4;80618:7;80604;:22::i;:::-;80599:152;;80643:12;;;;80675:4;80643:12;;;;;;;;-1:-1:-1;;;;;80643:29:0;;;;;;;;;;:36;;-1:-1:-1;;80643:36:0;;;;;;;80699:40;;792:10;;80643:12;;80699:40;;80643:12;80699:40;80520:238;;:::o;80938:239::-;81022:22;81030:4;81036:7;81022;:22::i;:::-;81018:152;;;81093:5;81061:12;;;:6;:12;;;;;;;;-1:-1:-1;;;;;81061:29:0;;;;;;;;;;:37;;-1:-1:-1;;81061:37:0;;;81118:40;792:10;;81061:12;;81118:40;;81093:5;81118:40;80938:239;;:::o;3454:120::-;2463:16;:14;:16::i;:::-;3523:5:::1;3513:15:::0;;-1:-1:-1;;3513:15:0::1;::::0;;3544:22:::1;792:10:::0;3553:12:::1;3544:22;::::0;-1:-1:-1;;;;;2869:32:1;;;2851:51;;2839:2;2824:18;3544:22:0::1;;;;;;;3454:120::o:0;12541:167::-;-1:-1:-1;;;;;12675:23:0;;12621:4;7893:19;;;:12;;;:19;;;;;;:24;;12645:55;7796:129;11969:152;12039:4;12063:50;12068:3;-1:-1:-1;;;;;12088:23:0;;12063:4;:50::i;3195:118::-;2204:19;:17;:19::i;:::-;3255:7:::1;:14:::0;;-1:-1:-1;;3255:14:0::1;3265:4;3255:14;::::0;;3285:20:::1;3292:12;792:10:::0;;712:98;12794:117;12857:7;12884:19;12892:3;8094:18;;8011:109;13265:158;13339:7;13390:22;13394:3;13406:5;13390:3;:22::i;76657:492::-;76746:22;76754:4;76760:7;76746;:22::i;:::-;76741:401;;76934:28;76954:7;76934:19;:28::i;:::-;77035:38;77063:4;77070:2;77035:19;:38::i;:::-;76839:257;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;76839:257:0;;;;;;;;;;-1:-1:-1;;;76785:345:0;;;;;;;:::i;6290:1420::-;6356:4;6495:19;;;:12;;;:19;;;;;;6531:15;;6527:1176;;6906:21;6930:14;6943:1;6930:10;:14;:::i;:::-;6979:18;;6906:38;;-1:-1:-1;6959:17:0;;6979:22;;7000:1;;6979:22;:::i;:::-;6959:42;;7035:13;7022:9;:26;7018:405;;7069:17;7089:3;:11;;7101:9;7089:22;;;;;;;;:::i;:::-;;;;;;;;;7069:42;;7243:9;7214:3;:11;;7226:13;7214:26;;;;;;;;:::i;:::-;;;;;;;;;;;;:38;;;;7328:23;;;:12;;;:23;;;;;:36;;;7018:405;7504:17;;:3;;:17;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;7599:3;:12;;:19;7612:5;7599:19;;;;;;;;;;;7592:26;;;7642:4;7635:11;;;;;;;6527:1176;7686:5;7679:12;;;;;2943:108;2646:4;2670:7;;;3002:41;;;;-1:-1:-1;;;3002:41:0;;21135:2:1;3002:41:0;;;21117:21:1;21174:2;21154:18;;;21147:30;-1:-1:-1;;;21193:18:1;;;21186:50;21253:18;;3002:41:0;20933:344:1;3002:41:0;2943:108::o;5700:414::-;5763:4;7893:19;;;:12;;;:19;;;;;;5780:327;;-1:-1:-1;5823:23:0;;;;;;;;:11;:23;;;;;;;;;;;;;6006:18;;5984:19;;;:12;;;:19;;;;;;:40;;;;6039:11;;5780:327;-1:-1:-1;6090:5:0;6083:12;;2758:108;2646:4;2670:7;;;2828:9;2820:38;;;;-1:-1:-1;;;2820:38:0;;21484:2:1;2820:38:0;;;21466:21:1;21523:2;21503:18;;;21496:30;-1:-1:-1;;;21542:18:1;;;21535:46;21598:18;;2820:38:0;21282:340:1;8474:120:0;8541:7;8568:3;:11;;8580:5;8568:18;;;;;;;;:::i;:::-;;;;;;;;;8561:25;;8474:120;;;;:::o;46964:151::-;47022:13;47055:52;-1:-1:-1;;;;;47067:22:0;;45119:2;46360:447;46435:13;46461:19;46493:10;46497:6;46493:1;:10;:::i;:::-;:14;;46506:1;46493:14;:::i;:::-;46483:25;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;46483:25:0;;46461:47;;-1:-1:-1;;;46519:6:0;46526:1;46519:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;46519:15:0;;;;;;;;;-1:-1:-1;;;46545:6:0;46552:1;46545:9;;;;;;;;:::i;:::-;;;;:15;-1:-1:-1;;;;;46545:15:0;;;;;;;;-1:-1:-1;46576:9:0;46588:10;46592:6;46588:1;:10;:::i;:::-;:14;;46601:1;46588:14;:::i;:::-;46576:26;;46571:131;46608:1;46604;:5;46571:131;;;-1:-1:-1;;;46652:5:0;46660:3;46652:11;46643:21;;;;;;;:::i;:::-;;;;46631:6;46638:1;46631:9;;;;;;;;:::i;:::-;;;;:33;-1:-1:-1;;;;;46631:33:0;;;;;;;;-1:-1:-1;46689:1:0;46679:11;;;;;46611:3;;;:::i;:::-;;;46571:131;;;-1:-1:-1;46720:10:0;;46712:55;;;;-1:-1:-1;;;46712:55:0;;22143:2:1;46712:55:0;;;22125:21:1;;;22162:18;;;22155:30;22221:34;22201:18;;;22194:62;22273:18;;46712:55:0;21941:356:1;14:139;-1:-1:-1;;;;;97:31:1;;87:42;;77:70;;143:1;140;133:12;158:263;225:6;278:2;266:9;257:7;253:23;249:32;246:52;;;294:1;291;284:12;246:52;333:9;320:23;352:39;385:5;352:39;:::i;426:286::-;484:6;537:2;525:9;516:7;512:23;508:32;505:52;;;553:1;550;543:12;505:52;579:23;;-1:-1:-1;;;;;;631:32:1;;621:43;;611:71;;678:1;675;668:12;1169:180;1228:6;1281:2;1269:9;1260:7;1256:23;1252:32;1249:52;;;1297:1;1294;1287:12;1249:52;-1:-1:-1;1320:23:1;;1169:180;-1:-1:-1;1169:180:1:o;1536:250::-;1621:1;1631:113;1645:6;1642:1;1639:13;1631:113;;;1721:11;;;1715:18;1702:11;;;1695:39;1667:2;1660:10;1631:113;;;-1:-1:-1;;1778:1:1;1760:16;;1753:27;1536:250::o;1791:396::-;1940:2;1929:9;1922:21;1903:4;1972:6;1966:13;2015:6;2010:2;1999:9;1995:18;1988:34;2031:79;2103:6;2098:2;2087:9;2083:18;2078:2;2070:6;2066:15;2031:79;:::i;:::-;2171:2;2150:15;-1:-1:-1;;2146:29:1;2131:45;;;;2178:2;2127:54;;1791:396;-1:-1:-1;;1791:396:1:o;2192:323::-;2260:6;2268;2321:2;2309:9;2300:7;2296:23;2292:32;2289:52;;;2337:1;2334;2327:12;2289:52;2373:9;2360:23;2350:33;;2433:2;2422:9;2418:18;2405:32;2446:39;2479:5;2446:39;:::i;:::-;2504:5;2494:15;;;2192:323;;;;;:::o;2913:348::-;2965:8;2975:6;3029:3;3022:4;3014:6;3010:17;3006:27;2996:55;;3047:1;3044;3037:12;2996:55;-1:-1:-1;3070:20:1;;3113:18;3102:30;;3099:50;;;3145:1;3142;3135:12;3099:50;3182:4;3174:6;3170:17;3158:29;;3234:3;3227:4;3218:6;3210;3206:19;3202:30;3199:39;3196:59;;;3251:1;3248;3241:12;3196:59;2913:348;;;;;:::o;3266:622::-;3355:6;3363;3371;3379;3432:2;3420:9;3411:7;3407:23;3403:32;3400:52;;;3448:1;3445;3438:12;3400:52;3488:9;3475:23;3521:18;3513:6;3510:30;3507:50;;;3553:1;3550;3543:12;3507:50;3592:59;3643:7;3634:6;3623:9;3619:22;3592:59;:::i;:::-;3670:8;;-1:-1:-1;3566:85:1;-1:-1:-1;;3755:2:1;3740:18;;3727:32;3768:39;3727:32;3768:39;:::i;:::-;3266:622;;;;-1:-1:-1;3826:5:1;;3878:2;3863:18;3850:32;;-1:-1:-1;;3266:622:1:o;4124:411::-;4195:6;4203;4256:2;4244:9;4235:7;4231:23;4227:32;4224:52;;;4272:1;4269;4262:12;4224:52;4312:9;4299:23;4345:18;4337:6;4334:30;4331:50;;;4377:1;4374;4367:12;4331:50;4416:59;4467:7;4458:6;4447:9;4443:22;4416:59;:::i;:::-;4494:8;;4390:85;;-1:-1:-1;4124:411:1;-1:-1:-1;;;;4124:411:1:o;4540:323::-;4608:6;4616;4669:2;4657:9;4648:7;4644:23;4640:32;4637:52;;;4685:1;4682;4675:12;4637:52;4724:9;4711:23;4743:39;4776:5;4743:39;:::i;:::-;4801:5;4853:2;4838:18;;;;4825:32;;-1:-1:-1;;;4540:323:1:o;4868:375::-;4939:8;4949:6;5003:3;4996:4;4988:6;4984:17;4980:27;4970:55;;5021:1;5018;5011:12;4970:55;-1:-1:-1;5044:20:1;;5087:18;5076:30;;5073:50;;;5119:1;5116;5109:12;5073:50;5156:4;5148:6;5144:17;5132:29;;5216:3;5209:4;5199:6;5196:1;5192:14;5184:6;5180:27;5176:38;5173:47;5170:67;;;5233:1;5230;5223:12;5248:1124;5418:6;5426;5434;5442;5450;5458;5511:2;5499:9;5490:7;5486:23;5482:32;5479:52;;;5527:1;5524;5517:12;5479:52;5567:9;5554:23;5596:18;5637:2;5629:6;5626:14;5623:34;;;5653:1;5650;5643:12;5623:34;5692:78;5762:7;5753:6;5742:9;5738:22;5692:78;:::i;:::-;5789:8;;-1:-1:-1;5666:104:1;-1:-1:-1;5877:2:1;5862:18;;5849:32;;-1:-1:-1;5893:16:1;;;5890:36;;;5922:1;5919;5912:12;5890:36;5961:80;6033:7;6022:8;6011:9;6007:24;5961:80;:::i;:::-;6060:8;;-1:-1:-1;5935:106:1;-1:-1:-1;6148:2:1;6133:18;;6120:32;;-1:-1:-1;6164:16:1;;;6161:36;;;6193:1;6190;6183:12;6161:36;;6232:80;6304:7;6293:8;6282:9;6278:24;6232:80;:::i;:::-;5248:1124;;;;-1:-1:-1;5248:1124:1;;-1:-1:-1;5248:1124:1;;6331:8;;5248:1124;-1:-1:-1;;;5248:1124:1:o;6377:1178::-;6645:2;6657:21;;;6727:13;;6630:18;;;6749:22;;;6597:4;;6824;;6802:2;6787:18;;;6851:15;;;6597:4;6894:195;6908:6;6905:1;6902:13;6894:195;;;6973:13;;-1:-1:-1;;;;;6969:39:1;6957:52;;7029:12;;;;7064:15;;;;7005:1;6923:9;6894:195;;;-1:-1:-1;;;7125:19:1;;;7105:18;;;7098:47;7195:13;;7217:21;;;7293:15;;;;7256:12;;;7328:1;7338:189;7354:8;7349:3;7346:17;7338:189;;;7423:15;;7409:30;;7500:17;;;;7461:14;;;;7382:1;7373:11;7338:189;;;-1:-1:-1;7544:5:1;;6377:1178;-1:-1:-1;;;;;;;6377:1178:1:o;7560:127::-;7621:10;7616:3;7612:20;7609:1;7602:31;7652:4;7649:1;7642:15;7676:4;7673:1;7666:15;7692:922;7761:6;7814:2;7802:9;7793:7;7789:23;7785:32;7782:52;;;7830:1;7827;7820:12;7782:52;7870:9;7857:23;7899:18;7940:2;7932:6;7929:14;7926:34;;;7956:1;7953;7946:12;7926:34;7994:6;7983:9;7979:22;7969:32;;8039:7;8032:4;8028:2;8024:13;8020:27;8010:55;;8061:1;8058;8051:12;8010:55;8097:2;8084:16;8119:2;8115;8112:10;8109:36;;;8125:18;;:::i;:::-;8200:2;8194:9;8168:2;8254:13;;-1:-1:-1;;8250:22:1;;;8274:2;8246:31;8242:40;8230:53;;;8298:18;;;8318:22;;;8295:46;8292:72;;;8344:18;;:::i;:::-;8384:10;8380:2;8373:22;8419:2;8411:6;8404:18;8459:7;8454:2;8449;8445;8441:11;8437:20;8434:33;8431:53;;;8480:1;8477;8470:12;8431:53;8536:2;8531;8527;8523:11;8518:2;8510:6;8506:15;8493:46;8581:1;8559:15;;;8576:2;8555:24;8548:35;;;;-1:-1:-1;8563:6:1;7692:922;-1:-1:-1;;;;;7692:922:1:o;8898:127::-;8959:10;8954:3;8950:20;8947:1;8940:31;8990:4;8987:1;8980:15;9014:4;9011:1;9004:15;9030:128;9097:9;;;9118:11;;;9115:37;;;9132:18;;:::i;9163:380::-;9242:1;9238:12;;;;9285;;;9306:61;;9360:4;9352:6;9348:17;9338:27;;9306:61;9413:2;9405:6;9402:14;9382:18;9379:38;9376:161;;9459:10;9454:3;9450:20;9447:1;9440:31;9494:4;9491:1;9484:15;9522:4;9519:1;9512:15;9376:161;;9163:380;;;:::o;9674:842::-;9802:3;9831:1;9864:6;9858:13;9894:36;9920:9;9894:36;:::i;:::-;9949:1;9966:18;;;9993:133;;;;10140:1;10135:356;;;;9959:532;;9993:133;-1:-1:-1;;10026:24:1;;10014:37;;10099:14;;10092:22;10080:35;;10071:45;;;-1:-1:-1;9993:133:1;;10135:356;10166:6;10163:1;10156:17;10196:4;10241:2;10238:1;10228:16;10266:1;10280:165;10294:6;10291:1;10288:13;10280:165;;;10372:14;;10359:11;;;10352:35;10415:16;;;;10309:10;;10280:165;;;10284:3;;;10474:6;10469:3;10465:16;10458:23;;9959:532;-1:-1:-1;10507:3:1;;9674:842;-1:-1:-1;;;;;;9674:842:1:o;10933:127::-;10994:10;10989:3;10985:20;10982:1;10975:31;11025:4;11022:1;11015:15;11049:4;11046:1;11039:15;11065:375;-1:-1:-1;;;;;11323:15:1;;;11305:34;;11375:15;;;;11370:2;11355:18;;11348:43;11422:2;11407:18;;11400:34;;;;11255:2;11240:18;;11065:375::o;11445:277::-;11512:6;11565:2;11553:9;11544:7;11540:23;11536:32;11533:52;;;11581:1;11578;11571:12;11533:52;11613:9;11607:16;11666:5;11659:13;11652:21;11645:5;11642:32;11632:60;;11688:1;11685;11678:12;11727:127;11788:10;11783:3;11779:20;11776:1;11769:31;11819:4;11816:1;11809:15;11843:4;11840:1;11833:15;11859:135;11898:3;11919:17;;;11916:43;;11939:18;;:::i;:::-;-1:-1:-1;11986:1:1;11975:13;;11859:135::o;12776:273::-;12961:6;12953;12948:3;12935:33;12917:3;12987:16;;13012:13;;;12987:16;12776:273;-1:-1:-1;12776:273:1:o;13054:545::-;13156:2;13151:3;13148:11;13145:448;;;13192:1;13217:5;13213:2;13206:17;13262:4;13258:2;13248:19;13332:2;13320:10;13316:19;13313:1;13309:27;13303:4;13299:38;13368:4;13356:10;13353:20;13350:47;;;-1:-1:-1;13391:4:1;13350:47;13446:2;13441:3;13437:12;13434:1;13430:20;13424:4;13420:31;13410:41;;13501:82;13519:2;13512:5;13509:13;13501:82;;;13564:17;;;13545:1;13534:13;13501:82;;;13505:3;;;13054:545;;;:::o;13775:1206::-;13899:18;13894:3;13891:27;13888:53;;;13921:18;;:::i;:::-;13950:94;14040:3;14000:38;14032:4;14026:11;14000:38;:::i;:::-;13994:4;13950:94;:::i;:::-;14070:1;14095:2;14090:3;14087:11;14112:1;14107:616;;;;14767:1;14784:3;14781:93;;;-1:-1:-1;14840:19:1;;;14827:33;14781:93;-1:-1:-1;;13732:1:1;13728:11;;;13724:24;13720:29;13710:40;13756:1;13752:11;;;13707:57;14887:78;;14080:895;;14107:616;9621:1;9614:14;;;9658:4;9645:18;;-1:-1:-1;;14143:17:1;;;14244:9;14266:229;14280:7;14277:1;14274:14;14266:229;;;14369:19;;;14356:33;14341:49;;14476:4;14461:20;;;;14429:1;14417:14;;;;14296:12;14266:229;;;14270:3;14523;14514:7;14511:16;14508:159;;;14647:1;14643:6;14637:3;14631;14628:1;14624:11;14620:21;14616:34;14612:39;14599:9;14594:3;14590:19;14577:33;14573:79;14565:6;14558:95;14508:159;;;14710:1;14704:3;14701:1;14697:11;14693:19;14687:4;14680:33;14080:895;;;13775:1206;;;:::o;14986:125::-;15051:9;;;15072:10;;;15069:36;;;15085:18;;:::i;15298:259::-;15368:6;15421:2;15409:9;15400:7;15396:23;15392:32;15389:52;;;15437:1;15434;15427:12;15389:52;15469:9;15463:16;15488:39;15521:5;15488:39;:::i;16379:522::-;16457:4;16463:6;16523:11;16510:25;16617:2;16613:7;16602:8;16586:14;16582:29;16578:43;16558:18;16554:68;16544:96;;16636:1;16633;16626:12;16544:96;16663:33;;16715:20;;;-1:-1:-1;16758:18:1;16747:30;;16744:50;;;16790:1;16787;16780:12;16744:50;16823:4;16811:17;;-1:-1:-1;16854:14:1;16850:27;;;16840:38;;16837:58;;;16891:1;16888;16881:12;16906:423;-1:-1:-1;;;17163:3:1;17156:32;17232:6;17224;17219:2;17214:3;17210:12;17197:42;17138:3;17262:16;;17280:2;17258:25;17292:13;;;17258:25;16906:423;-1:-1:-1;16906:423:1:o;17334:311::-;17422:19;;;17404:3;-1:-1:-1;;;;;17453:31:1;;17450:51;;;17497:1;17494;17487:12;17450:51;17533:6;17530:1;17526:14;17585:8;17578:5;17571:4;17566:3;17562:14;17549:45;17614:18;;;;17634:4;17610:29;;17334:311;-1:-1:-1;;;17334:311:1:o;17650:288::-;17839:2;17828:9;17821:21;17802:4;17859:73;17928:2;17917:9;17913:18;17905:6;17897;17859:73;:::i;:::-;17851:81;17650:288;-1:-1:-1;;;;17650:288:1:o;17943:267::-;18032:6;18027:3;18020:19;18084:6;18077:5;18070:4;18065:3;18061:14;18048:43;-1:-1:-1;18136:1:1;18111:16;;;18129:4;18107:27;;;18100:38;;;;18192:2;18171:15;;;-1:-1:-1;;18167:29:1;18158:39;;;18154:50;;17943:267::o;18215:1764::-;-1:-1:-1;;;;;18672:32:1;;18654:51;;18641:3;18724:2;18742:18;;;18735:31;;;18626:19;;;18801:22;;;-1:-1:-1;;18692:3:1;18904:1;18900:14;;;18885:30;;18881:40;;;18724:2;18839:19;;18944:6;-1:-1:-1;18978:715:1;18992:6;18989:1;18986:13;18978:715;;;19057:22;;;-1:-1:-1;;19053:37:1;19041:50;;19130:20;;19205:14;19201:27;;;-1:-1:-1;;19197:41:1;19173:66;;19163:94;;19253:1;19250;19243:12;19163:94;19283:31;;19388:14;;;;19341:19;19429:18;19418:30;;19415:50;;;19461:1;19458;19451:12;19415:50;19514:6;19498:14;19494:27;19485:7;19481:41;19478:61;;;19535:1;19532;19525:12;19478:61;19562:51;19606:6;19598;19589:7;19562:51;:::i;:::-;19552:61;-1:-1:-1;;;19671:12:1;;;;19636:15;;;;19014:1;19007:9;18978:715;;;18982:3;;;;19741:9;19733:6;19729:22;19724:2;19713:9;19709:18;19702:50;19775:61;19829:6;19821;19813;19775:61;:::i;:::-;19761:75;;19884:9;19876:6;19872:22;19867:2;19856:9;19852:18;19845:50;19912:61;19966:6;19958;19950;19912:61;:::i;:::-;19904:69;18215:1764;-1:-1:-1;;;;;;;;;;18215:1764:1:o;19984:812::-;20395:25;20390:3;20383:38;20365:3;20450:6;20444:13;20466:75;20534:6;20529:2;20524:3;20520:12;20513:4;20505:6;20501:17;20466:75;:::i;:::-;-1:-1:-1;;;20600:2:1;20560:16;;;20592:11;;;20585:40;20650:13;;20672:76;20650:13;20734:2;20726:11;;20719:4;20707:17;;20672:76;:::i;:::-;20768:17;20787:2;20764:26;;19984:812;-1:-1:-1;;;;19984:812:1:o;20801:127::-;20862:10;20857:3;20853:20;20850:1;20843:31;20893:4;20890:1;20883:15;20917:4;20914:1;20907:15;21627:168;21700:9;;;21731;;21748:15;;;21742:22;;21728:37;21718:71;;21769:18;;:::i;21800:136::-;21839:3;21867:5;21857:39;;21876:18;;:::i;:::-;-1:-1:-1;;;21912:18:1;;21800:136::o

Swarm Source

ipfs://a93d2005c0851f3244ef82a11c29733fa99f76c73ad23d09cdab58fd59e43654

Block Transaction Gas Used Reward
view all blocks produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ Download: CSV Export  ]
[ 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.