ETH Price: $3,238.72 (+3.37%)

Contract

0x72A2A3ae48637512b01346Ae9C21c422148e9480
 

Overview

ETH Balance

0.09 ETH

Eth Value

$291.49 (@ $3,238.72/ETH)

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Add Issue216225222025-01-14 11:47:3512 hrs ago1736855255IN
0x72A2A3ae...2148e9480
0 ETH0.000898885.01184731
Add Issue216224852025-01-14 11:40:1112 hrs ago1736854811IN
0x72A2A3ae...2148e9480
0 ETH0.000578244.14640721
Add Issue216224582025-01-14 11:34:4712 hrs ago1736854487IN
0x72A2A3ae...2148e9480
0 ETH0.000623464.47072799
Add Issue216224382025-01-14 11:30:4712 hrs ago1736854247IN
0x72A2A3ae...2148e9480
0 ETH0.000516814.32318866
Add Issue216224192025-01-14 11:26:5913 hrs ago1736854019IN
0x72A2A3ae...2148e9480
0 ETH0.000933895.20707522
Add Issue216223782025-01-14 11:18:4713 hrs ago1736853527IN
0x72A2A3ae...2148e9480
0 ETH0.000641564.60049614
Add Issue216223602025-01-14 11:15:1113 hrs ago1736853311IN
0x72A2A3ae...2148e9480
0 ETH0.000671234.81325788
Add Issue216223402025-01-14 11:11:1113 hrs ago1736853071IN
0x72A2A3ae...2148e9480
0 ETH0.000535794.48194844
Claim203927992024-07-26 19:25:47172 days ago1722021947IN
0x72A2A3ae...2148e9480
0 ETH0.000215762.48978651
Claim203927782024-07-26 19:21:23172 days ago1722021683IN
0x72A2A3ae...2148e9480
0 ETH0.000220882.54884382
Claim203650722024-07-22 22:31:59176 days ago1721687519IN
0x72A2A3ae...2148e9480
0 ETH0.000426684.92548855
Claim203650662024-07-22 22:30:47176 days ago1721687447IN
0x72A2A3ae...2148e9480
0 ETH0.000404574.67033558
Claim203650612024-07-22 22:29:47176 days ago1721687387IN
0x72A2A3ae...2148e9480
0 ETH0.000446885.15872765
Claim203650562024-07-22 22:28:47176 days ago1721687327IN
0x72A2A3ae...2148e9480
0 ETH0.000456315.26754488
Claim203650532024-07-22 22:28:11176 days ago1721687291IN
0x72A2A3ae...2148e9480
0 ETH0.000475615.49043353
Claim203650472024-07-22 22:26:59176 days ago1721687219IN
0x72A2A3ae...2148e9480
0 ETH0.000462825.34268692
Claim203650432024-07-22 22:26:11176 days ago1721687171IN
0x72A2A3ae...2148e9480
0 ETH0.000435895.03181318
Claim203650372024-07-22 22:24:59176 days ago1721687099IN
0x72A2A3ae...2148e9480
0 ETH0.000464145.35867602
Claim203650332024-07-22 22:24:11176 days ago1721687051IN
0x72A2A3ae...2148e9480
0 ETH0.000479585.53695426
Claim203650272024-07-22 22:22:59176 days ago1721686979IN
0x72A2A3ae...2148e9480
0 ETH0.000509785.884878
Claim203650242024-07-22 22:22:23176 days ago1721686943IN
0x72A2A3ae...2148e9480
0 ETH0.000507875.86283011
Claim203650102024-07-22 22:19:35176 days ago1721686775IN
0x72A2A3ae...2148e9480
0 ETH0.000652817.53591485
Claim203650052024-07-22 22:18:35176 days ago1721686715IN
0x72A2A3ae...2148e9480
0 ETH0.000635747.33891483
Claim203649992024-07-22 22:17:23176 days ago1721686643IN
0x72A2A3ae...2148e9480
0 ETH0.000664647.67246164
Claim203649922024-07-22 22:15:59176 days ago1721686559IN
0x72A2A3ae...2148e9480
0 ETH0.000657257.58828361
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
163900322023-01-12 10:09:23733 days ago1673518163
0x72A2A3ae...2148e9480
0.66 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Collectible

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 2 runs

Other Settings:
default evmVersion
File 1 of 16 : Collectible.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;

import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "./EncodeKey.sol";

contract Collectible is ERC1155 {
  using Strings for uint256;

  string public constant name = "ENCODE Graphics Collectible";
  string public constant symbol = "ENC";

  EncodeKey public encodeKey;

  mapping(address => bool) adminAddresses;

  enum CollectibleType {
    Null,
    Collectible,
    Packdrop,
    Raffle
  }

  struct Issue {
    uint8[] permissions;
    uint256 cost;
    uint128 maxSupply;
    uint128 currentSupply;
    CollectibleType t;
    bool hasPhysicalDelivery;
    address[] thirdPartyAddresses;
    // percentage of cost, 10000 = 100%
    uint256[] thirdPartyFees;
    uint256 startRaffle;
    uint256 endRaffle;
  }

  struct IssueFactory {
    uint256 tokenId;
    uint8[] permissions;
    uint256 cost;
    uint256 supply;
    CollectibleType t;
    bool hasPhysicalDelivery;
    address[] thirdPartyAddresses;
    uint256[] thirdPartyFees;
    // This is used for raffles and packdrops
    uint256[] withPhysicalDelivery;
    uint256 startRaffle;
    uint256 endRaffle;
  }

  struct ExplicitUri {
    string uri;
    bool isExplicit;
  }

  mapping(uint256 => ExplicitUri) public explicitTokenURIs;
  mapping(uint256 => Issue) public issues;
  mapping(uint256 => mapping(uint256 => bool)) public claimed;

  mapping(address => uint256) public nonce;
  mapping(address => uint256) public thirdPartyPayment;

  event PackdropPurchased(address indexed account, uint256 indexed blockId, uint256 quantity);
  event RafflePurchased(address indexed account, uint256 indexed tokenId, uint256 quantity);
  event ClaimedPhysicalDelivery(address indexed account, uint256 indexed tokenId, uint256 quantity);
  
  constructor(address _key) ERC1155("") {
    encodeKey = EncodeKey(_key);
  }

  function getIssue(uint256 _id) public view returns (Issue memory) {
    return issues[_id];
  }

  function getIssues(uint256[] calldata tokenIds) public view returns (Issue[] memory) {
    Issue[] memory result = new Issue[](tokenIds.length);
    for (uint256 i = 0; i < tokenIds.length; i++) {
      result[i] = getIssue(tokenIds[i]);
    }
    return result;
  }

  function claimedBatch(uint256[] calldata keyIds, uint256[] calldata tokenIds) public view returns (bool[] memory) {
    require(keyIds.length == tokenIds.length, "keyIds and tokenIds must be the same length");
    bool[] memory result = new bool[](keyIds.length);
    for (uint256 i = 0; i < tokenIds.length; i++) {
      result[i] = claimed[tokenIds[i]][keyIds[i]];
    }
    return result;
  }

  function getKeyType(uint256 keyId) public pure returns (uint8) {
    if (keyId <= 50) {
      return 0;
    } else if (keyId <= 450) {
      return 1;
    } else if (keyId <= 1450) {
      return 2;
    } else {
      return 3;
    }
  }

  function getDiscount(uint8 keyType) public pure returns (uint256) {
    if (keyType == 0) {
      return 80;
    } else if (keyType == 1) {
      return 85;
    } else if (keyType == 2) {
      return 90;
    } else {
      return 0;
    }
  }

  function setTokenUri(uint256 tokenId, string calldata _uri) public {
    require(encodeKey.hasMasterKey(msg.sender), "Only with the master key you can set the token URI");
    explicitTokenURIs[tokenId] = ExplicitUri(_uri, true);
  }

  function editIssue(uint256 tokenId, uint256 cost, uint128 maxSupply) public {
    require(encodeKey.hasMasterKey(msg.sender), "Only with the master key you can set the token URI");
    require(issues[tokenId].t != CollectibleType.Null, "Issue does not exist");
    issues[tokenId].cost = cost;
    issues[tokenId].maxSupply = maxSupply;
  }

  function uri(uint256 tokenId) public view override returns (string memory) {
    if (explicitTokenURIs[tokenId].isExplicit) {
      return explicitTokenURIs[tokenId].uri;
    }
    return string(abi.encodePacked("https://api.encode.network/metadata/collectibles/", tokenId.toString()));
  }

  function checkPermissions(uint256 tokenId, uint256 keyId) internal view {
    require(!claimed[tokenId][keyId], "Token already claimed");
    uint8 keyType = getKeyType(keyId);
    require(encodeKey.ownerOf(keyId) == msg.sender, "Key is not owned by sender");
    for (uint8 i = 0; i < issues[tokenId].permissions.length; i++) {
      if (issues[tokenId].permissions[i] == keyType) {
        return;
      }
    }
    revert("Key is not allowed to use this token");
  }

  function toggleAdminAddress(address _adminAddress) public {
    require(encodeKey.hasMasterKey(msg.sender), "Only users with the master key");
    adminAddresses[_adminAddress] = !adminAddresses[_adminAddress];
  }

  function addIssue(IssueFactory memory issue) public {
    require(issue.t != CollectibleType.Null, "Invalid type");
    require(encodeKey.hasMasterKey(msg.sender), "Only with the master key new issues can be added");
    require(issues[issue.tokenId].t == CollectibleType.Null && issues[100 * uint256(issue.tokenId / 100)].t == CollectibleType.Null, "Token already exists");
    require(issue.permissions.length < 5 && issue.permissions.length > 0, "Permissions must have up to 4 elements");
    require(issue.thirdPartyAddresses.length == issue.thirdPartyFees.length, "thirdPartyAddresses and thirdPartyFees must be the same length");
    if (issue.t == CollectibleType.Packdrop) {
      require(issue.tokenId % 100 == 0, "TokenId must be a multiple of 100");
    } else if (issue.t == CollectibleType.Collectible || issue.t == CollectibleType.Raffle) {
      require(issue.withPhysicalDelivery.length == 0, "Collectibles cannot have multiples physical delivery");
      require(issue.tokenId % 100 != 0, "TokenId must not be a multiple of 100");
    }

    if (issue.t != CollectibleType.Raffle) {
      require(issue.startRaffle == 0 && issue.endRaffle == 0, "Raffle dates must be 0");
    } else {
      require(issue.endRaffle > issue.startRaffle, "Raffle dates must be in the future");
    }

    for (uint256 i = 0; i < issue.withPhysicalDelivery.length; i++) {
      uint256 tokenId = issue.withPhysicalDelivery[i];
      require(100 * uint256(tokenId / 100) == issue.tokenId && (tokenId % 100) < 50, "Incorrect tokenId on packdrop physical delivery");
      issues[tokenId].hasPhysicalDelivery = true;
    }

    for (uint256 i = 0; i < issue.thirdPartyFees.length; i++) {
      require(issue.thirdPartyFees[i] > 0 && issue.thirdPartyFees[i] <= 10000, "Third party fee must be greater than 0 and less or equal than 10k");
    }

    issues[issue.tokenId] = Issue({
      permissions: issue.permissions,
      cost: issue.cost,
      maxSupply: uint128(issue.supply),
      currentSupply: 0,
      t: issue.t,
      hasPhysicalDelivery: issue.hasPhysicalDelivery,
      thirdPartyFees: issue.thirdPartyFees,
      thirdPartyAddresses: issue.thirdPartyAddresses,
      startRaffle: issue.startRaffle,
      endRaffle: issue.endRaffle
    });
  }

  function addSimpleIssues(uint256[] calldata tokenIds, uint8[] calldata permissions, uint256[] calldata costs, uint128[] calldata maxSupply) public {
    require(encodeKey.hasMasterKey(msg.sender), "Only with the master key new issues can be added");
    require(tokenIds.length == permissions.length && tokenIds.length == costs.length && tokenIds.length == maxSupply.length, "tokenIds, permissions, costs and maxSupply must be the same length");
    for (uint256 i = 0; i < tokenIds.length; i++) {
      require(issues[tokenIds[i]].t == CollectibleType.Null, "Token already exists");
      uint8[] memory permissionsArray = new uint8[](1);
      permissionsArray[0] = permissions[i];
      issues[tokenIds[i]] = Issue({
        permissions: permissionsArray,
        cost: costs[i],
        maxSupply: maxSupply[i],
        currentSupply: 0,
        t: CollectibleType.Collectible,
        hasPhysicalDelivery: false,
        thirdPartyFees: new uint256[](0),
        thirdPartyAddresses: new address[](0),
        startRaffle: 0,
        endRaffle: 0
      });
    }
  }

  function claim(uint256 tokenId, uint256[] calldata keyIds) public {
    require(keyIds.length > 0, "No keys to claim");

    if (issues[tokenId].t == CollectibleType.Raffle) {
      require(issues[tokenId].startRaffle <= block.timestamp && issues[tokenId].endRaffle > block.timestamp, "Raffle is not active");
    }

    for (uint16 i = 0; i < keyIds.length; i++) {
      checkPermissions(tokenId, keyIds[i]);
      claimed[tokenId][keyIds[i]] = true;
    }
    Issue storage issue = issues[tokenId];
    if (issue.t == CollectibleType.Packdrop) {
      emit PackdropPurchased(msg.sender, tokenId, keyIds.length);
    } else if (issue.t == CollectibleType.Collectible) {
      _mint(msg.sender, tokenId, keyIds.length, "");
    } else if (issue.t == CollectibleType.Raffle) {
      emit RafflePurchased(msg.sender, tokenId, keyIds.length);
    }
  }

  function purchase(uint256 tokenId, uint256 amount, uint256 keyId) public payable {
    require(amount > 0, "Amount must be greater than 0");
    Issue storage issue = issues[tokenId];
    require(amount <= issue.maxSupply - issue.currentSupply, "Not enough remaining");
    if (issue.t == CollectibleType.Raffle) {
      require(issue.startRaffle <= block.timestamp && issue.endRaffle > block.timestamp, "Raffle is not active");
    }
    uint256 cost = issue.cost;

    if (keyId > 0) {
      require(encodeKey.ownerOf(keyId) == msg.sender, "Key is not owned by sender");
      uint256 discount = getDiscount(getKeyType(keyId));
      cost = cost * discount / 100;
    }

    require(msg.value >= cost * amount, "Not enough ETH");

    issue.currentSupply += uint128(amount);

    if (issue.thirdPartyFees.length > 0) {
      uint256 totalFee = 0;
      for (uint256 i = 0; i < issue.thirdPartyFees.length; i++) {
        uint256 fee = issue.thirdPartyFees[i] * cost / 10000;
        totalFee += fee;
        thirdPartyPayment[issue.thirdPartyAddresses[i]] += fee;
      }
      thirdPartyPayment[address(0)] += totalFee;
    }

    if (issue.t == CollectibleType.Packdrop) {
      emit PackdropPurchased(msg.sender, tokenId, amount);
    } else if (issue.t == CollectibleType.Collectible) {
      _mint(msg.sender, tokenId, amount, "");
    } else if (issue.t == CollectibleType.Raffle) {
      emit RafflePurchased(msg.sender, tokenId, amount);
    }
  }

  function compress(uint256[] memory list) internal pure returns (bytes32) {
    return keccak256(abi.encodePacked(list));
  }

  function redeem(uint256[] calldata tokenIds, uint256[] calldata amounts, bytes calldata signature) public {
    require(tokenIds.length > 0 && tokenIds.length == amounts.length, "TokenIds and amounts must have the same length");
  
    bytes32 t = compress(tokenIds);
    bytes32 a = compress(amounts);
    bytes32 messageHash = keccak256(abi.encodePacked('encode packdrop redeem', msg.sender, nonce[msg.sender], t, a));
    bytes32 digest = ECDSA.toEthSignedMessageHash(messageHash);

    address signer = ECDSA.recover(digest, signature);
    require(adminAddresses[signer], "Invalid signature");

    nonce[msg.sender]++;
    for (uint256 i = 0; i < tokenIds.length; i++) {
      _mint(msg.sender, tokenIds[i], amounts[i], "");
    }
  }

  function claimPhysicalDelivery(uint256 tokenId, uint256 amount) public {
    Issue storage issue = issues[tokenId];
    require(issue.hasPhysicalDelivery, "Physical delivery is not enabled for this token");
    require(balanceOf(msg.sender, tokenId) >= amount, "Not enough tokens");
    _burn(msg.sender, tokenId, amount);
    _mint(msg.sender, tokenId + 50, amount, "");
    emit ClaimedPhysicalDelivery(msg.sender, tokenId, amount);
  }

  function withdrawThirdParty(address payable recipient) internal {
    uint256 amount = thirdPartyPayment[recipient];
    thirdPartyPayment[recipient] = 0;
    thirdPartyPayment[address(0)] -= amount;
    (bool sent,) = recipient.call{value: amount}("");
    require(sent, "Failed to send Ether");
  }

  function withdraw(address payable recipient) public {
    if (thirdPartyPayment[recipient] > 0) {
      return withdrawThirdParty(recipient);
    }
    require(encodeKey.hasMasterKey(msg.sender), "Only with the master key you can withdraw");
    uint256 amount = address(this).balance - thirdPartyPayment[address(0)];
    (bool sent,) = recipient.call{value: amount}("");
    require(sent, "Failed to send Ether");
  }
}

