ETH Price: $3,108.16 (+0.66%)

Token

Forged 0N1 Gear (FORGEDGEAR)
 

Overview

Max Total Supply

74 FORGEDGEAR

Holders

24

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A
Filtered by Token Holder
bobby-san.eth
Balance
1 FORGEDGEAR
0xb9780000151cae6a9bdda030d90af37637182b97
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
ForgedGear

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 10 runs

Other Settings:
default evmVersion
File 1 of 28 : ForgedGear.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/utils/math/SafeMath.sol';
import '@openzeppelin/contracts/utils/Base64.sol';
import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol';
import '@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol';
import '@openzeppelin/contracts/utils/Strings.sol';

import './Library.sol';
import './interfaces/IAssets.sol';
import './interfaces/ITacticalGear.sol';
import './interfaces/IForgedGear.sol';
import './interfaces/ILibrary.sol';

import './opensea-enforcer/DefaultOperatorFilterer.sol';

contract ForgedGear is ERC721Enumerable, Ownable, DefaultOperatorFilterer {
  using SafeMath for uint256;

  mapping(uint256 => uint256) private tokenToForgedAt;

  // contract references
  IAssets private assets;
  ITacticalGear private tacticalGear;

  constructor(
    string memory name,
    string memory symbol,
    address assetsAddress,
    address tacticalGearAddress
  ) ERC721(name, symbol) {
    assets = IAssets(assetsAddress);
    tacticalGear = ITacticalGear(tacticalGearAddress);
  }

  function forge(address to, uint256 tokenId) external {
    require(msg.sender == address(tacticalGear), 'Should be called by Gear contract');
    tokenToForgedAt[tokenId] = block.timestamp;
    _safeMint(to, tokenId);
  }

  function getForgedAt(uint256 tokenId) external view returns (uint256) {
    require(msg.sender == address(tacticalGear), 'Should be called by Gear contract');
    return tokenToForgedAt[tokenId];
  }

  function getForgedGear(uint256 tokenId) external view returns (IForgedGear.ForgedGear memory) {
    require(_exists(tokenId), 'Token does not exist');

    string memory prefix = tacticalGear.getPrefix(tokenId);
    string memory name = tacticalGear.getItem(tokenId).name;
    string memory suffix = tacticalGear.getSuffix(tokenId);
    string memory category = tacticalGear.getItem(tokenId).category;

    return
      IForgedGear.ForgedGear({
        fullName: string(abi.encodePacked(prefix, ' ', name, ' ', suffix)),
        name: name,
        category: category,
        prefix: prefix,
        suffix: suffix,
        isForged: true,
        extra: tacticalGear.hasR0N1(tokenId) ? 'R0N1' : 'None'
      });
  }

  function getImage(uint256 tokenId) public view returns (string memory) {
    require(_exists(tokenId), 'Token does not exist');

    return
      Library.getImage(
        ILibrary.ImageInput(
          assets.getAsset(tacticalGear.getItem(tokenId).name),
          assets.getAsset(
            string(abi.encodePacked(tacticalGear.getPrefix(tokenId), ' ', tacticalGear.getItem(tokenId).name))
          ),
          assets.getAsset(string(abi.encodePacked('R0N1 ', tacticalGear.getItem(tokenId).name))),
          true,
          tacticalGear.hasR0N1(tokenId)
        )
      );
  }

  function getCardImage(uint256 tokenId) public view returns (string memory) {
    require(_exists(tokenId), 'Token does not exist');

    return
      Library.getCardImage(
        ILibrary.CardImageInput(
          tacticalGear.getItem(tokenId).name,
          tacticalGear.getPrefix(tokenId),
          tacticalGear.getSuffix(tokenId),
          assets.getAsset(tacticalGear.getItem(tokenId).name),
          assets.getAsset(
            string(abi.encodePacked(tacticalGear.getPrefix(tokenId), ' ', tacticalGear.getItem(tokenId).name))
          ),
          assets.getAsset(tacticalGear.getSuffix(tokenId)),
          assets.getAsset(string(abi.encodePacked('R0N1 ', tacticalGear.getItem(tokenId).name))),
          true,
          tacticalGear.hasR0N1(tokenId),
          assets.getAsset('card'),
          assets.getAsset('font')
        )
      );
  }

  function tokenURI(uint256 tokenId) public view override returns (string memory) {
    require(_exists(tokenId), 'Token does not exist');

    return
      Library.getMetadata(
        tacticalGear.getItem(tokenId),
        tacticalGear.getSuffix(tokenId),
        tacticalGear.getPrefix(tokenId),
        true,
        tacticalGear.hasR0N1(tokenId),
        getCardImage(tokenId)
      );
  }

  // OpenSea Enforcer functions
  function setApprovalForAll(address operator, bool approved)
    public
    override(ERC721, IERC721)
    onlyAllowedOperatorApproval(operator)
  {
    super.setApprovalForAll(operator, approved);
  }

  function approve(address operator, uint256 tokenId)
    public
    override(ERC721, IERC721)
    onlyAllowedOperatorApproval(operator)
  {
    super.approve(operator, tokenId);
  }

  function transferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.transferFrom(from, to, tokenId);
  }

  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId);
  }

  function safeTransferFrom(
    address from,
    address to,
    uint256 tokenId,
    bytes memory data
  ) public override(ERC721, IERC721) onlyAllowedOperator(from) {
    super.safeTransferFrom(from, to, tokenId, data);
  }
}

File 2 of 28 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

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

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

File 4 of 28 : SafeMath.sol
// SPDX-License-Identifier: MIT
// 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 5 of 28 : Base64.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Base64.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides a set of functions to operate with Base64 strings.
 *
 * _Available since v4.5._
 */
