ETH Price: $3,829.68 (+4.96%)

Token

.earth Nomads (NOMAD)
 

Overview

Max Total Supply

4,834 NOMAD

Holders

526

Market

Volume (24H)

N/A

Min Price (24H)

N/A

Max Price (24H)

N/A

Other Info

Filtered by Token Holder
seanwbren.eth
0x0cb27e883E207905AD2A94F9B6eF0C7A99223C37
Loading...
Loading
Loading...
Loading
Loading...
Loading

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

Contract Source Code Verified (Exact Match)

Contract Name:
NameWrapper

Compiler Version
v0.8.13+commit.abaa5c0e

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 19 : NameWrapper.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@ensdomains/ens-contracts/contracts/wrapper/ERC1155Fuse.sol";
import "@ensdomains/ens-contracts/contracts/wrapper/Controllable.sol";
import "@ensdomains/ens-contracts/contracts/wrapper/INameWrapper.sol";
import "@ensdomains/ens-contracts/contracts/wrapper/INameWrapperUpgrade.sol";
import "@ensdomains/ens-contracts/contracts/wrapper/IMetadataService.sol";
import "@ensdomains/ens-contracts/contracts/registry/ENS.sol";
import "@ensdomains/ens-contracts/contracts/ethregistrar/IBaseRegistrar.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@ensdomains/ens-contracts/contracts/wrapper/BytesUtil.sol";

error Unauthorised(bytes32 node, address addr);
error NameNotFound();
error IncompatibleParent();
error IncompatibleName(bytes name);
error IncorrectTokenType();
error LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);
error LabelTooShort();
error LabelTooLong(string label);
error IncorrectTargetOwner(address owner);
error CannotUpgrade();
error InvalidExpiry(bytes32 node, uint64 expiry);

