ETH Price: $3,092.01 (+0.14%)

Token

 

Overview

Max Total Supply

58

Holders

38

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
bobby-san.eth
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:
Keys

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 10 runs

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

import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/security/Pausable.sol';
import '@openzeppelin/contracts/utils/Counters.sol';
import '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';
import '@openzeppelin/contracts/token/ERC1155/IERC1155.sol';
import '@openzeppelin/contracts/utils/Base64.sol';

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

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

contract Keys is ERC1155, Ownable, Pausable, DefaultOperatorFilterer {
  using Counters for Counters.Counter;
  Counters.Counter public tokenIds;

  uint256 MAX_SUPPLY = 174;
  uint256 APARTMENT_KEY = 0;

  IAssets private assets;
  ITacticalGear private tacticalGear;

  constructor(address assetsAddress, address tacticalGearAddress) ERC1155('') {
    assets = IAssets(assetsAddress);
    tacticalGear = ITacticalGear(tacticalGearAddress);
  }

  function forge(address to) external {
    require(_msgSender() == address(tacticalGear), 'Only callable by Gear contract');
    require(tokenIds.current() <= MAX_SUPPLY, 'No more Keys available');
    tokenIds.increment();
    _mint(to, APARTMENT_KEY, 1, '');
  }

  function getCardImage() private view returns (string memory) {
    string memory itemGraphic = assets.getAsset('key');
    string memory cardGraphic = assets.getAsset('card');
    string memory suffixGraphic = assets.getAsset('of the Kami');
    string memory font = assets.getAsset('font');
    string memory fontSize = Library.calculateFontSize('Apartment Key');

    // prettier-ignore
    return
      string(
        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(
              abi.encodePacked(
                "<style type='text/css'>",
                  "@font-face { font-family: GearFont; src: url('", font, "'); }",
                  ".pixelated { image-rendering: pixelated; }",
                  ".name { font-family: GearFont; font-size: ", fontSize, "; text-transform: uppercase; fill: black; }",
                "</style>"
              ),
              abi.encodePacked(
                "<rect width='100%' height='100%' x='0' y='0' fill='#887e88' />",
                Library.foreignImage('0', '0', '76', '114', cardGraphic),
                Library.foreignImage('6', '18', '64', '64', itemGraphic),
                Library.foreignImage('30', '0', '16', '12', suffixGraphic),
                "<text x='50%' y='104.50' text-anchor='middle' dominant-baseline='middle' class='name'>Apartment Key</text>"
              )
            ),
          "</svg>"
        )
      );
  }

  function uri(uint256) public view override returns (string memory) {
    // prettier-ignore
    string memory metadata = string(
      abi.encodePacked(
        '{',
          '"name": "0N1 Gear Apartment Key",',
          '"description": "0N1 Gear Apartment Key",',
          '"image": "data:image/svg+xml;base64,', Base64.encode(bytes(getCardImage())), '",',
          '"attributes": []',
        '}'
      )
    );

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

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

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

  function safeBatchTransferFrom(
    address from,
    address to,
    uint256[] memory ids,
    uint256[] memory amounts,
    bytes memory data
  ) public virtual override onlyAllowedOperator(from) {
    super.safeBatchTransferFrom(from, to, ids, amounts, data);
  }
}

File 2 of 25 : 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 25 : Pausable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

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

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

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

    bool private _paused;

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

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

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

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

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

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

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

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