File 2 of 16 : EncodeKey.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.7;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract EncodeKey is ERC721 {
  uint16[] public keyTypes = [1, 1, 1, 1];
  uint16[] public startOfBlock = [0, 50, 450, 1450];
  string bURI = "https://api.encode.network/metadata/keys/";

	constructor() ERC721("Encode Key", "ENK") {
    uint256 tokenId = startOfBlock[3] + keyTypes[3];
    _mint(msg.sender, tokenId);
    keyTypes[3]++;
	}

  function hasMasterKey(address _owner) public view returns (bool) {
    for (uint16 i = 1; i < keyTypes[3]; i++) {
      if (ownerOf(startOfBlock[3] + i) == _owner) {
        return true;
      }
    }
    return false;
  }

  function setURI(string calldata u) public {
    require(hasMasterKey(msg.sender), "You need a master key for this");
    bURI = u;
  }

  function lastIndex() public view returns (uint256) {
    return startOfBlock[3] + keyTypes[3] - 1;
  }

  function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) {
    uint256 balance = balanceOf(_owner);
    require(_index < balance, "index is greater than balance");
    for (uint16 k = 0; k < keyTypes.length; k++) {
      uint16 end = startOfBlock[k] + keyTypes[k];
      for (uint16 start = startOfBlock[k] + 1; start < end; start++) {
        if (ownerOf(start) == _owner) {
          if (_index == 0) {
            return start;
          }
          _index--;
        }
      }
    }
    revert("no token found");
  }

  function tokensOfOwner(address _owner) public view returns (uint256[] memory) {
    uint256 balance = balanceOf(_owner);
    uint256[] memory tokens = new uint256[](balance);
    uint256 index = 0;
    for (uint16 k = 0; k < keyTypes.length; k++) {
      uint16 end = startOfBlock[k] + keyTypes[k];
      for (uint16 start = startOfBlock[k] + 1; start < end; start++) {
        if (ownerOf(start) == _owner) {
          tokens[index] = start;
          index++;
        }
      }
    }
    return tokens;
  }

	function mint(address _to, uint8 _quantity, uint8 _type) public {
    require(hasMasterKey(msg.sender), "must have master key");
    require(_type == 3 || startOfBlock[_type] + keyTypes[_type] + _quantity <= (startOfBlock[_type + 1] + 1), "not enough tokens to mint");
		for (uint8 i = 0; i < _quantity; i++) {
      uint256 tokenId = startOfBlock[_type] + keyTypes[_type] + i;
      _mint(_to, tokenId);
    }
    keyTypes[_type] += _quantity;
	}

  function multiMint(address[] calldata _to, uint8[] calldata _quantity, uint8[] calldata _types) public {
    require(hasMasterKey(msg.sender), "must have master key");
    require(_to.length == _quantity.length && _to.length == _types.length, "to, quantity and types arrays must be the same length");
    uint16[] memory types = new uint16[](4);
    for (uint8 i = 0; i < _to.length; i++) {
      address to = _to[i];
      uint16 quantity = _quantity[i];
      uint16 _type = _types[i];
      require(_type == 3 || (startOfBlock[_type] + keyTypes[_type] + types[_type] + quantity <= (startOfBlock[_type + 1] + 1)), "not enough tokens to mint");
      for (uint16 j = 0; j < quantity; j++) {
        uint256 tokenId = startOfBlock[_type] + keyTypes[_type] + types[_type]++;
        _mint(to, tokenId);
      }
    }
    if (types[0] > 0) {
      keyTypes[0] += types[0];
    }
    if (types[1] > 0) {
      keyTypes[1] += types[1];
    }
    if (types[2] > 0) {
      keyTypes[2] += types[2];
    }
    if (types[3] > 0) {
      keyTypes[3] += types[3];
    }
  }

  function _baseURI() internal view override returns (string memory) {
    return bURI;
  }
}

File 3 of 16 : 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 4 of 16 : 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 5 of 16 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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
    }

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

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

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

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

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

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

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

        return (signer, RecoverError.NoError);
    }

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

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

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", 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 6 of 16 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_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) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

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

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

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

    /**
     * @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 7 of 16 : 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 8 of 16 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 functionCall(target, data, "Address: low-level call failed");
    }

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

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

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

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

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

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly
                /// @solidity memory-safe-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

import "../IERC721.sol";

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

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

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

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

pragma solidity ^0.8.0;

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

File 11 of 16 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: 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;

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

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

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

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

File 12 of 16 : ERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/ERC721.sol)

pragma solidity ^0.8.0;

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

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

    // Token name
    string private _name;

    // Token symbol
    string private _symbol;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        _approve(to, tokenId);
    }

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

        return _tokenApprovals[tokenId];
    }

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

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

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

        _transfer(from, to, tokenId);
    }

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

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

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

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

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

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

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

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

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

        _balances[to] += 1;
        _owners[tokenId] = to;

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

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

    /**
     * @dev Destroys `tokenId`.
     * The approval is cleared when the token is burned.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     *
     * Emits a {Transfer} event.
     */
    function _burn(uint256 tokenId) internal virtual {
        address owner = ERC721.ownerOf(tokenId);

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

        // Clear approvals
        _approve(address(0), tokenId);

        _balances[owner] -= 1;
        delete _owners[tokenId];

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

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

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

        _beforeTokenTransfer(from, to, tokenId);

        // Clear approvals from the previous owner
        _approve(address(0), tokenId);

        _balances[from] -= 1;
        _balances[to] += 1;
        _owners[tokenId] = to;

        emit Transfer(from, to, tokenId);

        _afterTokenTransfer(from, to, tokenId);
    }

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

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

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

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

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

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