contract NameWrapper is
  Ownable,
  ERC1155Fuse,
  INameWrapper,
  Controllable,
  IERC721Receiver
{
  using BytesUtils for bytes;
  ENS public immutable override ens;
  IBaseRegistrar public immutable override registrar;
  IMetadataService public override metadataService;
  mapping(bytes32 => bytes) public override names;
  mapping(address => bool) public authorized;
  string public constant name = ".earth Nomads";
  string public constant symbol = "NOMAD";
  bytes32 private constant ETH_NODE =
    0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;
  bytes32 private constant ROOT_NODE =
    0x0000000000000000000000000000000000000000000000000000000000000000;

  //A contract address to a new upgraded contract if any
  INameWrapperUpgrade public upgradeContract;
  uint64 private constant MAX_EXPIRY = type(uint64).max;

  constructor(
    ENS _ens,
    IBaseRegistrar _registrar,
    IMetadataService _metadataService
  ) {
    ens = _ens;
    registrar = _registrar;
    metadataService = _metadataService;

    /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE and ETH_NODE */

    _setData(
      uint256(ETH_NODE),
      address(0),
      uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),
      MAX_EXPIRY
    );
    _setData(
      uint256(ROOT_NODE),
      address(0),
      uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP),
      MAX_EXPIRY
    );
    names[ROOT_NODE] = "\x00";
    names[ETH_NODE] = "\x03eth\x00";
  }

  function supportsInterface(bytes4 interfaceId)
    public
    view
    virtual
    override(ERC1155Fuse, IERC165)
    returns (bool)
  {
    return
      interfaceId == type(INameWrapper).interfaceId ||
      super.supportsInterface(interfaceId);
  }

  /* ERC1155 */

  function ownerOf(uint256 id)
    public
    view
    override(ERC1155Fuse, INameWrapper)
    returns (address owner)
  {
    return super.ownerOf(id);
  }

  /* Metadata service */

  /**
   * @notice Set the metadata service. Only the owner can do this
   */

  function setMetadataService(IMetadataService _newMetadataService)
    public
    onlyOwner
  {
    metadataService = _newMetadataService;
  }

  /**
   * @notice Get the metadata uri
   * @return String uri of the metadata service
   */

  function uri(uint256 tokenId) public view override returns (string memory) {
    return metadataService.uri(tokenId);
  }

  /**
   * @notice Set the address of the upgradeContract of the contract. only admin can do this
   * @dev The default value of upgradeContract is the 0 address. Use the 0 address at any time
   * to make the contract not upgradable.
   * @param _upgradeAddress address of an upgraded contract
   */

  function setUpgradeContract(INameWrapperUpgrade _upgradeAddress)
    public
    onlyOwner
  {
    if (address(upgradeContract) != address(0)) {
      registrar.setApprovalForAll(address(upgradeContract), false);
      ens.setApprovalForAll(address(upgradeContract), false);
    }

    upgradeContract = _upgradeAddress;

    if (address(upgradeContract) != address(0)) {
      registrar.setApprovalForAll(address(upgradeContract), true);
      ens.setApprovalForAll(address(upgradeContract), true);
    }
  }

  /**
   * @notice Checks if msg.sender is the owner or approved by the owner of a name
   * @param node namehash of the name to check
   */

  modifier onlyTokenOwner(bytes32 node) {
    if (!isTokenOwnerOrApproved(node, msg.sender)) {
      revert Unauthorised(node, msg.sender);
    }

    _;
  }

  /**
   * @notice Checks if msg.sender is approved by the owner of the contract
   */

  modifier onlyAuthorized() {
    require(
      authorized[msg.sender] || msg.sender == owner(),
      "only authorized and owner"
    );
    _;
  }

  /**
   * @notice Checks if owner or approved by owner
   * @param node namehash of the name to check
   * @param addr which address to check permissions for
   * @return whether or not is owner or approved
   */

  function isTokenOwnerOrApproved(bytes32 node, address addr)
    public
    view
    override
    returns (bool)
  {
    address owner = ownerOf(uint256(node));
    return owner == addr || isApprovedForAll(owner, addr);
  }

  /**
   * @notice Gets fuse permissions for a specific name
   * @dev Fuses are represented by a uint32 where each permission is represented by 1 bit
   *      The interface has predefined fuses for all registry permissions, but additional
   *      fuses can be added for other use cases
   *      Also returns expiry, which is when the fuses are set to expire.
   * @param node namehash of the name to check
   * @return fuses A number that represents the permissions a name has. Returns 0 when expiry < block.timestamp
   * @return expiry Unix time of when the name expires and fuses are to expire
   */
  function getFuses(bytes32 node)
    public
    view
    override
    returns (uint32 fuses, uint64 expiry)
  {
    (, fuses, expiry) = getData(uint256(node));
    if (fuses == 0 && expiry == 0) {
      bytes memory name = names[node];
      if (name.length == 0) {
        revert NameNotFound();
      }
    }
  }

  /**
   * @notice Wraps a .eth domain, creating a new token and sending the original ERC721 token to this contract
   * @dev Can be called by the owner of the name on the .eth registrar or an authorised caller on the registrar
   * @param label label as a string of the .eth domain to wrap
   * @param wrappedOwner Owner of the name in this contract
   * @param fuses initial fuses to set
   * @param expiry when the fuses will expire
   * @param resolver resolver contract address
   */

  function wrapETH2LD(
    string calldata label,
    address wrappedOwner,
    uint32 fuses,
    uint64 expiry,
    address resolver
  ) public override onlyAuthorized returns (uint64) {
    uint256 tokenId = uint256(keccak256(bytes(label)));
    address registrant = registrar.ownerOf(tokenId);
    if (
      registrant != msg.sender &&
      !isApprovedForAll(registrant, msg.sender) &&
      !registrar.isApprovedForAll(registrant, msg.sender)
    ) {
      revert Unauthorised(_makeNode(ETH_NODE, bytes32(tokenId)), msg.sender);
    }

    // transfer the token from the user to this contract
    registrar.transferFrom(registrant, address(this), tokenId);

    // transfer the ens record back to the new owner (this contract)
    registrar.reclaim(tokenId, address(this));

    return _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);
  }

  /**
   * @dev Registers a new .eth second-level domain and wraps it.
   *      Only callable by authorised controllers.
   * @param label The label to register (Eg, 'foo' for 'foo.eth').
   * @param wrappedOwner The owner of the wrapped name.
   * @param duration The duration, in seconds, to register the name for.
   * @param resolver The resolver address to set on the ENS registry (optional).
   * @param fuses initial fuses to set
   * @param expiry when the fuses will expire
   * @return registrarExpiry The expiry date of the new name on the .eth registrar, in seconds since the Unix epoch.
   */

  function registerAndWrapETH2LD(
    string calldata label,
    address wrappedOwner,
    uint256 duration,
    address resolver,
    uint32 fuses,
    uint64 expiry
  )
    external
    override
    onlyController
    onlyAuthorized
    returns (uint256 registrarExpiry)
  {
    uint256 tokenId = uint256(keccak256(bytes(label)));
    registrarExpiry = registrar.register(tokenId, address(this), duration);
    _wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);
  }

  /**
   * @dev Renews a .eth second-level domain.
   *      Only callable by authorised controllers.
   * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo.eth').
   * @param duration The number of seconds to renew the name for.
   * @return expires The expiry date of the name on the .eth registrar, in seconds since the Unix epoch.
   */
  function renew(
    uint256 tokenId,
    uint256 duration,
    uint64 expiry
  ) external override onlyController onlyAuthorized returns (uint256 expires) {
    bytes32 node = _makeNode(ETH_NODE, bytes32(tokenId));

    expires = registrar.renew(tokenId, duration);
    (address owner, uint32 fuses, uint64 oldExpiry) = getData(uint256(node));
    expiry = _normaliseExpiry(expiry, oldExpiry, uint64(expires));

    _setData(node, owner, fuses, expiry);
  }

  /**
   * @notice Wraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
   * @dev Can be called by the owner in the registry or an authorised caller in the registry
   * @param name The name to wrap, in DNS format
   * @param wrappedOwner Owner of the name in this contract
   * @param resolver resolver contract address
   */

  function wrap(
    bytes calldata name,
    address wrappedOwner,
    address resolver
  ) public override onlyAuthorized {
    (bytes32 labelhash, uint256 offset) = name.readLabel(0);
    bytes32 parentNode = name.namehash(offset);
    bytes32 node = _makeNode(parentNode, labelhash);

    if (parentNode == ETH_NODE) {
      revert IncompatibleParent();
    }

    address owner = ens.owner(node);

    if (
      owner != msg.sender &&
      !isApprovedForAll(owner, msg.sender) &&
      !ens.isApprovedForAll(owner, msg.sender)
    ) {
      revert Unauthorised(node, msg.sender);
    }

    if (resolver != address(0)) {
      ens.setResolver(node, resolver);
    }

    ens.setOwner(node, address(this));

    _wrap(node, name, wrappedOwner, 0, 0);
  }

  /**
   * @notice Unwraps a .eth domain. e.g. vitalik.eth
   * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper
   * @param labelhash labelhash of the .eth domain
   * @param newRegistrant sets the owner in the .eth registrar to this address
   * @param newController sets the owner in the registry to this address
   */

  function unwrapETH2LD(
    bytes32 labelhash,
    address newRegistrant,
    address newController
  )
    public
    override
    onlyAuthorized
    onlyTokenOwner(_makeNode(ETH_NODE, labelhash))
  {
    _unwrap(_makeNode(ETH_NODE, labelhash), newController);
    registrar.transferFrom(address(this), newRegistrant, uint256(labelhash));
  }

  /**
   * @notice Unwraps a non .eth domain, of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
   * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper
   * @param parentNode parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')
   * @param labelhash labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')
   * @param newController sets the owner in the registry to this address
   */

  function unwrap(
    bytes32 parentNode,
    bytes32 labelhash,
    address newController
  )
    public
    override
    onlyAuthorized
    onlyTokenOwner(_makeNode(parentNode, labelhash))
  {
    if (parentNode == ETH_NODE) {
      revert IncompatibleParent();
    }
    _unwrap(_makeNode(parentNode, labelhash), newController);
  }

  /**
   * @notice Sets fuses of a name
   * @param node namehash of the name
   * @param fuses fuses to burn (cannot burn PARENT_CANOT_CONTROL)
   */

  function setFuses(bytes32 node, uint32 fuses)
    public
    onlyTokenOwner(node)
    operationAllowed(node, CANNOT_BURN_FUSES)
    onlyAuthorized
    returns (uint32)
  {
    if (fuses & PARENT_CANNOT_CONTROL != 0) {
      // Only the parent can burn the PARENT_CANNOT_CONTROL fuse.
      revert Unauthorised(node, msg.sender);
    }

    (address owner, uint32 oldFuses, uint64 expiry) = getData(uint256(node));

    fuses |= oldFuses;
    _setFuses(node, owner, fuses, expiry);
    return fuses;
  }

  /**
   * @notice Add an operator that can interact with the contract
   * @param operator Address getting modified
   * @param authorization value of the authorization
   */

  function setAuthorization(address operator, bool authorization)
    public
    onlyOwner
  {
    authorized[operator] = authorization;
  }

  /**
   * @notice Upgrades a .eth wrapped domain by calling the wrapETH2LD function of the upgradeContract
   *     and burning the token of this contract
   * @dev Can be called by the owner of the name in this contract
   * @param label Label as a string of the .eth name to upgrade
   * @param wrappedOwner The owner of the wrapped name
   */

  function upgradeETH2LD(
    string calldata label,
    address wrappedOwner,
    address resolver
  ) public onlyAuthorized {
    bytes32 labelhash = keccak256(bytes(label));
    bytes32 node = _makeNode(ETH_NODE, labelhash);
    (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);

    upgradeContract.wrapETH2LD(label, wrappedOwner, fuses, expiry, resolver);
  }

  /**
   * @notice Upgrades a non .eth domain of any kind. Could be a DNSSEC name vitalik.xyz or a subdomain
   * @dev Can be called by the owner or an authorised caller
   * Requires upgraded Namewrapper to permit old Namewrapper to call `setSubnodeRecord` for all names
   * @param parentNode namehash of the parent name
   * @param label Label as a string of the name to upgrade
   * @param wrappedOwner Owner of the name in this contract
   * @param resolver resolver contract for this name
   */

  function upgrade(
    bytes32 parentNode,
    string calldata label,
    address wrappedOwner,
    address resolver
  ) public onlyAuthorized {
    bytes32 labelhash = keccak256(bytes(label));
    bytes32 node = _makeNode(parentNode, labelhash);
    (uint32 fuses, uint64 expiry) = _prepareUpgrade(node);
    upgradeContract.setSubnodeRecord(
      parentNode,
      label,
      wrappedOwner,
      resolver,
      0,
      fuses,
      expiry
    );
  }

  /* @notice Sets fuses of a name that you own the parent of. Can also be called by the owner of a .eth name
   * @param parentNode parent namehash of the name e.g. vitalik.xyz would be namehash('xyz')
   * @param labelhash labelhash of the name, e.g. vitalik.xyz would be keccak256('vitalik')
   * @param fuses fuses to burn
   * @param expiry when the fuses will expire
   */

  function setChildFuses(
    bytes32 parentNode,
    bytes32 labelhash,
    uint32 fuses,
    uint64 expiry
  ) public onlyAuthorized {
    bytes32 node = _makeNode(parentNode, labelhash);
    (address owner, uint32 oldFuses, uint64 oldExpiry) = getData(uint256(node));
    uint64 maxExpiry;
    if (parentNode == ETH_NODE) {
      if (!isTokenOwnerOrApproved(node, msg.sender)) {
        revert Unauthorised(node, msg.sender);
      }
      // max expiry is set to the expiry on the registrar
      maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));
    } else {
      if (!isTokenOwnerOrApproved(parentNode, msg.sender)) {
        revert Unauthorised(node, msg.sender);
      }

      // max expiry is set to the expiry of the parent
      (, , maxExpiry) = getData(uint256(parentNode));
    }

    expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);

    fuses |= oldFuses;
    _setFuses(node, owner, fuses, expiry);
  }

  /**
   * @notice Sets the subdomain owner in the registry and then wraps the subdomain
   * @param parentNode parent namehash of the subdomain
   * @param label label of the subdomain as a string
   * @param newOwner newOwner in the registry
   * @param fuses initial fuses for the wrapped subdomain
   * @param expiry when the fuses will expire
   */

  function setSubnodeOwner(
    bytes32 parentNode,
    string calldata label,
    address newOwner,
    uint32 fuses,
    uint64 expiry
  )
    public
    onlyTokenOwner(parentNode)
    canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))
    onlyAuthorized
    returns (bytes32 node)
  {
    bytes32 labelhash = keccak256(bytes(label));
    node = _makeNode(parentNode, labelhash);
    (, , expiry) = _getDataAndNormaliseExpiry(parentNode, node, expiry);

    if (ens.owner(node) != address(this)) {
      ens.setSubnodeOwner(parentNode, labelhash, address(this));
      _addLabelAndWrap(parentNode, node, label, newOwner, fuses, expiry);
    } else {
      _transferAndBurnFuses(node, newOwner, fuses, expiry);
    }
  }

  /**
   * @notice Sets the subdomain owner in the registry with records and then wraps the subdomain
   * @param parentNode parent namehash of the subdomain
   * @param label label of the subdomain as a string
   * @param newOwner newOwner in the registry
   * @param resolver resolver contract in the registry
   * @param ttl ttl in the regsitry
   * @param fuses initial fuses for the wrapped subdomain
   * @param expiry expiry date for the domain
   */

  function setSubnodeRecord(
    bytes32 parentNode,
    string memory label,
    address newOwner,
    address resolver,
    uint64 ttl,
    uint32 fuses,
    uint64 expiry
  )
    public
    onlyTokenOwner(parentNode)
    canCallSetSubnodeOwner(parentNode, keccak256(bytes(label)))
    onlyAuthorized
  {
    bytes32 labelhash = keccak256(bytes(label));
    bytes32 node = _makeNode(parentNode, labelhash);
    (, , expiry) = _getDataAndNormaliseExpiry(parentNode, node, expiry);
    if (ens.owner(node) != address(this)) {
      ens.setSubnodeRecord(parentNode, labelhash, address(this), resolver, ttl);
      _addLabelAndWrap(parentNode, node, label, newOwner, fuses, expiry);
    } else {
      ens.setSubnodeRecord(parentNode, labelhash, address(this), resolver, ttl);
      _transferAndBurnFuses(node, newOwner, fuses, expiry);
    }
  }

  /**
   * @notice Sets records for the name in the ENS Registry
   * @param node namehash of the name to set a record for
   * @param owner newOwner in the registry
   * @param resolver the resolver contract
   * @param ttl ttl in the registry
   */

  function setRecord(
    bytes32 node,
    address owner,
    address resolver,
    uint64 ttl
  )
    public
    override
    onlyTokenOwner(node)
    onlyAuthorized
    operationAllowed(
      node,
      CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL
    )
  {
    ens.setRecord(node, address(this), resolver, ttl);
    (address oldOwner, , ) = getData(uint256(node));
    _transfer(oldOwner, owner, uint256(node), 1, "");
  }

  /**
   * @notice Sets resolver contract in the registry
   * @param node namehash of the name
   * @param resolver the resolver contract
   */

  function setResolver(bytes32 node, address resolver)
    public
    override
    onlyTokenOwner(node)
    operationAllowed(node, CANNOT_SET_RESOLVER)
    onlyAuthorized
  {
    ens.setResolver(node, resolver);
  }

  /**
   * @notice Sets TTL in the registry
   * @param node namehash of the name
   * @param ttl TTL in the registry
   */

  function setTTL(bytes32 node, uint64 ttl)
    public
    override
    onlyTokenOwner(node)
    operationAllowed(node, CANNOT_SET_TTL)
    onlyAuthorized
  {
    ens.setTTL(node, ttl);
  }

  /**
   * @dev Allows an operation only if none of the specified fuses are burned.
   * @param node The namehash of the name to check fuses on.
   * @param fuseMask A bitmask of fuses that must not be burned.
   */

  modifier operationAllowed(bytes32 node, uint32 fuseMask) {
    (, uint32 fuses, ) = getData(uint256(node));
    if (fuses & fuseMask != 0) {
      revert OperationProhibited(node);
    }
    _;
  }

  /**
   * @notice Check whether a name can call setSubnodeOwner/setSubnodeRecord
   * @dev Checks both canCreateSubdomain and canReplaceSubdomain and whether not they have been burnt
   *      and checks whether the owner of the subdomain is 0x0 for creating or already exists for
   *      replacing a subdomain. If either conditions are true, then it is possible to call
   *      setSubnodeOwner
   * @param node namehash of the name to check
   * @param labelhash labelhash of the name to check
   */

  modifier canCallSetSubnodeOwner(bytes32 node, bytes32 labelhash) {
    bytes32 subnode = _makeNode(node, labelhash);
    address owner = ens.owner(subnode);

    if (owner == address(0)) {
      (, uint32 fuses, ) = getData(uint256(node));
      if (fuses & CANNOT_CREATE_SUBDOMAIN != 0) {
        revert OperationProhibited(node);
      }
    } else {
      (, uint32 subnodeFuses, ) = getData(uint256(subnode));
      if (subnodeFuses & PARENT_CANNOT_CONTROL != 0) {
        revert OperationProhibited(node);
      }
    }

    _;
  }

  /**
   * @notice Checks all Fuses in the mask are burned for the node
   * @param node namehash of the name
   * @param fuseMask the fuses you want to check
   * @return Boolean of whether or not all the selected fuses are burned
   */

  function allFusesBurned(bytes32 node, uint32 fuseMask)
    public
    view
    override
    returns (bool)
  {
    (, uint32 fuses, ) = getData(uint256(node));
    return fuses & fuseMask == fuseMask;
  }

  function onERC721Received(
    address to,
    address,
    uint256 tokenId,
    bytes calldata data
  ) public override returns (bytes4) {
    //check if it's the eth registrar ERC721
    if (msg.sender != address(registrar)) {
      revert IncorrectTokenType();
    }

    (
      string memory label,
      address owner,
      uint32 fuses,
      uint64 expiry,
      address resolver
    ) = abi.decode(data, (string, address, uint32, uint64, address));

    bytes32 labelhash = bytes32(tokenId);
    bytes32 labelhashFromData = keccak256(bytes(label));

    if (labelhashFromData != labelhash) {
      revert LabelMismatch(labelhashFromData, labelhash);
    }

    // transfer the ens record back to the new owner (this contract)
    registrar.reclaim(uint256(labelhash), address(this));

    _wrapETH2LD(label, owner, fuses, expiry, resolver);

    return IERC721Receiver(to).onERC721Received.selector;
  }

  /***** Internal functions */

  function _canTransfer(uint32 fuses) internal pure override returns (bool) {
    return fuses & CANNOT_TRANSFER == 0;
  }

  function _makeNode(bytes32 node, bytes32 labelhash)
    private
    pure
    returns (bytes32)
  {
    return keccak256(abi.encodePacked(node, labelhash));
  }

  function _addLabel(string memory label, bytes memory name)
    internal
    pure
    returns (bytes memory ret)
  {
    if (bytes(label).length < 1) {
      revert LabelTooShort();
    }
    if (bytes(label).length > 255) {
      revert LabelTooLong(label);
    }
    return abi.encodePacked(uint8(bytes(label).length), label, name);
  }

  function _mint(
    bytes32 node,
    address wrappedOwner,
    uint32 fuses,
    uint64 expiry
  ) internal override {
    address oldWrappedOwner = ownerOf(uint256(node));
    if (oldWrappedOwner != address(0)) {
      // burn and unwrap old token of old owner
      _burn(uint256(node));
      emit NameUnwrapped(node, address(0));
    }
    super._mint(node, wrappedOwner, fuses, expiry);
  }

  function _wrap(
    bytes32 node,
    bytes memory name,
    address wrappedOwner,
    uint32 fuses,
    uint64 expiry
  ) internal {
    names[node] = name;
    _canFusesBeBurned(node, fuses);
    _mint(node, wrappedOwner, fuses, expiry);
    emit NameWrapped(node, name, wrappedOwner, fuses, expiry);
  }

  function _addLabelAndWrap(
    bytes32 parentNode,
    bytes32 node,
    string memory label,
    address newOwner,
    uint32 fuses,
    uint64 expiry
  ) internal {
    bytes memory name = _addLabel(label, names[parentNode]);
    _wrap(node, name, newOwner, fuses, expiry);
  }

  function _prepareUpgrade(bytes32 node)
    private
    returns (uint32 fuses, uint64 expiry)
  {
    if (address(upgradeContract) == address(0)) {
      revert CannotUpgrade();
    }

    if (!isTokenOwnerOrApproved(node, msg.sender)) {
      revert Unauthorised(node, msg.sender);
    }

    (fuses, expiry) = getFuses(node);

    // burn token and fuse data
    _burn(uint256(node));
  }

  function _transferAndBurnFuses(
    bytes32 node,
    address newOwner,
    uint32 fuses,
    uint64 expiry
  ) internal {
    (address owner, , ) = getData(uint256(node));
    _transfer(owner, newOwner, uint256(node), 1, "");
    _setFuses(node, newOwner, fuses, expiry);
  }

  // wrapper function for stack limit
  function _getDataAndNormaliseExpiry(
    bytes32 parentNode,
    bytes32 node,
    uint64 expiry
  )
    internal
    view
    returns (
      address owner,
      uint32 fuses,
      uint64
    )
  {
    uint64 oldExpiry;
    (owner, fuses, oldExpiry) = getData(uint256(node));
    (, , uint64 maxExpiry) = getData(uint256(parentNode));

    expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);
    return (owner, fuses, expiry);
  }

  function _getETH2LDDataAndNormaliseExpiry(
    bytes32 node,
    bytes32 labelhash,
    uint64 expiry
  )
    internal
    view
    returns (
      address owner,
      uint32 fuses,
      uint64
    )
  {
    uint64 oldExpiry;
    (owner, fuses, oldExpiry) = getData(uint256(node));
    uint64 maxExpiry = uint64(registrar.nameExpires(uint256(labelhash)));

    expiry = _normaliseExpiry(expiry, oldExpiry, maxExpiry);
    return (owner, fuses, expiry);
  }

  function _normaliseExpiry(
    uint64 expiry,
    uint64 oldExpiry,
    uint64 maxExpiry
  ) internal pure returns (uint64) {
    // Expiry cannot be more than maximum allowed
    // .eth names will check registrar, non .eth check parent
    if (expiry > maxExpiry) {
      expiry = maxExpiry;
    }
    // Expiry cannot be less than old expiry
    if (expiry < oldExpiry) {
      expiry = oldExpiry;
    }

    return expiry;
  }

  function _wrapETH2LD(
    string memory label,
    address wrappedOwner,
    uint32 fuses,
    uint64 expiry,
    address resolver
  ) private returns (uint64) {
    // Mint a new ERC1155 token with fuses
    // Set PARENT_CANNOT_REPLACE to reflect wrapper + registrar control over the 2LD
    bytes32 labelhash = keccak256(bytes(label));
    bytes32 node = _makeNode(ETH_NODE, labelhash);

    (, , expiry) = _getETH2LDDataAndNormaliseExpiry(node, labelhash, expiry);

    _addLabelAndWrap(
      ETH_NODE,
      node,
      label,
      wrappedOwner,
      fuses | PARENT_CANNOT_CONTROL,
      expiry
    );
    if (resolver != address(0)) {
      ens.setResolver(node, resolver);
    }

    return expiry;
  }

  function _unwrap(bytes32 node, address newOwner) private {
    if (newOwner == address(0x0) || newOwner == address(this)) {
      revert IncorrectTargetOwner(newOwner);
    }

    if (allFusesBurned(node, CANNOT_UNWRAP)) {
      revert OperationProhibited(node);
    }

    // Burn token and fuse data
    _burn(uint256(node));
    ens.setOwner(node, newOwner);

    emit NameUnwrapped(node, newOwner);
  }

  function _setFuses(
    bytes32 node,
    address owner,
    uint32 fuses,
    uint64 expiry
  ) internal {
    _setData(node, owner, fuses, expiry);
    emit FusesSet(node, fuses, expiry);
  }

  function _setData(
    bytes32 node,
    address owner,
    uint32 fuses,
    uint64 expiry
  ) internal {
    _canFusesBeBurned(node, fuses);
    super._setData(uint256(node), owner, fuses, expiry);
  }

  function _canFusesBeBurned(bytes32 node, uint32 fuses) internal pure {
    if (
      fuses & ~PARENT_CANNOT_CONTROL != 0 &&
      fuses & (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP) !=
      (PARENT_CANNOT_CONTROL | CANNOT_UNWRAP)
    ) {
      revert OperationProhibited(node);
    }
  }
}