File 4 of 25 : 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 5 of 25 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

        return batchBalances;
    }

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

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

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

        address operator = _msgSender();

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

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

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

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

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

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

        address operator = _msgSender();
        uint256[] memory ids = _asSingletonArray(id);
        uint256[] memory amounts = _asSingletonArray(amount);

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

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

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

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

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

        address operator = _msgSender();

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

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

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

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

        _afterTokenTransfer(operator, from, address(0), ids, amounts, "");
    }

    /**
     * @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, "ERC1155: setting approval status for self");
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Hook that is called before any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `ids` and `amounts` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    /**
     * @dev Hook that is called after any token transfer. This includes minting
     * and burning, as well as batched variants.
     *
     * The same hook is called on both single and batched variants. For single
     * transfers, the length of the `id` and `amount` arrays will be 1.
     *
     * Calling conditions (for each `id` and `amount` pair):
     *
     * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * of token type `id` will be  transferred to `to`.
     * - When `from` is zero, `amount` tokens of token type `id` will be minted
     * for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`
     * will be burned.
     * - `from` and `to` are never both zero.
     * - `ids` and `amounts` have the same, non-zero length.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _afterTokenTransfer(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {}

    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) private {
        if (to.isContract()) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non-ERC1155Receiver implementer");
            }
        }
    }

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

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

        return array;
    }
}

File 6 of 25 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 7 of 25 : 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 8 of 25 : 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 9 of 25 : IAssets.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

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

File 10 of 25 : 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 11 of 25 : 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 12 of 25 : 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 13 of 25 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.0;

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

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

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

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

pragma solidity ^0.8.0;

import "../IERC1155.sol";

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

File 15 of 25 : 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 16 of 25 : 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 17 of 25 : 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 18 of 25 : 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 19 of 25 : 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 20 of 25 : 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 21 of 25 : 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 22 of 25 : 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 23 of 25 : 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 24 of 25 : 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 25 of 25 : 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":"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":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"OPERATOR_FILTER_REGISTRY","outputs":[{"internalType":"contract IOperatorFilterRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"}],"name":"forge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"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":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenIds","outputs":[{"internalType":"uint256","name":"_value","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

608060405260ae60055560006006553480156200001b57600080fd5b5060405162002bfc38038062002bfc8339810160408190526200003e9162000336565b733cc6cdda760b79bafa08df41ecfa224f810dceb660016040518060200160405280600081525062000076816200020860201b60201c565b50620000823362000221565b6003805460ff60a01b191690556daaeb6d7670e522a718067333cd4e3b15620001d45780156200012257604051633e9f1edf60e11b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e90637d3e3dbe906044015b600060405180830381600087803b1580156200010357600080fd5b505af115801562000118573d6000803e3d6000fd5b50505050620001d4565b6001600160a01b03821615620001735760405163a0af290360e01b81523060048201526001600160a01b03831660248201526daaeb6d7670e522a718067333cd4e9063a0af290390604401620000e8565b604051632210724360e11b81523060048201526daaeb6d7670e522a718067333cd4e90634420e48690602401600060405180830381600087803b158015620001ba57600080fd5b505af1158015620001cf573d6000803e3d6000fd5b505050505b5050600780546001600160a01b039384166001600160a01b03199182161790915560088054929093169116179055620003aa565b80516200021d90600290602084019062000273565b5050565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b82805462000281906200036e565b90600052602060002090601f016020900481019282620002a55760008555620002f0565b82601f10620002c057805160ff1916838001178555620002f0565b82800160010185558215620002f0579182015b82811115620002f0578251825591602001919060010190620002d3565b50620002fe92915062000302565b5090565b5b80821115620002fe576000815560010162000303565b80516001600160a01b03811681146200033157600080fd5b919050565b600080604083850312156200034a57600080fd5b620003558362000319565b9150620003656020840162000319565b90509250929050565b600181811c908216806200038357607f821691505b602082108103620003a457634e487b7160e01b600052602260045260246000fd5b50919050565b61284280620003ba6000396000f3fe608060405234801561001057600080fd5b50600436106100c45760003560e01c8062fdd58e146100c957806301ffc9a7146100ef5780630e89341c146101125780632eb2c2d61461013257806341f43434146101475780634e1273f4146101695780634e5a5178146101895780635c975abb1461019c578063714cff56146101ae578063715018a6146101b85780638da5cb5b146101c0578063a22cb465146101c8578063e985e9c5146101db578063f242432a14610217578063f2fde38b1461022a575b600080fd5b6100dc6100d7366004611798565b61023d565b6040519081526020015b60405180910390f35b6101026100fd3660046117d8565b6102d3565b60405190151581526020016100e6565b6101256101203660046117fc565b610325565b6040516100e69190611871565b6101456101403660046119dd565b61038a565b005b61015c6daaeb6d7670e522a718067333cd4e81565b6040516100e69190611a86565b61017c610177366004611a9a565b6103b9565b6040516100e69190611b9f565b610145610197366004611bb2565b6104e2565b600354600160a01b900460ff16610102565b6004546100dc9081565b6101456105c1565b61015c6105d5565b6101456101d6366004611bdb565b6105e4565b6101026101e9366004611c12565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610145610225366004611c45565b6105fd565b610145610238366004611bb2565b610624565b60006001600160a01b0383166102ad5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061030457506001600160e01b031982166303a24d0760e21b145b8061031f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600061033961033461069a565b610af2565b6040516020016103499190611cc5565b604051602081830303815290604052905061036381610af2565b6040516020016103739190611db8565b604051602081830303815290604052915050919050565b846001600160a01b03811633146103a4576103a433610c44565b6103b18686868686610cf4565b505050505050565b6060815183511461041e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016102a4565b600083516001600160401b0381111561043957610439611884565b604051908082528060200260200182016040528015610462578160200160208202803683370190505b50905060005b84518110156104da576104ad85828151811061048657610486611dfd565b60200260200101518583815181106104a0576104a0611dfd565b602002602001015161023d565b8282815181106104bf576104bf611dfd565b60209081029190910101526104d381611e29565b9050610468565b509392505050565b6008546001600160a01b0316336001600160a01b0316146105455760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c792063616c6c61626c65206279204765617220636f6e7472616374000060448201526064016102a4565b60055460045411156105925760405162461bcd60e51b81526020600482015260166024820152754e6f206d6f7265204b65797320617661696c61626c6560501b60448201526064016102a4565b6105a0600480546001019055565b6105be81600654600160405180602001604052806000815250610d40565b50565b6105c9610e42565b6105d36000610ea1565b565b6003546001600160a01b031690565b816105ee81610c44565b6105f88383610ef3565b505050565b846001600160a01b03811633146106175761061733610c44565b6103b18686868686610f02565b61062c610e42565b6001600160a01b0381166106915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a4565b6105be81610ea1565b600754604051630cd5286d60e41b81526020600482015260036024820152626b657960e81b60448201526060916000916001600160a01b039091169063cd5286d090606401600060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107249190810190611e42565b600754604051630cd5286d60e41b81529192506000916001600160a01b039091169063cd5286d0906107719060040160208082526004908201526318d85c9960e21b604082015260600190565b600060405180830381865afa15801561078e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107b69190810190611e42565b600754604051630cd5286d60e41b815260206004820152600b60248201526a6f6620746865204b616d6960a81b60448201529192506000916001600160a01b039091169063cd5286d090606401600060405180830381865afa158015610820573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108489190810190611e42565b600754604051630cd5286d60e41b81529192506000916001600160a01b039091169063cd5286d09061089590600401602080825260049082015263199bdb9d60e21b604082015260600190565b600060405180830381865afa1580156108b2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108da9190810190611e42565b9050600061090c6040518060400160405280600d81526020016c41706172746d656e74204b657960981b815250610f47565b90508181604051602001610921929190611ec3565b6040516020818303038152906040526109a4604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001611b9b60f11b815250604051806040016040528060038152602001620c4c4d60ea1b81525089610f94565b610a18604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508b610f94565b610a8c60405180604001604052806002815260200161033360f41b815250604051806040016040528060018152602001600360fc1b81525060405180604001604052806002815260200161189b60f11b81525060405180604001604052806002815260200161189960f11b8152508a610f94565b604051602001610a9e93929190612027565b60408051601f1981840301815290829052610abc9291602001612148565b60408051601f1981840301815290829052610ad991602001612177565b6040516020818303038152906040529550505050505090565b60608151600003610b1157505060408051602081019091526000815290565b60006040518060600160405280604081526020016127cd6040913990506000600384516002610b409190612323565b610b4a919061233b565b610b5590600461235d565b6001600160401b03811115610b6c57610b6c611884565b6040519080825280601f01601f191660200182016040528015610b96576020820181803683370190505b509050600182016020820185865187015b80821015610c02576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250610ba7565b5050600386510660018114610c1e5760028114610c3157610c39565b603d6001830353603d6002830353610c39565b603d60018303535b509195945050505050565b6daaeb6d7670e522a718067333cd4e3b156105be57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd5919061237c565b6105be5780604051633b79c77360e21b81526004016102a49190611a86565b6001600160a01b038516331480610d105750610d1085336101e9565b610d2c5760405162461bcd60e51b81526004016102a490612399565b610d398585858585610fc9565b5050505050565b6001600160a01b038416610da05760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016102a4565b336000610dac8561119e565b90506000610db98561119e565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290610deb908490612323565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716916000805160206127ad833981519152910160405180910390a4610e39836000898989896111e9565b50505050505050565b33610e4b6105d5565b6001600160a01b0316146105d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a4565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610efe33838361134b565b5050565b6001600160a01b038516331480610f1e5750610f1e85336101e9565b610f3a5760405162461bcd60e51b81526004016102a490612399565b610d39858585858561142b565b8051606090602190600490819083811115610f6157600391505b610f6a82611543565b604051602001610f7a91906123e7565b604051602081830303815290604052945050505050919050565b60608585858585604051602001610faf95949392919061240d565b604051602081830303815290604052905095945050505050565b815183511461102b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016102a4565b6001600160a01b0384166110515760405162461bcd60e51b81526004016102a490612557565b3360005b845181101561113857600085828151811061107257611072611dfd565b60200260200101519050600085838151811061109057611090611dfd565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156110e05760405162461bcd60e51b81526004016102a49061259c565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061111d908490612323565b925050819055505050508061113190611e29565b9050611055565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516111889291906125e6565b60405180910390a46103b18187878787876115d5565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106111d8576111d8611dfd565b602090810291909101015292915050565b6111fb846001600160a01b0316611697565b156103b15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611234908990899088908890889060040161260b565b6020604051808303816000875af192505050801561126f575060408051601f3d908101601f1916820190925261126c91810190612650565b60015b61131b5761127b61266d565b806308c379a0036112b4575061128f612689565b8061129a57506112b6565b8060405162461bcd60e51b81526004016102a49190611871565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016102a4565b6001600160e01b0319811663f23a6e6160e01b14610e395760405162461bcd60e51b81526004016102a490612712565b816001600160a01b0316836001600160a01b0316036113be5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016102a4565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114515760405162461bcd60e51b81526004016102a490612557565b33600061145d8561119e565b9050600061146a8561119e565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156114ad5760405162461bcd60e51b81526004016102a49061259c565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906114ea908490612323565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816916000805160206127ad833981519152910160405180910390a4611538848a8a8a8a8a6111e9565b505050505050505050565b60606000611550836116a6565b60010190506000816001600160401b0381111561156f5761156f611884565b6040519080825280601f01601f191660200182016040528015611599576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846115a357509392505050565b6115e7846001600160a01b0316611697565b156103b15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611620908990899088908890889060040161275a565b6020604051808303816000875af192505050801561165b575060408051601f3d908101601f1916820190925261165891810190612650565b60015b6116675761127b61266d565b6001600160e01b0319811663bc197c8160e01b14610e395760405162461bcd60e51b81526004016102a490612712565b6001600160a01b03163b151590565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116e55772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b831061170f576904ee2d6d415b85acef8160201b830492506020015b662386f26fc10000831061172d57662386f26fc10000830492506010015b6305f5e1008310611745576305f5e100830492506008015b612710831061175957612710830492506004015b6064831061176b576064830492506002015b600a831061031f5760010192915050565b80356001600160a01b038116811461179357600080fd5b919050565b600080604083850312156117ab57600080fd5b6117b48361177c565b946020939093013593505050565b6001600160e01b0319811681146105be57600080fd5b6000602082840312156117ea57600080fd5b81356117f5816117c2565b9392505050565b60006020828403121561180e57600080fd5b5035919050565b60005b83811015611830578181015183820152602001611818565b8381111561183f576000848401525b50505050565b6000815180845261185d816020860160208601611815565b601f01601f19169290920160200192915050565b6020815260006117f56020830184611845565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156118bf576118bf611884565b6040525050565b60006001600160401b038211156118df576118df611884565b5060051b60200190565b600082601f8301126118fa57600080fd5b81356020611907826118c6565b604051611914828261189a565b83815260059390931b850182019282810191508684111561193457600080fd5b8286015b8481101561194f5780358352918301918301611938565b509695505050505050565b60006001600160401b0382111561197357611973611884565b50601f01601f191660200190565b600082601f83011261199257600080fd5b813561199d8161195a565b6040516119aa828261189a565b8281528560208487010111156119bf57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156119f557600080fd5b6119fe8661177c565b9450611a0c6020870161177c565b935060408601356001600160401b0380821115611a2857600080fd5b611a3489838a016118e9565b94506060880135915080821115611a4a57600080fd5b611a5689838a016118e9565b93506080880135915080821115611a6c57600080fd5b50611a7988828901611981565b9150509295509295909350565b6001600160a01b0391909116815260200190565b60008060408385031215611aad57600080fd5b82356001600160401b0380821115611ac457600080fd5b818501915085601f830112611ad857600080fd5b81356020611ae5826118c6565b604051611af2828261189a565b83815260059390931b8501820192828101915089841115611b1257600080fd5b948201945b83861015611b3757611b288661177c565b82529482019490820190611b17565b96505086013592505080821115611b4d57600080fd5b50611b5a858286016118e9565b9150509250929050565b600081518084526020808501945080840160005b83811015611b9457815187529582019590820190600101611b78565b509495945050505050565b6020815260006117f56020830184611b64565b600060208284031215611bc457600080fd5b6117f58261177c565b80151581146105be57600080fd5b60008060408385031215611bee57600080fd5b611bf78361177c565b91506020830135611c0781611bcd565b809150509250929050565b60008060408385031215611c2557600080fd5b611c2e8361177c565b9150611c3c6020840161177c565b90509250929050565b600080600080600060a08688031215611c5d57600080fd5b611c668661177c565b9450611c746020870161177c565b9350604086013592506060860135915060808601356001600160401b03811115611c9d57600080fd5b611a7988828901611981565b60008151611cbb818560208601611815565b9290920192915050565b607b60f81b81527f226e616d65223a2022304e3120476561722041706172746d656e74204b6579226001820152600b60fa1b60218201527f226465736372697074696f6e223a2022304e3120476561722041706172746d656022820152671b9d0812d95e488b60c21b60428201527f22696d616765223a2022646174613a696d6167652f7376672b786d6c3b626173604a82015263194d8d0b60e21b606a8201528151600090611d7c81606e850160208701611815565b61088b60f21b606e9390910192830152506f2261747472696275746573223a205b5d60801b6070820152607d60f81b6080820152608101919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611df081601d850160208701611815565b91909101601d0192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e3b57611e3b611e13565b5060010190565b600060208284031215611e5457600080fd5b81516001600160401b03811115611e6a57600080fd5b8201601f81018413611e7b57600080fd5b8051611e868161195a565b604051611e93828261189a565b828152866020848601011115611ea857600080fd5b611eb9836020830160208701611815565b9695505050505050565b761e39ba3cb632903a3cb8329e93ba32bc3a17b1b9b9939f60491b81527f40666f6e742d66616365207b20666f6e742d66616d696c793a2047656172466f60178201526d6e743b207372633a2075726c282760901b603782015260008351611f32816045850160208801611815565b6427293b207d60d81b6045918401918201527f2e706978656c61746564207b20696d6167652d72656e646572696e673a207069604a8201526978656c617465643b207d60b01b606a8201527f2e6e616d65207b20666f6e742d66616d696c793a2047656172466f6e743b2066607482015269037b73a16b9b4bd329d160b51b60948201528351611fc981609e840160208801611815565b7f3b20746578742d7472616e73666f726d3a207570706572636173653b2066696c9101609e8101919091526a6c3a20626c61636b3b207d60a81b60be820152671e17b9ba3cb6329f60c11b60c982015260d181015b95945050505050565b7f3c726563742077696474683d273130302527206865696768743d27313030252781527f20783d27302720793d2730272066696c6c3d272338383765383827202f3e000060208201526000845161208581603e850160208901611815565b84519083019061209c81603e840160208901611815565b84519101906120b281603e840160208801611815565b7f3c7465787420783d273530252720793d273130342e35302720746578742d616e603e92909101918201527f63686f723d276d6964646c652720646f6d696e616e742d626173656c696e653d605e8201527f276d6964646c652720636c6173733d276e616d65273e41706172746d656e7420607e8201526925b2bc9e17ba32bc3a1f60b11b609e82015260a80195945050505050565b6000835161215a818460208801611815565b83519083019061216e818360208801611815565b01949350505050565b7f3c7376672076657273696f6e3d27312e312720786d6c6e733d27687474703a2f81527f2f7777772e77332e6f72672f323030302f7376672720786d6c6e733a786c696e60208201527f6b3d27687474703a2f2f7777772e77332e6f72672f313939392f786c696e6b2760408201527f20786d6c6e733a7868746d6c3d27687474703a2f2f7777772e77332e6f72672f60608201527f313939392f7868746d6c272077696474683d2737363027206865696768743d2760808201527f3131343027207072657365727665417370656374526174696f3d27784d69645960a08201527f4d6964206d656574272076696577426f783d273020302037362031313427207360c08201527f74796c653d277374726f6b652d77696474683a303b206261636b67726f756e6460e08201527f2d636f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746101008201527f6f3b6865696768743a202d7765626b69742d66696c6c2d617661696c61626c6561012082015261139f60f11b61014082015260006117f5612311610142840185611ca9565b651e17b9bb339f60d11b815260060190565b6000821982111561233657612336611e13565b500190565b60008261235857634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561237757612377611e13565b500290565b60006020828403121561238e57600080fd5b81516117f581611bcd565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600082516123f9818460208701611815565b610e0f60f31b920191825250600201919050565b713c666f726569676e4f626a65637420783d2760701b815260008651602061243b8260128601838c01611815565b642720793d2760d81b601292850192830152875161245f8160178501848c01611815565b68272077696474683d2760b81b60179390910192830152865161248781838501848b01611815565b6927206865696768743d2760b01b92018181019290925285516124b081602a8501898501611815565b61139f60f11b602a9390910192830152507f3c7868746d6c3a696d6720636c6173733d27706978656c617465642720776964602c8201527f74683d273130302527206865696768743d273130302527207372633d27000000604c82015261254b61252f6125206069840187611ca9565b6213979f60e91b815260030190565b6f1e17b337b932b4b3b727b13532b1ba1f60811b815260100190565b98975050505050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6040815260006125f96040830185611b64565b828103602084015261201e8185611b64565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061264590830184611845565b979650505050505050565b60006020828403121561266257600080fd5b81516117f5816117c2565b600060033d11156126865760046000803e5060005160e01c5b90565b600060443d10156126975790565b6040516003193d81016004833e81513d6001600160401b0380831160248401831017156126c657505050505090565b82850191508151818111156126de5750505050505090565b843d87010160208285010111156126f85750505050505090565b6127076020828601018761189a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061278690830186611b64565b82810360608401526127988186611b64565b9050828103608084015261254b818561184556fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f624142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220d7c8182161815f7abd0321aa5d4bd3fd9257fed0c05939049ba1d6f6276a3eb364736f6c634300080d00330000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c45760003560e01c8062fdd58e146100c957806301ffc9a7146100ef5780630e89341c146101125780632eb2c2d61461013257806341f43434146101475780634e1273f4146101695780634e5a5178146101895780635c975abb1461019c578063714cff56146101ae578063715018a6146101b85780638da5cb5b146101c0578063a22cb465146101c8578063e985e9c5146101db578063f242432a14610217578063f2fde38b1461022a575b600080fd5b6100dc6100d7366004611798565b61023d565b6040519081526020015b60405180910390f35b6101026100fd3660046117d8565b6102d3565b60405190151581526020016100e6565b6101256101203660046117fc565b610325565b6040516100e69190611871565b6101456101403660046119dd565b61038a565b005b61015c6daaeb6d7670e522a718067333cd4e81565b6040516100e69190611a86565b61017c610177366004611a9a565b6103b9565b6040516100e69190611b9f565b610145610197366004611bb2565b6104e2565b600354600160a01b900460ff16610102565b6004546100dc9081565b6101456105c1565b61015c6105d5565b6101456101d6366004611bdb565b6105e4565b6101026101e9366004611c12565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b610145610225366004611c45565b6105fd565b610145610238366004611bb2565b610624565b60006001600160a01b0383166102ad5760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061030457506001600160e01b031982166303a24d0760e21b145b8061031f57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6060600061033961033461069a565b610af2565b6040516020016103499190611cc5565b604051602081830303815290604052905061036381610af2565b6040516020016103739190611db8565b604051602081830303815290604052915050919050565b846001600160a01b03811633146103a4576103a433610c44565b6103b18686868686610cf4565b505050505050565b6060815183511461041e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016102a4565b600083516001600160401b0381111561043957610439611884565b604051908082528060200260200182016040528015610462578160200160208202803683370190505b50905060005b84518110156104da576104ad85828151811061048657610486611dfd565b60200260200101518583815181106104a0576104a0611dfd565b602002602001015161023d565b8282815181106104bf576104bf611dfd565b60209081029190910101526104d381611e29565b9050610468565b509392505050565b6008546001600160a01b0316336001600160a01b0316146105455760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c792063616c6c61626c65206279204765617220636f6e7472616374000060448201526064016102a4565b60055460045411156105925760405162461bcd60e51b81526020600482015260166024820152754e6f206d6f7265204b65797320617661696c61626c6560501b60448201526064016102a4565b6105a0600480546001019055565b6105be81600654600160405180602001604052806000815250610d40565b50565b6105c9610e42565b6105d36000610ea1565b565b6003546001600160a01b031690565b816105ee81610c44565b6105f88383610ef3565b505050565b846001600160a01b03811633146106175761061733610c44565b6103b18686868686610f02565b61062c610e42565b6001600160a01b0381166106915760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102a4565b6105be81610ea1565b600754604051630cd5286d60e41b81526020600482015260036024820152626b657960e81b60448201526060916000916001600160a01b039091169063cd5286d090606401600060405180830381865afa1580156106fc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107249190810190611e42565b600754604051630cd5286d60e41b81529192506000916001600160a01b039091169063cd5286d0906107719060040160208082526004908201526318d85c9960e21b604082015260600190565b600060405180830381865afa15801561078e573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526107b69190810190611e42565b600754604051630cd5286d60e41b815260206004820152600b60248201526a6f6620746865204b616d6960a81b60448201529192506000916001600160a01b039091169063cd5286d090606401600060405180830381865afa158015610820573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108489190810190611e42565b600754604051630cd5286d60e41b81529192506000916001600160a01b039091169063cd5286d09061089590600401602080825260049082015263199bdb9d60e21b604082015260600190565b600060405180830381865afa1580156108b2573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108da9190810190611e42565b9050600061090c6040518060400160405280600d81526020016c41706172746d656e74204b657960981b815250610f47565b90508181604051602001610921929190611ec3565b6040516020818303038152906040526109a4604051806040016040528060018152602001600360fc1b815250604051806040016040528060018152602001600360fc1b815250604051806040016040528060028152602001611b9b60f11b815250604051806040016040528060038152602001620c4c4d60ea1b81525089610f94565b610a18604051806040016040528060018152602001601b60f91b81525060405180604001604052806002815260200161062760f31b815250604051806040016040528060028152602001610d8d60f21b815250604051806040016040528060028152602001610d8d60f21b8152508b610f94565b610a8c60405180604001604052806002815260200161033360f41b815250604051806040016040528060018152602001600360fc1b81525060405180604001604052806002815260200161189b60f11b81525060405180604001604052806002815260200161189960f11b8152508a610f94565b604051602001610a9e93929190612027565b60408051601f1981840301815290829052610abc9291602001612148565b60408051601f1981840301815290829052610ad991602001612177565b6040516020818303038152906040529550505050505090565b60608151600003610b1157505060408051602081019091526000815290565b60006040518060600160405280604081526020016127cd6040913990506000600384516002610b409190612323565b610b4a919061233b565b610b5590600461235d565b6001600160401b03811115610b6c57610b6c611884565b6040519080825280601f01601f191660200182016040528015610b96576020820181803683370190505b509050600182016020820185865187015b80821015610c02576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250610ba7565b5050600386510660018114610c1e5760028114610c3157610c39565b603d6001830353603d6002830353610c39565b603d60018303535b509195945050505050565b6daaeb6d7670e522a718067333cd4e3b156105be57604051633185c44d60e21b81523060048201526001600160a01b03821660248201526daaeb6d7670e522a718067333cd4e9063c617113490604401602060405180830381865afa158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd5919061237c565b6105be5780604051633b79c77360e21b81526004016102a49190611a86565b6001600160a01b038516331480610d105750610d1085336101e9565b610d2c5760405162461bcd60e51b81526004016102a490612399565b610d398585858585610fc9565b5050505050565b6001600160a01b038416610da05760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b60648201526084016102a4565b336000610dac8561119e565b90506000610db98561119e565b90506000868152602081815260408083206001600160a01b038b16845290915281208054879290610deb908490612323565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716916000805160206127ad833981519152910160405180910390a4610e39836000898989896111e9565b50505050505050565b33610e4b6105d5565b6001600160a01b0316146105d35760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016102a4565b600380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b610efe33838361134b565b5050565b6001600160a01b038516331480610f1e5750610f1e85336101e9565b610f3a5760405162461bcd60e51b81526004016102a490612399565b610d39858585858561142b565b8051606090602190600490819083811115610f6157600391505b610f6a82611543565b604051602001610f7a91906123e7565b604051602081830303815290604052945050505050919050565b60608585858585604051602001610faf95949392919061240d565b604051602081830303815290604052905095945050505050565b815183511461102b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016102a4565b6001600160a01b0384166110515760405162461bcd60e51b81526004016102a490612557565b3360005b845181101561113857600085828151811061107257611072611dfd565b60200260200101519050600085838151811061109057611090611dfd565b602090810291909101810151600084815280835260408082206001600160a01b038e1683529093529190912054909150818110156110e05760405162461bcd60e51b81526004016102a49061259c565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b1682528120805484929061111d908490612323565b925050819055505050508061113190611e29565b9050611055565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb87876040516111889291906125e6565b60405180910390a46103b18187878787876115d5565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106111d8576111d8611dfd565b602090810291909101015292915050565b6111fb846001600160a01b0316611697565b156103b15760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e6190611234908990899088908890889060040161260b565b6020604051808303816000875af192505050801561126f575060408051601f3d908101601f1916820190925261126c91810190612650565b60015b61131b5761127b61266d565b806308c379a0036112b4575061128f612689565b8061129a57506112b6565b8060405162461bcd60e51b81526004016102a49190611871565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016102a4565b6001600160e01b0319811663f23a6e6160e01b14610e395760405162461bcd60e51b81526004016102a490612712565b816001600160a01b0316836001600160a01b0316036113be5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b60648201526084016102a4565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6001600160a01b0384166114515760405162461bcd60e51b81526004016102a490612557565b33600061145d8561119e565b9050600061146a8561119e565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156114ad5760405162461bcd60e51b81526004016102a49061259c565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a168252812080548892906114ea908490612323565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816916000805160206127ad833981519152910160405180910390a4611538848a8a8a8a8a6111e9565b505050505050505050565b60606000611550836116a6565b60010190506000816001600160401b0381111561156f5761156f611884565b6040519080825280601f01601f191660200182016040528015611599576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846115a357509392505050565b6115e7846001600160a01b0316611697565b156103b15760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190611620908990899088908890889060040161275a565b6020604051808303816000875af192505050801561165b575060408051601f3d908101601f1916820190925261165891810190612650565b60015b6116675761127b61266d565b6001600160e01b0319811663bc197c8160e01b14610e395760405162461bcd60e51b81526004016102a490612712565b6001600160a01b03163b151590565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106116e55772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6904ee2d6d415b85acef8160201b831061170f576904ee2d6d415b85acef8160201b830492506020015b662386f26fc10000831061172d57662386f26fc10000830492506010015b6305f5e1008310611745576305f5e100830492506008015b612710831061175957612710830492506004015b6064831061176b576064830492506002015b600a831061031f5760010192915050565b80356001600160a01b038116811461179357600080fd5b919050565b600080604083850312156117ab57600080fd5b6117b48361177c565b946020939093013593505050565b6001600160e01b0319811681146105be57600080fd5b6000602082840312156117ea57600080fd5b81356117f5816117c2565b9392505050565b60006020828403121561180e57600080fd5b5035919050565b60005b83811015611830578181015183820152602001611818565b8381111561183f576000848401525b50505050565b6000815180845261185d816020860160208601611815565b601f01601f19169290920160200192915050565b6020815260006117f56020830184611845565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b03811182821017156118bf576118bf611884565b6040525050565b60006001600160401b038211156118df576118df611884565b5060051b60200190565b600082601f8301126118fa57600080fd5b81356020611907826118c6565b604051611914828261189a565b83815260059390931b850182019282810191508684111561193457600080fd5b8286015b8481101561194f5780358352918301918301611938565b509695505050505050565b60006001600160401b0382111561197357611973611884565b50601f01601f191660200190565b600082601f83011261199257600080fd5b813561199d8161195a565b6040516119aa828261189a565b8281528560208487010111156119bf57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a086880312156119f557600080fd5b6119fe8661177c565b9450611a0c6020870161177c565b935060408601356001600160401b0380821115611a2857600080fd5b611a3489838a016118e9565b94506060880135915080821115611a4a57600080fd5b611a5689838a016118e9565b93506080880135915080821115611a6c57600080fd5b50611a7988828901611981565b9150509295509295909350565b6001600160a01b0391909116815260200190565b60008060408385031215611aad57600080fd5b82356001600160401b0380821115611ac457600080fd5b818501915085601f830112611ad857600080fd5b81356020611ae5826118c6565b604051611af2828261189a565b83815260059390931b8501820192828101915089841115611b1257600080fd5b948201945b83861015611b3757611b288661177c565b82529482019490820190611b17565b96505086013592505080821115611b4d57600080fd5b50611b5a858286016118e9565b9150509250929050565b600081518084526020808501945080840160005b83811015611b9457815187529582019590820190600101611b78565b509495945050505050565b6020815260006117f56020830184611b64565b600060208284031215611bc457600080fd5b6117f58261177c565b80151581146105be57600080fd5b60008060408385031215611bee57600080fd5b611bf78361177c565b91506020830135611c0781611bcd565b809150509250929050565b60008060408385031215611c2557600080fd5b611c2e8361177c565b9150611c3c6020840161177c565b90509250929050565b600080600080600060a08688031215611c5d57600080fd5b611c668661177c565b9450611c746020870161177c565b9350604086013592506060860135915060808601356001600160401b03811115611c9d57600080fd5b611a7988828901611981565b60008151611cbb818560208601611815565b9290920192915050565b607b60f81b81527f226e616d65223a2022304e3120476561722041706172746d656e74204b6579226001820152600b60fa1b60218201527f226465736372697074696f6e223a2022304e3120476561722041706172746d656022820152671b9d0812d95e488b60c21b60428201527f22696d616765223a2022646174613a696d6167652f7376672b786d6c3b626173604a82015263194d8d0b60e21b606a8201528151600090611d7c81606e850160208701611815565b61088b60f21b606e9390910192830152506f2261747472696275746573223a205b5d60801b6070820152607d60f81b6080820152608101919050565b7f646174613a6170706c69636174696f6e2f6a736f6e3b6261736536342c000000815260008251611df081601d850160208701611815565b91909101601d0192915050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e3b57611e3b611e13565b5060010190565b600060208284031215611e5457600080fd5b81516001600160401b03811115611e6a57600080fd5b8201601f81018413611e7b57600080fd5b8051611e868161195a565b604051611e93828261189a565b828152866020848601011115611ea857600080fd5b611eb9836020830160208701611815565b9695505050505050565b761e39ba3cb632903a3cb8329e93ba32bc3a17b1b9b9939f60491b81527f40666f6e742d66616365207b20666f6e742d66616d696c793a2047656172466f60178201526d6e743b207372633a2075726c282760901b603782015260008351611f32816045850160208801611815565b6427293b207d60d81b6045918401918201527f2e706978656c61746564207b20696d6167652d72656e646572696e673a207069604a8201526978656c617465643b207d60b01b606a8201527f2e6e616d65207b20666f6e742d66616d696c793a2047656172466f6e743b2066607482015269037b73a16b9b4bd329d160b51b60948201528351611fc981609e840160208801611815565b7f3b20746578742d7472616e73666f726d3a207570706572636173653b2066696c9101609e8101919091526a6c3a20626c61636b3b207d60a81b60be820152671e17b9ba3cb6329f60c11b60c982015260d181015b95945050505050565b7f3c726563742077696474683d273130302527206865696768743d27313030252781527f20783d27302720793d2730272066696c6c3d272338383765383827202f3e000060208201526000845161208581603e850160208901611815565b84519083019061209c81603e840160208901611815565b84519101906120b281603e840160208801611815565b7f3c7465787420783d273530252720793d273130342e35302720746578742d616e603e92909101918201527f63686f723d276d6964646c652720646f6d696e616e742d626173656c696e653d605e8201527f276d6964646c652720636c6173733d276e616d65273e41706172746d656e7420607e8201526925b2bc9e17ba32bc3a1f60b11b609e82015260a80195945050505050565b6000835161215a818460208801611815565b83519083019061216e818360208801611815565b01949350505050565b7f3c7376672076657273696f6e3d27312e312720786d6c6e733d27687474703a2f81527f2f7777772e77332e6f72672f323030302f7376672720786d6c6e733a786c696e60208201527f6b3d27687474703a2f2f7777772e77332e6f72672f313939392f786c696e6b2760408201527f20786d6c6e733a7868746d6c3d27687474703a2f2f7777772e77332e6f72672f60608201527f313939392f7868746d6c272077696474683d2737363027206865696768743d2760808201527f3131343027207072657365727665417370656374526174696f3d27784d69645960a08201527f4d6964206d656574272076696577426f783d273020302037362031313427207360c08201527f74796c653d277374726f6b652d77696474683a303b206261636b67726f756e6460e08201527f2d636f6c6f723a68736c28302c30252c3025293b206d617267696e3a206175746101008201527f6f3b6865696768743a202d7765626b69742d66696c6c2d617661696c61626c6561012082015261139f60f11b61014082015260006117f5612311610142840185611ca9565b651e17b9bb339f60d11b815260060190565b6000821982111561233657612336611e13565b500190565b60008261235857634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561237757612377611e13565b500290565b60006020828403121561238e57600080fd5b81516117f581611bcd565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600082516123f9818460208701611815565b610e0f60f31b920191825250600201919050565b713c666f726569676e4f626a65637420783d2760701b815260008651602061243b8260128601838c01611815565b642720793d2760d81b601292850192830152875161245f8160178501848c01611815565b68272077696474683d2760b81b60179390910192830152865161248781838501848b01611815565b6927206865696768743d2760b01b92018181019290925285516124b081602a8501898501611815565b61139f60f11b602a9390910192830152507f3c7868746d6c3a696d6720636c6173733d27706978656c617465642720776964602c8201527f74683d273130302527206865696768743d273130302527207372633d27000000604c82015261254b61252f6125206069840187611ca9565b6213979f60e91b815260030190565b6f1e17b337b932b4b3b727b13532b1ba1f60811b815260100190565b98975050505050505050565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6040815260006125f96040830185611b64565b828103602084015261201e8185611b64565b6001600160a01b03868116825285166020820152604081018490526060810183905260a06080820181905260009061264590830184611845565b979650505050505050565b60006020828403121561266257600080fd5b81516117f5816117c2565b600060033d11156126865760046000803e5060005160e01c5b90565b600060443d10156126975790565b6040516003193d81016004833e81513d6001600160401b0380831160248401831017156126c657505050505090565b82850191508151818111156126de5750505050505090565b843d87010160208285010111156126f85750505050505090565b6127076020828601018761189a565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b6001600160a01b0386811682528516602082015260a06040820181905260009061278690830186611b64565b82810360608401526127988186611b64565b9050828103608084015261254b818561184556fec3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f624142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2fa2646970667358221220d7c8182161815f7abd0321aa5d4bd3fd9257fed0c05939049ba1d6f6276a3eb364736f6c634300080d0033

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

0000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14

-----Decoded View---------------
Arg [0] : assetsAddress (address): 0x8948Ea37a3121F2419e2f83a7BD2C35DAf611D73
Arg [1] : tacticalGearAddress (address): 0xCc6f2DD643589D47987566Afe17BaE948dbC2C14

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008948ea37a3121f2419e2f83a7bd2c35daf611d73
Arg [1] : 000000000000000000000000cc6f2dd643589d47987566afe17bae948dbc2c14


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.