File 13 of 16 : 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 14 of 16 : 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 15 of 16 : 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 16 of 16 : ERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.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 nor approved"
        );
        _safeTransferFrom(from, to, id, amount, data);
    }

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

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

        address operator = _msgSender();
        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;
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_key","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"ClaimedPhysicalDelivery","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"blockId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"PackdropPurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantity","type":"uint256"}],"name":"RafflePurchased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[{"components":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint8[]","name":"permissions","type":"uint8[]"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint256","name":"supply","type":"uint256"},{"internalType":"enum Collectible.CollectibleType","name":"t","type":"uint8"},{"internalType":"bool","name":"hasPhysicalDelivery","type":"bool"},{"internalType":"address[]","name":"thirdPartyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"thirdPartyFees","type":"uint256[]"},{"internalType":"uint256[]","name":"withPhysicalDelivery","type":"uint256[]"},{"internalType":"uint256","name":"startRaffle","type":"uint256"},{"internalType":"uint256","name":"endRaffle","type":"uint256"}],"internalType":"struct Collectible.IssueFactory","name":"issue","type":"tuple"}],"name":"addIssue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint8[]","name":"permissions","type":"uint8[]"},{"internalType":"uint256[]","name":"costs","type":"uint256[]"},{"internalType":"uint128[]","name":"maxSupply","type":"uint128[]"}],"name":"addSimpleIssues","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256[]","name":"keyIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"claimPhysicalDelivery","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"keyIds","type":"uint256[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"claimedBatch","outputs":[{"internalType":"bool[]","name":"","type":"bool[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint128","name":"maxSupply","type":"uint128"}],"name":"editIssue","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"encodeKey","outputs":[{"internalType":"contract EncodeKey","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"explicitTokenURIs","outputs":[{"internalType":"string","name":"uri","type":"string"},{"internalType":"bool","name":"isExplicit","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint8","name":"keyType","type":"uint8"}],"name":"getDiscount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"getIssue","outputs":[{"components":[{"internalType":"uint8[]","name":"permissions","type":"uint8[]"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"currentSupply","type":"uint128"},{"internalType":"enum Collectible.CollectibleType","name":"t","type":"uint8"},{"internalType":"bool","name":"hasPhysicalDelivery","type":"bool"},{"internalType":"address[]","name":"thirdPartyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"thirdPartyFees","type":"uint256[]"},{"internalType":"uint256","name":"startRaffle","type":"uint256"},{"internalType":"uint256","name":"endRaffle","type":"uint256"}],"internalType":"struct Collectible.Issue","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"}],"name":"getIssues","outputs":[{"components":[{"internalType":"uint8[]","name":"permissions","type":"uint8[]"},{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"currentSupply","type":"uint128"},{"internalType":"enum Collectible.CollectibleType","name":"t","type":"uint8"},{"internalType":"bool","name":"hasPhysicalDelivery","type":"bool"},{"internalType":"address[]","name":"thirdPartyAddresses","type":"address[]"},{"internalType":"uint256[]","name":"thirdPartyFees","type":"uint256[]"},{"internalType":"uint256","name":"startRaffle","type":"uint256"},{"internalType":"uint256","name":"endRaffle","type":"uint256"}],"internalType":"struct Collectible.Issue[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"keyId","type":"uint256"}],"name":"getKeyType","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"issues","outputs":[{"internalType":"uint256","name":"cost","type":"uint256"},{"internalType":"uint128","name":"maxSupply","type":"uint128"},{"internalType":"uint128","name":"currentSupply","type":"uint128"},{"internalType":"enum Collectible.CollectibleType","name":"t","type":"uint8"},{"internalType":"bool","name":"hasPhysicalDelivery","type":"bool"},{"internalType":"uint256","name":"startRaffle","type":"uint256"},{"internalType":"uint256","name":"endRaffle","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"keyId","type":"uint256"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"redeem","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenUri","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"thirdPartyPayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_adminAddress","type":"address"}],"name":"toggleAdminAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address payable","name":"recipient","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506040516200543338038062005433833981016040819052620000349162000134565b6040805160208101909152600081526200004e8162000075565b50600380546001600160a01b0319166001600160a01b0392909216919091179055620001a3565b80516200008a9060029060208401906200008e565b5050565b8280546200009c9062000166565b90600052602060002090601f016020900481019282620000c057600085556200010b565b82601f10620000db57805160ff19168380011785556200010b565b828001600101855582156200010b579182015b828111156200010b578251825591602001919060010190620000ee565b50620001199291506200011d565b5090565b5b808211156200011957600081556001016200011e565b6000602082840312156200014757600080fd5b81516001600160a01b03811681146200015f57600080fd5b9392505050565b600181811c908216806200017b57607f821691505b602082108114156200019d57634e487b7160e01b600052602260045260246000fd5b50919050565b61528080620001b36000396000f3fe6080604052600436106101675760003560e01c8062fdd58e1461016c57806301ffc9a71461019f57806304e15de5146101cf57806306fdde03146102515780630e89341c146102a55780631117a8e9146102c55780631dfaac27146102f257806323add0a7146103145780632eb2c2d6146103345780633be14e791461035457806345dcf523146103815780634e1273f4146103a157806351cff8d9146103ce57806353373bfd146103ee57806357f7789e1461041b5780635d7af7ba1461043b57806370ae92d21461045b5780637921feae14610488578063920367df146104ba57806395d89b41146104da578063976b3113146105095780639b8b930514610536578063a22cb46514610549578063a2f3d5e614610569578063a54ab45714610589578063aacdec17146105c4578063b1b66652146105f1578063bf735dc014610611578063c256c6161461063f578063e985e9c51461065f578063f242432a146106a8575b600080fd5b34801561017857600080fd5b5061018c610187366004614208565b6106c8565b6040519081526020015b60405180910390f35b3480156101ab57600080fd5b506101bf6101ba3660046144bc565b61075e565b6040519015158152602001610196565b3480156101db57600080fd5b5061023e6101ea366004614646565b60066020819052600091825260409091206001810154600282015460038301549383015460079093015491936001600160801b0380831694600160801b909304169260ff8083169361010090930416919087565b6040516101969796959493929190614e10565b34801561025d57600080fd5b506102986040518060400160405280601b81526020017a454e434f444520477261706869637320436f6c6c65637469626c6560281b81525081565b6040516101969190614b80565b3480156102b157600080fd5b506102986102c0366004614646565b6107b0565b3480156102d157600080fd5b506102e56102e03660046142d8565b61089a565b6040516101969190614a97565b3480156102fe57600080fd5b5061031261030d3660046144f6565b6109f0565b005b34801561032057600080fd5b5061018c61032f36600461476b565b61126b565b34801561034057600080fd5b5061031261034f3660046140c5565b6112b2565b34801561036057600080fd5b5061018c61036f36600461404b565b60096020526000908152604090205481565b34801561038d57600080fd5b5061031261039c3660046146e8565b6112fe565b3480156103ad57600080fd5b506103c16103bc366004614234565b611437565b6040516101969190614b3f565b3480156103da57600080fd5b506103126103e936600461404b565b611560565b3480156103fa57600080fd5b5060035461040e906001600160a01b031681565b60405161019691906149e0565b34801561042757600080fd5b506103126104363660046146aa565b61171c565b34801561044757600080fd5b5061031261045636600461470a565b61183e565b34801561046757600080fd5b5061018c61047636600461404b565b60086020526000908152604090205481565b34801561049457600080fd5b506104a86104a3366004614646565b61197f565b60405160ff9091168152602001610196565b3480156104c657600080fd5b506103126104d53660046143dc565b6119bb565b3480156104e657600080fd5b5061029860405180604001604052806003815260200162454e4360e81b81525081565b34801561051557600080fd5b50610529610524366004614646565b611df0565b6040516101969190614dfd565b61031261054436600461473f565b611fc6565b34801561055557600080fd5b506103126105643660046141da565b612429565b34801561057557600080fd5b50610312610584366004614343565b612438565b34801561059557600080fd5b506101bf6105a43660046146e8565b600760209081526000928352604080842090915290825290205460ff1681565b3480156105d057600080fd5b506105e46105df366004614297565b6126f1565b6040516101969190614add565b3480156105fd57600080fd5b5061031261060c36600461465f565b6127a5565b34801561061d57600080fd5b5061063161062c366004614646565b6129e4565b604051610196929190614b93565b34801561064b57600080fd5b5061031261065a36600461404b565b612a8b565b34801561066b57600080fd5b506101bf61067a36600461408c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b3480156106b457600080fd5b506103126106c3366004614172565b612b80565b60006001600160a01b0383166107385760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061078f57506001600160e01b031982166303a24d0760e21b145b806107aa57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008181526005602052604090206001015460609060ff161561086b57600082815260056020526040902080546107e690614f86565b80601f016020809104026020016040519081016040528092919081815260200182805461081290614f86565b801561085f5780601f106108345761010080835404028352916020019161085f565b820191906000526020600020905b81548152906001019060200180831161084257829003601f168201915b50505050509050919050565b61087482612bc5565b6040516020016108849190614981565b6040516020818303038152906040529050919050565b60608382146108ff5760405162461bcd60e51b815260206004820152602b60248201527f6b657949647320616e6420746f6b656e496473206d757374206265207468652060448201526a0e6c2daca40d8cadccee8d60ab1b606482015260840161072f565b6000846001600160401b03811115610919576109196150b6565b604051908082528060200260200182016040528015610942578160200160208202803683370190505b50905060005b838110156109e65760076000868684818110610966576109666150a0565b905060200201358152602001908152602001600020600088888481811061098f5761098f6150a0565b90506020020135815260200190815260200160002060009054906101000a900460ff168282815181106109c4576109c46150a0565b91151560209283029190910190910152806109de8161500f565b915050610948565b5095945050505050565b600081608001516003811115610a0857610a0861508a565b1415610a455760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964207479706560a01b604482015260640161072f565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f90610a759033906004016149e0565b60206040518083038186803b158015610a8d57600080fd5b505afa158015610aa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac5919061449f565b610ae15760405162461bcd60e51b815260040161072f90614c7c565b8051600090815260066020526040812060039081015460ff1690811115610b0a57610b0a61508a565b148015610b5f575060006006600060648460000151610b299190614ee8565b610b34906064614efc565b8152602081019190915260400160002060039081015460ff1690811115610b5d57610b5d61508a565b145b610b7b5760405162461bcd60e51b815260040161072f90614c4e565b6005816020015151108015610b9557506000816020015151115b610bf05760405162461bcd60e51b815260206004820152602660248201527f5065726d697373696f6e73206d757374206861766520757020746f203420656c604482015265656d656e747360d01b606482015260840161072f565b8060e00151518160c001515114610c6f5760405162461bcd60e51b815260206004820152603e60248201527f7468697264506172747941646472657373657320616e6420746869726450617260448201527f747946656573206d757374206265207468652073616d65206c656e6774680000606482015260840161072f565b600281608001516003811115610c8757610c8761508a565b1415610cf7578051610c9b9060649061504a565b15610cf25760405162461bcd60e51b815260206004820152602160248201527f546f6b656e4964206d7573742062652061206d756c7469706c65206f662031306044820152600360fc1b606482015260840161072f565b610e0e565b600181608001516003811115610d0f57610d0f61508a565b1480610d305750600381608001516003811115610d2e57610d2e61508a565b145b15610e0e576101008101515115610da65760405162461bcd60e51b815260206004820152603460248201527f436f6c6c65637469626c65732063616e6e6f742068617665206d756c7469706c604482015273657320706879736963616c2064656c697665727960601b606482015260840161072f565b8051610db49060649061504a565b610e0e5760405162461bcd60e51b815260206004820152602560248201527f546f6b656e4964206d757374206e6f742062652061206d756c7469706c65206f604482015264066203130360dc1b606482015260840161072f565b600381608001516003811115610e2657610e2661508a565b14610e8b57610120810151158015610e415750610140810151155b610e865760405162461bcd60e51b81526020600482015260166024820152750526166666c65206461746573206d75737420626520360541b604482015260640161072f565b610eef565b80610120015181610140015111610eef5760405162461bcd60e51b815260206004820152602260248201527f526166666c65206461746573206d75737420626520696e207468652066757475604482015261726560f01b606482015260840161072f565b60005b81610100015151811015610feb5760008261010001518281518110610f1957610f196150a0565b602002602001015190508260000151606482610f359190614ee8565b610f40906064614efc565b148015610f5757506032610f5560648361504a565b105b610fbb5760405162461bcd60e51b815260206004820152602f60248201527f496e636f727265637420746f6b656e4964206f6e207061636b64726f7020706860448201526e79736963616c2064656c697665727960881b606482015260840161072f565b6000908152600660205260409020600301805461ff00191661010017905580610fe38161500f565b915050610ef2565b5060005b8160e00151518110156110d65760008260e001518281518110611014576110146150a0565b602002602001015111801561104857506127108260e00151828151811061103d5761103d6150a0565b602002602001015111155b6110c45760405162461bcd60e51b815260206004820152604160248201527f546869726420706172747920666565206d75737420626520677265617465722060448201527f7468616e203020616e64206c657373206f7220657175616c207468616e2031306064820152606b60f81b608482015260a40161072f565b806110ce8161500f565b915050610fef565b50604051806101400160405280826020015181526020018260400151815260200182606001516001600160801b0316815260200160006001600160801b03168152602001826080015160038111156111305761113061508a565b81526020018260a00151151581526020018260c0015181526020018260e00151815260200182610120015181526020018261014001518152506006600083600001518152602001908152602001600020600082015181600001908051906020019061119c929190613ba3565b506020820151600180830191909155604083015160608401516001600160801b03908116600160801b0291161760028301556080830151600380840180549293909260ff19169184908111156111f4576111f461508a565b021790555060a08201516003820180549115156101000261ff001990921691909117905560c08201518051611233916004840191602090910190613c49565b5060e0820151805161124f916005840191602090910190613c9e565b5061010082015160068201556101209091015160079091015550565b600060ff821661127d57506050919050565b8160ff166001141561129157506055919050565b8160ff16600214156112a55750605a919050565b506000919050565b919050565b6001600160a01b0385163314806112ce57506112ce853361067a565b6112ea5760405162461bcd60e51b815260040161072f90614bb7565b6112f78585858585612cca565b5050505050565b60008281526006602052604090206003810154610100900460ff1661137d5760405162461bcd60e51b815260206004820152602f60248201527f506879736963616c2064656c6976657279206973206e6f7420656e61626c656460448201526e103337b9103a3434b9903a37b5b2b760891b606482015260840161072f565b8161138833856106c8565b10156113ca5760405162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f75676820746f6b656e7360781b604482015260640161072f565b6113d5338484612ea7565b6113fa336113e4856032614ed0565b8460405180602001604052806000815250613016565b604051828152839033907fd954cebefa450cd60f299e545dfe53bd13d85483508f06824982bba0828ab8dd906020015b60405180910390a3505050565b6060815183511461149c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161072f565b600083516001600160401b038111156114b7576114b76150b6565b6040519080825280602002602001820160405280156114e0578160200160208202803683370190505b50905060005b84518110156115585761152b858281518110611504576115046150a0565b602002602001015185838151811061151e5761151e6150a0565b60200260200101516106c8565b82828151811061153d5761153d6150a0565b60209081029190910101526115518161500f565b90506114e6565b509392505050565b6001600160a01b0381166000908152600960205260409020541561158a576115878161310f565b50565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f906115ba9033906004016149e0565b60206040518083038186803b1580156115d257600080fd5b505afa1580156115e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160a919061449f565b6116565760405162461bcd60e51b8152602060048201526029602482015260008051602061522b83398151915260448201526820776974686472617760b81b606482015260840161072f565b600080805260096020526000805160206151ab8339815191525461167a9047614f43565b90506000826001600160a01b0316826040515b60006040518083038185875af1925050503d80600081146116ca576040519150601f19603f3d011682016040523d82523d6000602084013e6116cf565b606091505b50509050806117175760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161072f565b505050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f9061174c9033906004016149e0565b60206040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179c919061449f565b6117b85760405162461bcd60e51b815260040161072f90614d89565b6040805160606020601f8501819004028201810183529181018381529091829190859085908190850183828082843760009201829052509385525050600160209384015250858152600582526040902082518051919261181d92849290910190613cd9565b50602091909101516001909101805460ff1916911515919091179055505050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f9061186e9033906004016149e0565b60206040518083038186803b15801561188657600080fd5b505afa15801561189a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118be919061449f565b6118da5760405162461bcd60e51b815260040161072f90614d89565b600083815260066020526040812060039081015460ff16908111156119015761190161508a565b14156119465760405162461bcd60e51b8152602060048201526014602482015273125cdcdd5948191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161072f565b600092835260066020526040909220600181019190915560020180546001600160801b0319166001600160801b03909216919091179055565b60006032821161199157506000919050565b6101c282116119a257506001919050565b6105aa82116119b357506002919050565b506003919050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f906119eb9033906004016149e0565b60206040518083038186803b158015611a0357600080fd5b505afa158015611a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3b919061449f565b611a575760405162461bcd60e51b815260040161072f90614c7c565b8685148015611a6557508683145b8015611a7057508681145b611aed5760405162461bcd60e51b815260206004820152604260248201527f746f6b656e4964732c207065726d697373696f6e732c20636f73747320616e6460448201527f206d6178537570706c79206d757374206265207468652073616d65206c656e676064820152610e8d60f31b608482015260a40161072f565b60005b87811015611de5576000600660008b8b85818110611b1057611b106150a0565b90506020020135815260200190815260200160002060030160009054906101000a900460ff166003811115611b4757611b4761508a565b14611b645760405162461bcd60e51b815260040161072f90614c4e565b60408051600180825281830190925260009160208083019080368337019050509050878783818110611b9857611b986150a0565b9050602002016020810190611bad919061476b565b81600081518110611bc057611bc06150a0565b602002602001019060ff16908160ff1681525050604051806101400160405280828152602001878785818110611bf857611bf86150a0565b905060200201358152602001858585818110611c1657611c166150a0565b9050602002016020810190611c2b919061462b565b6001600160801b031681526000602082015260400160018152600060208201819052604090910190604051908082528060200260200182016040528015611c7c578160200160208202803683370190505b5081526020016000604051908082528060200260200182016040528015611cad578160200160208202803683370190505b508152602001600081526020016000815250600660008c8c86818110611cd557611cd56150a0565b9050602002013581526020019081526020016000206000820151816000019080519060200190611d06929190613ba3565b506020820151600180830191909155604083015160608401516001600160801b03908116600160801b0291161760028301556080830151600380840180549293909260ff1916918490811115611d5e57611d5e61508a565b021790555060a08201516003820180549115156101000261ff001990921691909117905560c08201518051611d9d916004840191602090910190613c49565b5060e08201518051611db9916005840191602090910190613c9e565b506101008201516006820155610120909101516007909101555080611ddd8161500f565b915050611af0565b505050505050505050565b611df8613d4c565b600082815260066020908152604091829020825181546101609381028201840190945261014081018481529093919284928491840182828015611e7857602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411611e495790505b50505091835250506001820154602082015260028201546001600160801b038082166040840152600160801b90910416606082015260038083015460809092019160ff1690811115611ecc57611ecc61508a565b6003811115611edd57611edd61508a565b81526003820154610100900460ff1615156020808301919091526004830180546040805182850281018501825282815294019392830182828015611f4a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f2c575b5050505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015611fa257602002820191906000526020600020905b815481526020019060010190808311611f8e575b50505050508152602001600682015481526020016007820154815250509050919050565b600082116120165760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161072f565b60008381526006602052604090206002810154612045906001600160801b03600160801b820481169116614f1b565b6001600160801b03168311156120945760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f7567682072656d61696e696e6760601b604482015260640161072f565b60038181015460ff16818111156120ad576120ad61508a565b14156120e657428160060154111580156120ca5750428160070154115b6120e65760405162461bcd60e51b815260040161072f90614d5b565b600181015482156121bd576003546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561213557600080fd5b505afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d919061406f565b6001600160a01b0316146121935760405162461bcd60e51b815260040161072f90614dc9565b60006121a161032f8561197f565b905060646121af8284614efc565b6121b99190614ee8565b9150505b6121c78482614efc565b3410156122075760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b604482015260640161072f565b838260020160108282829054906101000a90046001600160801b031661222d9190614ea5565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550600082600501805490501115612352576000805b60058401548110156123215760006127108486600501848154811061228c5761228c6150a0565b90600052602060002001546122a19190614efc565b6122ab9190614ee8565b90506122b78184614ed0565b925080600960008760040185815481106122d3576122d36150a0565b60009182526020808320909101546001600160a01b0316835282019290925260400181208054909190612307908490614ed0565b9091555082915061231990508161500f565b915050612265565b50600080805260096020526000805160206151ab833981519152805483929061234b908490614ed0565b9091555050505b600260038084015460ff169081111561236d5761236d61508a565b141561239d576040518481528590339060008051602061520b8339815191529060200160405180910390a36112f7565b600160038084015460ff16908111156123b8576123b861508a565b14156123de576123d933868660405180602001604052806000815250613016565b6112f7565b60038281015460ff16818111156123f7576123f761508a565b14156112f757604051848152859033906000805160206151eb8339815191529060200160405180910390a35050505050565b61243433838361316c565b5050565b841580159061244657508483145b6124a95760405162461bcd60e51b815260206004820152602e60248201527f546f6b656e49647320616e6420616d6f756e7473206d7573742068617665207460448201526d0d0ca40e6c2daca40d8cadccee8d60931b606482015260840161072f565b60006124e787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061324592505050565b9050600061252786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061324592505050565b3360008181526008602090815260408083205490519495509193612595939291879187910175656e636f6465207061636b64726f702072656465656d60501b815260609490941b6001600160601b0319166016850152602a840192909252604a830152606a820152608a0190565b60405160208183030381529060405280519060200120905060006125b882613275565b905060006125fc8288888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132af92505050565b6001600160a01b03811660009081526004602052604090205490915060ff1661265b5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161072f565b3360009081526008602052604081208054916126768361500f565b919050555060005b8a8110156126e3576126d1338d8d8481811061269c5761269c6150a0565b905060200201358c8c858181106126b5576126b56150a0565b9050602002013560405180602001604052806000815250613016565b806126db8161500f565b91505061267e565b505050505050505050505050565b60606000826001600160401b0381111561270d5761270d6150b6565b60405190808252806020026020018201604052801561274657816020015b612733613d4c565b81526020019060019003908161272b5790505b50905060005b8381101561155857612775858583818110612769576127696150a0565b90506020020135611df0565b828281518110612787576127876150a0565b6020026020010181905250808061279d9061500f565b91505061274c565b806127e55760405162461bcd60e51b815260206004820152601060248201526f4e6f206b65797320746f20636c61696d60801b604482015260640161072f565b600083815260066020526040902060039081015460ff168181111561280c5761280c61508a565b141561286057600083815260066020819052604090912001544210801590612844575060008381526006602052604090206007015442105b6128605760405162461bcd60e51b815260040161072f90614d5b565b60005b61ffff81168211156128fb576128958484848461ffff16818110612889576128896150a0565b905060200201356132cb565b6000848152600760205260408120600191858561ffff86168181106128bc576128bc6150a0565b90506020020135815260200190815260200160002060006101000a81548160ff02191690831515021790555080806128f390614fed565b915050612863565b506000838152600660205260409020600260038083015460ff16908111156129255761292561508a565b1415612955576040518281528490339060008051602061520b8339815191529060200160405180910390a36129de565b600160038083015460ff16908111156129705761297061508a565b14156129995761299433858585905060405180602001604052806000815250613016565b6129de565b60038181015460ff16818111156129b2576129b261508a565b14156129de57604051828152849033906000805160206151eb8339815191529060200160405180910390a35b50505050565b6005602052600090815260409020805481906129ff90614f86565b80601f0160208091040260200160405190810160405280929190818152602001828054612a2b90614f86565b8015612a785780601f10612a4d57610100808354040283529160200191612a78565b820191906000526020600020905b815481529060010190602001808311612a5b57829003601f168201915b5050506001909301549192505060ff1682565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f90612abb9033906004016149e0565b60206040518083038186803b158015612ad357600080fd5b505afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b919061449f565b612b575760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207573657273207769746820746865206d6173746572206b65790000604482015260640161072f565b6001600160a01b03166000908152600460205260409020805460ff19811660ff90911615179055565b6001600160a01b038516331480612b9c5750612b9c853361067a565b612bb85760405162461bcd60e51b815260040161072f90614bb7565b6112f785858585856134b7565b606081612be95750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c135780612bfd8161500f565b9150612c0c9050600a83614ee8565b9150612bed565b6000816001600160401b03811115612c2d57612c2d6150b6565b6040519080825280601f01601f191660200182016040528015612c57576020820181803683370190505b5090505b8415612cc257612c6c600183614f43565b9150612c79600a8661504a565b612c84906030614ed0565b60f81b818381518110612c9957612c996150a0565b60200101906001600160f81b031916908160001a905350612cbb600a86614ee8565b9450612c5b565b949350505050565b8151835114612d2c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161072f565b6001600160a01b038416612d525760405162461bcd60e51b815260040161072f90614ccc565b3360005b8451811015612e39576000858281518110612d7357612d736150a0565b602002602001015190506000858381518110612d9157612d916150a0565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612de15760405162461bcd60e51b815260040161072f90614d11565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e1e908490614ed0565b9250508190555050505080612e329061500f565b9050612d56565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612e89929190614b52565b60405180910390a4612e9f8187878787876135c4565b505050505050565b6001600160a01b038316612f095760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161072f565b336000612f1584613736565b90506000612f2284613736565b60408051602080820183526000918290528882528181528282206001600160a01b038b1683529052205490915084811015612fab5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161072f565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816916000805160206151cb833981519152910160405180910390a46040805160208101909152600090525b50505050505050565b6001600160a01b0384166130765760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161072f565b33600061308285613736565b9050600061308f85613736565b90506000868152602081815260408083206001600160a01b038b168452909152812080548792906130c1908490614ed0565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716916000805160206151cb833981519152910160405180910390a461300d83600089898989613781565b6001600160a01b03811660009081526009602052604081208054908290558180526000805160206151ab833981519152805491928392613150908490614f43565b925050819055506000826001600160a01b03168260405161168d565b816001600160a01b0316836001600160a01b031614156131e05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161072f565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161142a565b600081604051602001613258919061494b565b604051602081830303815290604052805190602001209050919050565b6040517b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6020820152603c8101829052600090605c01613258565b60008060006132be8585613852565b91509150611558816138c2565b600082815260076020908152604080832084845290915290205460ff161561332d5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185b1c9958591e4818db185a5b5959605a1b604482015260640161072f565b60006133388261197f565b6003546040516331a9108f60e11b81526004810185905291925033916001600160a01b0390911690636352211e9060240160206040518083038186803b15801561338157600080fd5b505afa158015613395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b9919061406f565b6001600160a01b0316146133df5760405162461bcd60e51b815260040161072f90614dc9565b60005b60008481526006602052604090205460ff82161015613462576000848152600660205260409020805460ff8085169291908416908110613424576134246150a0565b60009182526020918290209181049091015460ff601f9092166101000a90041614156134505750505050565b8061345a8161502a565b9150506133e2565b5060405162461bcd60e51b8152602060048201526024808201527f4b6579206973206e6f7420616c6c6f77656420746f207573652074686973207460448201526337b5b2b760e11b606482015260840161072f565b6001600160a01b0384166134dd5760405162461bcd60e51b815260040161072f90614ccc565b3360006134e985613736565b905060006134f685613736565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156135395760405162461bcd60e51b815260040161072f90614d11565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613576908490614ed0565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816916000805160206151cb833981519152910160405180910390a4611de5848a8a8a8a8a613781565b6135d6846001600160a01b0316613a78565b15612e9f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061360f90899089908890889088906004016149f4565b602060405180830381600087803b15801561362957600080fd5b505af1925050508015613659575060408051601f3d908101601f19168201909252613656918101906144d9565b60015b613706576136656150cc565b806308c379a0141561369f575061367a6150e8565b8061368557506136a1565b8060405162461bcd60e51b815260040161072f9190614b80565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161072f565b6001600160e01b0319811663bc197c8160e01b1461300d5760405162461bcd60e51b815260040161072f90614c06565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613770576137706150a0565b602090810291909101015292915050565b613793846001600160a01b0316613a78565b15612e9f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906137cc9089908990889088908890600401614a52565b602060405180830381600087803b1580156137e657600080fd5b505af1925050508015613816575060408051601f3d908101601f19168201909252613813918101906144d9565b60015b613822576136656150cc565b6001600160e01b0319811663f23a6e6160e01b1461300d5760405162461bcd60e51b815260040161072f90614c06565b6000808251604114156138895760208301516040840151606085015160001a61387d87828585613a87565b945094505050506138bb565b8251604014156138b357602083015160408401516138a8868383613b6a565b9350935050506138bb565b506000905060025b9250929050565b60008160048111156138d6576138d661508a565b14156138df5750565b60018160048111156138f3576138f361508a565b141561393c5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161072f565b60028160048111156139505761395061508a565b141561399e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161072f565b60038160048111156139b2576139b261508a565b1415613a0b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161072f565b6004816004811115613a1f57613a1f61508a565b14156115875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161072f565b6001600160a01b03163b151590565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115613ab45750600090506003613b61565b8460ff16601b14158015613acc57508460ff16601c14155b15613add5750600090506004613b61565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613b31573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613b5a57600060019250925050613b61565b9150600090505b94509492505050565b6000806001600160ff1b03831681613b8760ff86901c601b614ed0565b9050613b9587828885613a87565b935093505050935093915050565b82805482825590600052602060002090601f01602090048101928215613c395791602002820160005b83821115613c0a57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613bcc565b8015613c375782816101000a81549060ff0219169055600101602081600001049283019260010302613c0a565b505b50613c45929150613da1565b5090565b828054828255906000526020600020908101928215613c39579160200282015b82811115613c3957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613c69565b828054828255906000526020600020908101928215613c39579160200282015b82811115613c39578251825591602001919060010190613cbe565b828054613ce590614f86565b90600052602060002090601f016020900481019282613d075760008555613c39565b82601f10613d2057805160ff1916838001178555613c39565b82800160010185558215613c395791820182811115613c39578251825591602001919060010190613cbe565b6040805161014081018252606080825260006020830181905292820183905281018290529060808201908152602001600015158152602001606081526020016060815260200160008152602001600081525090565b5b80821115613c455760008155600101613da2565b600082601f830112613dc757600080fd5b81356020613dd482614e82565b604051613de18282614fc1565b8381528281019150858301600585901b87018401881015613e0157600080fd5b60005b85811015613e29578135613e1781615171565b84529284019290840190600101613e04565b5090979650505050505050565b60008083601f840112613e4857600080fd5b5081356001600160401b03811115613e5f57600080fd5b6020830191508360208260051b85010111156138bb57600080fd5b600082601f830112613e8b57600080fd5b81356020613e9882614e82565b604051613ea58282614fc1565b8381528281019150858301600585901b87018401881015613ec557600080fd5b60005b85811015613e2957813584529284019290840190600101613ec8565b600082601f830112613ef557600080fd5b81356020613f0282614e82565b604051613f0f8282614fc1565b8381528281019150858301600585901b87018401881015613f2f57600080fd5b60005b85811015613e2957613f438261403a565b84529284019290840190600101613f32565b80356112ad81615186565b60008083601f840112613f7257600080fd5b5081356001600160401b03811115613f8957600080fd5b6020830191508360208285010111156138bb57600080fd5b600082601f830112613fb257600080fd5b81356001600160401b03811115613fcb57613fcb6150b6565b604051613fe2601f8301601f191660200182614fc1565b818152846020838601011115613ff757600080fd5b816020850160208301376000918101602001919091529392505050565b8035600481106112ad57600080fd5b80356001600160801b03811681146112ad57600080fd5b803560ff811681146112ad57600080fd5b60006020828403121561405d57600080fd5b813561406881615171565b9392505050565b60006020828403121561408157600080fd5b815161406881615171565b6000806040838503121561409f57600080fd5b82356140aa81615171565b915060208301356140ba81615171565b809150509250929050565b600080600080600060a086880312156140dd57600080fd5b85356140e881615171565b945060208601356140f881615171565b935060408601356001600160401b038082111561411457600080fd5b61412089838a01613e7a565b9450606088013591508082111561413657600080fd5b61414289838a01613e7a565b9350608088013591508082111561415857600080fd5b5061416588828901613fa1565b9150509295509295909350565b600080600080600060a0868803121561418a57600080fd5b853561419581615171565b945060208601356141a581615171565b9350604086013592506060860135915060808601356001600160401b038111156141ce57600080fd5b61416588828901613fa1565b600080604083850312156141ed57600080fd5b82356141f881615171565b915060208301356140ba81615186565b6000806040838503121561421b57600080fd5b823561422681615171565b946020939093013593505050565b6000806040838503121561424757600080fd5b82356001600160401b038082111561425e57600080fd5b61426a86838701613db6565b9350602085013591508082111561428057600080fd5b5061428d85828601613e7a565b9150509250929050565b600080602083850312156142aa57600080fd5b82356001600160401b038111156142c057600080fd5b6142cc85828601613e36565b90969095509350505050565b600080600080604085870312156142ee57600080fd5b84356001600160401b038082111561430557600080fd5b61431188838901613e36565b9096509450602087013591508082111561432a57600080fd5b5061433787828801613e36565b95989497509550505050565b6000806000806000806060878903121561435c57600080fd5b86356001600160401b038082111561437357600080fd5b61437f8a838b01613e36565b9098509650602089013591508082111561439857600080fd5b6143a48a838b01613e36565b909650945060408901359150808211156143bd57600080fd5b506143ca89828a01613f60565b979a9699509497509295939492505050565b6000806000806000806000806080898b0312156143f857600080fd5b88356001600160401b038082111561440f57600080fd5b61441b8c838d01613e36565b909a50985060208b013591508082111561443457600080fd5b6144408c838d01613e36565b909850965060408b013591508082111561445957600080fd5b6144658c838d01613e36565b909650945060608b013591508082111561447e57600080fd5b5061448b8b828c01613e36565b999c989b5096995094979396929594505050565b6000602082840312156144b157600080fd5b815161406881615186565b6000602082840312156144ce57600080fd5b813561406881615194565b6000602082840312156144eb57600080fd5b815161406881615194565b60006020828403121561450857600080fd5b81356001600160401b038082111561451f57600080fd5b90830190610160828603121561453457600080fd5b61453c614e59565b8235815260208301358281111561455257600080fd5b61455e87828601613ee4565b602083015250604083013560408201526060830135606082015261458460808401614014565b608082015261459560a08401613f55565b60a082015260c0830135828111156145ac57600080fd5b6145b887828601613db6565b60c08301525060e0830135828111156145d057600080fd5b6145dc87828601613e7a565b60e08301525061010080840135838111156145f657600080fd5b61460288828701613e7a565b918301919091525061012083810135908201526101409283013592810192909252509392505050565b60006020828403121561463d57600080fd5b61406882614023565b60006020828403121561465857600080fd5b5035919050565b60008060006040848603121561467457600080fd5b8335925060208401356001600160401b0381111561469157600080fd5b61469d86828701613e36565b9497909650939450505050565b6000806000604084860312156146bf57600080fd5b8335925060208401356001600160401b038111156146dc57600080fd5b61469d86828701613f60565b600080604083850312156146fb57600080fd5b50508035926020909101359150565b60008060006060848603121561471f57600080fd5b833592506020840135915061473660408501614023565b90509250925092565b60008060006060848603121561475457600080fd5b505081359360208301359350604090920135919050565b60006020828403121561477d57600080fd5b6140688261403a565b600081518084526020808501945080840160005b838110156147bf5781516001600160a01b03168752958201959082019060010161479a565b509495945050505050565b600081518084526020808501945080840160005b838110156147bf578151875295820195908201906001016147de565b600081518084526020808501945080840160005b838110156147bf57815160ff168752958201959082019060010161480e565b60008151808452614845816020860160208601614f5a565b601f01601f19169290920160200192915050565b6004811061487757634e487b7160e01b600052602160045260246000fd5b9052565b60006101408251818552614891828601826147fa565b9150506020830151602085015260408301516148b0604086018261493e565b5060608301516148c3606086018261493e565b5060808301516148d66080860182614859565b5060a08301516148ea60a086018215159052565b5060c083015184820360c08601526149028282614786565b91505060e083015184820360e086015261491c82826147ca565b6101008581015190870152610120948501519490950193909352509192915050565b6001600160801b03169052565b815160009082906020808601845b8381101561497557815185529382019390820190600101614959565b50929695505050505050565b7f68747470733a2f2f6170692e656e636f64652e6e6574776f726b2f6d657461648152706174612f636f6c6c65637469626c65732f60781b6020820152600082516149d3816031850160208701614f5a565b9190910160310192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a060408201819052600090614a20908301866147ca565b8281036060840152614a3281866147ca565b90508281036080840152614a46818561482d565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614a8c9083018461482d565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015614ad1578351151583529284019291840191600101614ab3565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614b3257603f19888603018452614b2085835161487b565b94509285019290850190600101614b04565b5092979650505050505050565b60208152600061406860208301846147ca565b604081526000614b6560408301856147ca565b8281036020840152614b7781856147ca565b95945050505050565b602081526000614068602083018461482d565b604081526000614ba6604083018561482d565b905082151560208301529392505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b602080825260149082015273546f6b656e20616c72656164792065786973747360601b604082015260600190565b60208082526030908201527f4f6e6c79207769746820746865206d6173746572206b6579206e65772069737360408201526f1d595cc818d85b88189948185919195960821b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b602080825260149082015273526166666c65206973206e6f742061637469766560601b604082015260600190565b602080825260329082015260008051602061522b833981519152604082015271207365742074686520746f6b656e2055524960701b606082015260800190565b6020808252601a908201527925b2bc9034b9903737ba1037bbb732b210313c9039b2b73232b960311b604082015260600190565b602081526000614068602083018461487b565b8781526001600160801b0387811660208301528616604082015260e08101614e3b6060830187614859565b931515608082015260a081019290925260c090910152949350505050565b60405161016081016001600160401b0381118282101715614e7c57614e7c6150b6565b60405290565b60006001600160401b03821115614e9b57614e9b6150b6565b5060051b60200190565b60006001600160801b03828116848216808303821115614ec757614ec761505e565b01949350505050565b60008219821115614ee357614ee361505e565b500190565b600082614ef757614ef7615074565b500490565b6000816000190483118215151615614f1657614f1661505e565b500290565b60006001600160801b0383811690831681811015614f3b57614f3b61505e565b039392505050565b600082821015614f5557614f5561505e565b500390565b60005b83811015614f75578181015183820152602001614f5d565b838111156129de5750506000910152565b600181811c90821680614f9a57607f821691505b60208210811415614fbb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b0381118282101715614fe657614fe66150b6565b6040525050565b600061ffff808316818114156150055761500561505e565b6001019392505050565b60006000198214156150235761502361505e565b5060010190565b600060ff821660ff8114156150415761504161505e565b60010192915050565b60008261505957615059615074565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156150e55760046000803e5060005160e01c5b90565b600060443d10156150f65790565b6040516003193d81016004833e81513d6001600160401b03808311602484018310171561512557505050505090565b828501915081518181111561513d5750505050505090565b843d87010160208285010111156151575750505050505090565b61516660208286010187614fc1565b509095945050505050565b6001600160a01b038116811461158757600080fd5b801515811461158757600080fd5b6001600160e01b03198116811461158757600080fdfeec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6bc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62255cc379a22fa1681afb35dd87e2e9fb1777f2deb5fc4fc9cb63dda76cbbb93e0ad7b41c6f9055080c389b736df7bf36a6509f6449f89d67eb0bc6e7c25940e04f6e6c79207769746820746865206d6173746572206b657920796f752063616ea2646970667358221220498344b7d51882e096a63a3e5794a470b429c8ea4f0bb3f916262a52d5c6433764736f6c63430008070033000000000000000000000000cba5ac55d5e1c56cf16482456ad0a47f27d38a62

Deployed Bytecode

0x6080604052600436106101675760003560e01c8062fdd58e1461016c57806301ffc9a71461019f57806304e15de5146101cf57806306fdde03146102515780630e89341c146102a55780631117a8e9146102c55780631dfaac27146102f257806323add0a7146103145780632eb2c2d6146103345780633be14e791461035457806345dcf523146103815780634e1273f4146103a157806351cff8d9146103ce57806353373bfd146103ee57806357f7789e1461041b5780635d7af7ba1461043b57806370ae92d21461045b5780637921feae14610488578063920367df146104ba57806395d89b41146104da578063976b3113146105095780639b8b930514610536578063a22cb46514610549578063a2f3d5e614610569578063a54ab45714610589578063aacdec17146105c4578063b1b66652146105f1578063bf735dc014610611578063c256c6161461063f578063e985e9c51461065f578063f242432a146106a8575b600080fd5b34801561017857600080fd5b5061018c610187366004614208565b6106c8565b6040519081526020015b60405180910390f35b3480156101ab57600080fd5b506101bf6101ba3660046144bc565b61075e565b6040519015158152602001610196565b3480156101db57600080fd5b5061023e6101ea366004614646565b60066020819052600091825260409091206001810154600282015460038301549383015460079093015491936001600160801b0380831694600160801b909304169260ff8083169361010090930416919087565b6040516101969796959493929190614e10565b34801561025d57600080fd5b506102986040518060400160405280601b81526020017a454e434f444520477261706869637320436f6c6c65637469626c6560281b81525081565b6040516101969190614b80565b3480156102b157600080fd5b506102986102c0366004614646565b6107b0565b3480156102d157600080fd5b506102e56102e03660046142d8565b61089a565b6040516101969190614a97565b3480156102fe57600080fd5b5061031261030d3660046144f6565b6109f0565b005b34801561032057600080fd5b5061018c61032f36600461476b565b61126b565b34801561034057600080fd5b5061031261034f3660046140c5565b6112b2565b34801561036057600080fd5b5061018c61036f36600461404b565b60096020526000908152604090205481565b34801561038d57600080fd5b5061031261039c3660046146e8565b6112fe565b3480156103ad57600080fd5b506103c16103bc366004614234565b611437565b6040516101969190614b3f565b3480156103da57600080fd5b506103126103e936600461404b565b611560565b3480156103fa57600080fd5b5060035461040e906001600160a01b031681565b60405161019691906149e0565b34801561042757600080fd5b506103126104363660046146aa565b61171c565b34801561044757600080fd5b5061031261045636600461470a565b61183e565b34801561046757600080fd5b5061018c61047636600461404b565b60086020526000908152604090205481565b34801561049457600080fd5b506104a86104a3366004614646565b61197f565b60405160ff9091168152602001610196565b3480156104c657600080fd5b506103126104d53660046143dc565b6119bb565b3480156104e657600080fd5b5061029860405180604001604052806003815260200162454e4360e81b81525081565b34801561051557600080fd5b50610529610524366004614646565b611df0565b6040516101969190614dfd565b61031261054436600461473f565b611fc6565b34801561055557600080fd5b506103126105643660046141da565b612429565b34801561057557600080fd5b50610312610584366004614343565b612438565b34801561059557600080fd5b506101bf6105a43660046146e8565b600760209081526000928352604080842090915290825290205460ff1681565b3480156105d057600080fd5b506105e46105df366004614297565b6126f1565b6040516101969190614add565b3480156105fd57600080fd5b5061031261060c36600461465f565b6127a5565b34801561061d57600080fd5b5061063161062c366004614646565b6129e4565b604051610196929190614b93565b34801561064b57600080fd5b5061031261065a36600461404b565b612a8b565b34801561066b57600080fd5b506101bf61067a36600461408c565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205460ff1690565b3480156106b457600080fd5b506103126106c3366004614172565b612b80565b60006001600160a01b0383166107385760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a2061646472657373207a65726f206973206e6f742061207660448201526930b634b21037bbb732b960b11b60648201526084015b60405180910390fd5b506000908152602081815260408083206001600160a01b03949094168352929052205490565b60006001600160e01b03198216636cdb3d1360e11b148061078f57506001600160e01b031982166303a24d0760e21b145b806107aa57506301ffc9a760e01b6001600160e01b03198316145b92915050565b60008181526005602052604090206001015460609060ff161561086b57600082815260056020526040902080546107e690614f86565b80601f016020809104026020016040519081016040528092919081815260200182805461081290614f86565b801561085f5780601f106108345761010080835404028352916020019161085f565b820191906000526020600020905b81548152906001019060200180831161084257829003601f168201915b50505050509050919050565b61087482612bc5565b6040516020016108849190614981565b6040516020818303038152906040529050919050565b60608382146108ff5760405162461bcd60e51b815260206004820152602b60248201527f6b657949647320616e6420746f6b656e496473206d757374206265207468652060448201526a0e6c2daca40d8cadccee8d60ab1b606482015260840161072f565b6000846001600160401b03811115610919576109196150b6565b604051908082528060200260200182016040528015610942578160200160208202803683370190505b50905060005b838110156109e65760076000868684818110610966576109666150a0565b905060200201358152602001908152602001600020600088888481811061098f5761098f6150a0565b90506020020135815260200190815260200160002060009054906101000a900460ff168282815181106109c4576109c46150a0565b91151560209283029190910190910152806109de8161500f565b915050610948565b5095945050505050565b600081608001516003811115610a0857610a0861508a565b1415610a455760405162461bcd60e51b815260206004820152600c60248201526b496e76616c6964207479706560a01b604482015260640161072f565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f90610a759033906004016149e0565b60206040518083038186803b158015610a8d57600080fd5b505afa158015610aa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac5919061449f565b610ae15760405162461bcd60e51b815260040161072f90614c7c565b8051600090815260066020526040812060039081015460ff1690811115610b0a57610b0a61508a565b148015610b5f575060006006600060648460000151610b299190614ee8565b610b34906064614efc565b8152602081019190915260400160002060039081015460ff1690811115610b5d57610b5d61508a565b145b610b7b5760405162461bcd60e51b815260040161072f90614c4e565b6005816020015151108015610b9557506000816020015151115b610bf05760405162461bcd60e51b815260206004820152602660248201527f5065726d697373696f6e73206d757374206861766520757020746f203420656c604482015265656d656e747360d01b606482015260840161072f565b8060e00151518160c001515114610c6f5760405162461bcd60e51b815260206004820152603e60248201527f7468697264506172747941646472657373657320616e6420746869726450617260448201527f747946656573206d757374206265207468652073616d65206c656e6774680000606482015260840161072f565b600281608001516003811115610c8757610c8761508a565b1415610cf7578051610c9b9060649061504a565b15610cf25760405162461bcd60e51b815260206004820152602160248201527f546f6b656e4964206d7573742062652061206d756c7469706c65206f662031306044820152600360fc1b606482015260840161072f565b610e0e565b600181608001516003811115610d0f57610d0f61508a565b1480610d305750600381608001516003811115610d2e57610d2e61508a565b145b15610e0e576101008101515115610da65760405162461bcd60e51b815260206004820152603460248201527f436f6c6c65637469626c65732063616e6e6f742068617665206d756c7469706c604482015273657320706879736963616c2064656c697665727960601b606482015260840161072f565b8051610db49060649061504a565b610e0e5760405162461bcd60e51b815260206004820152602560248201527f546f6b656e4964206d757374206e6f742062652061206d756c7469706c65206f604482015264066203130360dc1b606482015260840161072f565b600381608001516003811115610e2657610e2661508a565b14610e8b57610120810151158015610e415750610140810151155b610e865760405162461bcd60e51b81526020600482015260166024820152750526166666c65206461746573206d75737420626520360541b604482015260640161072f565b610eef565b80610120015181610140015111610eef5760405162461bcd60e51b815260206004820152602260248201527f526166666c65206461746573206d75737420626520696e207468652066757475604482015261726560f01b606482015260840161072f565b60005b81610100015151811015610feb5760008261010001518281518110610f1957610f196150a0565b602002602001015190508260000151606482610f359190614ee8565b610f40906064614efc565b148015610f5757506032610f5560648361504a565b105b610fbb5760405162461bcd60e51b815260206004820152602f60248201527f496e636f727265637420746f6b656e4964206f6e207061636b64726f7020706860448201526e79736963616c2064656c697665727960881b606482015260840161072f565b6000908152600660205260409020600301805461ff00191661010017905580610fe38161500f565b915050610ef2565b5060005b8160e00151518110156110d65760008260e001518281518110611014576110146150a0565b602002602001015111801561104857506127108260e00151828151811061103d5761103d6150a0565b602002602001015111155b6110c45760405162461bcd60e51b815260206004820152604160248201527f546869726420706172747920666565206d75737420626520677265617465722060448201527f7468616e203020616e64206c657373206f7220657175616c207468616e2031306064820152606b60f81b608482015260a40161072f565b806110ce8161500f565b915050610fef565b50604051806101400160405280826020015181526020018260400151815260200182606001516001600160801b0316815260200160006001600160801b03168152602001826080015160038111156111305761113061508a565b81526020018260a00151151581526020018260c0015181526020018260e00151815260200182610120015181526020018261014001518152506006600083600001518152602001908152602001600020600082015181600001908051906020019061119c929190613ba3565b506020820151600180830191909155604083015160608401516001600160801b03908116600160801b0291161760028301556080830151600380840180549293909260ff19169184908111156111f4576111f461508a565b021790555060a08201516003820180549115156101000261ff001990921691909117905560c08201518051611233916004840191602090910190613c49565b5060e0820151805161124f916005840191602090910190613c9e565b5061010082015160068201556101209091015160079091015550565b600060ff821661127d57506050919050565b8160ff166001141561129157506055919050565b8160ff16600214156112a55750605a919050565b506000919050565b919050565b6001600160a01b0385163314806112ce57506112ce853361067a565b6112ea5760405162461bcd60e51b815260040161072f90614bb7565b6112f78585858585612cca565b5050505050565b60008281526006602052604090206003810154610100900460ff1661137d5760405162461bcd60e51b815260206004820152602f60248201527f506879736963616c2064656c6976657279206973206e6f7420656e61626c656460448201526e103337b9103a3434b9903a37b5b2b760891b606482015260840161072f565b8161138833856106c8565b10156113ca5760405162461bcd60e51b81526020600482015260116024820152704e6f7420656e6f75676820746f6b656e7360781b604482015260640161072f565b6113d5338484612ea7565b6113fa336113e4856032614ed0565b8460405180602001604052806000815250613016565b604051828152839033907fd954cebefa450cd60f299e545dfe53bd13d85483508f06824982bba0828ab8dd906020015b60405180910390a3505050565b6060815183511461149c5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b606482015260840161072f565b600083516001600160401b038111156114b7576114b76150b6565b6040519080825280602002602001820160405280156114e0578160200160208202803683370190505b50905060005b84518110156115585761152b858281518110611504576115046150a0565b602002602001015185838151811061151e5761151e6150a0565b60200260200101516106c8565b82828151811061153d5761153d6150a0565b60209081029190910101526115518161500f565b90506114e6565b509392505050565b6001600160a01b0381166000908152600960205260409020541561158a576115878161310f565b50565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f906115ba9033906004016149e0565b60206040518083038186803b1580156115d257600080fd5b505afa1580156115e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061160a919061449f565b6116565760405162461bcd60e51b8152602060048201526029602482015260008051602061522b83398151915260448201526820776974686472617760b81b606482015260840161072f565b600080805260096020526000805160206151ab8339815191525461167a9047614f43565b90506000826001600160a01b0316826040515b60006040518083038185875af1925050503d80600081146116ca576040519150601f19603f3d011682016040523d82523d6000602084013e6116cf565b606091505b50509050806117175760405162461bcd60e51b81526020600482015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b604482015260640161072f565b505050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f9061174c9033906004016149e0565b60206040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179c919061449f565b6117b85760405162461bcd60e51b815260040161072f90614d89565b6040805160606020601f8501819004028201810183529181018381529091829190859085908190850183828082843760009201829052509385525050600160209384015250858152600582526040902082518051919261181d92849290910190613cd9565b50602091909101516001909101805460ff1916911515919091179055505050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f9061186e9033906004016149e0565b60206040518083038186803b15801561188657600080fd5b505afa15801561189a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118be919061449f565b6118da5760405162461bcd60e51b815260040161072f90614d89565b600083815260066020526040812060039081015460ff16908111156119015761190161508a565b14156119465760405162461bcd60e51b8152602060048201526014602482015273125cdcdd5948191bd95cc81b9bdd08195e1a5cdd60621b604482015260640161072f565b600092835260066020526040909220600181019190915560020180546001600160801b0319166001600160801b03909216919091179055565b60006032821161199157506000919050565b6101c282116119a257506001919050565b6105aa82116119b357506002919050565b506003919050565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f906119eb9033906004016149e0565b60206040518083038186803b158015611a0357600080fd5b505afa158015611a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a3b919061449f565b611a575760405162461bcd60e51b815260040161072f90614c7c565b8685148015611a6557508683145b8015611a7057508681145b611aed5760405162461bcd60e51b815260206004820152604260248201527f746f6b656e4964732c207065726d697373696f6e732c20636f73747320616e6460448201527f206d6178537570706c79206d757374206265207468652073616d65206c656e676064820152610e8d60f31b608482015260a40161072f565b60005b87811015611de5576000600660008b8b85818110611b1057611b106150a0565b90506020020135815260200190815260200160002060030160009054906101000a900460ff166003811115611b4757611b4761508a565b14611b645760405162461bcd60e51b815260040161072f90614c4e565b60408051600180825281830190925260009160208083019080368337019050509050878783818110611b9857611b986150a0565b9050602002016020810190611bad919061476b565b81600081518110611bc057611bc06150a0565b602002602001019060ff16908160ff1681525050604051806101400160405280828152602001878785818110611bf857611bf86150a0565b905060200201358152602001858585818110611c1657611c166150a0565b9050602002016020810190611c2b919061462b565b6001600160801b031681526000602082015260400160018152600060208201819052604090910190604051908082528060200260200182016040528015611c7c578160200160208202803683370190505b5081526020016000604051908082528060200260200182016040528015611cad578160200160208202803683370190505b508152602001600081526020016000815250600660008c8c86818110611cd557611cd56150a0565b9050602002013581526020019081526020016000206000820151816000019080519060200190611d06929190613ba3565b506020820151600180830191909155604083015160608401516001600160801b03908116600160801b0291161760028301556080830151600380840180549293909260ff1916918490811115611d5e57611d5e61508a565b021790555060a08201516003820180549115156101000261ff001990921691909117905560c08201518051611d9d916004840191602090910190613c49565b5060e08201518051611db9916005840191602090910190613c9e565b506101008201516006820155610120909101516007909101555080611ddd8161500f565b915050611af0565b505050505050505050565b611df8613d4c565b600082815260066020908152604091829020825181546101609381028201840190945261014081018481529093919284928491840182828015611e7857602002820191906000526020600020906000905b825461010083900a900460ff16815260206001928301818104948501949093039092029101808411611e495790505b50505091835250506001820154602082015260028201546001600160801b038082166040840152600160801b90910416606082015260038083015460809092019160ff1690811115611ecc57611ecc61508a565b6003811115611edd57611edd61508a565b81526003820154610100900460ff1615156020808301919091526004830180546040805182850281018501825282815294019392830182828015611f4a57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611f2c575b5050505050815260200160058201805480602002602001604051908101604052809291908181526020018280548015611fa257602002820191906000526020600020905b815481526020019060010190808311611f8e575b50505050508152602001600682015481526020016007820154815250509050919050565b600082116120165760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015260640161072f565b60008381526006602052604090206002810154612045906001600160801b03600160801b820481169116614f1b565b6001600160801b03168311156120945760405162461bcd60e51b81526020600482015260146024820152734e6f7420656e6f7567682072656d61696e696e6760601b604482015260640161072f565b60038181015460ff16818111156120ad576120ad61508a565b14156120e657428160060154111580156120ca5750428160070154115b6120e65760405162461bcd60e51b815260040161072f90614d5b565b600181015482156121bd576003546040516331a9108f60e11b81526004810185905233916001600160a01b031690636352211e9060240160206040518083038186803b15801561213557600080fd5b505afa158015612149573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216d919061406f565b6001600160a01b0316146121935760405162461bcd60e51b815260040161072f90614dc9565b60006121a161032f8561197f565b905060646121af8284614efc565b6121b99190614ee8565b9150505b6121c78482614efc565b3410156122075760405162461bcd60e51b815260206004820152600e60248201526d09cdee840cadcdeeaced0408aa8960931b604482015260640161072f565b838260020160108282829054906101000a90046001600160801b031661222d9190614ea5565b92506101000a8154816001600160801b0302191690836001600160801b03160217905550600082600501805490501115612352576000805b60058401548110156123215760006127108486600501848154811061228c5761228c6150a0565b90600052602060002001546122a19190614efc565b6122ab9190614ee8565b90506122b78184614ed0565b925080600960008760040185815481106122d3576122d36150a0565b60009182526020808320909101546001600160a01b0316835282019290925260400181208054909190612307908490614ed0565b9091555082915061231990508161500f565b915050612265565b50600080805260096020526000805160206151ab833981519152805483929061234b908490614ed0565b9091555050505b600260038084015460ff169081111561236d5761236d61508a565b141561239d576040518481528590339060008051602061520b8339815191529060200160405180910390a36112f7565b600160038084015460ff16908111156123b8576123b861508a565b14156123de576123d933868660405180602001604052806000815250613016565b6112f7565b60038281015460ff16818111156123f7576123f761508a565b14156112f757604051848152859033906000805160206151eb8339815191529060200160405180910390a35050505050565b61243433838361316c565b5050565b841580159061244657508483145b6124a95760405162461bcd60e51b815260206004820152602e60248201527f546f6b656e49647320616e6420616d6f756e7473206d7573742068617665207460448201526d0d0ca40e6c2daca40d8cadccee8d60931b606482015260840161072f565b60006124e787878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061324592505050565b9050600061252786868080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061324592505050565b3360008181526008602090815260408083205490519495509193612595939291879187910175656e636f6465207061636b64726f702072656465656d60501b815260609490941b6001600160601b0319166016850152602a840192909252604a830152606a820152608a0190565b60405160208183030381529060405280519060200120905060006125b882613275565b905060006125fc8288888080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506132af92505050565b6001600160a01b03811660009081526004602052604090205490915060ff1661265b5760405162461bcd60e51b8152602060048201526011602482015270496e76616c6964207369676e617475726560781b604482015260640161072f565b3360009081526008602052604081208054916126768361500f565b919050555060005b8a8110156126e3576126d1338d8d8481811061269c5761269c6150a0565b905060200201358c8c858181106126b5576126b56150a0565b9050602002013560405180602001604052806000815250613016565b806126db8161500f565b91505061267e565b505050505050505050505050565b60606000826001600160401b0381111561270d5761270d6150b6565b60405190808252806020026020018201604052801561274657816020015b612733613d4c565b81526020019060019003908161272b5790505b50905060005b8381101561155857612775858583818110612769576127696150a0565b90506020020135611df0565b828281518110612787576127876150a0565b6020026020010181905250808061279d9061500f565b91505061274c565b806127e55760405162461bcd60e51b815260206004820152601060248201526f4e6f206b65797320746f20636c61696d60801b604482015260640161072f565b600083815260066020526040902060039081015460ff168181111561280c5761280c61508a565b141561286057600083815260066020819052604090912001544210801590612844575060008381526006602052604090206007015442105b6128605760405162461bcd60e51b815260040161072f90614d5b565b60005b61ffff81168211156128fb576128958484848461ffff16818110612889576128896150a0565b905060200201356132cb565b6000848152600760205260408120600191858561ffff86168181106128bc576128bc6150a0565b90506020020135815260200190815260200160002060006101000a81548160ff02191690831515021790555080806128f390614fed565b915050612863565b506000838152600660205260409020600260038083015460ff16908111156129255761292561508a565b1415612955576040518281528490339060008051602061520b8339815191529060200160405180910390a36129de565b600160038083015460ff16908111156129705761297061508a565b14156129995761299433858585905060405180602001604052806000815250613016565b6129de565b60038181015460ff16818111156129b2576129b261508a565b14156129de57604051828152849033906000805160206151eb8339815191529060200160405180910390a35b50505050565b6005602052600090815260409020805481906129ff90614f86565b80601f0160208091040260200160405190810160405280929190818152602001828054612a2b90614f86565b8015612a785780601f10612a4d57610100808354040283529160200191612a78565b820191906000526020600020905b815481529060010190602001808311612a5b57829003601f168201915b5050506001909301549192505060ff1682565b6003546040516308ac110f60e01b81526001600160a01b03909116906308ac110f90612abb9033906004016149e0565b60206040518083038186803b158015612ad357600080fd5b505afa158015612ae7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b0b919061449f565b612b575760405162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207573657273207769746820746865206d6173746572206b65790000604482015260640161072f565b6001600160a01b03166000908152600460205260409020805460ff19811660ff90911615179055565b6001600160a01b038516331480612b9c5750612b9c853361067a565b612bb85760405162461bcd60e51b815260040161072f90614bb7565b6112f785858585856134b7565b606081612be95750506040805180820190915260018152600360fc1b602082015290565b8160005b8115612c135780612bfd8161500f565b9150612c0c9050600a83614ee8565b9150612bed565b6000816001600160401b03811115612c2d57612c2d6150b6565b6040519080825280601f01601f191660200182016040528015612c57576020820181803683370190505b5090505b8415612cc257612c6c600183614f43565b9150612c79600a8661504a565b612c84906030614ed0565b60f81b818381518110612c9957612c996150a0565b60200101906001600160f81b031916908160001a905350612cbb600a86614ee8565b9450612c5b565b949350505050565b8151835114612d2c5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b606482015260840161072f565b6001600160a01b038416612d525760405162461bcd60e51b815260040161072f90614ccc565b3360005b8451811015612e39576000858281518110612d7357612d736150a0565b602002602001015190506000858381518110612d9157612d916150a0565b602090810291909101810151600084815280835260408082206001600160a01b038e168352909352919091205490915081811015612de15760405162461bcd60e51b815260040161072f90614d11565b6000838152602081815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290612e1e908490614ed0565b9250508190555050505080612e329061500f565b9050612d56565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051612e89929190614b52565b60405180910390a4612e9f8187878787876135c4565b505050505050565b6001600160a01b038316612f095760405162461bcd60e51b815260206004820152602360248201527f455243313135353a206275726e2066726f6d20746865207a65726f206164647260448201526265737360e81b606482015260840161072f565b336000612f1584613736565b90506000612f2284613736565b60408051602080820183526000918290528882528181528282206001600160a01b038b1683529052205490915084811015612fab5760405162461bcd60e51b8152602060048201526024808201527f455243313135353a206275726e20616d6f756e7420657863656564732062616c604482015263616e636560e01b606482015260840161072f565b6000868152602081815260408083206001600160a01b038b81168086529184528285208a8703905582518b81529384018a90529092908816916000805160206151cb833981519152910160405180910390a46040805160208101909152600090525b50505050505050565b6001600160a01b0384166130765760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f206164647265736044820152607360f81b606482015260840161072f565b33600061308285613736565b9050600061308f85613736565b90506000868152602081815260408083206001600160a01b038b168452909152812080548792906130c1908490614ed0565b909155505060408051878152602081018790526001600160a01b03808a1692600092918716916000805160206151cb833981519152910160405180910390a461300d83600089898989613781565b6001600160a01b03811660009081526009602052604081208054908290558180526000805160206151ab833981519152805491928392613150908490614f43565b925050819055506000826001600160a01b03168260405161168d565b816001600160a01b0316836001600160a01b031614156131e05760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c20737461747573604482015268103337b91039b2b63360b91b606482015260840161072f565b6001600160a01b03838116600081815260016020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910161142a565b600081604051602001613258919061494b565b604051602081830303815290604052805190602001209050919050565b6040517b0ca2ba3432b932bab69029b4b3b732b21026b2b9b9b0b3b29d05199960211b6020820152603c8101829052600090605c01613258565b60008060006132be8585613852565b91509150611558816138c2565b600082815260076020908152604080832084845290915290205460ff161561332d5760405162461bcd60e51b8152602060048201526015602482015274151bdad95b88185b1c9958591e4818db185a5b5959605a1b604482015260640161072f565b60006133388261197f565b6003546040516331a9108f60e11b81526004810185905291925033916001600160a01b0390911690636352211e9060240160206040518083038186803b15801561338157600080fd5b505afa158015613395573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133b9919061406f565b6001600160a01b0316146133df5760405162461bcd60e51b815260040161072f90614dc9565b60005b60008481526006602052604090205460ff82161015613462576000848152600660205260409020805460ff8085169291908416908110613424576134246150a0565b60009182526020918290209181049091015460ff601f9092166101000a90041614156134505750505050565b8061345a8161502a565b9150506133e2565b5060405162461bcd60e51b8152602060048201526024808201527f4b6579206973206e6f7420616c6c6f77656420746f207573652074686973207460448201526337b5b2b760e11b606482015260840161072f565b6001600160a01b0384166134dd5760405162461bcd60e51b815260040161072f90614ccc565b3360006134e985613736565b905060006134f685613736565b90506000868152602081815260408083206001600160a01b038c168452909152902054858110156135395760405162461bcd60e51b815260040161072f90614d11565b6000878152602081815260408083206001600160a01b038d8116855292528083208985039055908a16825281208054889290613576908490614ed0565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816916000805160206151cb833981519152910160405180910390a4611de5848a8a8a8a8a613781565b6135d6846001600160a01b0316613a78565b15612e9f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061360f90899089908890889088906004016149f4565b602060405180830381600087803b15801561362957600080fd5b505af1925050508015613659575060408051601f3d908101601f19168201909252613656918101906144d9565b60015b613706576136656150cc565b806308c379a0141561369f575061367a6150e8565b8061368557506136a1565b8060405162461bcd60e51b815260040161072f9190614b80565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e20455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b606482015260840161072f565b6001600160e01b0319811663bc197c8160e01b1461300d5760405162461bcd60e51b815260040161072f90614c06565b60408051600180825281830190925260609160009190602080830190803683370190505090508281600081518110613770576137706150a0565b602090810291909101015292915050565b613793846001600160a01b0316613a78565b15612e9f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906137cc9089908990889088908890600401614a52565b602060405180830381600087803b1580156137e657600080fd5b505af1925050508015613816575060408051601f3d908101601f19168201909252613813918101906144d9565b60015b613822576136656150cc565b6001600160e01b0319811663f23a6e6160e01b1461300d5760405162461bcd60e51b815260040161072f90614c06565b6000808251604114156138895760208301516040840151606085015160001a61387d87828585613a87565b945094505050506138bb565b8251604014156138b357602083015160408401516138a8868383613b6a565b9350935050506138bb565b506000905060025b9250929050565b60008160048111156138d6576138d661508a565b14156138df5750565b60018160048111156138f3576138f361508a565b141561393c5760405162461bcd60e51b815260206004820152601860248201527745434453413a20696e76616c6964207369676e617475726560401b604482015260640161072f565b60028160048111156139505761395061508a565b141561399e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161072f565b60038160048111156139b2576139b261508a565b1415613a0b5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161072f565b6004816004811115613a1f57613a1f61508a565b14156115875760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161072f565b6001600160a01b03163b151590565b6000806fa2a8918ca85bafe22016d0b997e4df60600160ff1b03831115613ab45750600090506003613b61565b8460ff16601b14158015613acc57508460ff16601c14155b15613add5750600090506004613b61565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613b31573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613b5a57600060019250925050613b61565b9150600090505b94509492505050565b6000806001600160ff1b03831681613b8760ff86901c601b614ed0565b9050613b9587828885613a87565b935093505050935093915050565b82805482825590600052602060002090601f01602090048101928215613c395791602002820160005b83821115613c0a57835183826101000a81548160ff021916908360ff1602179055509260200192600101602081600001049283019260010302613bcc565b8015613c375782816101000a81549060ff0219169055600101602081600001049283019260010302613c0a565b505b50613c45929150613da1565b5090565b828054828255906000526020600020908101928215613c39579160200282015b82811115613c3957825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190613c69565b828054828255906000526020600020908101928215613c39579160200282015b82811115613c39578251825591602001919060010190613cbe565b828054613ce590614f86565b90600052602060002090601f016020900481019282613d075760008555613c39565b82601f10613d2057805160ff1916838001178555613c39565b82800160010185558215613c395791820182811115613c39578251825591602001919060010190613cbe565b6040805161014081018252606080825260006020830181905292820183905281018290529060808201908152602001600015158152602001606081526020016060815260200160008152602001600081525090565b5b80821115613c455760008155600101613da2565b600082601f830112613dc757600080fd5b81356020613dd482614e82565b604051613de18282614fc1565b8381528281019150858301600585901b87018401881015613e0157600080fd5b60005b85811015613e29578135613e1781615171565b84529284019290840190600101613e04565b5090979650505050505050565b60008083601f840112613e4857600080fd5b5081356001600160401b03811115613e5f57600080fd5b6020830191508360208260051b85010111156138bb57600080fd5b600082601f830112613e8b57600080fd5b81356020613e9882614e82565b604051613ea58282614fc1565b8381528281019150858301600585901b87018401881015613ec557600080fd5b60005b85811015613e2957813584529284019290840190600101613ec8565b600082601f830112613ef557600080fd5b81356020613f0282614e82565b604051613f0f8282614fc1565b8381528281019150858301600585901b87018401881015613f2f57600080fd5b60005b85811015613e2957613f438261403a565b84529284019290840190600101613f32565b80356112ad81615186565b60008083601f840112613f7257600080fd5b5081356001600160401b03811115613f8957600080fd5b6020830191508360208285010111156138bb57600080fd5b600082601f830112613fb257600080fd5b81356001600160401b03811115613fcb57613fcb6150b6565b604051613fe2601f8301601f191660200182614fc1565b818152846020838601011115613ff757600080fd5b816020850160208301376000918101602001919091529392505050565b8035600481106112ad57600080fd5b80356001600160801b03811681146112ad57600080fd5b803560ff811681146112ad57600080fd5b60006020828403121561405d57600080fd5b813561406881615171565b9392505050565b60006020828403121561408157600080fd5b815161406881615171565b6000806040838503121561409f57600080fd5b82356140aa81615171565b915060208301356140ba81615171565b809150509250929050565b600080600080600060a086880312156140dd57600080fd5b85356140e881615171565b945060208601356140f881615171565b935060408601356001600160401b038082111561411457600080fd5b61412089838a01613e7a565b9450606088013591508082111561413657600080fd5b61414289838a01613e7a565b9350608088013591508082111561415857600080fd5b5061416588828901613fa1565b9150509295509295909350565b600080600080600060a0868803121561418a57600080fd5b853561419581615171565b945060208601356141a581615171565b9350604086013592506060860135915060808601356001600160401b038111156141ce57600080fd5b61416588828901613fa1565b600080604083850312156141ed57600080fd5b82356141f881615171565b915060208301356140ba81615186565b6000806040838503121561421b57600080fd5b823561422681615171565b946020939093013593505050565b6000806040838503121561424757600080fd5b82356001600160401b038082111561425e57600080fd5b61426a86838701613db6565b9350602085013591508082111561428057600080fd5b5061428d85828601613e7a565b9150509250929050565b600080602083850312156142aa57600080fd5b82356001600160401b038111156142c057600080fd5b6142cc85828601613e36565b90969095509350505050565b600080600080604085870312156142ee57600080fd5b84356001600160401b038082111561430557600080fd5b61431188838901613e36565b9096509450602087013591508082111561432a57600080fd5b5061433787828801613e36565b95989497509550505050565b6000806000806000806060878903121561435c57600080fd5b86356001600160401b038082111561437357600080fd5b61437f8a838b01613e36565b9098509650602089013591508082111561439857600080fd5b6143a48a838b01613e36565b909650945060408901359150808211156143bd57600080fd5b506143ca89828a01613f60565b979a9699509497509295939492505050565b6000806000806000806000806080898b0312156143f857600080fd5b88356001600160401b038082111561440f57600080fd5b61441b8c838d01613e36565b909a50985060208b013591508082111561443457600080fd5b6144408c838d01613e36565b909850965060408b013591508082111561445957600080fd5b6144658c838d01613e36565b909650945060608b013591508082111561447e57600080fd5b5061448b8b828c01613e36565b999c989b5096995094979396929594505050565b6000602082840312156144b157600080fd5b815161406881615186565b6000602082840312156144ce57600080fd5b813561406881615194565b6000602082840312156144eb57600080fd5b815161406881615194565b60006020828403121561450857600080fd5b81356001600160401b038082111561451f57600080fd5b90830190610160828603121561453457600080fd5b61453c614e59565b8235815260208301358281111561455257600080fd5b61455e87828601613ee4565b602083015250604083013560408201526060830135606082015261458460808401614014565b608082015261459560a08401613f55565b60a082015260c0830135828111156145ac57600080fd5b6145b887828601613db6565b60c08301525060e0830135828111156145d057600080fd5b6145dc87828601613e7a565b60e08301525061010080840135838111156145f657600080fd5b61460288828701613e7a565b918301919091525061012083810135908201526101409283013592810192909252509392505050565b60006020828403121561463d57600080fd5b61406882614023565b60006020828403121561465857600080fd5b5035919050565b60008060006040848603121561467457600080fd5b8335925060208401356001600160401b0381111561469157600080fd5b61469d86828701613e36565b9497909650939450505050565b6000806000604084860312156146bf57600080fd5b8335925060208401356001600160401b038111156146dc57600080fd5b61469d86828701613f60565b600080604083850312156146fb57600080fd5b50508035926020909101359150565b60008060006060848603121561471f57600080fd5b833592506020840135915061473660408501614023565b90509250925092565b60008060006060848603121561475457600080fd5b505081359360208301359350604090920135919050565b60006020828403121561477d57600080fd5b6140688261403a565b600081518084526020808501945080840160005b838110156147bf5781516001600160a01b03168752958201959082019060010161479a565b509495945050505050565b600081518084526020808501945080840160005b838110156147bf578151875295820195908201906001016147de565b600081518084526020808501945080840160005b838110156147bf57815160ff168752958201959082019060010161480e565b60008151808452614845816020860160208601614f5a565b601f01601f19169290920160200192915050565b6004811061487757634e487b7160e01b600052602160045260246000fd5b9052565b60006101408251818552614891828601826147fa565b9150506020830151602085015260408301516148b0604086018261493e565b5060608301516148c3606086018261493e565b5060808301516148d66080860182614859565b5060a08301516148ea60a086018215159052565b5060c083015184820360c08601526149028282614786565b91505060e083015184820360e086015261491c82826147ca565b6101008581015190870152610120948501519490950193909352509192915050565b6001600160801b03169052565b815160009082906020808601845b8381101561497557815185529382019390820190600101614959565b50929695505050505050565b7f68747470733a2f2f6170692e656e636f64652e6e6574776f726b2f6d657461648152706174612f636f6c6c65637469626c65732f60781b6020820152600082516149d3816031850160208701614f5a565b9190910160310192915050565b6001600160a01b0391909116815260200190565b6001600160a01b0386811682528516602082015260a060408201819052600090614a20908301866147ca565b8281036060840152614a3281866147ca565b90508281036080840152614a46818561482d565b98975050505050505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a060808201819052600090614a8c9083018461482d565b979650505050505050565b6020808252825182820181905260009190848201906040850190845b81811015614ad1578351151583529284019291840191600101614ab3565b50909695505050505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015614b3257603f19888603018452614b2085835161487b565b94509285019290850190600101614b04565b5092979650505050505050565b60208152600061406860208301846147ca565b604081526000614b6560408301856147ca565b8281036020840152614b7781856147ca565b95945050505050565b602081526000614068602083018461482d565b604081526000614ba6604083018561482d565b905082151560208301529392505050565b6020808252602f908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526e195c881b9bdc88185c1c1c9bdd9959608a1b606082015260800190565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b602080825260149082015273546f6b656e20616c72656164792065786973747360601b604082015260600190565b60208082526030908201527f4f6e6c79207769746820746865206d6173746572206b6579206e65772069737360408201526f1d595cc818d85b88189948185919195960821b606082015260800190565b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b602080825260149082015273526166666c65206973206e6f742061637469766560601b604082015260600190565b602080825260329082015260008051602061522b833981519152604082015271207365742074686520746f6b656e2055524960701b606082015260800190565b6020808252601a908201527925b2bc9034b9903737ba1037bbb732b210313c9039b2b73232b960311b604082015260600190565b602081526000614068602083018461487b565b8781526001600160801b0387811660208301528616604082015260e08101614e3b6060830187614859565b931515608082015260a081019290925260c090910152949350505050565b60405161016081016001600160401b0381118282101715614e7c57614e7c6150b6565b60405290565b60006001600160401b03821115614e9b57614e9b6150b6565b5060051b60200190565b60006001600160801b03828116848216808303821115614ec757614ec761505e565b01949350505050565b60008219821115614ee357614ee361505e565b500190565b600082614ef757614ef7615074565b500490565b6000816000190483118215151615614f1657614f1661505e565b500290565b60006001600160801b0383811690831681811015614f3b57614f3b61505e565b039392505050565b600082821015614f5557614f5561505e565b500390565b60005b83811015614f75578181015183820152602001614f5d565b838111156129de5750506000910152565b600181811c90821680614f9a57607f821691505b60208210811415614fbb57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8201601f191681016001600160401b0381118282101715614fe657614fe66150b6565b6040525050565b600061ffff808316818114156150055761500561505e565b6001019392505050565b60006000198214156150235761502361505e565b5060010190565b600060ff821660ff8114156150415761504161505e565b60010192915050565b60008261505957615059615074565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b600060033d11156150e55760046000803e5060005160e01c5b90565b600060443d10156150f65790565b6040516003193d81016004833e81513d6001600160401b03808311602484018310171561512557505050505090565b828501915081518181111561513d5750505050505090565b843d87010160208285010111156151575750505050505090565b61516660208286010187614fc1565b509095945050505050565b6001600160a01b038116811461158757600080fd5b801515811461158757600080fd5b6001600160e01b03198116811461158757600080fdfeec8156718a8372b1db44bb411437d0870f3e3790d4a08526d024ce1b0b668f6bc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62255cc379a22fa1681afb35dd87e2e9fb1777f2deb5fc4fc9cb63dda76cbbb93e0ad7b41c6f9055080c389b736df7bf36a6509f6449f89d67eb0bc6e7c25940e04f6e6c79207769746820746865206d6173746572206b657920796f752063616ea2646970667358221220498344b7d51882e096a63a3e5794a470b429c8ea4f0bb3f916262a52d5c6433764736f6c63430008070033

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

000000000000000000000000cba5ac55d5e1c56cf16482456ad0a47f27d38a62

-----Decoded View---------------
Arg [0] : _key (address): 0xCBA5AC55D5e1c56Cf16482456aD0a47f27D38a62

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000cba5ac55d5e1c56cf16482456ad0a47f27d38a62


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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