File 2 of 19 : ERC1155Fuse.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol";
import "@openzeppelin/contracts/utils/Address.sol";

/* This contract is a variation on ERC1155 with the additions of _setData, getData and _canTransfer and ownerOf. _setData and getData allows the use of the other 96 bits next to the address of the owner for extra data. We use this to store 'fuses' that control permissions that can be burnt. 32 bits are used for the fuses themselves and 64 bits are used for the expiry of the name. When a name has expired, its fuses will be be set back to 0 */

error OperationProhibited(bytes32 node);

abstract contract ERC1155Fuse is ERC165, IERC1155, IERC1155MetadataURI {
    using Address for address;
    mapping(uint256 => uint256) public _tokens;

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

    /**************************************************************************
     * ERC721 methods
     *************************************************************************/

    function ownerOf(uint256 id) public view virtual returns (address) {
        (address owner, , ) = getData(id);
        return owner;
    }

    /**
     * @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 {IERC1155-balanceOf}.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id)
        public
        view
        virtual
        override
        returns (uint256)
    {
        require(
            account != address(0),
            "ERC1155: balance query for the zero address"
        );
        (address owner, , ) = getData(id);
        if (owner == account) {
            return 1;
        }
        return 0;
    }

    /**
     * @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
    {
        require(
            msg.sender != operator,
            "ERC1155: setting approval status for self"
        );

        _operatorApprovals[msg.sender][operator] = approved;
        emit ApprovalForAll(msg.sender, operator, approved);
    }

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

    /**
     * @dev Returns the Name's owner address and fuses
     */
    function getData(uint256 tokenId)
        public
        view
        returns (
            address owner,
            uint32 fuses,
            uint64 expiry
        )
    {
        uint256 t = _tokens[tokenId];
        owner = address(uint160(t));
        expiry = uint64(t >> 192);
        if (block.timestamp > expiry) {
            fuses = 0;
        } else {
            fuses = uint32(t >> 160);
        }
    }

    /**
     * @dev Sets the Name's owner address and fuses
     */
    function _setData(
        uint256 tokenId,
        address owner,
        uint32 fuses,
        uint64 expiry
    ) internal virtual {
        _tokens[tokenId] =
            uint256(uint160(owner)) |
            (uint256(fuses) << 160) |
            (uint256(expiry) << 192);
    }

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

        _transfer(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(
            ids.length == amounts.length,
            "ERC1155: ids and amounts length mismatch"
        );
        require(to != address(0), "ERC1155: transfer to the zero address");
        require(
            from == msg.sender || isApprovedForAll(from, msg.sender),
            "ERC1155: transfer caller is not owner nor approved"
        );

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

            (address oldOwner, uint32 fuses, uint64 expiration) = getData(id);

            if (!_canTransfer(fuses)) {
                revert OperationProhibited(bytes32(id));
            }

            require(
                amount == 1 && oldOwner == from,
                "ERC1155: insufficient balance for transfer"
            );
            _setData(id, to, fuses, expiration);
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        _doSafeBatchTransferAcceptanceCheck(
            msg.sender,
            from,
            to,
            ids,
            amounts,
            data
        );
    }

    /**************************************************************************
     * Internal/private methods
     *************************************************************************/

    function _canTransfer(uint32 fuses) internal virtual returns (bool);

    function _mint(
        bytes32 node,
        address newOwner,
        uint32 fuses,
        uint64 expiry
    ) internal virtual {
        uint256 tokenId = uint256(node);
        address owner = ownerOf(tokenId);
        require(owner == address(0), "ERC1155: mint of existing token");
        require(newOwner != address(0), "ERC1155: mint to the zero address");
        require(
            newOwner != address(this),
            "ERC1155: newOwner cannot be the NameWrapper contract"
        );

        _setData(tokenId, newOwner, fuses, expiry);
        emit TransferSingle(msg.sender, address(0x0), newOwner, tokenId, 1);
        _doSafeTransferAcceptanceCheck(
            msg.sender,
            address(0),
            newOwner,
            tokenId,
            1,
            ""
        );
    }

    function _burn(uint256 tokenId) internal virtual {
        address owner = ownerOf(tokenId);
        // Clear fuses and set owner to 0
        _setData(tokenId, address(0x0), 0, 0);
        emit TransferSingle(msg.sender, owner, address(0x0), tokenId, 1);
    }

    function _transfer(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal {
        (address oldOwner, uint32 fuses, uint64 expiry) = getData(id);
        if (oldOwner == to) {
            return;
        }

        if (!_canTransfer(fuses)) {
            revert OperationProhibited(bytes32(id));
        }

        require(
            amount == 1 && oldOwner == from,
            "ERC1155: insufficient balance for transfer"
        );
        _setData(id, to, fuses, expiry);

        emit TransferSingle(msg.sender, from, to, id, amount);

        _doSafeTransferAcceptanceCheck(msg.sender, from, to, id, amount, data);
    }

    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(to).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(to).onERC1155BatchReceived.selector
                ) {
                    revert("ERC1155: ERC1155Receiver rejected tokens");
                }
            } catch Error(string memory reason) {
                revert(reason);
            } catch {
                revert("ERC1155: transfer to non ERC1155Receiver implementer");
            }
        }
    }
}

File 3 of 19 : Controllable.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

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

contract Controllable is Ownable {
    mapping(address=>bool) public controllers;

    event ControllerChanged(address indexed controller, bool active);

    function setController(address controller, bool active) onlyOwner() public {
        controllers[controller] = active;
        emit ControllerChanged(controller, active);
    }

    modifier onlyController() {
        require(controllers[msg.sender], "Controllable: Caller is not a controller");
        _;
    }
}

File 4 of 19 : INameWrapper.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import "../registry/ENS.sol";
import "../ethregistrar/IBaseRegistrar.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "./IMetadataService.sol";

uint32 constant CANNOT_UNWRAP = 1;
uint32 constant CANNOT_BURN_FUSES = 2;
uint32 constant CANNOT_TRANSFER = 4;
uint32 constant CANNOT_SET_RESOLVER = 8;
uint32 constant CANNOT_SET_TTL = 16;
uint32 constant CANNOT_CREATE_SUBDOMAIN = 32;
uint32 constant PARENT_CANNOT_CONTROL = 64;
uint32 constant CAN_DO_EVERYTHING = 0;

interface INameWrapper is IERC1155 {
    event NameWrapped(
        bytes32 indexed node,
        bytes name,
        address owner,
        uint32 fuses,
        uint64 expiry
    );

    event NameUnwrapped(bytes32 indexed node, address owner);

    event FusesSet(bytes32 indexed node, uint32 fuses, uint64 expiry);

    function ens() external view returns (ENS);

    function registrar() external view returns (IBaseRegistrar);

    function metadataService() external view returns (IMetadataService);

    function names(bytes32) external view returns (bytes memory);

    function wrap(
        bytes calldata name,
        address wrappedOwner,
        address resolver
    ) external;

    function wrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint32 fuses,
        uint64 _expiry,
        address resolver
    ) external returns (uint64 expiry);

    function registerAndWrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint256 duration,
        address resolver,
        uint32 fuses,
        uint64 expiry
    ) external returns (uint256 registrarExpiry);

    function renew(
        uint256 labelHash,
        uint256 duration,
        uint64 expiry
    ) external returns (uint256 expires);

    function unwrap(
        bytes32 node,
        bytes32 label,
        address owner
    ) external;

    function unwrapETH2LD(
        bytes32 label,
        address newRegistrant,
        address newController
    ) external;

    function setFuses(bytes32 node, uint32 fuses)
        external
        returns (uint32 newFuses);

    function setChildFuses(
        bytes32 parentNode,
        bytes32 labelhash,
        uint32 fuses,
        uint64 expiry
    ) external;

    function setSubnodeRecord(
        bytes32 node,
        string calldata label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    ) external;

    function setRecord(
        bytes32 node,
        address owner,
        address resolver,
        uint64 ttl
    ) external;

    function setSubnodeOwner(
        bytes32 node,
        string calldata label,
        address newOwner,
        uint32 fuses,
        uint64 expiry
    ) external returns (bytes32);

    function isTokenOwnerOrApproved(bytes32 node, address addr)
        external
        returns (bool);

    function setResolver(bytes32 node, address resolver) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function ownerOf(uint256 id) external returns (address owner);

    function getFuses(bytes32 node)
        external
        returns (uint32 fuses, uint64 expiry);

    function allFusesBurned(bytes32 node, uint32 fuseMask)
        external
        view
        returns (bool);
}

File 5 of 19 : INameWrapperUpgrade.sol
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;

interface INameWrapperUpgrade {
    function setSubnodeRecord(
        bytes32 node,
        string calldata label,
        address owner,
        address resolver,
        uint64 ttl,
        uint32 fuses,
        uint64 expiry
    ) external;

    function wrapETH2LD(
        string calldata label,
        address wrappedOwner,
        uint32 fuses,
        uint64 expiry,
        address resolver
    ) external;
}

File 6 of 19 : IMetadataService.sol
pragma solidity >=0.8.4;

interface IMetadataService {
    function uri(uint256) external view returns (string memory);
}

File 7 of 19 : ENS.sol
pragma solidity >=0.8.4;

interface ENS {
    // Logged when the owner of a node assigns a new owner to a subnode.
    event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);

    // Logged when the owner of a node transfers ownership to a new account.
    event Transfer(bytes32 indexed node, address owner);

    // Logged when the resolver for a node changes.
    event NewResolver(bytes32 indexed node, address resolver);

    // Logged when the TTL of a node changes
    event NewTTL(bytes32 indexed node, uint64 ttl);

    // Logged when an operator is added or removed.
    event ApprovalForAll(
        address indexed owner,
        address indexed operator,
        bool approved
    );

    function setRecord(
        bytes32 node,
        address owner,
        address resolver,
        uint64 ttl
    ) external;

    function setSubnodeRecord(
        bytes32 node,
        bytes32 label,
        address owner,
        address resolver,
        uint64 ttl
    ) external;

    function setSubnodeOwner(
        bytes32 node,
        bytes32 label,
        address owner
    ) external returns (bytes32);

    function setResolver(bytes32 node, address resolver) external;

    function setOwner(bytes32 node, address owner) external;

    function setTTL(bytes32 node, uint64 ttl) external;

    function setApprovalForAll(address operator, bool approved) external;

    function owner(bytes32 node) external view returns (address);

    function resolver(bytes32 node) external view returns (address);

    function ttl(bytes32 node) external view returns (uint64);

    function recordExists(bytes32 node) external view returns (bool);

    function isApprovedForAll(address owner, address operator)
        external
        view
        returns (bool);
}

File 8 of 19 : IBaseRegistrar.sol
import "../registry/ENS.sol";
import "./IBaseRegistrar.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IBaseRegistrar is IERC721 {

    event ControllerAdded(address indexed controller);
    event ControllerRemoved(address indexed controller);
    event NameMigrated(
        uint256 indexed id,
        address indexed owner,
        uint256 expires
    );
    event NameRegistered(
        uint256 indexed id,
        address indexed owner,
        uint256 expires
    );
    event NameRenewed(uint256 indexed id, uint256 expires);
    // Authorises a controller, who can register and renew domains.
    function addController(address controller) external;

    // Revoke controller permission for an address.
    function removeController(address controller) external;

    // Set the resolver for the TLD this registrar manages.
    function setResolver(address resolver) external;

    // Returns the expiration timestamp of the specified label hash.
    function nameExpires(uint256 id) external view returns (uint256);

    // Returns true iff the specified name is available for registration.
    function available(uint256 id) external view returns (bool);

    /**
     * @dev Register a name.
     */
    function register(
        uint256 id,
        address owner,
        uint256 duration
    ) external returns (uint256);

    function renew(uint256 id, uint256 duration) external returns (uint256);

    /**
     * @dev Reclaim ownership of a name in ENS, if you own it in the registrar.
     */
    function reclaim(uint256 id, address owner) external;
}

File 9 of 19 : 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 10 of 19 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

File 11 of 19 : BytesUtil.sol
//SPDX-License-Identifier: MIT
pragma solidity >=0.8.4;