library Base64 {
    /**
     * @dev Base64 Encoding/Decoding Table
     */
    string internal constant _TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";

    /**
     * @dev Converts a `bytes` to its Bytes64 `string` representation.
     */
    function encode(bytes memory data) internal pure returns (string memory) {
        /**
         * Inspired by Brecht Devos (Brechtpd) implementation - MIT licence
         * https://github.com/Brechtpd/base64/blob/e78d9fd951e7b0977ddca77d92dc85183770daf4/base64.sol
         */
        if (data.length == 0) return "";

        // Loads the table into memory
        string memory table = _TABLE;

        // Encoding takes 3 bytes chunks of binary data from `bytes` data parameter
        // and split into 4 numbers of 6 bits.
        // The final Base64 length should be `bytes` data length multiplied by 4/3 rounded up
        // - `data.length + 2`  -> Round up
        // - `/ 3`              -> Number of 3-bytes chunks
        // - `4 *`              -> 4 characters for each chunk
        string memory result = new string(4 * ((data.length + 2) / 3));

        /// @solidity memory-safe-assembly
        assembly {
            // Prepare the lookup table (skip the first "length" byte)
            let tablePtr := add(table, 1)

            // Prepare result pointer, jump over length
            let resultPtr := add(result, 32)

            // Run over the input, 3 bytes at a time
            for {
                let dataPtr := data
                let endPtr := add(data, mload(data))
            } lt(dataPtr, endPtr) {

            } {
                // Advance 3 bytes
                dataPtr := add(dataPtr, 3)
                let input := mload(dataPtr)

                // To write each character, shift the 3 bytes (18 bits) chunk
                // 4 times in blocks of 6 bits for each character (18, 12, 6, 0)
                // and apply logical AND with 0x3F which is the number of
                // the previous character in the ASCII table prior to the Base64 Table
                // The result is then added to the table to get the character to write,
                // and finally write it in the result pointer but with a left shift
                // of 256 (1 byte) - 8 (1 ASCII char) = 248 bits

                mstore8(resultPtr, mload(add(tablePtr, and(shr(18, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(12, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(shr(6, input), 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance

                mstore8(resultPtr, mload(add(tablePtr, and(input, 0x3F))))
                resultPtr := add(resultPtr, 1) // Advance
            }

            // When data `bytes` is not exactly 3 bytes long
            // it is padded with `=` characters at the end
            switch mod(mload(data), 3)
            case 1 {
                mstore8(sub(resultPtr, 1), 0x3d)
                mstore8(sub(resultPtr, 2), 0x3d)
            }
            case 2 {
                mstore8(sub(resultPtr, 1), 0x3d)
            }
        }

        return result;
    }
}

File 6 of 28 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";

/**
 * @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 7 of 28 : ERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/extensions/ERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../ERC721.sol";
import "./IERC721Enumerable.sol";

/**
 * @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 8 of 28 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "../IERC721.sol";

/**
 * @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 9 of 28 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

import "./math/Math.sol";

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

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

    /**
     * @dev Converts a `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 10 of 28 : Library.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import '@openzeppelin/contracts/utils/Base64.sol';
import '@openzeppelin/contracts/utils/Strings.sol';
import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol';

import './interfaces/ITacticalGear.sol';
import './interfaces/ILibrary.sol';

library Library {
  function calculateFontSize(string memory text) internal pure returns (string memory) {
    uint256 maxSize = 33;
    uint256 baseSize = 4;
    uint256 size = baseSize;
    uint256 length = bytes(text).length;

    if (length > maxSize) {
      size = 3;
    }

    return string(abi.encodePacked(Strings.toString(size), 'px'));
  }

  function random(string memory name, uint256 seed) internal pure returns (uint256) {
    return uint256(keccak256(abi.encodePacked(name, seed)));
  }

  function isEqualStrings(string memory stringA, string memory stringB) internal pure returns (bool) {
    return keccak256(abi.encodePacked(stringA)) == keccak256(abi.encodePacked(stringB));
  }

  function getMetadata(
    ITacticalGear.Item memory item,
    string memory suffix,
    string memory prefix,
    bool isForged,
    bool hasR0N1,
    string memory image
  ) internal pure returns (string memory) {
    string memory name = item.name;
    string memory category = item.category;

    // prettier-ignore
    string memory metadata = string(
      abi.encodePacked(
        '{',
          isForged ?
            string(abi.encodePacked('"name": "', prefix, ' ', name, ' ', suffix, '",')) :
            string(abi.encodePacked('"name": "', name, ' ', suffix, '",')),
          '"description": "It got empty in the vents after 0BER1N had gone missing. The need for weapons and armor is now greater than it ever was.",',
          '"attributes": [',
            abi.encodePacked(
              '{"trait_type": "Name", "value": "', name, '"},',
              isForged ? string(abi.encodePacked('{"trait_type": "Prefix", "value": "', prefix, '"},')) : '',
              '{"trait_type": "Suffix", "value": "', suffix, '"},',
              '{"trait_type": "Category", "value": "', category, '"}',
              isForged && hasR0N1 ? string(abi.encodePacked(',{"trait_type": "Extra", "value": "', hasR0N1 ? 'R0N1' : 'None', '"}')) : ''
            ),
          '],',
          '"image": "', image, '"'
        '}'
      )
    );

    return string(abi.encodePacked('data:application/json;base64,', Base64.encode(bytes(metadata))));
  }

  function getImage(ILibrary.ImageInput memory data) internal pure returns (string memory) {
    bytes memory svg = bytes(
      abi.encodePacked(
        "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xhtml='http://www.w3.org/1999/xhtml' width='640' height='640' preserveAspectRatio='xMidYMid meet' viewBox='0 0 64 64' style='stroke-width:0; background-color:hsl(0,0%,0%); margin: auto;height: -webkit-fill-available'>",
        "<style type='text/css'>.pixelated { image-rendering: pixelated; }</style>",
        abi.encodePacked(
          data.hasR0N1 ? Library.foreignImage('0', '0', '64', '64', data.r0n1Graphic) : '',
          Library.foreignImage('0', '0', '64', '64', data.itemGraphic),
          data.isForged ? Library.foreignImage('0', '0', '64', '64', data.prefixGraphic) : ''
        ),
        '</svg>'
      )
    );

    return string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(svg)));
  }

  function getCardImage(ILibrary.CardImageInput memory data) internal pure returns (string memory) {
    // prettier-ignore
    bytes memory svg = bytes(
      abi.encodePacked(
        "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:xhtml='http://www.w3.org/1999/xhtml' width='760' height='1140' preserveAspectRatio='xMidYMid meet' viewBox='0 0 76 114' style='stroke-width:0; background-color:hsl(0,0%,0%); margin: auto;height: -webkit-fill-available'>",
        abi.encodePacked(
          "<style type='text/css'>",
            "@font-face { font-family: GearFont; src: url('", data.font, "'); }",
            ".pixelated { image-rendering: pixelated; }",
            ".name { font-family: GearFont; font-size: ", Library.calculateFontSize(string(abi.encodePacked(data.name, ' ', data.suffix))), "; text-transform: uppercase; fill: black; }",
          "</style>"
        ),
        "<rect width='100%' height='100%' x='0' y='0' fill='#887e88' />",
        abi.encodePacked(
          data.hasR0N1 ? Library.foreignImage('6', '18', '64', '64', data.r0n1Graphic) : '',
          Library.foreignImage('0', '0', '76', '114', data.cardGraphic),
          Library.foreignImage('6', '18', '64', '64', data.itemGraphic),
          Library.foreignImage('30', '0', '16', '12', data.suffixGraphic),
          data.isForged ? Library.foreignImage('6', '18', '64', '64', data.prefixGraphic) : ''
        ),
        data.isForged
          ? string(abi.encodePacked(
            "<text x='50%' y='103.50' text-anchor='middle' dominant-baseline='bottom' class='name'>", data.prefix, "</text>",
            "<text x='50%' y='106.75' text-anchor='middle' dominant-baseline='top' class='name'>", abi.encodePacked(data.name, " ", data.suffix), "</text>"
          ))
          : string(
            abi.encodePacked(
              "<text x='50%' y='104.50' text-anchor='middle' dominant-baseline='middle' class='name'>",
              abi.encodePacked(data.name, ' ', data.suffix),
              '</text>'
            )
          ),
        '</svg>'
      )
    );

    return string(abi.encodePacked('data:image/svg+xml;base64,', Base64.encode(svg)));
  }

  function foreignImage(
    string memory x,
    string memory y,
    string memory width,
    string memory height,
    string memory img
  ) internal pure returns (string memory) {
    // prettier-ignore
    return
      string(
        (
          abi.encodePacked(
            "<foreignObject x='", x, "' y='", y, "' width='", width, "' height='", height, "'>",
              "<xhtml:img class='pixelated' width='100%' height='100%' src='", img, "'/>",
            '</foreignObject>'
          )
        )
      );
  }
}

File 11 of 28 : IAssets.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IAssets {
  function getAsset(string calldata _name) external view returns (string memory);
}

File 12 of 28 : ITacticalGear.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import 'erc721a/contracts/extensions/IERC721AQueryable.sol';

interface ITacticalGear is IERC721AQueryable {
  struct Item {
    string category;
    string name;
  }

  struct TacticalGear {
    string fullName;
    string name;
    string category;
    string suffix;
  }

  function getItem(uint256 tokenId) external view returns (Item memory);

  function getPrefix(uint256 tokenId) external view returns (string memory);

  function getSuffix(uint256 tokenId) external view returns (string memory);

  function hasR0N1(uint256 tokenId) external view returns (bool);

  function getGear(uint256 tokenId) external view returns (TacticalGear memory);

  function getImage(uint256 tokenId) external view returns (string memory);

  function getCardImage(uint256 tokenId) external view returns (string memory);
}

File 13 of 28 : IForgedGear.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import '@openzeppelin/contracts/token/ERC721/IERC721.sol';

interface IForgedGear is IERC721 {
  struct ForgedGear {
    string fullName;
    string name;
    string category;
    string prefix;
    string suffix;
    bool isForged;
    string extra;
  }

  function forge(address to, uint256 tokenId) external;

  function getForgedAt(uint256 tokenId) external view returns (uint256);

  function getForgedGear(uint256 tokenId) external view returns (ForgedGear memory);

  function getImage(uint256 tokenId) external view returns (string memory);

  function getCardImage(uint256 tokenId) external view returns (string memory);
}

File 14 of 28 : ILibrary.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface ILibrary {
  struct CardImageInput {
    string name;
    string prefix;
    string suffix;
    string itemGraphic;
    string prefixGraphic;
    string suffixGraphic;
    string r0n1Graphic;
    bool isForged;
    bool hasR0N1;
    string cardGraphic;
    string font;
  }

  struct ImageInput {
    string itemGraphic;
    string prefixGraphic;
    string r0n1Graphic;
    bool isForged;
    bool hasR0N1;
  }
}

File 15 of 28 : DefaultOperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { OperatorFilterer } from './OperatorFilterer.sol';

/**
 * @title  DefaultOperatorFilterer
 * @notice Inherits from OperatorFilterer and automatically subscribes to the default OpenSea subscription.
 */
abstract contract DefaultOperatorFilterer is OperatorFilterer {
  address constant DEFAULT_SUBSCRIPTION = address(0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6);

  constructor() OperatorFilterer(DEFAULT_SUBSCRIPTION, true) {}
}

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

pragma solidity ^0.8.0;

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

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

File 17 of 28 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

File 20 of 28 : Address.sol
// SPDX-License-Identifier: MIT
// 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 21 of 28 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

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

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * 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 23 of 28 : Math.sol
// SPDX-License-Identifier: MIT
// 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 24 of 28 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

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

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

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

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

File 25 of 28 : IERC721AQueryable.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

import '../IERC721A.sol';

/**
 * @dev Interface of ERC721AQueryable.
 */
interface IERC721AQueryable is IERC721A {
    /**
     * Invalid query range (`start` >= `stop`).
     */
    error InvalidQueryRange();

    /**
     * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.
     *
     * If the `tokenId` is out of bounds:
     *
     * - `addr = address(0)`
     * - `startTimestamp = 0`
     * - `burned = false`
     * - `extraData = 0`
     *
     * If the `tokenId` is burned:
     *
     * - `addr = <Address of owner before token was burned>`
     * - `startTimestamp = <Timestamp when token was burned>`
     * - `burned = true`
     * - `extraData = <Extra data when token was burned>`
     *
     * Otherwise:
     *
     * - `addr = <Address of owner>`
     * - `startTimestamp = <Timestamp of start of ownership>`
     * - `burned = false`
     * - `extraData = <Extra data at start of ownership>`
     */
    function explicitOwnershipOf(uint256 tokenId) external view returns (TokenOwnership memory);

    /**
     * @dev Returns an array of `TokenOwnership` structs at `tokenIds` in order.
     * See {ERC721AQueryable-explicitOwnershipOf}
     */
    function explicitOwnershipsOf(uint256[] memory tokenIds) external view returns (TokenOwnership[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`,
     * in the range [`start`, `stop`)
     * (i.e. `start <= tokenId < stop`).
     *
     * This function allows for tokens to be queried if the collection
     * grows too big for a single call of {ERC721AQueryable-tokensOfOwner}.
     *
     * Requirements:
     *
     * - `start < stop`
     */
    function tokensOfOwnerIn(
        address owner,
        uint256 start,
        uint256 stop
    ) external view returns (uint256[] memory);

    /**
     * @dev Returns an array of token IDs owned by `owner`.
     *
     * This function scans the ownership mapping and is O(`totalSupply`) in complexity.
     * It is meant to be called off-chain.
     *
     * See {ERC721AQueryable-tokensOfOwnerIn} for splitting the scan into
     * multiple smaller scans if the collection is large enough to cause
     * an out-of-gas error (10K collections should be fine).
     */
    function tokensOfOwner(address owner) external view returns (uint256[] memory);
}

File 26 of 28 : IERC721A.sol
// SPDX-License-Identifier: MIT
// ERC721A Contracts v4.2.3
// Creator: Chiru Labs

pragma solidity ^0.8.4;

/**
 * @dev Interface of ERC721A.
 */
interface IERC721A {
    /**
     * The caller must own the token or be an approved operator.
     */
    error ApprovalCallerNotOwnerNorApproved();

    /**
     * The token does not exist.
     */
    error ApprovalQueryForNonexistentToken();

    /**
     * Cannot query the balance for the zero address.
     */
    error BalanceQueryForZeroAddress();

    /**
     * Cannot mint to the zero address.
     */
    error MintToZeroAddress();

    /**
     * The quantity of tokens minted must be more than zero.
     */
    error MintZeroQuantity();

    /**
     * The token does not exist.
     */
    error OwnerQueryForNonexistentToken();

    /**
     * The caller must own the token or be an approved operator.
     */
    error TransferCallerNotOwnerNorApproved();

    /**
     * The token must be owned by `from`.
     */
    error TransferFromIncorrectOwner();

    /**
     * Cannot safely transfer to a contract that does not implement the
     * ERC721Receiver interface.
     */
    error TransferToNonERC721ReceiverImplementer();

    /**
     * Cannot transfer to the zero address.
     */
    error TransferToZeroAddress();

    /**
     * The token does not exist.
     */
    error URIQueryForNonexistentToken();

    /**
     * The `quantity` minted with ERC2309 exceeds the safety limit.
     */
    error MintERC2309QuantityExceedsLimit();

    /**
     * The `extraData` cannot be set on an unintialized ownership slot.
     */
    error OwnershipNotInitializedForExtraData();

    // =============================================================
    //                            STRUCTS
    // =============================================================

    struct TokenOwnership {
        // The address of the owner.
        address addr;
        // Stores the start time of ownership with minimal overhead for tokenomics.
        uint64 startTimestamp;
        // Whether the token has been burned.
        bool burned;
        // Arbitrary data similar to `startTimestamp` that can be set via {_extraData}.
        uint24 extraData;
    }

    // =============================================================
    //                         TOKEN COUNTERS
    // =============================================================

    /**
     * @dev Returns the total number of tokens in existence.
     * Burned tokens will reduce the count.
     * To get the total number of tokens minted, please see {_totalMinted}.
     */
    function totalSupply() external view returns (uint256);

    // =============================================================
    //                            IERC165
    // =============================================================

    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * [EIP section](https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified)
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);

    // =============================================================
    //                            IERC721
    // =============================================================

    /**
     * @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`,
     * 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 be 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,
        bytes calldata data
    ) external payable;

    /**
     * @dev Equivalent to `safeTransferFrom(from, to, tokenId, '')`.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external payable;

    /**
     * @dev Transfers `tokenId` from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom}
     * whenever possible.
     *
     * 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 payable;

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

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

    // =============================================================
    //                        IERC721Metadata
    // =============================================================

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

    // =============================================================
    //                           IERC2309
    // =============================================================

    /**
     * @dev Emitted when tokens in `fromTokenId` to `toTokenId`
     * (inclusive) is transferred from `from` to `to`, as defined in the
     * [ERC2309](https://eips.ethereum.org/EIPS/eip-2309) standard.
     *
     * See {_mintERC2309} for more details.
     */
    event ConsecutiveTransfer(uint256 indexed fromTokenId, uint256 toTokenId, address indexed from, address indexed to);
}

File 27 of 28 : OperatorFilterer.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

import { IOperatorFilterRegistry } from './IOperatorFilterRegistry.sol';

/**
 * @title  OperatorFilterer
 * @notice Abstract contract whose constructor automatically registers and optionally subscribes to or copies another
 *         registrant's entries in the OperatorFilterRegistry.
 * @dev    This smart contract is meant to be inherited by token contracts so they can use the following:
 *         - `onlyAllowedOperator` modifier for `transferFrom` and `safeTransferFrom` methods.
 *         - `onlyAllowedOperatorApproval` modifier for `approve` and `setApprovalForAll` methods.
 */
abstract contract OperatorFilterer {
  error OperatorNotAllowed(address operator);

  IOperatorFilterRegistry public constant OPERATOR_FILTER_REGISTRY =
    IOperatorFilterRegistry(0x000000000000AAeB6D7670E522A718067333cd4E);

  constructor(address subscriptionOrRegistrantToCopy, bool subscribe) {
    // If an inheriting token contract is deployed to a network without the registry deployed, the modifier
    // will not revert, but the contract will need to be registered with the registry once it is deployed in
    // order for the modifier to filter addresses.
    if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
      if (subscribe) {
        OPERATOR_FILTER_REGISTRY.registerAndSubscribe(address(this), subscriptionOrRegistrantToCopy);
      } else {
        if (subscriptionOrRegistrantToCopy != address(0)) {
          OPERATOR_FILTER_REGISTRY.registerAndCopyEntries(address(this), subscriptionOrRegistrantToCopy);
        } else {
          OPERATOR_FILTER_REGISTRY.register(address(this));
        }
      }
    }
  }

  modifier onlyAllowedOperator(address from) virtual {
    // Allow spending tokens from addresses with balance
    // Note that this still allows listings and marketplaces with escrow to transfer tokens if transferred
    // from an EOA.
    if (from != msg.sender) {
      _checkFilterOperator(msg.sender);
    }
    _;
  }

  modifier onlyAllowedOperatorApproval(address operator) virtual {
    _checkFilterOperator(operator);
    _;
  }

  function _checkFilterOperator(address operator) internal view virtual {
    // Check registry code length to facilitate testing in environments without a deployed registry.
    if (address(OPERATOR_FILTER_REGISTRY).code.length > 0) {
      if (!OPERATOR_FILTER_REGISTRY.isOperatorAllowed(address(this), operator)) {
        revert OperatorNotAllowed(operator);
      }
    }
  }
}

File 28 of 28 : IOperatorFilterRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface IOperatorFilterRegistry {
  function isOperatorAllowed(address registrant, address operator) external view returns (bool);

  function register(address registrant) external;

  function registerAndSubscribe(address registrant, address subscription) external;

  function registerAndCopyEntries(address registrant, address registrantToCopy) external;

  function unregister(address addr) external;

  function updateOperator(
    address registrant,
    address operator,
    bool filtered
  ) external;

  function updateOperators(
    address registrant,
    address[] calldata operators,
    bool filtered
  ) external;

  function updateCodeHash(
    address registrant,
    bytes32 codehash,
    bool filtered
  ) external;

  function updateCodeHashes(
    address registrant,
    bytes32[] calldata codeHashes,
    bool filtered
  ) external;

  function subscribe(address registrant, address registrantToSubscribe) external;

  function unsubscribe(address registrant, bool copyExistingEntries) external;

  function subscriptionOf(address addr) external returns (address registrant);

  function subscribers(address registrant) external returns (address[] memory);

  function subscriberAt(address registrant, uint256 index) external returns (address);

  function copyEntriesOf(address registrant, address registrantToCopy) external;

  function isOperatorFiltered(address registrant, address operator) external returns (bool);

  function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool);

  function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool);

  function filteredOperators(address addr) external returns (address[] memory);

  function filteredCodeHashes(address addr) external returns (bytes32[] memory);

  function filteredOperatorAt(address registrant, uint256 index) external returns (address);

  function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32);

  function isRegistered(address addr) external returns (bool);

  function codeHashOf(address addr) external returns (bytes32);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"assetsAddress","type":"address"},{"internalType":"address","name":"tacticalGearAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"OperatorNotAllowed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"forge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getCardImage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getForgedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getForgedGear","outputs":[{"components":[{"internalType":"string","name":"fullName","type":"string"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"category","type":"string"},{"internalType":"string","name":"prefix","type":"string"},{"internalType":"string","name":"suffix","type":"string"},{"internalType":"bool","name":"isForged","type":"bool"},{"internalType":"string","name":"extra","type":"string"}],"internalType":"struct IForgedGear.ForgedGear","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getImage","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162004bd638038062004bd68339810160408190526200003491620003fa565b733cc6cdda760b79bafa08df41ecfa224f810dceb6600185858160009080519060200190620000659291906200026a565b5080516200007b9060019060208401906200026a565b50505062000098620000926200021460201b60201c565b62000218565b6daaeb6d7670e522a718067333cd4e3b15620001dd5780156200012b57604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200010c57600080fd5b505af115801562000121573d6000803e3d6000fd5b50505050620001dd565b6001600160a01b038216156200017c5760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401620000f1565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001c357600080fd5b505af1158015620001d8573d6000803e3d6000fd5b505050505b5050600c80546001600160a01b039384166001600160a01b031991821617909155600d805492909316911617905550620004c59050565b3390565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b828054620002789062000489565b90600052602060002090601f0160209004810192826200029c5760008555620002e7565b82601f10620002b757805160ff1916838001178555620002e7565b82800160010185558215620002e7579182015b82811115620002e7578251825591602001919060010190620002ca565b50620002f5929150620002f9565b5090565b5b80821115620002f55760008155600101620002fa565b634e487b7160e01b600052604160045260246000fd5b600082601f8301126200033857600080fd5b81516001600160401b038082111562000355576200035562000310565b604051601f8301601f19908116603f0116810190828211818310171562000380576200038062000310565b816040528381526020925086838588010111156200039d57600080fd5b600091505b83821015620003c15785820183015181830184015290820190620003a2565b83821115620003d35760008385830101525b9695505050505050565b80516001600160a01b0381168114620003f557600080fd5b919050565b600080600080608085870312156200041157600080fd5b84516001600160401b03808211156200042957600080fd5b620004378883890162000326565b955060208701519150808211156200044e57600080fd5b506200045d8782880162000326565b9350506200046e60408601620003dd565b91506200047e60608601620003dd565b905092959194509250565b600181811c908216806200049e57607f821691505b602082108103620004bf57634e487b7160e01b600052602260045260246000fd5b50919050565b61470180620004d56000396000f3fe608060405234801561001057600080fd5b50600436106101335760003560e01c806301ffc9a71461013857806306fdde0314610160578063081812fc14610175578063095ea7b31461019557806318160ddd146101aa57806323b872dd146101bc5780632607aafa146101cf5780632f745c59146101e25780633cdebf76146101f557806341f434341461021557806342842e0e1461022a5780634f6ccce71461023d5780635e1b5a00146102505780636352211e14610263578063641cc9d41461027657806370a0823114610289578063715018a61461029c5780638b89ad89146102a45780638da5cb5b146102b757806395d89b41146102bf578063a22cb465146102c7578063b88d4fde146102da578063c87b56dd146102ed578063e985e9c514610300578063f2fde38b14610313575b600080fd5b61014b610146366004613037565b610326565b60405190151581526020015b60405180910390f35b610168610351565b60405161015791906130b3565b6101886101833660046130c6565b6103e3565b60405161015791906130df565b6101a86101a336600461310f565b61040a565b005b6008545b604051908152602001610157565b6101a86101ca366004613139565b610423565b6101686101dd3660046130c6565b61044e565b6101ae6101f036600461310f565b610873565b6102086102033660046130c6565b610909565b6040516101579190613175565b6101886daaeb6d7670e522a718067333cd4e81565b6101a8610238366004613139565b610c61565b6101ae61024b3660046130c6565b610c86565b6101ae61025e3660046130c6565b610d19565b6101886102713660046130c6565b610d59565b6101a861028436600461310f565b610d8d565b6101ae610297366004613243565b610dd6565b6101a8610e5c565b6101686102b23660046130c6565b610e70565b6101886115f8565b610168611607565b6101a86102d536600461326c565b611616565b6101a86102e8366004613310565b61162a565b6101686102fb3660046130c6565b611657565b61014b61030e3660046133ba565b61184e565b6101a8610321366004613243565b61187c565b60006001600160e01b0319821663780e9d6360e01b148061034b575061034b826118f5565b92915050565b606060008054610360906133ed565b80601f016020809104026020016040519081016040528092919081815260200182805461038c906133ed565b80156103d95780601f106103ae576101008083540402835291602001916103d9565b820191906000526020600020905b8154815290600101906020018083116103bc57829003601f168201915b5050505050905090565b60006103ee82611945565b506000908152600460205260409020546001600160a01b031690565b816104148161196a565b61041e8383611a1a565b505050565b826001600160a01b038116331461043d5761043d3361196a565b610448848484611b2a565b50505050565b606061045982611b5b565b61047e5760405162461bcd60e51b815260040161047590613427565b60405180910390fd5b6040805160a0810191829052600c54600d54633129e77360e01b90935260a4820185905261034b9282916001600160a01b039081169163cd5286d09116633129e77360c48501600060405180830381865afa1580156104e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610509919081019061349a565b602001516040518263ffffffff1660e01b815260040161052991906130b3565b600060405180830381865afa158015610546573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261056e9190810190613540565b8152600c54600d54604051634a0a5c8160e11b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690639414b90290602401600060405180830381865afa1580156105ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105f29190810190613540565b600d54604051633129e77360e01b8152600481018a90526001600160a01b0390911690633129e77390602401600060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610663919081019061349a565b60200151604051602001610678929190613590565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016106a391906130b3565b600060405180830381865afa1580156106c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106e89190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa158015610744573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261076c919081019061349a565b6020015160405160200161078091906135cc565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016107ab91906130b3565b600060405180830381865afa1580156107c8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107f09190810190613540565b815260016020820152600d546040805163a67fdc7360e01b8152600481018890529201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a91906135f9565b15159052611b78565b600061087e83610dd6565b82106108e05760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610475565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61094b6040518060e001604052806060815260200160608152602001606081526020016060815260200160608152602001600015158152602001606081525090565b61095482611b5b565b6109705760405162461bcd60e51b815260040161047590613427565b600d54604051634a0a5c8160e11b8152600481018490526000916001600160a01b031690639414b90290602401600060405180830381865afa1580156109ba573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e29190810190613540565b600d54604051633129e77360e01b8152600481018690529192506000916001600160a01b0390911690633129e77390602401600060405180830381865afa158015610a31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a59919081019061349a565b60200151600d5460405162d47de760e71b8152600481018790529192506000916001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015610aab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad39190810190613540565b600d54604051633129e77360e01b8152600481018890529192506000916001600160a01b0390911690633129e77390602401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b4a919081019061349a565b516040805160e0810190915290915080610b6a8686866101008501613616565b60408051808303601f19018152918152908252602082018690528181018490526060820187905260808201859052600160a0830152600d54905163a67fdc7360e01b8152600481018a905260c0909201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa158015610bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1191906135f9565b610c3757604051806040016040528060048152602001634e6f6e6560e01b815250610c55565b6040518060400160405280600481526020016352304e3160e01b8152505b90529695505050505050565b826001600160a01b0381163314610c7b57610c7b3361196a565b610448848484611d8d565b6000610c9160085490565b8210610cf45760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610475565b60088281548110610d0757610d07613670565b90600052602060002001549050919050565b600d546000906001600160a01b03163314610d465760405162461bcd60e51b815260040161047590613686565b506000908152600b602052604090205490565b600080610d6583611da8565b90506001600160a01b03811661034b5760405162461bcd60e51b8152600401610475906136c7565b600d546001600160a01b03163314610db75760405162461bcd60e51b815260040161047590613686565b6000818152600b60205260409020429055610dd28282611dc3565b5050565b60006001600160a01b038216610e405760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610475565b506001600160a01b031660009081526003602052604090205490565b610e64611ddd565b610e6e6000611e3c565b565b6060610e7b82611b5b565b610e975760405162461bcd60e51b815260040161047590613427565b60408051610160810191829052600d54633129e77360e01b909252610164810184905261034b9181906001600160a01b0316633129e7736101848301600060405180830381865afa158015610ef0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f18919081019061349a565b6020908101518252600d54604051634a0a5c8160e11b81526004810188905292909101916001600160a01b0390911690639414b90290602401600060405180830381865afa158015610f6e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f969190810190613540565b8152600d5460405162d47de760e71b8152600481018790526020909201916001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261100e9190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa15801561106a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611092919081019061349a565b602001516040518263ffffffff1660e01b81526004016110b291906130b3565b600060405180830381865afa1580156110cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110f79190810190613540565b8152600c54600d54604051634a0a5c8160e11b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690639414b90290602401600060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261117b9190810190613540565b600d54604051633129e77360e01b8152600481018a90526001600160a01b0390911690633129e77390602401600060405180830381865afa1580156111c4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111ec919081019061349a565b60200151604051602001611201929190613590565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161122c91906130b3565b600060405180830381865afa158015611249573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112719190810190613540565b8152600c54600d5460405162d47de760e71b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690636a3ef38090602401600060405180830381865afa1580156112cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112f49190810190613540565b6040518263ffffffff1660e01b815260040161131091906130b3565b600060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113559190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa1580156113b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113d9919081019061349a565b602001516040516020016113ed91906135cc565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161141891906130b3565b600060405180830381865afa158015611435573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261145d9190810190613540565b815260016020820152600d546040805163a67fdc7360e01b8152600481018890529201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d791906135f9565b15158152600c54604051630cd5286d60e41b81526020600480830182905260248301526318d85c9960e21b6044830152909201916001600160a01b039091169063cd5286d090606401600060405180830381865afa15801561153d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115659190810190613540565b8152600c54604051630cd5286d60e41b815260206004808301829052602483015263199bdb9d60e21b6044830152909201916001600160a01b039091169063cd5286d090606401600060405180830381865afa1580156115c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115f19190810190613540565b9052611e8e565b600a546001600160a01b031690565b606060018054610360906133ed565b816116208161196a565b61041e8383612251565b836001600160a01b0381163314611644576116443361196a565b6116508585858561225c565b5050505050565b606061166282611b5b565b61167e5760405162461bcd60e51b815260040161047590613427565b600d54604051633129e77360e01b81526004810184905261034b916001600160a01b031690633129e77390602401600060405180830381865afa1580156116c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116f1919081019061349a565b600d5460405162d47de760e71b8152600481018690526001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015611739573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117619190810190613540565b600d54604051634a0a5c8160e11b8152600481018790526001600160a01b0390911690639414b90290602401600060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117d29190810190613540565b600d5460405163a67fdc7360e01b8152600481018890526001916001600160a01b03169063a67fdc7390602401602060405180830381865afa15801561181c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184091906135f9565b61184988610e70565b61228e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b611884611ddd565b6001600160a01b0381166118e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610475565b6118f281611e3c565b50565b60006001600160e01b031982166380ac58cd60e01b148061192657506001600160e01b03198216635b5e139f60e01b145b8061034b57506301ffc9a760e01b6001600160e01b031983161461034b565b61194e81611b5b565b6118f25760405162461bcd60e51b8152600401610475906136c7565b6daaeb6d7670e522a718067333cd4e3b156118f257604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb91906135f9565b6118f25780604051633b79c77360e21b815260040161047591906130df565b6000611a2582610d59565b9050806001600160a01b0316836001600160a01b031603611a925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610475565b336001600160a01b0382161480611aae5750611aae813361184e565b611b205760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610475565b61041e838361242e565b611b34338261249c565b611b505760405162461bcd60e51b8152600401610475906136f9565b61041e8383836124fb565b600080611b6783611da8565b6001600160a01b0316141592915050565b606060008260800151611b9a5760405180602001604052806000815250611c11565b611c11604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250876040015161265a565b611c88604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250886000015161265a565b8460600151611ca65760405180602001604052806000815250611d1d565b611d1d604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250896020015161265a565b604051602001611d2f93929190613746565b60408051601f1981840301815290829052611d4c91602001613789565b6040516020818303038152906040529050611d668161268f565b604051602001611d769190613942565b604051602081830303815290604052915050919050565b61041e8383836040518060200160405280600081525061162a565b6000908152600260205260409020546001600160a01b031690565b610dd28282604051806020016040528060008152506127e1565b33611de66115f8565b6001600160a01b031614610e6e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610475565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000826101400151611eca84600001518560400151604051602001611eb6929190613590565b604051602081830303815290604052612814565b604051602001611edb929190613984565b604051602081830303815290604052836101000151611f095760405180602001604052806000815250611f81565b611f81604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508860c0015161265a565b611ffa604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001611b9b60f11b815250604051806040016040528060038152602001620c4c4d60ea1b81525089610120015161265a565b612072604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508a6060015161265a565b6120ea60405180604001604052806002815260200161033360f41b815250604051806040016040528060018152602001600360fc1b81525060405180604001604052806002815260200161189b60f11b81525060405180604001604052806002815260200161189960f11b8152508b60a0015161265a565b8760e001516121085760405180602001604052806000815250612180565b612180604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508c6080015161265a565b604051602001612194959493929190613ae3565b6040516020818303038152906040528460e001516121f557845160408087015190516121c4929190602001613590565b60408051601f19818403018152908290526121e191602001613b4e565b60405160208183030381529060405261223f565b6020808601518651604080890151905192936122119301613590565b60408051601f198184030181529082905261222f9291602001613bd7565b6040516020818303038152906040525b604051602001611d4c93929190613ccb565b610dd2338383612861565b612266338361249c565b6122825760405162461bcd60e51b8152600401610475906136f9565b6104488484848461292b565b60208601518651606091906000866122c75782896040516020016122b3929190613e81565b6040516020818303038152906040526122ec565b87838a6040516020016122dc93929190613ee2565b6040516020818303038152906040525b83886123075760405180602001604052806000815250612328565b896040516020016123189190613f61565b6040516020818303038152906040525b8b858b801561233457508a5b61234d57604051806020016040528060008152506123b2565b8a61237457604051806040016040528060048152602001634e6f6e6560e01b815250612392565b6040518060400160405280600481526020016352304e3160e01b8152505b6040516020016123a29190613fbf565b6040516020818303038152906040525b6040516020016123c695949392919061401c565b60408051601f19818403018152908290526123e692918890602001614136565b60405160208183030381529060405290506124008161268f565b6040516020016124109190614269565b60405160208183030381529060405293505050509695505050505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061246382610d59565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806124a883610d59565b9050806001600160a01b0316846001600160a01b031614806124cf57506124cf818561184e565b806124f35750836001600160a01b03166124e8846103e3565b6001600160a01b0316145b949350505050565b826001600160a01b031661250e82610d59565b6001600160a01b0316146125345760405162461bcd60e51b8152600401610475906142ae565b6001600160a01b0382166125965760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610475565b6125a3838383600161295e565b826001600160a01b03166125b682610d59565b6001600160a01b0316146125dc5760405162461bcd60e51b8152600401610475906142ae565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652600385528386208054600019019055908716808652838620805460010190558686526002909452828520805490921684179091559051849360008051602061468c83398151915291a4505050565b606085858585856040516020016126759594939291906142f3565b604051602081830303815290604052905095945050505050565b606081516000036126ae57505060408051602081019091526000815290565b600060405180606001604052806040815260200161462c60409139905060006003845160026126dd9190614447565b6126e7919061445f565b6126f2906004614481565b6001600160401b03811115612709576127096132a3565b6040519080825280601f01601f191660200182016040528015612733576020820181803683370190505b509050600182016020820185865187015b8082101561279f576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250612744565b50506003865106600181146127bb57600281146127ce576127d6565b603d6001830353603d60028303536127d6565b603d60018303535b509195945050505050565b6127eb8383612a97565b6127f86000848484612ba0565b61041e5760405162461bcd60e51b8152600401610475906144a0565b805160609060219060049081908381111561282e57600391505b61283782612ca1565b60405160200161284791906144f2565b604051602081830303815290604052945050505050919050565b816001600160a01b0316836001600160a01b0316036128be5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610475565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6129368484846124fb565b61294284848484612ba0565b6104485760405162461bcd60e51b8152600401610475906144a0565b61296a84848484612d33565b60018111156129d95760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610475565b816001600160a01b038516612a3557612a3081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612a58565b836001600160a01b0316856001600160a01b031614612a5857612a588582612dbb565b6001600160a01b038416612a7457612a6f81612e58565b611650565b846001600160a01b0316846001600160a01b031614611650576116508482612f07565b6001600160a01b038216612aed5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610475565b612af681611b5b565b15612b135760405162461bcd60e51b815260040161047590614518565b612b2160008383600161295e565b612b2a81611b5b565b15612b475760405162461bcd60e51b815260040161047590614518565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b03191684179055518392919060008051602061468c833981519152908290a45050565b60006001600160a01b0384163b15612c9657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612be490339089908890889060040161454e565b6020604051808303816000875af1925050508015612c1f575060408051601f3d908101601f19168201909252612c1c91810190614581565b60015b612c7c573d808015612c4d576040519150601f19603f3d011682016040523d82523d6000602084013e612c52565b606091505b508051600003612c745760405162461bcd60e51b8152600401610475906144a0565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124f3565b506001949350505050565b60606000612cae83612f4b565b60010190506000816001600160401b03811115612ccd57612ccd6132a3565b6040519080825280601f01601f191660200182016040528015612cf7576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d0157509392505050565b6001811115610448576001600160a01b03841615612d79576001600160a01b03841660009081526003602052604081208054839290612d7390849061459e565b90915550505b6001600160a01b03831615610448576001600160a01b03831660009081526003602052604081208054839290612db0908490614447565b909155505050505050565b60006001612dc884610dd6565b612dd2919061459e565b600083815260076020526040902054909150808214612e25576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612e6a9060019061459e565b60008381526009602052604081205460088054939450909284908110612e9257612e92613670565b906000526020600020015490508060088381548110612eb357612eb3613670565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612eeb57612eeb6145b5565b6001900381819060005260206000200160009055905550505050565b6000612f1283610dd6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f8a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612fb4576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310612fd257662386f26fc10000830492506010015b6305f5e1008310612fea576305f5e100830492506008015b6127108310612ffe57612710830492506004015b60648310613010576064830492506002015b600a831061034b5760010192915050565b6001600160e01b0319811681146118f257600080fd5b60006020828403121561304957600080fd5b813561305481613021565b9392505050565b60005b8381101561307657818101518382015260200161305e565b838111156104485750506000910152565b6000815180845261309f81602086016020860161305b565b601f01601f19169290920160200192915050565b6020815260006130546020830184613087565b6000602082840312156130d857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461310a57600080fd5b919050565b6000806040838503121561312257600080fd5b61312b836130f3565b946020939093013593505050565b60008060006060848603121561314e57600080fd5b613157846130f3565b9250613165602085016130f3565b9150604084013590509250925092565b602081526000825160e06020840152613192610100840182613087565b90506020840151601f19808584030160408601526131b08383613087565b925060408601519150808584030160608601526131cd8383613087565b925060608601519150808584030160808601526131ea8383613087565b925060808601519150808584030160a08601526132078383613087565b925060a0860151915061321e60c086018315159052565b60c08601519150808584030160e08601525061323a8282613087565b95945050505050565b60006020828403121561325557600080fd5b613054826130f3565b80151581146118f257600080fd5b6000806040838503121561327f57600080fd5b613288836130f3565b915060208301356132988161325e565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156132e1576132e16132a3565b604052919050565b60006001600160401b03821115613302576133026132a3565b50601f01601f191660200190565b6000806000806080858703121561332657600080fd5b61332f856130f3565b935061333d602086016130f3565b92506040850135915060608501356001600160401b0381111561335f57600080fd5b8501601f8101871361337057600080fd5b803561338361337e826132e9565b6132b9565b81815288602083850101111561339857600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156133cd57600080fd5b6133d6836130f3565b91506133e4602084016130f3565b90509250929050565b600181811c9082168061340157607f821691505b60208210810361342157634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b600082601f83011261346657600080fd5b815161347461337e826132e9565b81815284602083860101111561348957600080fd5b6124f382602083016020870161305b565b6000602082840312156134ac57600080fd5b81516001600160401b03808211156134c357600080fd5b90830190604082860312156134d757600080fd5b6040516040810181811083821117156134f2576134f26132a3565b60405282518281111561350457600080fd5b61351087828601613455565b82525060208301518281111561352557600080fd5b61353187828601613455565b60208301525095945050505050565b60006020828403121561355257600080fd5b81516001600160401b0381111561356857600080fd5b6124f384828501613455565b6000815161358681856020860161305b565b9290920192915050565b600083516135a281846020880161305b565b600160fd1b90830190815283516135c081600184016020880161305b565b01600101949350505050565b64029182718960dd1b8152600082516135ec81600585016020870161305b565b9190910160050192915050565b60006020828403121561360b57600080fd5b81516130548161325e565b6000845161362881846020890161305b565b8083019050600160fd1b8082528551613648816001850160208a0161305b565b6001920191820152835161366381600284016020880161305b565b0160020195945050505050565b634e487b7160e01b600052603260045260246000fd5b60208082526021908201527f53686f756c642062652063616c6c6564206279204765617220636f6e747261636040820152601d60fa1b606082015260800190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6000845161375881846020890161305b565b84519083019061376c81836020890161305b565b845191019061377f81836020880161305b565b0195945050505050565b60008051602061460c833981519152815260008051602061466c83398151915260208201526000805160206145cc83398151915260408201526000805160206145ec83398151915260608201527f313939392f7868746d6c272077696474683d2736343027206865696768743d2760808201527f36343027207072657365727665417370656374526174696f3d27784d6964594d60a08201527f6964206d656574272076696577426f783d27302030203634203634272073747960c08201527f6c653d277374726f6b652d77696474683a303b206261636b67726f756e642d6360e08201527f6f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746f3b6101008201527f6865696768743a202d7765626b69742d66696c6c2d617661696c61626c65273e6101208201527f3c7374796c6520747970653d27746578742f637373273e2e706978656c6174656101408201527f64207b20696d6167652d72656e646572696e673a20706978656c617465643b20610160820152683e9e17b9ba3cb6329f60b91b6101808201526000613054613930610189840185613574565b651e17b9bb339f60d11b815260060190565b7919185d184e9a5b5859d94bdcdd99cade1b5b0ed8985cd94d8d0b60321b81526000825161397781601a85016020870161305b565b91909101601a0192915050565b761e39ba3cb632903a3cb8329e93ba32bc3a17b1b9b9939f60491b81527f40666f6e742d66616365207b20666f6e742d66616d696c793a2047656172466f60178201526d6e743b207372633a2075726c282760901b6037820152600083516139f381604585016020880161305b565b6427293b207d60d81b6045918401918201527f2e706978656c61746564207b20696d6167652d72656e646572696e673a207069604a8201526978656c617465643b207d60b01b606a8201527f2e6e616d65207b20666f6e742d66616d696c793a2047656172466f6e743b2066607482015269037b73a16b9b4bd329d160b51b60948201528351613a8a81609e84016020880161305b565b7f3b20746578742d7472616e73666f726d3a207570706572636173653b2066696c9101609e8101919091526a6c3a20626c61636b3b207d60a81b60be820152671e17b9ba3cb6329f60c11b60c982015260d1810161323a565b60008651613af5818460208b0161305b565b865190830190613b09818360208b0161305b565b8651910190613b1c818360208a0161305b565b8551910190613b2f81836020890161305b565b8451910190613b4281836020880161305b565b01979650505050505050565b7f3c7465787420783d273530252720793d273130342e35302720746578742d616e81526000805160206146ac83398151915260208201527513b6b4b2323632939031b630b9b99e93b730b6b2939f60511b604082015260008251613bb981605685016020870161305b565b661e17ba32bc3a1f60c91b6056939091019283015250605d01919050565b7f3c7465787420783d273530252720793d273130332e35302720746578742d616e815260006000805160206146ac8339815191528060208401527513b137ba3a37b6939031b630b9b99e93b730b6b2939f60511b60408401528451613c4381605686016020890161305b565b8084019050661e17ba32bc3a1f60c91b8060568301527f3c7465787420783d273530252720793d273130362e37352720746578742d616e605d83015282607d8301527213ba37b8139031b630b9b99e93b730b6b2939f60691b609d83015285519250613cb68360b084016020890161305b565b910160b081019190915260b701949350505050565b60008051602061460c833981519152815260008051602061466c83398151915260208201526000805160206145cc83398151915260408201526000805160206145ec83398151915260608201527f313939392f7868746d6c272077696474683d2737363027206865696768743d2760808201527f3131343027207072657365727665417370656374526174696f3d27784d69645960a08201527f4d6964206d656574272076696577426f783d273020302037362031313427207360c08201527f74796c653d277374726f6b652d77696474683a303b206261636b67726f756e6460e08201527f2d636f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746101008201527f6f3b6865696768743a202d7765626b69742d66696c6c2d617661696c61626c6561012082015261139f60f11b610140820152600061323a613930613e7b613e75613e2661014287018a613574565b7f3c726563742077696474683d273130302527206865696768743d27313030252781527f20783d27302720793d2730272066696c6c3d272338383765383827202f3e00006020820152603e0190565b87613574565b85613574565b68113730b6b2911d101160b91b81528251600090613ea681600985016020880161305b565b600160fd1b6009918401918201528351613ec781600a84016020880161305b565b61088b60f21b600a9290910191820152600c01949350505050565b68113730b6b2911d101160b91b81528351600090613f0781600985016020890161305b565b8083019050600160fd1b8060098301528551613f2a81600a850160208a0161305b565b600a9201918201528351613f4581600b84016020880161305b565b61088b60f21b600b9290910191820152600d0195945050505050565b7f7b2274726169745f74797065223a2022507265666978222c202276616c7565228152621d101160e91b602082015260008251613fa581602385016020870161305b565b62089f4b60ea1b6023939091019283015250602601919050565b7f2c7b2274726169745f74797065223a20224578747261222c202276616c7565228152621d101160e91b60208201526000825161400381602385016020870161305b565b61227d60f01b6023939091019283015250602501919050565b7f7b2274726169745f74797065223a20224e616d65222c202276616c7565223a208152601160f91b60208201526000865161405e816021850160208b0161305b565b62089f4b60ea1b60219184019182018190528751614083816024850160208c0161305b565b7f7b2274726169745f74797065223a2022537566666978222c202276616c75652260249390910192830152621d101160e91b604483015286516140cd816047850160208b0161305b565b60479201918201527f7b2274726169745f74797065223a202243617465676f7279222c202276616c75604a8201526432911d101160d91b606a82015261412a613e7b61411c606f840188613574565b61227d60f01b815260020190565b98975050505050505050565b607b60f81b81526000845161415281600185016020890161305b565b7f226465736372697074696f6e223a2022497420676f7420656d70747920696e206001918401918201527f7468652076656e74732061667465722030424552314e2068616420676f6e652060218201527f6d697373696e672e20546865206e65656420666f7220776561706f6e7320616e60418201527f642061726d6f72206973206e6f772067726561746572207468616e20697420656061820152691d995c881dd85ccb888b60b21b60818201526e2261747472696275746573223a205b60881b608b820152845161422c81609a84016020890161305b565b61174b60f21b9101609a810191909152691134b6b0b3b2911d101160b11b609c82015261425f61411c60a6830186613574565b9695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516142a181601d85016020870161305b565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b713c666f726569676e4f626a65637420783d2760701b81526000865160206143218260128601838c0161305b565b642720793d2760d81b60129285019283015287516143458160178501848c0161305b565b68272077696474683d2760b81b60179390910192830152865161436d81838501848b0161305b565b6927206865696768743d2760b01b920181810192909252855161439681602a850189850161305b565b61139f60f11b602a9390910192830152507f3c7868746d6c3a696d6720636c6173733d27706978656c617465642720776964602c8201527f74683d273130302527206865696768743d273130302527207372633d27000000604c82015261412a6144156144066069840187613574565b6213979f60e91b815260030190565b6f1e17b337b932b4b3b727b13532b1ba1f60811b815260100190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561445a5761445a614431565b500190565b60008261447c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561449b5761449b614431565b500290565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000825161450481846020870161305b565b610e0f60f31b920191825250600201919050565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061425f90830184613087565b60006020828403121561459357600080fd5b815161305481613021565b6000828210156145b0576145b0614431565b500390565b634e487b7160e01b600052603160045260246000fdfe6b3d27687474703a2f2f7777772e77332e6f72672f313939392f786c696e6b2720786d6c6e733a7868746d6c3d27687474703a2f2f7777772e77332e6f72672f3c7376672076657273696f6e3d27312e312720786d6c6e733d27687474703a2f4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f2f7777772e77332e6f72672f323030302f7376672720786d6c6e733a786c696eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef63686f723d276d6964646c652720646f6d696e616e742d626173656c696e653da264697066735822122039ff91b6ce9b6b13f555b22e02125d290272ab4b5edc95d0569cc54467c1097964736f6c634300080d0033000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14000000000000000000000000000000000000000000000000000000000000000f466f7267656420304e3120476561720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a464f524745444745415200000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101335760003560e01c806301ffc9a71461013857806306fdde0314610160578063081812fc14610175578063095ea7b31461019557806318160ddd146101aa57806323b872dd146101bc5780632607aafa146101cf5780632f745c59146101e25780633cdebf76146101f557806341f434341461021557806342842e0e1461022a5780634f6ccce71461023d5780635e1b5a00146102505780636352211e14610263578063641cc9d41461027657806370a0823114610289578063715018a61461029c5780638b89ad89146102a45780638da5cb5b146102b757806395d89b41146102bf578063a22cb465146102c7578063b88d4fde146102da578063c87b56dd146102ed578063e985e9c514610300578063f2fde38b14610313575b600080fd5b61014b610146366004613037565b610326565b60405190151581526020015b60405180910390f35b610168610351565b60405161015791906130b3565b6101886101833660046130c6565b6103e3565b60405161015791906130df565b6101a86101a336600461310f565b61040a565b005b6008545b604051908152602001610157565b6101a86101ca366004613139565b610423565b6101686101dd3660046130c6565b61044e565b6101ae6101f036600461310f565b610873565b6102086102033660046130c6565b610909565b6040516101579190613175565b6101886daaeb6d7670e522a718067333cd4e81565b6101a8610238366004613139565b610c61565b6101ae61024b3660046130c6565b610c86565b6101ae61025e3660046130c6565b610d19565b6101886102713660046130c6565b610d59565b6101a861028436600461310f565b610d8d565b6101ae610297366004613243565b610dd6565b6101a8610e5c565b6101686102b23660046130c6565b610e70565b6101886115f8565b610168611607565b6101a86102d536600461326c565b611616565b6101a86102e8366004613310565b61162a565b6101686102fb3660046130c6565b611657565b61014b61030e3660046133ba565b61184e565b6101a8610321366004613243565b61187c565b60006001600160e01b0319821663780e9d6360e01b148061034b575061034b826118f5565b92915050565b606060008054610360906133ed565b80601f016020809104026020016040519081016040528092919081815260200182805461038c906133ed565b80156103d95780601f106103ae576101008083540402835291602001916103d9565b820191906000526020600020905b8154815290600101906020018083116103bc57829003601f168201915b5050505050905090565b60006103ee82611945565b506000908152600460205260409020546001600160a01b031690565b816104148161196a565b61041e8383611a1a565b505050565b826001600160a01b038116331461043d5761043d3361196a565b610448848484611b2a565b50505050565b606061045982611b5b565b61047e5760405162461bcd60e51b815260040161047590613427565b60405180910390fd5b6040805160a0810191829052600c54600d54633129e77360e01b90935260a4820185905261034b9282916001600160a01b039081169163cd5286d09116633129e77360c48501600060405180830381865afa1580156104e1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610509919081019061349a565b602001516040518263ffffffff1660e01b815260040161052991906130b3565b600060405180830381865afa158015610546573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261056e9190810190613540565b8152600c54600d54604051634a0a5c8160e11b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690639414b90290602401600060405180830381865afa1580156105ca573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105f29190810190613540565b600d54604051633129e77360e01b8152600481018a90526001600160a01b0390911690633129e77390602401600060405180830381865afa15801561063b573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610663919081019061349a565b60200151604051602001610678929190613590565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016106a391906130b3565b600060405180830381865afa1580156106c0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526106e89190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa158015610744573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261076c919081019061349a565b6020015160405160200161078091906135cc565b6040516020818303038152906040526040518263ffffffff1660e01b81526004016107ab91906130b3565b600060405180830381865afa1580156107c8573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107f09190810190613540565b815260016020820152600d546040805163a67fdc7360e01b8152600481018890529201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa158015610846573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086a91906135f9565b15159052611b78565b600061087e83610dd6565b82106108e05760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610475565b506001600160a01b03919091166000908152600660209081526040808320938352929052205490565b61094b6040518060e001604052806060815260200160608152602001606081526020016060815260200160608152602001600015158152602001606081525090565b61095482611b5b565b6109705760405162461bcd60e51b815260040161047590613427565b600d54604051634a0a5c8160e11b8152600481018490526000916001600160a01b031690639414b90290602401600060405180830381865afa1580156109ba573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526109e29190810190613540565b600d54604051633129e77360e01b8152600481018690529192506000916001600160a01b0390911690633129e77390602401600060405180830381865afa158015610a31573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610a59919081019061349a565b60200151600d5460405162d47de760e71b8152600481018790529192506000916001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015610aab573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610ad39190810190613540565b600d54604051633129e77360e01b8152600481018890529192506000916001600160a01b0390911690633129e77390602401600060405180830381865afa158015610b22573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b4a919081019061349a565b516040805160e0810190915290915080610b6a8686866101008501613616565b60408051808303601f19018152918152908252602082018690528181018490526060820187905260808201859052600160a0830152600d54905163a67fdc7360e01b8152600481018a905260c0909201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa158015610bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1191906135f9565b610c3757604051806040016040528060048152602001634e6f6e6560e01b815250610c55565b6040518060400160405280600481526020016352304e3160e01b8152505b90529695505050505050565b826001600160a01b0381163314610c7b57610c7b3361196a565b610448848484611d8d565b6000610c9160085490565b8210610cf45760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610475565b60088281548110610d0757610d07613670565b90600052602060002001549050919050565b600d546000906001600160a01b03163314610d465760405162461bcd60e51b815260040161047590613686565b506000908152600b602052604090205490565b600080610d6583611da8565b90506001600160a01b03811661034b5760405162461bcd60e51b8152600401610475906136c7565b600d546001600160a01b03163314610db75760405162461bcd60e51b815260040161047590613686565b6000818152600b60205260409020429055610dd28282611dc3565b5050565b60006001600160a01b038216610e405760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610475565b506001600160a01b031660009081526003602052604090205490565b610e64611ddd565b610e6e6000611e3c565b565b6060610e7b82611b5b565b610e975760405162461bcd60e51b815260040161047590613427565b60408051610160810191829052600d54633129e77360e01b909252610164810184905261034b9181906001600160a01b0316633129e7736101848301600060405180830381865afa158015610ef0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f18919081019061349a565b6020908101518252600d54604051634a0a5c8160e11b81526004810188905292909101916001600160a01b0390911690639414b90290602401600060405180830381865afa158015610f6e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610f969190810190613540565b8152600d5460405162d47de760e71b8152600481018790526020909201916001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261100e9190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa15801561106a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052611092919081019061349a565b602001516040518263ffffffff1660e01b81526004016110b291906130b3565b600060405180830381865afa1580156110cf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526110f79190810190613540565b8152600c54600d54604051634a0a5c8160e11b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690639414b90290602401600060405180830381865afa158015611153573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261117b9190810190613540565b600d54604051633129e77360e01b8152600481018a90526001600160a01b0390911690633129e77390602401600060405180830381865afa1580156111c4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526111ec919081019061349a565b60200151604051602001611201929190613590565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161122c91906130b3565b600060405180830381865afa158015611249573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112719190810190613540565b8152600c54600d5460405162d47de760e71b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690636a3ef38090602401600060405180830381865afa1580156112cc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526112f49190810190613540565b6040518263ffffffff1660e01b815260040161131091906130b3565b600060405180830381865afa15801561132d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113559190810190613540565b8152600c54600d54604051633129e77360e01b8152600481018890526020909301926001600160a01b039283169263cd5286d0921690633129e77390602401600060405180830381865afa1580156113b1573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526113d9919081019061349a565b602001516040516020016113ed91906135cc565b6040516020818303038152906040526040518263ffffffff1660e01b815260040161141891906130b3565b600060405180830381865afa158015611435573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261145d9190810190613540565b815260016020820152600d546040805163a67fdc7360e01b8152600481018890529201916001600160a01b039091169063a67fdc7390602401602060405180830381865afa1580156114b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d791906135f9565b15158152600c54604051630cd5286d60e41b81526020600480830182905260248301526318d85c9960e21b6044830152909201916001600160a01b039091169063cd5286d090606401600060405180830381865afa15801561153d573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115659190810190613540565b8152600c54604051630cd5286d60e41b815260206004808301829052602483015263199bdb9d60e21b6044830152909201916001600160a01b039091169063cd5286d090606401600060405180830381865afa1580156115c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526115f19190810190613540565b9052611e8e565b600a546001600160a01b031690565b606060018054610360906133ed565b816116208161196a565b61041e8383612251565b836001600160a01b0381163314611644576116443361196a565b6116508585858561225c565b5050505050565b606061166282611b5b565b61167e5760405162461bcd60e51b815260040161047590613427565b600d54604051633129e77360e01b81526004810184905261034b916001600160a01b031690633129e77390602401600060405180830381865afa1580156116c9573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526116f1919081019061349a565b600d5460405162d47de760e71b8152600481018690526001600160a01b0390911690636a3ef38090602401600060405180830381865afa158015611739573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117619190810190613540565b600d54604051634a0a5c8160e11b8152600481018790526001600160a01b0390911690639414b90290602401600060405180830381865afa1580156117aa573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526117d29190810190613540565b600d5460405163a67fdc7360e01b8152600481018890526001916001600160a01b03169063a67fdc7390602401602060405180830381865afa15801561181c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184091906135f9565b61184988610e70565b61228e565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205460ff1690565b611884611ddd565b6001600160a01b0381166118e95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610475565b6118f281611e3c565b50565b60006001600160e01b031982166380ac58cd60e01b148061192657506001600160e01b03198216635b5e139f60e01b145b8061034b57506301ffc9a760e01b6001600160e01b031983161461034b565b61194e81611b5b565b6118f25760405162461bcd60e51b8152600401610475906136c7565b6daaeb6d7670e522a718067333cd4e3b156118f257604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb91906135f9565b6118f25780604051633b79c77360e21b815260040161047591906130df565b6000611a2582610d59565b9050806001600160a01b0316836001600160a01b031603611a925760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610475565b336001600160a01b0382161480611aae5750611aae813361184e565b611b205760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610475565b61041e838361242e565b611b34338261249c565b611b505760405162461bcd60e51b8152600401610475906136f9565b61041e8383836124fb565b600080611b6783611da8565b6001600160a01b0316141592915050565b606060008260800151611b9a5760405180602001604052806000815250611c11565b611c11604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250876040015161265a565b611c88604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250886000015161265a565b8460600151611ca65760405180602001604052806000815250611d1d565b611d1d604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b815250896020015161265a565b604051602001611d2f93929190613746565b60408051601f1981840301815290829052611d4c91602001613789565b6040516020818303038152906040529050611d668161268f565b604051602001611d769190613942565b604051602081830303815290604052915050919050565b61041e8383836040518060200160405280600081525061162a565b6000908152600260205260409020546001600160a01b031690565b610dd28282604051806020016040528060008152506127e1565b33611de66115f8565b6001600160a01b031614610e6e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610475565b600a80546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000826101400151611eca84600001518560400151604051602001611eb6929190613590565b604051602081830303815290604052612814565b604051602001611edb929190613984565b604051602081830303815290604052836101000151611f095760405180602001604052806000815250611f81565b611f81604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508860c0015161265a565b611ffa604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001611b9b60f11b815250604051806040016040528060038152602001620c4c4d60ea1b81525089610120015161265a565b612072604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508a6060015161265a565b6120ea60405180604001604052806002815260200161033360f41b815250604051806040016040528060018152602001600360fc1b81525060405180604001604052806002815260200161189b60f11b81525060405180604001604052806002815260200161189960f11b8152508b60a0015161265a565b8760e001516121085760405180602001604052806000815250612180565b612180604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508c6080015161265a565b604051602001612194959493929190613ae3565b6040516020818303038152906040528460e001516121f557845160408087015190516121c4929190602001613590565b60408051601f19818403018152908290526121e191602001613b4e565b60405160208183030381529060405261223f565b6020808601518651604080890151905192936122119301613590565b60408051601f198184030181529082905261222f9291602001613bd7565b6040516020818303038152906040525b604051602001611d4c93929190613ccb565b610dd2338383612861565b612266338361249c565b6122825760405162461bcd60e51b8152600401610475906136f9565b6104488484848461292b565b60208601518651606091906000866122c75782896040516020016122b3929190613e81565b6040516020818303038152906040526122ec565b87838a6040516020016122dc93929190613ee2565b6040516020818303038152906040525b83886123075760405180602001604052806000815250612328565b896040516020016123189190613f61565b6040516020818303038152906040525b8b858b801561233457508a5b61234d57604051806020016040528060008152506123b2565b8a61237457604051806040016040528060048152602001634e6f6e6560e01b815250612392565b6040518060400160405280600481526020016352304e3160e01b8152505b6040516020016123a29190613fbf565b6040516020818303038152906040525b6040516020016123c695949392919061401c565b60408051601f19818403018152908290526123e692918890602001614136565b60405160208183030381529060405290506124008161268f565b6040516020016124109190614269565b60405160208183030381529060405293505050509695505050505050565b600081815260046020526040902080546001600160a01b0319166001600160a01b038416908117909155819061246382610d59565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806124a883610d59565b9050806001600160a01b0316846001600160a01b031614806124cf57506124cf818561184e565b806124f35750836001600160a01b03166124e8846103e3565b6001600160a01b0316145b949350505050565b826001600160a01b031661250e82610d59565b6001600160a01b0316146125345760405162461bcd60e51b8152600401610475906142ae565b6001600160a01b0382166125965760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610475565b6125a3838383600161295e565b826001600160a01b03166125b682610d59565b6001600160a01b0316146125dc5760405162461bcd60e51b8152600401610475906142ae565b600081815260046020908152604080832080546001600160a01b03199081169091556001600160a01b03878116808652600385528386208054600019019055908716808652838620805460010190558686526002909452828520805490921684179091559051849360008051602061468c83398151915291a4505050565b606085858585856040516020016126759594939291906142f3565b604051602081830303815290604052905095945050505050565b606081516000036126ae57505060408051602081019091526000815290565b600060405180606001604052806040815260200161462c60409139905060006003845160026126dd9190614447565b6126e7919061445f565b6126f2906004614481565b6001600160401b03811115612709576127096132a3565b6040519080825280601f01601f191660200182016040528015612733576020820181803683370190505b509050600182016020820185865187015b8082101561279f576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250612744565b50506003865106600181146127bb57600281146127ce576127d6565b603d6001830353603d60028303536127d6565b603d60018303535b509195945050505050565b6127eb8383612a97565b6127f86000848484612ba0565b61041e5760405162461bcd60e51b8152600401610475906144a0565b805160609060219060049081908381111561282e57600391505b61283782612ca1565b60405160200161284791906144f2565b604051602081830303815290604052945050505050919050565b816001600160a01b0316836001600160a01b0316036128be5760405162461bcd60e51b815260206004820152601960248201527822a9219b99189d1030b8383937bb32903a379031b0b63632b960391b6044820152606401610475565b6001600160a01b03838116600081815260056020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6129368484846124fb565b61294284848484612ba0565b6104485760405162461bcd60e51b8152600401610475906144a0565b61296a84848484612d33565b60018111156129d95760405162461bcd60e51b815260206004820152603560248201527f455243373231456e756d657261626c653a20636f6e7365637574697665207472604482015274185b9cd9995c9cc81b9bdd081cdd5c1c1bdc9d1959605a1b6064820152608401610475565b816001600160a01b038516612a3557612a3081600880546000838152600960205260408120829055600182018355919091527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee30155565b612a58565b836001600160a01b0316856001600160a01b031614612a5857612a588582612dbb565b6001600160a01b038416612a7457612a6f81612e58565b611650565b846001600160a01b0316846001600160a01b031614611650576116508482612f07565b6001600160a01b038216612aed5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610475565b612af681611b5b565b15612b135760405162461bcd60e51b815260040161047590614518565b612b2160008383600161295e565b612b2a81611b5b565b15612b475760405162461bcd60e51b815260040161047590614518565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b03191684179055518392919060008051602061468c833981519152908290a45050565b60006001600160a01b0384163b15612c9657604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612be490339089908890889060040161454e565b6020604051808303816000875af1925050508015612c1f575060408051601f3d908101601f19168201909252612c1c91810190614581565b60015b612c7c573d808015612c4d576040519150601f19603f3d011682016040523d82523d6000602084013e612c52565b606091505b508051600003612c745760405162461bcd60e51b8152600401610475906144a0565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506124f3565b506001949350505050565b60606000612cae83612f4b565b60010190506000816001600160401b03811115612ccd57612ccd6132a3565b6040519080825280601f01601f191660200182016040528015612cf7576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a8504945084612d0157509392505050565b6001811115610448576001600160a01b03841615612d79576001600160a01b03841660009081526003602052604081208054839290612d7390849061459e565b90915550505b6001600160a01b03831615610448576001600160a01b03831660009081526003602052604081208054839290612db0908490614447565b909155505050505050565b60006001612dc884610dd6565b612dd2919061459e565b600083815260076020526040902054909150808214612e25576001600160a01b03841660009081526006602090815260408083208584528252808320548484528184208190558352600790915290208190555b5060009182526007602090815260408084208490556001600160a01b039094168352600681528383209183525290812055565b600854600090612e6a9060019061459e565b60008381526009602052604081205460088054939450909284908110612e9257612e92613670565b906000526020600020015490508060088381548110612eb357612eb3613670565b6000918252602080832090910192909255828152600990915260408082208490558582528120556008805480612eeb57612eeb6145b5565b6001900381819060005260206000200160009055905550505050565b6000612f1283610dd6565b6001600160a01b039093166000908152600660209081526040808320868452825280832085905593825260079052919091209190915550565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612f8a5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b8310612fb4576904ee2d6d415b85acef8160201b830492506020015b662386f26fc100008310612fd257662386f26fc10000830492506010015b6305f5e1008310612fea576305f5e100830492506008015b6127108310612ffe57612710830492506004015b60648310613010576064830492506002015b600a831061034b5760010192915050565b6001600160e01b0319811681146118f257600080fd5b60006020828403121561304957600080fd5b813561305481613021565b9392505050565b60005b8381101561307657818101518382015260200161305e565b838111156104485750506000910152565b6000815180845261309f81602086016020860161305b565b601f01601f19169290920160200192915050565b6020815260006130546020830184613087565b6000602082840312156130d857600080fd5b5035919050565b6001600160a01b0391909116815260200190565b80356001600160a01b038116811461310a57600080fd5b919050565b6000806040838503121561312257600080fd5b61312b836130f3565b946020939093013593505050565b60008060006060848603121561314e57600080fd5b613157846130f3565b9250613165602085016130f3565b9150604084013590509250925092565b602081526000825160e06020840152613192610100840182613087565b90506020840151601f19808584030160408601526131b08383613087565b925060408601519150808584030160608601526131cd8383613087565b925060608601519150808584030160808601526131ea8383613087565b925060808601519150808584030160a08601526132078383613087565b925060a0860151915061321e60c086018315159052565b60c08601519150808584030160e08601525061323a8282613087565b95945050505050565b60006020828403121561325557600080fd5b613054826130f3565b80151581146118f257600080fd5b6000806040838503121561327f57600080fd5b613288836130f3565b915060208301356132988161325e565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f191681016001600160401b03811182821017156132e1576132e16132a3565b604052919050565b60006001600160401b03821115613302576133026132a3565b50601f01601f191660200190565b6000806000806080858703121561332657600080fd5b61332f856130f3565b935061333d602086016130f3565b92506040850135915060608501356001600160401b0381111561335f57600080fd5b8501601f8101871361337057600080fd5b803561338361337e826132e9565b6132b9565b81815288602083850101111561339857600080fd5b8160208401602083013760006020838301015280935050505092959194509250565b600080604083850312156133cd57600080fd5b6133d6836130f3565b91506133e4602084016130f3565b90509250929050565b600181811c9082168061340157607f821691505b60208210810361342157634e487b7160e01b600052602260045260246000fd5b50919050565b602080825260149082015273151bdad95b88191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b600082601f83011261346657600080fd5b815161347461337e826132e9565b81815284602083860101111561348957600080fd5b6124f382602083016020870161305b565b6000602082840312156134ac57600080fd5b81516001600160401b03808211156134c357600080fd5b90830190604082860312156134d757600080fd5b6040516040810181811083821117156134f2576134f26132a3565b60405282518281111561350457600080fd5b61351087828601613455565b82525060208301518281111561352557600080fd5b61353187828601613455565b60208301525095945050505050565b60006020828403121561355257600080fd5b81516001600160401b0381111561356857600080fd5b6124f384828501613455565b6000815161358681856020860161305b565b9290920192915050565b600083516135a281846020880161305b565b600160fd1b90830190815283516135c081600184016020880161305b565b01600101949350505050565b64029182718960dd1b8152600082516135ec81600585016020870161305b565b9190910160050192915050565b60006020828403121561360b57600080fd5b81516130548161325e565b6000845161362881846020890161305b565b8083019050600160fd1b8082528551613648816001850160208a0161305b565b6001920191820152835161366381600284016020880161305b565b0160020195945050505050565b634e487b7160e01b600052603260045260246000fd5b60208082526021908201527f53686f756c642062652063616c6c6564206279204765617220636f6e747261636040820152601d60fa1b606082015260800190565b602080825260189082015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b604082015260600190565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b6000845161375881846020890161305b565b84519083019061376c81836020890161305b565b845191019061377f81836020880161305b565b0195945050505050565b60008051602061460c833981519152815260008051602061466c83398151915260208201526000805160206145cc83398151915260408201526000805160206145ec83398151915260608201527f313939392f7868746d6c272077696474683d2736343027206865696768743d2760808201527f36343027207072657365727665417370656374526174696f3d27784d6964594d60a08201527f6964206d656574272076696577426f783d27302030203634203634272073747960c08201527f6c653d277374726f6b652d77696474683a303b206261636b67726f756e642d6360e08201527f6f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746f3b6101008201527f6865696768743a202d7765626b69742d66696c6c2d617661696c61626c65273e6101208201527f3c7374796c6520747970653d27746578742f637373273e2e706978656c6174656101408201527f64207b20696d6167652d72656e646572696e673a20706978656c617465643b20610160820152683e9e17b9ba3cb6329f60b91b6101808201526000613054613930610189840185613574565b651e17b9bb339f60d11b815260060190565b7919185d184e9a5b5859d94bdcdd99cade1b5b0ed8985cd94d8d0b60321b81526000825161397781601a85016020870161305b565b91909101601a0192915050565b761e39ba3cb632903a3cb8329e93ba32bc3a17b1b9b9939f60491b81527f40666f6e742d66616365207b20666f6e742d66616d696c793a2047656172466f60178201526d6e743b207372633a2075726c282760901b6037820152600083516139f381604585016020880161305b565b6427293b207d60d81b6045918401918201527f2e706978656c61746564207b20696d6167652d72656e646572696e673a207069604a8201526978656c617465643b207d60b01b606a8201527f2e6e616d65207b20666f6e742d66616d696c793a2047656172466f6e743b2066607482015269037b73a16b9b4bd329d160b51b60948201528351613a8a81609e84016020880161305b565b7f3b20746578742d7472616e73666f726d3a207570706572636173653b2066696c9101609e8101919091526a6c3a20626c61636b3b207d60a81b60be820152671e17b9ba3cb6329f60c11b60c982015260d1810161323a565b60008651613af5818460208b0161305b565b865190830190613b09818360208b0161305b565b8651910190613b1c818360208a0161305b565b8551910190613b2f81836020890161305b565b8451910190613b4281836020880161305b565b01979650505050505050565b7f3c7465787420783d273530252720793d273130342e35302720746578742d616e81526000805160206146ac83398151915260208201527513b6b4b2323632939031b630b9b99e93b730b6b2939f60511b604082015260008251613bb981605685016020870161305b565b661e17ba32bc3a1f60c91b6056939091019283015250605d01919050565b7f3c7465787420783d273530252720793d273130332e35302720746578742d616e815260006000805160206146ac8339815191528060208401527513b137ba3a37b6939031b630b9b99e93b730b6b2939f60511b60408401528451613c4381605686016020890161305b565b8084019050661e17ba32bc3a1f60c91b8060568301527f3c7465787420783d273530252720793d273130362e37352720746578742d616e605d83015282607d8301527213ba37b8139031b630b9b99e93b730b6b2939f60691b609d83015285519250613cb68360b084016020890161305b565b910160b081019190915260b701949350505050565b60008051602061460c833981519152815260008051602061466c83398151915260208201526000805160206145cc83398151915260408201526000805160206145ec83398151915260608201527f313939392f7868746d6c272077696474683d2737363027206865696768743d2760808201527f3131343027207072657365727665417370656374526174696f3d27784d69645960a08201527f4d6964206d656574272076696577426f783d273020302037362031313427207360c08201527f74796c653d277374726f6b652d77696474683a303b206261636b67726f756e6460e08201527f2d636f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746101008201527f6f3b6865696768743a202d7765626b69742d66696c6c2d617661696c61626c6561012082015261139f60f11b610140820152600061323a613930613e7b613e75613e2661014287018a613574565b7f3c726563742077696474683d273130302527206865696768743d27313030252781527f20783d27302720793d2730272066696c6c3d272338383765383827202f3e00006020820152603e0190565b87613574565b85613574565b68113730b6b2911d101160b91b81528251600090613ea681600985016020880161305b565b600160fd1b6009918401918201528351613ec781600a84016020880161305b565b61088b60f21b600a9290910191820152600c01949350505050565b68113730b6b2911d101160b91b81528351600090613f0781600985016020890161305b565b8083019050600160fd1b8060098301528551613f2a81600a850160208a0161305b565b600a9201918201528351613f4581600b84016020880161305b565b61088b60f21b600b9290910191820152600d0195945050505050565b7f7b2274726169745f74797065223a2022507265666978222c202276616c7565228152621d101160e91b602082015260008251613fa581602385016020870161305b565b62089f4b60ea1b6023939091019283015250602601919050565b7f2c7b2274726169745f74797065223a20224578747261222c202276616c7565228152621d101160e91b60208201526000825161400381602385016020870161305b565b61227d60f01b6023939091019283015250602501919050565b7f7b2274726169745f74797065223a20224e616d65222c202276616c7565223a208152601160f91b60208201526000865161405e816021850160208b0161305b565b62089f4b60ea1b60219184019182018190528751614083816024850160208c0161305b565b7f7b2274726169745f74797065223a2022537566666978222c202276616c75652260249390910192830152621d101160e91b604483015286516140cd816047850160208b0161305b565b60479201918201527f7b2274726169745f74797065223a202243617465676f7279222c202276616c75604a8201526432911d101160d91b606a82015261412a613e7b61411c606f840188613574565b61227d60f01b815260020190565b98975050505050505050565b607b60f81b81526000845161415281600185016020890161305b565b7f226465736372697074696f6e223a2022497420676f7420656d70747920696e206001918401918201527f7468652076656e74732061667465722030424552314e2068616420676f6e652060218201527f6d697373696e672e20546865206e65656420666f7220776561706f6e7320616e60418201527f642061726d6f72206973206e6f772067726561746572207468616e20697420656061820152691d995c881dd85ccb888b60b21b60818201526e2261747472696275746573223a205b60881b608b820152845161422c81609a84016020890161305b565b61174b60f21b9101609a810191909152691134b6b0b3b2911d101160b11b609c82015261425f61411c60a6830186613574565b9695505050505050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c0000008152600082516142a181601d85016020870161305b565b91909101601d0192915050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b713c666f726569676e4f626a65637420783d2760701b81526000865160206143218260128601838c0161305b565b642720793d2760d81b60129285019283015287516143458160178501848c0161305b565b68272077696474683d2760b81b60179390910192830152865161436d81838501848b0161305b565b6927206865696768743d2760b01b920181810192909252855161439681602a850189850161305b565b61139f60f11b602a9390910192830152507f3c7868746d6c3a696d6720636c6173733d27706978656c617465642720776964602c8201527f74683d273130302527206865696768743d273130302527207372633d27000000604c82015261412a6144156144066069840187613574565b6213979f60e91b815260030190565b6f1e17b337b932b4b3b727b13532b1ba1f60811b815260100190565b634e487b7160e01b600052601160045260246000fd5b6000821982111561445a5761445a614431565b500190565b60008261447c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561449b5761449b614431565b500290565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6000825161450481846020870161305b565b610e0f60f31b920191825250600201919050565b6020808252601c908201527b115490cdcc8c4e881d1bdad95b88185b1c9958591e481b5a5b9d195960221b604082015260600190565b6001600160a01b038581168252841660208201526040810183905260806060820181905260009061425f90830184613087565b60006020828403121561459357600080fd5b815161305481613021565b6000828210156145b0576145b0614431565b500390565b634e487b7160e01b600052603160045260246000fdfe6b3d27687474703a2f2f7777772e77332e6f72672f313939392f786c696e6b2720786d6c6e733a7868746d6c3d27687474703a2f2f7777772e77332e6f72672f3c7376672076657273696f6e3d27312e312720786d6c6e733d27687474703a2f4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f2f7777772e77332e6f72672f323030302f7376672720786d6c6e733a786c696eddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef63686f723d276d6964646c652720646f6d696e616e742d626173656c696e653da264697066735822122039ff91b6ce9b6b13f555b22e02125d290272ab4b5edc95d0569cc54467c1097964736f6c634300080d0033

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

000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14000000000000000000000000000000000000000000000000000000000000000f466f7267656420304e3120476561720000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a464f524745444745415200000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : name (string): Forged 0N1 Gear
Arg [1] : symbol (string): FORGEDGEAR
Arg [2] : assetsAddress (address): 0x8948Ea37a3121F2419e2f83a7BD2C35DAf611D73
Arg [3] : tacticalGearAddress (address): 0xCc6f2DD643589D47987566Afe17BaE948dbC2C14

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000080
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [2] : 0000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73
Arg [3] : 000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [5] : 466f7267656420304e3120476561720000000000000000000000000000000000
Arg [6] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [7] : 464f524745444745415200000000000000000000000000000000000000000000


Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

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