library BytesUtils {
    /*
    * @dev Returns the keccak-256 hash of a byte range.
    * @param self The byte string to hash.
    * @param offset The position to start hashing at.
    * @param len The number of bytes to hash.
    * @return The hash of the byte range.
    */
    function keccak(bytes memory self, uint offset, uint len) internal pure returns (bytes32 ret) {
        require(offset + len <= self.length);
        assembly {
            ret := keccak256(add(add(self, 32), offset), len)
        }
    }

    /**
     * @dev Returns the ENS namehash of a DNS-encoded name.
     * @param self The DNS-encoded name to hash.
     * @param offset The offset at which to start hashing.
     * @return The namehash of the name.
     */
    function namehash(bytes memory self, uint offset) internal pure returns(bytes32) {
        (bytes32 labelhash, uint newOffset) = readLabel(self, offset);
        if(labelhash == bytes32(0)) {
            require(offset == self.length - 1, "namehash: Junk at end of name");
            return bytes32(0);
        }
        return keccak256(abi.encodePacked(namehash(self, newOffset), labelhash));
    }
    
    /**
     * @dev Returns the keccak-256 hash of a DNS-encoded label, and the offset to the start of the next label.
     * @param self The byte string to read a label from.
     * @param idx The index to read a label at.
     * @return labelhash The hash of the label at the specified index, or 0 if it is the last label.
     * @return newIdx The index of the start of the next label.
     */
    function readLabel(bytes memory self, uint256 idx) internal pure returns (bytes32 labelhash, uint newIdx) {
        require(idx < self.length, "readLabel: Index out of bounds");
        uint len = uint(uint8(self[idx]));
        if(len > 0) {
            labelhash = keccak(self, idx + 1, len);
        } else {
            labelhash = bytes32(0);
        }
        newIdx = idx + len + 1;
    }
}

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

pragma solidity ^0.8.0;

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

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

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

File 14 of 19 : 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 15 of 19 : 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 16 of 19 : 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 17 of 19 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 18 of 19 : 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 19 of 19 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract ENS","name":"_ens","type":"address"},{"internalType":"contract IBaseRegistrar","name":"_registrar","type":"address"},{"internalType":"contract IMetadataService","name":"_metadataService","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CannotUpgrade","type":"error"},{"inputs":[],"name":"IncompatibleParent","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"IncorrectTargetOwner","type":"error"},{"inputs":[],"name":"IncorrectTokenType","type":"error"},{"inputs":[{"internalType":"bytes32","name":"labelHash","type":"bytes32"},{"internalType":"bytes32","name":"expectedLabelhash","type":"bytes32"}],"name":"LabelMismatch","type":"error"},{"inputs":[{"internalType":"string","name":"label","type":"string"}],"name":"LabelTooLong","type":"error"},{"inputs":[],"name":"LabelTooShort","type":"error"},{"inputs":[],"name":"NameNotFound","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"OperationProhibited","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"Unauthorised","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"active","type":"bool"}],"name":"ControllerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"uint32","name":"fuses","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"FusesSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"address","name":"owner","type":"address"}],"name":"NameUnwrapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"node","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"name","type":"bytes"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint32","name":"fuses","type":"uint32"},{"indexed":false,"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"NameWrapped","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"_tokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint32","name":"fuseMask","type":"uint32"}],"name":"allFusesBurned","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"authorized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ens","outputs":[{"internalType":"contract ENS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getData","outputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"getFuses","outputs":[{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"addr","type":"address"}],"name":"isTokenOwnerOrApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"metadataService","outputs":[{"internalType":"contract IMetadataService","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"names","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"registerAndWrapETH2LD","outputs":[{"internalType":"uint256","name":"registrarExpiry","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registrar","outputs":[{"internalType":"contract IBaseRegistrar","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"duration","type":"uint256"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"renew","outputs":[{"internalType":"uint256","name":"expires","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"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":"address","name":"operator","type":"address"},{"internalType":"bool","name":"authorization","type":"bool"}],"name":"setAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setChildFuses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bool","name":"active","type":"bool"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint32","name":"fuses","type":"uint32"}],"name":"setFuses","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IMetadataService","name":"_newMetadataService","type":"address"}],"name":"setMetadataService","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"address","name":"resolver","type":"address"}],"name":"setResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setSubnodeOwner","outputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"newOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"uint64","name":"ttl","type":"uint64"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"name":"setSubnodeRecord","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"},{"internalType":"uint64","name":"ttl","type":"uint64"}],"name":"setTTL","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract INameWrapperUpgrade","name":"_upgradeAddress","type":"address"}],"name":"setUpgradeContract","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":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"address","name":"newController","type":"address"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"address","name":"newRegistrant","type":"address"},{"internalType":"address","name":"newController","type":"address"}],"name":"unwrapETH2LD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"upgrade","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"upgradeContract","outputs":[{"internalType":"contract INameWrapperUpgrade","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"upgradeETH2LD","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":"bytes","name":"name","type":"bytes"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"address","name":"resolver","type":"address"}],"name":"wrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"label","type":"string"},{"internalType":"address","name":"wrappedOwner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint64","name":"expiry","type":"uint64"},{"internalType":"address","name":"resolver","type":"address"}],"name":"wrapETH2LD","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"nonpayable","type":"function"}]

60c06040523480156200001157600080fd5b5060405162005f5a38038062005f5a833981016040819052620000349162000299565b6200003f336200018a565b6001600160a01b0383811660805282811660a052600480546001600160a01b031916918316919091179055600163ffffffbf60a01b03197fafa26c20e8b3d9a2853d642cfe1021dae26242ffedfac91c97aab212c1a4b93b8190557fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49556040805180820190915260018152600060208083018281529180526005905290516200010a917f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc91620001da565b50604080518082019091526005808252626cae8d60e31b60208084019182527f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60005291909152905162000180917fd99130487705d6970718a0cee91984b61956f8a1db3482bba7e6bf0131adb01f91620001da565b5050505062000329565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b828054620001e890620002ed565b90600052602060002090601f0160209004810192826200020c576000855562000257565b82601f106200022757805160ff191683800117855562000257565b8280016001018555821562000257579182015b82811115620002575782518255916020019190600101906200023a565b506200026592915062000269565b5090565b5b808211156200026557600081556001016200026a565b6001600160a01b03811681146200029657600080fd5b50565b600080600060608486031215620002af57600080fd5b8351620002bc8162000280565b6020850151909350620002cf8162000280565b6040850151909250620002e28162000280565b809150509250925092565b600181811c908216806200030257607f821691505b6020821081036200032357634e487b7160e01b600052602260045260246000fd5b50919050565b60805160a051615b3262000428600039600081816104b701528181610b6401528181610c420152818161176201528181611bf101528181611e1001528181611f9a015281816121b4015281816122f30152818161364b0152818161372901528181613832015281816138a8015261452801526000818161050401528181610aea01528181610e1201528181610f6c01528181611124015281816111e1015281816112930152818161223901528181612378015281816125a8015281816127730152818161283101528181612a3601528181612f4601528181613024015281816130ed0152818161316601528181613ab701526140770152615b326000f3fe608060405234801561001057600080fd5b50600436106103095760003560e01c80638da5cb5b1161019c578063da8c229e116100ee578063ee7eba7811610097578063f2fde38b11610071578063f2fde38b146107e0578063f44779b9146107f3578063f9547a9e1461080657600080fd5b8063ee7eba78146107a7578063eecea000146107ba578063f242432a146107cd57600080fd5b8063e985e9c5116100c8578063e985e9c514610738578063eb8ae53014610774578063ed70554d1461078757600080fd5b8063da8c229e146106ef578063e0dba60f14610712578063e72bf00f1461072557600080fd5b8063b6bcad2611610150578063c658e0861161012a578063c658e086146106b6578063cf408823146106c9578063d8c9921a146106dc57600080fd5b8063b6bcad2614610658578063b91816111461066b578063c20a2eb01461068e57600080fd5b80639f56dac6116101815780639f56dac61461061f578063a22cb46514610632578063adf4960a1461064557600080fd5b80638da5cb5b146105d257806395d89b41146105e357600080fd5b806324c1af44116102605780634e1273f4116102095780636846f2f7116101e35780636846f2f7146105a4578063715018a6146105b75780638b4dfa75146105bf57600080fd5b80634e1273f41461055e578063530954671461057e5780636352211e1461059157600080fd5b806333c69ea91161023a57806333c69ea9146104ec5780633f15457f146104ff5780634ac07f411461052657600080fd5b806324c1af441461049f5780632b20e397146104b25780632eb2c2d6146104d957600080fd5b806314ab9038116102c25780631896f70a1161029c5780631896f70a1461044e5780631f4e15041461046157806320c38e2b1461048c57600080fd5b806314ab9038146103fa578063150b7a021461040f5780631534e1771461043b57600080fd5b806301ffc9a7116102f357806301ffc9a71461037b57806306fdde031461039e5780630e89341c146103e757600080fd5b8062fdd58e1461030e5780630178fe3f14610334575b600080fd5b61032161031c366004614b28565b610832565b6040519081526020015b60405180910390f35b610347610342366004614b54565b6108f3565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161032b565b61038e610389366004614b83565b61092a565b604051901515815260200161032b565b6103da6040518060400160405280600d81526020017f2e6561727468204e6f6d6164730000000000000000000000000000000000000081525081565b60405161032b9190614bff565b6103da6103f5366004614b54565b610968565b61040d610408366004614c2f565b6109dc565b005b61042261041d366004614ca4565b610b57565b6040516001600160e01b0319909116815260200161032b565b61040d610449366004614d17565b610ce6565b61040d61045c366004614d34565b610d1d565b600754610474906001600160a01b031681565b6040516001600160a01b03909116815260200161032b565b6103da61049a366004614b54565b610e41565b61040d6104ad366004614e3f565b610edb565b6104747f000000000000000000000000000000000000000000000000000000000000000081565b61040d6104e7366004614f72565b61130b565b61040d6104fa366004615020565b611655565b6104747f000000000000000000000000000000000000000000000000000000000000000081565b610539610534366004614b54565b611842565b6040805163ffffffff909316835267ffffffffffffffff90911660208301520161032b565b61057161056c366004615066565b611950565b60405161032b9190615164565b600454610474906001600160a01b031681565b61047461059f366004614b54565b611a8e565b6103216105b2366004615177565b611a99565b61040d611c9f565b61040d6105cd3660046151ac565b611cb3565b6000546001600160a01b0316610474565b6103da6040518060400160405280600581526020017f4e4f4d414400000000000000000000000000000000000000000000000000000081525081565b61032161062d3660046151ee565b611e72565b61040d610640366004615281565b612063565b61038e6106533660046152af565b61214d565b61040d610666366004614d17565b612172565b61038e610679366004614d17565b60066020526000908152604090205460ff1681565b6106a161069c3660046152af565b6123d7565b60405163ffffffff909116815260200161032b565b6103216106c43660046152d2565b612505565b61040d6106d7366004615351565b612912565b61040d6106ea366004615389565b612ac4565b61038e6106fd366004614d17565b60036020526000908152604090205460ff1681565b61040d610720366004615281565b612bf5565b61040d6107333660046153b7565b612c5d565b61038e61074636600461541f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61040d6107823660046153b7565b612dd0565b610321610795366004614b54565b60016020526000908152604090205481565b61040d6107b536600461544d565b61320d565b61040d6107c8366004615281565b613365565b61040d6107db3660046154c1565b613398565b61040d6107ee366004614d17565b6134b5565b61038e610801366004614d34565b613542565b61081961081436600461552a565b61359d565b60405167ffffffffffffffff909116815260200161032b565b60006001600160a01b0383166108b55760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60006108c0836108f3565b50509050836001600160a01b0316816001600160a01b0316036108e75760019150506108ed565b60009150505b92915050565b6000818152600160205260408120549060c082901c824282101561091a5760009250610922565b60a081901c92505b509193909250565b60006001600160e01b031982167f71bc02720000000000000000000000000000000000000000000000000000000014806108ed57506108ed82613960565b600480546040516303a24d0760e21b81529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ed91908101906155b4565b816109e78133613542565b610a0d5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8260106000610a1b836108f3565b5091505063ffffffff8282161615610a495760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff1680610a7157506000546001600160a01b031633145b610aab5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610bbb576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610bcd87890189615636565b84516020860120949950929750909550935091508990808214610c26576040517fc65c3ccc00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108ac565b604051630a3b53db60e21b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610c8e57600080fd5b505af1158015610ca2573d6000803e3d6000fd5b50505050610cb387878787876139e2565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b610cee613b20565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b81610d288133613542565b610d4e5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8260086000610d5c836108f3565b5091505063ffffffff8282161615610d8a5760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff1680610db257506000546001600160a01b031633145b610dec5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604051630c4b7b8560e11b8152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401610b1d565b60056020526000908152604090208054610e5a906156ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610e86906156ae565b8015610ed35780601f10610ea857610100808354040283529160200191610ed3565b820191906000526020600020905b815481529060010190602001808311610eb657829003601f168201915b505050505081565b86610ee68133613542565b610f0c5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8787805190602001206000610f488383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040516302571be360e01b8152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd791906156e8565b90506001600160a01b038116611021576000610ff2856108f3565b50915050602081161561101b5760405163a2a7201360e01b8152600481018690526024016108ac565b50611057565b600061102c836108f3565b5091505060408116156110555760405163a2a7201360e01b8152600481018690526024016108ac565b505b3360009081526006602052604090205460ff168061107f57506000546001600160a01b031633145b6110b95760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b8a5160208c012060006110f38e83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506111008e828a613b7a565b6040516302571be360e01b815260048101859052909a503092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506302571be390602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119091906156e8565b6001600160a01b031614611250576040516305ef2c7f60e41b8152600481018f9052602481018390523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b5050505061124b8e828f8f8d8d613bb9565b6112fb565b6040516305ef2c7f60e41b8152600481018f9052602481018390523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000000000000000000000000000000001690635ef2c7f09060a401600060405180830381600087803b1580156112d757600080fd5b505af11580156112eb573d6000803e3d6000fd5b505050506112fb818d8b8b613c73565b5050505050505050505050505050565b81518351146113825760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016108ac565b6001600160a01b0384166113e65760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ac565b6001600160a01b03851633148061142057506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6114925760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016108ac565b60005b83518110156115e85760008482815181106114b2576114b2615705565b6020026020010151905060008483815181106114d0576114d0615705565b6020026020010151905060008060006114e8856108f3565b9250925092506114f9826004161590565b6115195760405163a2a7201360e01b8152600481018690526024016108ac565b83600114801561153a57508a6001600160a01b0316836001600160a01b0316145b6115995760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ac565b60008581526001602052604090206001600160a01b038b1663ffffffff60a01b60a085901b16176001600160c01b031960c084901b161790555050505050806115e190615731565b9050611495565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161163892919061574a565b60405180910390a461164e338686868686613cae565b5050505050565b3360009081526006602052604090205460ff168061167d57506000546001600160a01b031633145b6116b75760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806116ec846108f3565b9194509250905060007f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5289016117dc576117268533613542565b61174c5760405163168ab55d60e31b8152600481018690523360248201526044016108ac565b604051636b727d4360e11b8152600481018990527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d59190615778565b905061181a565b6117e68933613542565b61180c5760405163168ab55d60e31b8152600481018690523360248201526044016108ac565b611815896108f3565b925050505b611825868383613e5b565b96831796955061183785858989613ea5565b505050505050505050565b60008061184e836108f3565b90935091505063ffffffff8216158015611870575067ffffffffffffffff8116155b1561194b576000838152600560205260408120805461188e906156ae565b80601f01602080910402602001604051908101604052809291908181526020018280546118ba906156ae565b80156119075780601f106118dc57610100808354040283529160200191611907565b820191906000526020600020905b8154815290600101906020018083116118ea57829003601f168201915b505050505090508051600003611949576040517f3b4d540000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b915091565b606081518351146119c95760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016108ac565b6000835167ffffffffffffffff8111156119e5576119e5614d64565b604051908082528060200260200182016040528015611a0e578160200160208202803683370190505b50905060005b8451811015611a8657611a59858281518110611a3257611a32615705565b6020026020010151858381518110611a4c57611a4c615705565b6020026020010151610832565b828281518110611a6b57611a6b615705565b6020908102919091010152611a7f81615731565b9050611a14565b509392505050565b60006108ed82613f01565b3360009081526003602052604081205460ff16611b095760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016108ac565b3360009081526006602052604090205460ff1680611b3157506000546001600160a01b031633145b611b6b5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301879052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101879052602481018690529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af1158015611c42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c669190615778565b915060008080611c75846108f3565b925092509250611c86868287613e5b565b9550611c9484848489613f17565b505050509392505050565b611ca7613b20565b611cb16000613f5f565b565b3360009081526006602052604090205460ff1680611cdb57506000546001600160a01b031633145b611d155760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611d698133613542565b611d8f5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611de4905b83613fbc565b6040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b158015611e5457600080fd5b505af1158015611e68573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611ee25760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016108ac565b3360009081526006602052604090205460ff1680611f0a57506000546001600160a01b031633145b611f445760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008888604051611f56929190615791565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200f9190615778565b915061205689898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896139e2565b5050979650505050505050565b6001600160a01b03821633036120e15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016108ac565b3360008181526002602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080612159846108f3565b50841663ffffffff908116908516149250505092915050565b61217a613b20565b6007546001600160a01b03161561229a5760075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b1580156121fa57600080fd5b505af115801561220e573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b15801561228157600080fd5b505af1158015612295573d6000803e3d6000fd5b505050505b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155156123d45760075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b15801561233957600080fd5b505af115801561234d573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b1580156123c057600080fd5b505af115801561164e573d6000803e3d6000fd5b50565b6000826123e48133613542565b61240a5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8360026000612418836108f3565b5091505063ffffffff82821616156124465760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff168061246e57506000546001600160a01b031633145b6124a85760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408616156124d35760405163168ab55d60e31b8152600481018890523360248201526044016108ac565b600080806124e08a6108f3565b92509250925081891798506124f78a848b84613ea5565b509698975050505050505050565b6000866125128133613542565b6125385760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b878787604051612549929190615791565b604051809103902060006125848383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040516302571be360e01b8152600481018290529091506000906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa1580156125ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061261391906156e8565b90506001600160a01b03811661265d57600061262e856108f3565b5091505060208116156126575760405163a2a7201360e01b8152600481018690526024016108ac565b50612693565b6000612668836108f3565b5091505060408116156126915760405163a2a7201360e01b8152600481018690526024016108ac565b505b3360009081526006602052604090205460ff16806126bb57506000546001600160a01b031633145b6126f55760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008b8b604051612707929190615791565b604051809103902090506127428d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b965061274f8d888a613b7a565b6040516302571be360e01b8152600481018b9052909a503092506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001691506302571be390602401602060405180830381865afa1580156127bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127df91906156e8565b6001600160a01b0316146128f6576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906306ab5923906064016020604051808303816000875af115801561287a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289e9190615778565b506128f18d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613bb9565b612902565b612902878b8b8b613c73565b5050505050509695505050505050565b8361291d8133613542565b6129435760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b3360009081526006602052604090205460ff168061296b57506000546001600160a01b031633145b6129a55760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b84601c60006129b3836108f3565b5091505063ffffffff82821616156129e15760405163a2a7201360e01b8152600481018490526024016108ac565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b158015612a7a57600080fd5b505af1158015612a8e573d6000803e3d6000fd5b505050506000612aa08960001c6108f3565b5050905061183781898b60001c60016040518060200160405280600081525061410e565b3360009081526006602052604090205460ff1680612aec57506000546001600160a01b031633145b612b265760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408051602080820186905281830185905282518083038401815260609092019092528051910120612b588133613542565b612b7e5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612bbe5760405163615a470360e01b815260040160405180910390fd5b60408051602080820187905281830186905282518083038401815260609092019092528051910120612bef90611dde565b50505050565b612bfd613b20565b6001600160a01b038216600081815260036020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b3360009081526006602052604090205460ff1680612c8557506000546001600160a01b031633145b612cbf5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008484604051612cd1929190615791565b60405190819003902090506000612d2f7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612d3d8361427a565b6007546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612d94908b908b908b90889088908d906004016157ca565b600060405180830381600087803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b505050505050505050505050565b3360009081526006602052604090205460ff1680612df857506000546001600160a01b031633145b612e325760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b600080612e79600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143089050565b915091506000612ec28288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143bf9050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528201612f2d5760405163615a470360e01b815260040160405180910390fd5b6040516302571be360e01b8152600481018290526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906302571be390602401602060405180830381865afa158015612f95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb991906156e8565b90506001600160a01b0381163314801590612ff857506001600160a01b038116600090815260026020908152604080832033845290915290205460ff16155b8015613091575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa15801561306b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308f9190615820565b155b156130b85760405163168ab55d60e31b8152600481018390523360248201526044016108ac565b6001600160a01b0386161561314a57604051630c4b7b8560e11b8152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b15801561313157600080fd5b505af1158015613145573d6000803e3d6000fd5b505050505b604051635b0fc9c360e01b8152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690635b0fc9c390604401600060405180830381600087803b1580156131b257600080fd5b505af11580156131c6573d6000803e3d6000fd5b50505050611837828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d9350915081905061447e565b3360009081526006602052604090205460ff168061323557506000546001600160a01b031633145b61326f5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008484604051613281929190615791565b6040518091039020905060006132be8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000806132cc8361427a565b6007546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af4490613328908c908c908c908c908c906000908b908b9060040161583d565b600060405180830381600087803b15801561334257600080fd5b505af1158015613356573d6000803e3d6000fd5b50505050505050505050505050565b61336d613b20565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6001600160a01b0384166133fc5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ac565b6001600160a01b03851633148061343657506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6134a85760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016108ac565b61164e858585858561410e565b6134bd613b20565b6001600160a01b0381166135395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108ac565b6123d481613f5f565b60008061354e84611a8e565b9050826001600160a01b0316816001600160a01b0316148061359557506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b3360009081526006602052604081205460ff16806135c557506000546001600160a01b031633145b6135ff5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008787604051613611929190615791565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be91906156e8565b90506001600160a01b03811633148015906136fd57506001600160a01b038116600090815260026020908152604080832033845290915290205460ff16155b8015613796575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015613770573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137949190615820565b155b1561380657604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a4016108ac565b6040516323b872dd60e01b81526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561387657600080fd5b505af115801561388a573d6000803e3d6000fd5b5050604051630a3b53db60e21b8152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b1580156138f657600080fd5b505af115801561390a573d6000803e3d6000fd5b5050505061395389898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886139e2565b9998505050505050505050565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806139aa57506001600160e01b031982166303a24d0760e21b145b806108ed57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108ed565b8451602086012060009081613a3e7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050613a4b8183876144f9565b9650613a8291507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae9050828a8a60408b178a613bb9565b6001600160a01b03841615613b1457604051630c4b7b8560e11b8152600481018290526001600160a01b0385811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b158015613afb57600080fd5b505af1158015613b0f573d6000803e3d6000fd5b505050505b50929695505050505050565b6000546001600160a01b03163314611cb15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108ac565b6000808080613b88866108f3565b919550935090506000613b9a886108f3565b92505050613ba9868383613e5b565b9550859250505093509350939050565b60008681526005602052604081208054613c5b918791613bd8906156ae565b80601f0160208091040260200160405190810160405280929190818152602001828054613c04906156ae565b8015613c515780601f10613c2657610100808354040283529160200191613c51565b820191906000526020600020905b815481529060010190602001808311613c3457829003601f168201915b50505050506145a8565b9050613c6a868286868661447e565b50505050505050565b6000613c7e856108f3565b50509050613ca281858760001c60016040518060200160405280600081525061410e565b61164e85858585613ea5565b6001600160a01b0384163b15613e535760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613cf290899089908890889088906004016158a0565b6020604051808303816000875af1925050508015613d2d575060408051601f3d908101601f19168201909252613d2a918101906158fe565b60015b613de257613d3961591b565b806308c379a003613d725750613d4d615937565b80613d585750613d74565b8060405162461bcd60e51b81526004016108ac9190614bff565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016108ac565b6001600160e01b0319811663bc197c8160e01b14613c6a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ac565b505050505050565b60008167ffffffffffffffff168467ffffffffffffffff161115613e7d578193505b8267ffffffffffffffff168467ffffffffffffffff161015613e9d578293505b509192915050565b613eb184848484613f17565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b600080613f0d836108f3565b5090949350505050565b613f218483614651565b60008481526001602052604090206001600160a01b03841663ffffffff60a01b60a085901b16176001600160c01b031960c084901b16179055612bef565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381161580613fda57506001600160a01b03811630145b1561401c576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108ac565b61402782600161214d565b156140485760405163a2a7201360e01b8152600481018390526024016108ac565b6140518261468e565b604051635b0fc9c360e01b8152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b1580156140bb57600080fd5b505af11580156140cf573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612c51565b600080600061411c866108f3565b925092509250866001600160a01b0316836001600160a01b0316036141435750505061164e565b60048216156141685760405163a2a7201360e01b8152600481018790526024016108ac565b8460011480156141895750876001600160a01b0316836001600160a01b0316145b6141e85760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ac565b60008681526001602052604090206001600160a01b03881663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e683389898989896146f7565b60075460009081906001600160a01b03166142c1576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142cb8333613542565b6142f15760405163168ab55d60e31b8152600481018490523360248201526044016108ac565b6142fa83611842565b909250905061194b8361468e565b6000808351831061435b5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016108ac565b600084848151811061436f5761436f615705565b016020015160f81c9050801561439b576143948561438e8660016159c1565b836147f3565b92506143a0565b600092505b6143aa81856159c1565b6143b59060016159c1565b9150509250929050565b60008060006143ce8585614308565b90925090508161444057600185516143e691906159d9565b84146144345760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016108ac565b50600091506108ed9050565b61444a85826143bf565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6000858152600560209081526040909120855161449d92870190614a7a565b506144a88583614651565b6144b485848484614817565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516144ea94939291906159f0565b60405180910390a25050505050565b6000808080614507876108f3565b604051636b727d4360e11b8152600481018a905292965090945091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015614577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061459b9190615778565b9050613ba9868383613e5b565b60606001835110156145e6576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561462457826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016108ac9190614bff565b8251838360405160200161463a93929190615a38565b604051602081830303815290604052905092915050565b63ffffffbf8116158015906146695750604181811614155b1561468a5760405163a2a7201360e01b8152600481018390526024016108ac565b5050565b600061469982611a8e565b600083815260016020526040812055905060408051838152600160208201526000916001600160a01b0384169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050565b6001600160a01b0384163b15613e535760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061473b9089908990889088908890600401615a99565b6020604051808303816000875af1925050508015614776575060408051601f3d908101601f19168201909252614773918101906158fe565b60015b61478257613d3961591b565b6001600160e01b0319811663f23a6e6160e01b14613c6a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ac565b825160009061480283856159c1565b111561480d57600080fd5b5091016020012090565b600061482285611a8e565b90506001600160a01b038116156148735761483c8561468e565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b61164e8585858583600061488682611a8e565b90506001600160a01b038116156148df5760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e0060448201526064016108ac565b6001600160a01b03851661495b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b306001600160a01b038616036149d95760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e747261637400000000000000000000000060648201526084016108ac565b60008281526001602052604090206001600160a01b03861663ffffffff60a01b60a087901b16176001600160c01b031960c086901b1617905560408051838152600160208201526001600160a01b0387169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613e5333600087856001604051806020016040528060008152506146f7565b828054614a86906156ae565b90600052602060002090601f016020900481019282614aa85760008555614aee565b82601f10614ac157805160ff1916838001178555614aee565b82800160010185558215614aee579182015b82811115614aee578251825591602001919060010190614ad3565b50614afa929150614afe565b5090565b5b80821115614afa5760008155600101614aff565b6001600160a01b03811681146123d457600080fd5b60008060408385031215614b3b57600080fd5b8235614b4681614b13565b946020939093013593505050565b600060208284031215614b6657600080fd5b5035919050565b6001600160e01b0319811681146123d457600080fd5b600060208284031215614b9557600080fd5b8135614ba081614b6d565b9392505050565b60005b83811015614bc2578181015183820152602001614baa565b83811115612bef5750506000910152565b60008151808452614beb816020860160208601614ba7565b601f01601f19169290920160200192915050565b602081526000614ba06020830184614bd3565b803567ffffffffffffffff81168114614c2a57600080fd5b919050565b60008060408385031215614c4257600080fd5b82359150614c5260208401614c12565b90509250929050565b60008083601f840112614c6d57600080fd5b50813567ffffffffffffffff811115614c8557600080fd5b602083019150836020828501011115614c9d57600080fd5b9250929050565b600080600080600060808688031215614cbc57600080fd5b8535614cc781614b13565b94506020860135614cd781614b13565b935060408601359250606086013567ffffffffffffffff811115614cfa57600080fd5b614d0688828901614c5b565b969995985093965092949392505050565b600060208284031215614d2957600080fd5b8135614ba081614b13565b60008060408385031215614d4757600080fd5b823591506020830135614d5981614b13565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715614da057614da0614d64565b6040525050565b600067ffffffffffffffff821115614dc157614dc1614d64565b50601f01601f191660200190565b600082601f830112614de057600080fd5b8135614deb81614da7565b604051614df88282614d7a565b828152856020848701011115614e0d57600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614c2a57600080fd5b600080600080600080600060e0888a031215614e5a57600080fd5b87359650602088013567ffffffffffffffff811115614e7857600080fd5b614e848a828b01614dcf565b9650506040880135614e9581614b13565b94506060880135614ea581614b13565b9350614eb360808901614c12565b9250614ec160a08901614e2b565b9150614ecf60c08901614c12565b905092959891949750929550565b600067ffffffffffffffff821115614ef757614ef7614d64565b5060051b60200190565b600082601f830112614f1257600080fd5b81356020614f1f82614edd565b604051614f2c8282614d7a565b83815260059390931b8501820192828101915086841115614f4c57600080fd5b8286015b84811015614f675780358352918301918301614f50565b509695505050505050565b600080600080600060a08688031215614f8a57600080fd5b8535614f9581614b13565b94506020860135614fa581614b13565b9350604086013567ffffffffffffffff80821115614fc257600080fd5b614fce89838a01614f01565b94506060880135915080821115614fe457600080fd5b614ff089838a01614f01565b9350608088013591508082111561500657600080fd5b5061501388828901614dcf565b9150509295509295909350565b6000806000806080858703121561503657600080fd5b843593506020850135925061504d60408601614e2b565b915061505b60608601614c12565b905092959194509250565b6000806040838503121561507957600080fd5b823567ffffffffffffffff8082111561509157600080fd5b818501915085601f8301126150a557600080fd5b813560206150b282614edd565b6040516150bf8282614d7a565b83815260059390931b85018201928281019150898411156150df57600080fd5b948201945b838610156151065785356150f781614b13565b825294820194908201906150e4565b9650508601359250508082111561511c57600080fd5b506143b585828601614f01565b600081518084526020808501945080840160005b838110156151595781518752958201959082019060010161513d565b509495945050505050565b602081526000614ba06020830184615129565b60008060006060848603121561518c57600080fd5b83359250602084013591506151a360408501614c12565b90509250925092565b6000806000606084860312156151c157600080fd5b8335925060208401356151d381614b13565b915060408401356151e381614b13565b809150509250925092565b600080600080600080600060c0888a03121561520957600080fd5b873567ffffffffffffffff81111561522057600080fd5b61522c8a828b01614c5b565b909850965050602088013561524081614b13565b945060408801359350606088013561525781614b13565b925061526560808901614e2b565b9150614ecf60a08901614c12565b80151581146123d457600080fd5b6000806040838503121561529457600080fd5b823561529f81614b13565b91506020830135614d5981615273565b600080604083850312156152c257600080fd5b82359150614c5260208401614e2b565b60008060008060008060a087890312156152eb57600080fd5b86359550602087013567ffffffffffffffff81111561530957600080fd5b61531589828a01614c5b565b909650945050604087013561532981614b13565b925061533760608801614e2b565b915061534560808801614c12565b90509295509295509295565b6000806000806080858703121561536757600080fd5b84359350602085013561537981614b13565b9250604085013561504d81614b13565b60008060006060848603121561539e57600080fd5b833592506020840135915060408401356151e381614b13565b600080600080606085870312156153cd57600080fd5b843567ffffffffffffffff8111156153e457600080fd5b6153f087828801614c5b565b909550935050602085013561540481614b13565b9150604085013561541481614b13565b939692955090935050565b6000806040838503121561543257600080fd5b823561543d81614b13565b91506020830135614d5981614b13565b60008060008060006080868803121561546557600080fd5b85359450602086013567ffffffffffffffff81111561548357600080fd5b61548f88828901614c5b565b90955093505060408601356154a381614b13565b915060608601356154b381614b13565b809150509295509295909350565b600080600080600060a086880312156154d957600080fd5b85356154e481614b13565b945060208601356154f481614b13565b93506040860135925060608601359150608086013567ffffffffffffffff81111561551e57600080fd5b61501388828901614dcf565b60008060008060008060a0878903121561554357600080fd5b863567ffffffffffffffff81111561555a57600080fd5b61556689828a01614c5b565b909750955050602087013561557a81614b13565b935061558860408801614e2b565b925061559660608801614c12565b915060808701356155a681614b13565b809150509295509295509295565b6000602082840312156155c657600080fd5b815167ffffffffffffffff8111156155dd57600080fd5b8201601f810184136155ee57600080fd5b80516155f981614da7565b6040516156068282614d7a565b82815286602084860101111561561b57600080fd5b61562c836020830160208701614ba7565b9695505050505050565b600080600080600060a0868803121561564e57600080fd5b853567ffffffffffffffff81111561566557600080fd5b61567188828901614dcf565b955050602086013561568281614b13565b935061569060408701614e2b565b925061569e60608701614c12565b915060808601356154b381614b13565b600181811c908216806156c257607f821691505b6020821081036156e257634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156156fa57600080fd5b8151614ba081614b13565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016157435761574361571b565b5060010190565b60408152600061575d6040830185615129565b828103602084015261576f8185615129565b95945050505050565b60006020828403121561578a57600080fd5b5051919050565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60a0815260006157de60a08301888a6157a1565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b60006020828403121561583257600080fd5b8151614ba081615273565b88815260e06020820152600061585760e08301898b6157a1565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b60006001600160a01b03808816835280871660208401525060a060408301526158cc60a0830186615129565b82810360608401526158de8186615129565b905082810360808401526158f28185614bd3565b98975050505050505050565b60006020828403121561591057600080fd5b8151614ba081614b6d565b600060033d11156159345760046000803e5060005160e01c5b90565b600060443d10156159455790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561597557505050505090565b828501915081518181111561598d5750505050505090565b843d87010160208285010111156159a75750505050505090565b6159b660208286010187614d7a565b509095945050505050565b600082198211156159d4576159d461571b565b500190565b6000828210156159eb576159eb61571b565b500390565b608081526000615a036080830187614bd3565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615a75816001850160208801614ba7565b835190830190615a8c816001840160208801614ba7565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615ad160a0830184614bd3565b97965050505050505056fe6f6e6c7920617574686f72697a656420616e64206f776e657200000000000000a2646970667358221220aa8d8fab69aba82c30dfefd45673c85a1138fa8d038bb1da5f8baeaa00891b9f64736f6c634300080d003300000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea850000000000000000000000009a6f5e6a86f42e34c613f7bf8ee727863dd7e1c6

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106103095760003560e01c80638da5cb5b1161019c578063da8c229e116100ee578063ee7eba7811610097578063f2fde38b11610071578063f2fde38b146107e0578063f44779b9146107f3578063f9547a9e1461080657600080fd5b8063ee7eba78146107a7578063eecea000146107ba578063f242432a146107cd57600080fd5b8063e985e9c5116100c8578063e985e9c514610738578063eb8ae53014610774578063ed70554d1461078757600080fd5b8063da8c229e146106ef578063e0dba60f14610712578063e72bf00f1461072557600080fd5b8063b6bcad2611610150578063c658e0861161012a578063c658e086146106b6578063cf408823146106c9578063d8c9921a146106dc57600080fd5b8063b6bcad2614610658578063b91816111461066b578063c20a2eb01461068e57600080fd5b80639f56dac6116101815780639f56dac61461061f578063a22cb46514610632578063adf4960a1461064557600080fd5b80638da5cb5b146105d257806395d89b41146105e357600080fd5b806324c1af44116102605780634e1273f4116102095780636846f2f7116101e35780636846f2f7146105a4578063715018a6146105b75780638b4dfa75146105bf57600080fd5b80634e1273f41461055e578063530954671461057e5780636352211e1461059157600080fd5b806333c69ea91161023a57806333c69ea9146104ec5780633f15457f146104ff5780634ac07f411461052657600080fd5b806324c1af441461049f5780632b20e397146104b25780632eb2c2d6146104d957600080fd5b806314ab9038116102c25780631896f70a1161029c5780631896f70a1461044e5780631f4e15041461046157806320c38e2b1461048c57600080fd5b806314ab9038146103fa578063150b7a021461040f5780631534e1771461043b57600080fd5b806301ffc9a7116102f357806301ffc9a71461037b57806306fdde031461039e5780630e89341c146103e757600080fd5b8062fdd58e1461030e5780630178fe3f14610334575b600080fd5b61032161031c366004614b28565b610832565b6040519081526020015b60405180910390f35b610347610342366004614b54565b6108f3565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff169082015260600161032b565b61038e610389366004614b83565b61092a565b604051901515815260200161032b565b6103da6040518060400160405280600d81526020017f2e6561727468204e6f6d6164730000000000000000000000000000000000000081525081565b60405161032b9190614bff565b6103da6103f5366004614b54565b610968565b61040d610408366004614c2f565b6109dc565b005b61042261041d366004614ca4565b610b57565b6040516001600160e01b0319909116815260200161032b565b61040d610449366004614d17565b610ce6565b61040d61045c366004614d34565b610d1d565b600754610474906001600160a01b031681565b6040516001600160a01b03909116815260200161032b565b6103da61049a366004614b54565b610e41565b61040d6104ad366004614e3f565b610edb565b6104747f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea8581565b61040d6104e7366004614f72565b61130b565b61040d6104fa366004615020565b611655565b6104747f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e81565b610539610534366004614b54565b611842565b6040805163ffffffff909316835267ffffffffffffffff90911660208301520161032b565b61057161056c366004615066565b611950565b60405161032b9190615164565b600454610474906001600160a01b031681565b61047461059f366004614b54565b611a8e565b6103216105b2366004615177565b611a99565b61040d611c9f565b61040d6105cd3660046151ac565b611cb3565b6000546001600160a01b0316610474565b6103da6040518060400160405280600581526020017f4e4f4d414400000000000000000000000000000000000000000000000000000081525081565b61032161062d3660046151ee565b611e72565b61040d610640366004615281565b612063565b61038e6106533660046152af565b61214d565b61040d610666366004614d17565b612172565b61038e610679366004614d17565b60066020526000908152604090205460ff1681565b6106a161069c3660046152af565b6123d7565b60405163ffffffff909116815260200161032b565b6103216106c43660046152d2565b612505565b61040d6106d7366004615351565b612912565b61040d6106ea366004615389565b612ac4565b61038e6106fd366004614d17565b60036020526000908152604090205460ff1681565b61040d610720366004615281565b612bf5565b61040d6107333660046153b7565b612c5d565b61038e61074636600461541f565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b61040d6107823660046153b7565b612dd0565b610321610795366004614b54565b60016020526000908152604090205481565b61040d6107b536600461544d565b61320d565b61040d6107c8366004615281565b613365565b61040d6107db3660046154c1565b613398565b61040d6107ee366004614d17565b6134b5565b61038e610801366004614d34565b613542565b61081961081436600461552a565b61359d565b60405167ffffffffffffffff909116815260200161032b565b60006001600160a01b0383166108b55760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60006108c0836108f3565b50509050836001600160a01b0316816001600160a01b0316036108e75760019150506108ed565b60009150505b92915050565b6000818152600160205260408120549060c082901c824282101561091a5760009250610922565b60a081901c92505b509193909250565b60006001600160e01b031982167f71bc02720000000000000000000000000000000000000000000000000000000014806108ed57506108ed82613960565b600480546040516303a24d0760e21b81529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa1580156109b4573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526108ed91908101906155b4565b816109e78133613542565b610a0d5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8260106000610a1b836108f3565b5091505063ffffffff8282161615610a495760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff1680610a7157506000546001600160a01b031633145b610aab5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316906314ab9038906044015b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea851614610bbb576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610bcd87890189615636565b84516020860120949950929750909550935091508990808214610c26576040517fc65c3ccc00000000000000000000000000000000000000000000000000000000815260048101829052602481018390526044016108ac565b604051630a3b53db60e21b8152600481018390523060248201527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610c8e57600080fd5b505af1158015610ca2573d6000803e3d6000fd5b50505050610cb387878787876139e2565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b610cee613b20565b6004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b81610d288133613542565b610d4e5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8260086000610d5c836108f3565b5091505063ffffffff8282161615610d8a5760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff1680610db257506000546001600160a01b031633145b610dec5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604051630c4b7b8560e11b8152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690631896f70a90604401610b1d565b60056020526000908152604090208054610e5a906156ae565b80601f0160208091040260200160405190810160405280929190818152602001828054610e86906156ae565b8015610ed35780601f10610ea857610100808354040283529160200191610ed3565b820191906000526020600020905b815481529060010190602001808311610eb657829003601f168201915b505050505081565b86610ee68133613542565b610f0c5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8787805190602001206000610f488383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040516302571be360e01b8152600481018290529091506000906001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16906302571be390602401602060405180830381865afa158015610fb3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd791906156e8565b90506001600160a01b038116611021576000610ff2856108f3565b50915050602081161561101b5760405163a2a7201360e01b8152600481018690526024016108ac565b50611057565b600061102c836108f3565b5091505060408116156110555760405163a2a7201360e01b8152600481018690526024016108ac565b505b3360009081526006602052604090205460ff168061107f57506000546001600160a01b031633145b6110b95760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b8a5160208c012060006110f38e83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506111008e828a613b7a565b6040516302571be360e01b815260048101859052909a503092506001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1691506302571be390602401602060405180830381865afa15801561116c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119091906156e8565b6001600160a01b031614611250576040516305ef2c7f60e41b8152600481018f9052602481018390523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690635ef2c7f09060a401600060405180830381600087803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b5050505061124b8e828f8f8d8d613bb9565b6112fb565b6040516305ef2c7f60e41b8152600481018f9052602481018390523060448201526001600160a01b038c8116606483015267ffffffffffffffff8c1660848301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690635ef2c7f09060a401600060405180830381600087803b1580156112d757600080fd5b505af11580156112eb573d6000803e3d6000fd5b505050506112fb818d8b8b613c73565b5050505050505050505050505050565b81518351146113825760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d6174636800000000000000000000000000000000000000000000000060648201526084016108ac565b6001600160a01b0384166113e65760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ac565b6001600160a01b03851633148061142057506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6114925760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f766564000000000000000000000000000060648201526084016108ac565b60005b83518110156115e85760008482815181106114b2576114b2615705565b6020026020010151905060008483815181106114d0576114d0615705565b6020026020010151905060008060006114e8856108f3565b9250925092506114f9826004161590565b6115195760405163a2a7201360e01b8152600481018690526024016108ac565b83600114801561153a57508a6001600160a01b0316836001600160a01b0316145b6115995760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ac565b60008581526001602052604090206001600160a01b038b1663ffffffff60a01b60a085901b16176001600160c01b031960c084901b161790555050505050806115e190615731565b9050611495565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb868660405161163892919061574a565b60405180910390a461164e338686868686613cae565b5050505050565b3360009081526006602052604090205460ff168061167d57506000546001600160a01b031633145b6116b75760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408051602080820187905281830186905282518083038401815260609092019092528051910120600080806116ec846108f3565b9194509250905060007f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b5289016117dc576117268533613542565b61174c5760405163168ab55d60e31b8152600481018690523360248201526044016108ac565b604051636b727d4360e11b8152600481018990527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b03169063d6e4fa8690602401602060405180830381865afa1580156117b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d59190615778565b905061181a565b6117e68933613542565b61180c5760405163168ab55d60e31b8152600481018690523360248201526044016108ac565b611815896108f3565b925050505b611825868383613e5b565b96831796955061183785858989613ea5565b505050505050505050565b60008061184e836108f3565b90935091505063ffffffff8216158015611870575067ffffffffffffffff8116155b1561194b576000838152600560205260408120805461188e906156ae565b80601f01602080910402602001604051908101604052809291908181526020018280546118ba906156ae565b80156119075780601f106118dc57610100808354040283529160200191611907565b820191906000526020600020905b8154815290600101906020018083116118ea57829003601f168201915b505050505090508051600003611949576040517f3b4d540000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505b915091565b606081518351146119c95760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d61746368000000000000000000000000000000000000000000000060648201526084016108ac565b6000835167ffffffffffffffff8111156119e5576119e5614d64565b604051908082528060200260200182016040528015611a0e578160200160208202803683370190505b50905060005b8451811015611a8657611a59858281518110611a3257611a32615705565b6020026020010151858381518110611a4c57611a4c615705565b6020026020010151610832565b828281518110611a6b57611a6b615705565b6020908102919091010152611a7f81615731565b9050611a14565b509392505050565b60006108ed82613f01565b3360009081526003602052604081205460ff16611b095760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016108ac565b3360009081526006602052604090205460ff1680611b3157506000546001600160a01b031633145b611b6b5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae602080830191909152818301879052825180830384018152606090920190925280519101206000906040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101879052602481018690529091507f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b03169063c475abff906044016020604051808303816000875af1158015611c42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c669190615778565b915060008080611c75846108f3565b925092509250611c86868287613e5b565b9550611c9484848489613f17565b505050509392505050565b611ca7613b20565b611cb16000613f5f565b565b3360009081526006602052604090205460ff1680611cdb57506000546001600160a01b031633145b611d155760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830186905282518083038401815260609092019092528051910120611d698133613542565b611d8f5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60208083019190915281830187905282518083038401815260609092019092528051910120611de4905b83613fbc565b6040516323b872dd60e01b81523060048201526001600160a01b038481166024830152604482018690527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea8516906323b872dd90606401600060405180830381600087803b158015611e5457600080fd5b505af1158015611e68573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff16611ee25760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f604482015267373a3937b63632b960c11b60648201526084016108ac565b3360009081526006602052604090205460ff1680611f0a57506000546001600160a01b031633145b611f445760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008888604051611f56929190615791565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611feb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061200f9190615778565b915061205689898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896139e2565b5050979650505050505050565b6001600160a01b03821633036120e15760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c66000000000000000000000000000000000000000000000060648201526084016108ac565b3360008181526002602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080612159846108f3565b50841663ffffffff908116908516149250505092915050565b61217a613b20565b6007546001600160a01b03161561229a5760075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea859091169063a22cb46590604401600060405180830381600087803b1580156121fa57600080fd5b505af115801561220e573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e909116925063a22cb4659150604401600060405180830381600087803b15801561228157600080fd5b505af1158015612295573d6000803e3d6000fd5b505050505b6007805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316908117909155156123d45760075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea859091169063a22cb46590604401600060405180830381600087803b15801561233957600080fd5b505af115801561234d573d6000803e3d6000fd5b505060075460405163a22cb46560e01b81526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e909116925063a22cb4659150604401600060405180830381600087803b1580156123c057600080fd5b505af115801561164e573d6000803e3d6000fd5b50565b6000826123e48133613542565b61240a5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b8360026000612418836108f3565b5091505063ffffffff82821616156124465760405163a2a7201360e01b8152600481018490526024016108ac565b3360009081526006602052604090205460ff168061246e57506000546001600160a01b031633145b6124a85760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408616156124d35760405163168ab55d60e31b8152600481018890523360248201526044016108ac565b600080806124e08a6108f3565b92509250925081891798506124f78a848b84613ea5565b509698975050505050505050565b6000866125128133613542565b6125385760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b878787604051612549929190615791565b604051809103902060006125848383604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b6040516302571be360e01b8152600481018290529091506000906001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16906302571be390602401602060405180830381865afa1580156125ef573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061261391906156e8565b90506001600160a01b03811661265d57600061262e856108f3565b5091505060208116156126575760405163a2a7201360e01b8152600481018690526024016108ac565b50612693565b6000612668836108f3565b5091505060408116156126915760405163a2a7201360e01b8152600481018690526024016108ac565b505b3360009081526006602052604090205460ff16806126bb57506000546001600160a01b031633145b6126f55760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008b8b604051612707929190615791565b604051809103902090506127428d82604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b965061274f8d888a613b7a565b6040516302571be360e01b8152600481018b9052909a503092506001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1691506302571be390602401602060405180830381865afa1580156127bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127df91906156e8565b6001600160a01b0316146128f6576040517f06ab5923000000000000000000000000000000000000000000000000000000008152600481018e9052602481018290523060448201526001600160a01b037f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e16906306ab5923906064016020604051808303816000875af115801561287a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061289e9190615778565b506128f18d888e8e8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050508d8d8d613bb9565b612902565b612902878b8b8b613c73565b5050505050509695505050505050565b8361291d8133613542565b6129435760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b3360009081526006602052604090205460ff168061296b57506000546001600160a01b031633145b6129a55760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b84601c60006129b3836108f3565b5091505063ffffffff82821616156129e15760405163a2a7201360e01b8152600481018490526024016108ac565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e169063cf40882390608401600060405180830381600087803b158015612a7a57600080fd5b505af1158015612a8e573d6000803e3d6000fd5b505050506000612aa08960001c6108f3565b5050905061183781898b60001c60016040518060200160405280600081525061410e565b3360009081526006602052604090205460ff1680612aec57506000546001600160a01b031633145b612b265760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60408051602080820186905281830185905282518083038401815260609092019092528051910120612b588133613542565b612b7e5760405163168ab55d60e31b8152600481018290523360248201526044016108ac565b7f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528401612bbe5760405163615a470360e01b815260040160405180910390fd5b60408051602080820187905281830186905282518083038401815260609092019092528051910120612bef90611dde565b50505050565b612bfd613b20565b6001600160a01b038216600081815260036020908152604091829020805460ff191685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b3360009081526006602052604090205460ff1680612c8557506000546001600160a01b031633145b612cbf5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008484604051612cd1929190615791565b60405190819003902090506000612d2f7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080612d3d8361427a565b6007546040517ff9547a9e0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b03169063f9547a9e90612d94908b908b908b90889088908d906004016157ca565b600060405180830381600087803b158015612dae57600080fd5b505af1158015612dc2573d6000803e3d6000fd5b505050505050505050505050565b3360009081526006602052604090205460ff1680612df857506000546001600160a01b031633145b612e325760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b600080612e79600087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143089050565b915091506000612ec28288888080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506143bf9050565b604080516020808201849052818301879052825180830384018152606090920190925280519101209091507f6c32148f748aba23997146d7fe89e962e3cc30271290fb96f5f4337756c03b528201612f2d5760405163615a470360e01b815260040160405180910390fd5b6040516302571be360e01b8152600481018290526000907f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b0316906302571be390602401602060405180830381865afa158015612f95573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612fb991906156e8565b90506001600160a01b0381163314801590612ff857506001600160a01b038116600090815260026020908152604080832033845290915290205460ff16155b8015613091575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e169063e985e9c590604401602060405180830381865afa15801561306b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061308f9190615820565b155b156130b85760405163168ab55d60e31b8152600481018390523360248201526044016108ac565b6001600160a01b0386161561314a57604051630c4b7b8560e11b8152600481018390526001600160a01b0387811660248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690631896f70a90604401600060405180830381600087803b15801561313157600080fd5b505af1158015613145573d6000803e3d6000fd5b505050505b604051635b0fc9c360e01b8152600481018390523060248201527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e6001600160a01b031690635b0fc9c390604401600060405180830381600087803b1580156131b257600080fd5b505af11580156131c6573d6000803e3d6000fd5b50505050611837828a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052508d9350915081905061447e565b3360009081526006602052604090205460ff168061323557506000546001600160a01b031633145b61326f5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008484604051613281929190615791565b6040518091039020905060006132be8783604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000806132cc8361427a565b6007546040517f24c1af440000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b0316906324c1af4490613328908c908c908c908c908c906000908b908b9060040161583d565b600060405180830381600087803b15801561334257600080fd5b505af1158015613356573d6000803e3d6000fd5b50505050505050505050505050565b61336d613b20565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6001600160a01b0384166133fc5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604482015264647265737360d81b60648201526084016108ac565b6001600160a01b03851633148061343657506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6134a85760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f766564000000000000000000000000000000000000000000000060648201526084016108ac565b61164e858585858561410e565b6134bd613b20565b6001600160a01b0381166135395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016108ac565b6123d481613f5f565b60008061354e84611a8e565b9050826001600160a01b0316816001600160a01b0316148061359557506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b3360009081526006602052604081205460ff16806135c557506000546001600160a01b031633145b6135ff5760405162461bcd60e51b81526020600482015260196024820152600080516020615add83398151915260448201526064016108ac565b60008787604051613611929190615791565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b031690636352211e90602401602060405180830381865afa15801561369a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136be91906156e8565b90506001600160a01b03811633148015906136fd57506001600160a01b038116600090815260026020908152604080832033845290915290205460ff16155b8015613796575060405163e985e9c560e01b81526001600160a01b0382811660048301523360248301527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea85169063e985e9c590604401602060405180830381865afa158015613770573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137949190615820565b155b1561380657604080517f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a4016108ac565b6040516323b872dd60e01b81526001600160a01b038281166004830152306024830152604482018490527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea8516906323b872dd90606401600060405180830381600087803b15801561387657600080fd5b505af115801561388a573d6000803e3d6000fd5b5050604051630a3b53db60e21b8152600481018590523060248201527f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b1580156138f657600080fd5b505af115801561390a573d6000803e3d6000fd5b5050505061395389898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886139e2565b9998505050505050505050565b60006001600160e01b031982167fd9b67a260000000000000000000000000000000000000000000000000000000014806139aa57506001600160e01b031982166303a24d0760e21b145b806108ed57507f01ffc9a7000000000000000000000000000000000000000000000000000000006001600160e01b03198316146108ed565b8451602086012060009081613a3e7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae83604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050613a4b8183876144f9565b9650613a8291507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae9050828a8a60408b178a613bb9565b6001600160a01b03841615613b1457604051630c4b7b8560e11b8152600481018290526001600160a01b0385811660248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690631896f70a90604401600060405180830381600087803b158015613afb57600080fd5b505af1158015613b0f573d6000803e3d6000fd5b505050505b50929695505050505050565b6000546001600160a01b03163314611cb15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016108ac565b6000808080613b88866108f3565b919550935090506000613b9a886108f3565b92505050613ba9868383613e5b565b9550859250505093509350939050565b60008681526005602052604081208054613c5b918791613bd8906156ae565b80601f0160208091040260200160405190810160405280929190818152602001828054613c04906156ae565b8015613c515780601f10613c2657610100808354040283529160200191613c51565b820191906000526020600020905b815481529060010190602001808311613c3457829003601f168201915b50505050506145a8565b9050613c6a868286868661447e565b50505050505050565b6000613c7e856108f3565b50509050613ca281858760001c60016040518060200160405280600081525061410e565b61164e85858585613ea5565b6001600160a01b0384163b15613e535760405163bc197c8160e01b81526001600160a01b0385169063bc197c8190613cf290899089908890889088906004016158a0565b6020604051808303816000875af1925050508015613d2d575060408051601f3d908101601f19168201909252613d2a918101906158fe565b60015b613de257613d3961591b565b806308c379a003613d725750613d4d615937565b80613d585750613d74565b8060405162461bcd60e51b81526004016108ac9190614bff565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e74657200000000000000000000000060648201526084016108ac565b6001600160e01b0319811663bc197c8160e01b14613c6a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ac565b505050505050565b60008167ffffffffffffffff168467ffffffffffffffff161115613e7d578193505b8267ffffffffffffffff168467ffffffffffffffff161015613e9d578293505b509192915050565b613eb184848484613f17565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b600080613f0d836108f3565b5090949350505050565b613f218483614651565b60008481526001602052604090206001600160a01b03841663ffffffff60a01b60a085901b16176001600160c01b031960c084901b16179055612bef565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381161580613fda57506001600160a01b03811630145b1561401c576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b03821660048201526024016108ac565b61402782600161214d565b156140485760405163a2a7201360e01b8152600481018390526024016108ac565b6140518261468e565b604051635b0fc9c360e01b8152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e1690635b0fc9c390604401600060405180830381600087803b1580156140bb57600080fd5b505af11580156140cf573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49150602001612c51565b600080600061411c866108f3565b925092509250866001600160a01b0316836001600160a01b0316036141435750505061164e565b60048216156141685760405163a2a7201360e01b8152600481018790526024016108ac565b8460011480156141895750876001600160a01b0316836001600160a01b0316145b6141e85760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201526939103a3930b739b332b960b11b60648201526084016108ac565b60008681526001602052604090206001600160a01b03881663ffffffff60a01b60a085901b16176001600160c01b031960c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4611e683389898989896146f7565b60075460009081906001600160a01b03166142c1576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6142cb8333613542565b6142f15760405163168ab55d60e31b8152600481018490523360248201526044016108ac565b6142fa83611842565b909250905061194b8361468e565b6000808351831061435b5760405162461bcd60e51b815260206004820152601e60248201527f726561644c6162656c3a20496e646578206f7574206f6620626f756e6473000060448201526064016108ac565b600084848151811061436f5761436f615705565b016020015160f81c9050801561439b576143948561438e8660016159c1565b836147f3565b92506143a0565b600092505b6143aa81856159c1565b6143b59060016159c1565b9150509250929050565b60008060006143ce8585614308565b90925090508161444057600185516143e691906159d9565b84146144345760405162461bcd60e51b815260206004820152601d60248201527f6e616d65686173683a204a756e6b20617420656e64206f66206e616d6500000060448201526064016108ac565b50600091506108ed9050565b61444a85826143bf565b6040805160208101929092528101839052606001604051602081830303815290604052805190602001209250505092915050565b6000858152600560209081526040909120855161449d92870190614a7a565b506144a88583614651565b6144b485848484614817565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd340858585856040516144ea94939291906159f0565b60405180910390a25050505050565b6000808080614507876108f3565b604051636b727d4360e11b8152600481018a905292965090945091506000907f00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea856001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015614577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061459b9190615778565b9050613ba9868383613e5b565b60606001835110156145e6576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff8351111561462457826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016108ac9190614bff565b8251838360405160200161463a93929190615a38565b604051602081830303815290604052905092915050565b63ffffffbf8116158015906146695750604181811614155b1561468a5760405163a2a7201360e01b8152600481018390526024016108ac565b5050565b600061469982611a8e565b600083815260016020526040812055905060408051838152600160208201526000916001600160a01b0384169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a45050565b6001600160a01b0384163b15613e535760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e619061473b9089908990889088908890600401615a99565b6020604051808303816000875af1925050508015614776575060408051601f3d908101601f19168201909252614773918101906158fe565b60015b61478257613d3961591b565b6001600160e01b0319811663f23a6e6160e01b14613c6a5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a656374656044820152676420746f6b656e7360c01b60648201526084016108ac565b825160009061480283856159c1565b111561480d57600080fd5b5091016020012090565b600061482285611a8e565b90506001600160a01b038116156148735761483c8561468e565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b61164e8585858583600061488682611a8e565b90506001600160a01b038116156148df5760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e0060448201526064016108ac565b6001600160a01b03851661495b5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f730000000000000000000000000000000000000000000000000000000000000060648201526084016108ac565b306001600160a01b038616036149d95760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e747261637400000000000000000000000060648201526084016108ac565b60008281526001602052604090206001600160a01b03861663ffffffff60a01b60a087901b16176001600160c01b031960c086901b1617905560408051838152600160208201526001600160a01b0387169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a4613e5333600087856001604051806020016040528060008152506146f7565b828054614a86906156ae565b90600052602060002090601f016020900481019282614aa85760008555614aee565b82601f10614ac157805160ff1916838001178555614aee565b82800160010185558215614aee579182015b82811115614aee578251825591602001919060010190614ad3565b50614afa929150614afe565b5090565b5b80821115614afa5760008155600101614aff565b6001600160a01b03811681146123d457600080fd5b60008060408385031215614b3b57600080fd5b8235614b4681614b13565b946020939093013593505050565b600060208284031215614b6657600080fd5b5035919050565b6001600160e01b0319811681146123d457600080fd5b600060208284031215614b9557600080fd5b8135614ba081614b6d565b9392505050565b60005b83811015614bc2578181015183820152602001614baa565b83811115612bef5750506000910152565b60008151808452614beb816020860160208601614ba7565b601f01601f19169290920160200192915050565b602081526000614ba06020830184614bd3565b803567ffffffffffffffff81168114614c2a57600080fd5b919050565b60008060408385031215614c4257600080fd5b82359150614c5260208401614c12565b90509250929050565b60008083601f840112614c6d57600080fd5b50813567ffffffffffffffff811115614c8557600080fd5b602083019150836020828501011115614c9d57600080fd5b9250929050565b600080600080600060808688031215614cbc57600080fd5b8535614cc781614b13565b94506020860135614cd781614b13565b935060408601359250606086013567ffffffffffffffff811115614cfa57600080fd5b614d0688828901614c5b565b969995985093965092949392505050565b600060208284031215614d2957600080fd5b8135614ba081614b13565b60008060408385031215614d4757600080fd5b823591506020830135614d5981614b13565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b601f8201601f1916810167ffffffffffffffff81118282101715614da057614da0614d64565b6040525050565b600067ffffffffffffffff821115614dc157614dc1614d64565b50601f01601f191660200190565b600082601f830112614de057600080fd5b8135614deb81614da7565b604051614df88282614d7a565b828152856020848701011115614e0d57600080fd5b82602086016020830137600092810160200192909252509392505050565b803563ffffffff81168114614c2a57600080fd5b600080600080600080600060e0888a031215614e5a57600080fd5b87359650602088013567ffffffffffffffff811115614e7857600080fd5b614e848a828b01614dcf565b9650506040880135614e9581614b13565b94506060880135614ea581614b13565b9350614eb360808901614c12565b9250614ec160a08901614e2b565b9150614ecf60c08901614c12565b905092959891949750929550565b600067ffffffffffffffff821115614ef757614ef7614d64565b5060051b60200190565b600082601f830112614f1257600080fd5b81356020614f1f82614edd565b604051614f2c8282614d7a565b83815260059390931b8501820192828101915086841115614f4c57600080fd5b8286015b84811015614f675780358352918301918301614f50565b509695505050505050565b600080600080600060a08688031215614f8a57600080fd5b8535614f9581614b13565b94506020860135614fa581614b13565b9350604086013567ffffffffffffffff80821115614fc257600080fd5b614fce89838a01614f01565b94506060880135915080821115614fe457600080fd5b614ff089838a01614f01565b9350608088013591508082111561500657600080fd5b5061501388828901614dcf565b9150509295509295909350565b6000806000806080858703121561503657600080fd5b843593506020850135925061504d60408601614e2b565b915061505b60608601614c12565b905092959194509250565b6000806040838503121561507957600080fd5b823567ffffffffffffffff8082111561509157600080fd5b818501915085601f8301126150a557600080fd5b813560206150b282614edd565b6040516150bf8282614d7a565b83815260059390931b85018201928281019150898411156150df57600080fd5b948201945b838610156151065785356150f781614b13565b825294820194908201906150e4565b9650508601359250508082111561511c57600080fd5b506143b585828601614f01565b600081518084526020808501945080840160005b838110156151595781518752958201959082019060010161513d565b509495945050505050565b602081526000614ba06020830184615129565b60008060006060848603121561518c57600080fd5b83359250602084013591506151a360408501614c12565b90509250925092565b6000806000606084860312156151c157600080fd5b8335925060208401356151d381614b13565b915060408401356151e381614b13565b809150509250925092565b600080600080600080600060c0888a03121561520957600080fd5b873567ffffffffffffffff81111561522057600080fd5b61522c8a828b01614c5b565b909850965050602088013561524081614b13565b945060408801359350606088013561525781614b13565b925061526560808901614e2b565b9150614ecf60a08901614c12565b80151581146123d457600080fd5b6000806040838503121561529457600080fd5b823561529f81614b13565b91506020830135614d5981615273565b600080604083850312156152c257600080fd5b82359150614c5260208401614e2b565b60008060008060008060a087890312156152eb57600080fd5b86359550602087013567ffffffffffffffff81111561530957600080fd5b61531589828a01614c5b565b909650945050604087013561532981614b13565b925061533760608801614e2b565b915061534560808801614c12565b90509295509295509295565b6000806000806080858703121561536757600080fd5b84359350602085013561537981614b13565b9250604085013561504d81614b13565b60008060006060848603121561539e57600080fd5b833592506020840135915060408401356151e381614b13565b600080600080606085870312156153cd57600080fd5b843567ffffffffffffffff8111156153e457600080fd5b6153f087828801614c5b565b909550935050602085013561540481614b13565b9150604085013561541481614b13565b939692955090935050565b6000806040838503121561543257600080fd5b823561543d81614b13565b91506020830135614d5981614b13565b60008060008060006080868803121561546557600080fd5b85359450602086013567ffffffffffffffff81111561548357600080fd5b61548f88828901614c5b565b90955093505060408601356154a381614b13565b915060608601356154b381614b13565b809150509295509295909350565b600080600080600060a086880312156154d957600080fd5b85356154e481614b13565b945060208601356154f481614b13565b93506040860135925060608601359150608086013567ffffffffffffffff81111561551e57600080fd5b61501388828901614dcf565b60008060008060008060a0878903121561554357600080fd5b863567ffffffffffffffff81111561555a57600080fd5b61556689828a01614c5b565b909750955050602087013561557a81614b13565b935061558860408801614e2b565b925061559660608801614c12565b915060808701356155a681614b13565b809150509295509295509295565b6000602082840312156155c657600080fd5b815167ffffffffffffffff8111156155dd57600080fd5b8201601f810184136155ee57600080fd5b80516155f981614da7565b6040516156068282614d7a565b82815286602084860101111561561b57600080fd5b61562c836020830160208701614ba7565b9695505050505050565b600080600080600060a0868803121561564e57600080fd5b853567ffffffffffffffff81111561566557600080fd5b61567188828901614dcf565b955050602086013561568281614b13565b935061569060408701614e2b565b925061569e60608701614c12565b915060808601356154b381614b13565b600181811c908216806156c257607f821691505b6020821081036156e257634e487b7160e01b600052602260045260246000fd5b50919050565b6000602082840312156156fa57600080fd5b8151614ba081614b13565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016157435761574361571b565b5060010190565b60408152600061575d6040830185615129565b828103602084015261576f8185615129565b95945050505050565b60006020828403121561578a57600080fd5b5051919050565b8183823760009101908152919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60a0815260006157de60a08301888a6157a1565b90506001600160a01b03808716602084015263ffffffff8616604084015267ffffffffffffffff85166060840152808416608084015250979650505050505050565b60006020828403121561583257600080fd5b8151614ba081615273565b88815260e06020820152600061585760e08301898b6157a1565b6001600160a01b03978816604084015295909616606082015267ffffffffffffffff938416608082015263ffffffff9290921660a083015290911660c090910152949350505050565b60006001600160a01b03808816835280871660208401525060a060408301526158cc60a0830186615129565b82810360608401526158de8186615129565b905082810360808401526158f28185614bd3565b98975050505050505050565b60006020828403121561591057600080fd5b8151614ba081614b6d565b600060033d11156159345760046000803e5060005160e01c5b90565b600060443d10156159455790565b6040516003193d81016004833e81513d67ffffffffffffffff816024840111818411171561597557505050505090565b828501915081518181111561598d5750505050505090565b843d87010160208285010111156159a75750505050505090565b6159b660208286010187614d7a565b509095945050505050565b600082198211156159d4576159d461571b565b500190565b6000828210156159eb576159eb61571b565b500390565b608081526000615a036080830187614bd3565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff16606090910152919050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b16815260008351615a75816001850160208801614ba7565b835190830190615a8c816001840160208801614ba7565b0160010195945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a06080830152615ad160a0830184614bd3565b97965050505050505056fe6f6e6c7920617574686f72697a656420616e64206f776e657200000000000000a2646970667358221220aa8d8fab69aba82c30dfefd45673c85a1138fa8d038bb1da5f8baeaa00891b9f64736f6c634300080d0033

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

00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea850000000000000000000000009a6f5e6a86f42e34c613f7bf8ee727863dd7e1c6

-----Decoded View---------------
Arg [0] : _ens (address): 0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e
Arg [1] : _registrar (address): 0x57f1887a8BF19b14fC0dF6Fd9B2acc9Af147eA85
Arg [2] : _metadataService (address): 0x9A6F5e6A86F42E34C613f7bF8eE727863dd7e1C6

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000c2e074ec69a0dfb2997ba6c7d2e1e
Arg [1] : 00000000000000000000000057f1887a8bf19b14fc0df6fd9b2acc9af147ea85
Arg [2] : 0000000000000000000000009a6f5e6a86f42e34c613f7bf8ee727863dd7e1c6


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

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