ERC-1155
Overview
Max Total Supply
66
Holders
31
Market
Volume (24H)
N/A
Min Price (24H)
N/A
Max Price (24H)
N/A
Other Info
Token Contract
Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
NameWrapper
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; import {ERC1155Fuse, IERC165, OperationProhibited} from "./ERC1155Fuse.sol"; import {Controllable} from "./Controllable.sol"; import {INameWrapper, CANNOT_UNWRAP, CANNOT_BURN_FUSES, CANNOT_TRANSFER, CANNOT_SET_RESOLVER, CANNOT_SET_TTL, PARENT_CANNOT_CONTROL} from "./INameWrapper.sol"; import {INameWrapperUpgrade} from "./INameWrapperUpgrade.sol"; import {IMetadataService} from "./IMetadataService.sol"; import {BDNS} from "../registry/BDNS.sol"; import {IBaseRegistrar} from "../ethregistrar/IBaseRegistrar.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {BytesUtils} from "./BytesUtils.sol"; import {ERC20Recoverable} from "../utils/ERC20Recoverable.sol"; error Unauthorised(bytes32 node, address addr); error IncorrectTokenType(); error LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash); error LabelTooShort(); error LabelTooLong(string label); error IncorrectTargetOwner(address owner); error CannotUpgrade(); contract NameWrapper is Ownable, ERC1155Fuse, INameWrapper, Controllable, IERC721Receiver, ERC20Recoverable { using BytesUtils for bytes; BDNS public immutable override bdns; IBaseRegistrar public immutable override registrar; IMetadataService public override metadataService; mapping(bytes32 => bytes) public override names; string public constant name = "NameWrapper"; bytes32 private constant ROOT_NODE = 0; INameWrapperUpgrade public upgradeContract; uint64 private constant MAX_EXPIRY = type(uint64).max; constructor( BDNS _bdns, IBaseRegistrar _registrar, IMetadataService _metadataService ) { bdns = _bdns; registrar = _registrar; metadataService = _metadataService; /* Burn PARENT_CANNOT_CONTROL and CANNOT_UNWRAP fuses for ROOT_NODE */ _setData( uint256(ROOT_NODE), address(0), uint32(PARENT_CANNOT_CONTROL | CANNOT_UNWRAP), MAX_EXPIRY ); names[ROOT_NODE] = "\x00"; } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC1155Fuse, IERC165) returns (bool) { return interfaceId == type(INameWrapper).interfaceId || interfaceId == type(IERC721Receiver).interfaceId || super.supportsInterface(interfaceId); } /* ERC1155 Fuse */ /** * @notice Gets the owner of a name * @param id Label as a string of the root domain to wrap * @return owner The owner of the name */ function ownerOf(uint256 id) public view override(ERC1155Fuse, INameWrapper) returns (address owner) { return super.ownerOf(id); } /** * @notice Gets the data for a name * @param id Label as a string of the root domain to wrap * @return address The owner of the name * @return uint32 Fuses of the name * @return uint64 Expiry of when the fuses expire for the name */ function getData(uint256 id) public view override(ERC1155Fuse, INameWrapper) returns ( address, uint32, uint64 ) { return super.getData(id); } /* Metadata service */ /** * @notice Set the metadata service. Only the owner can do this * @param _metadataService The new metadata service */ function setMetadataService(IMetadataService _metadataService) public onlyOwner { metadataService = _metadataService; } /** * @notice Get the metadata uri * @param tokenId The id of the token * @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); bdns.setApprovalForAll(address(upgradeContract), false); } upgradeContract = _upgradeAddress; if (address(upgradeContract) != address(0)) { registrar.setApprovalForAll(address(upgradeContract), true); bdns.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 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 Wraps a root 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 root registrar or an authorised caller on the registrar * @param label Label as a string of the root 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 * @return Normalised expiry of when the fuses expire */ function wrap( string calldata label, address wrappedOwner, uint32 fuses, uint64 expiry, address resolver ) public override returns (uint64) { uint256 tokenId = uint256(keccak256(bytes(label))); address registrant = registrar.ownerOf(tokenId); if ( registrant != msg.sender && !registrar.isApprovedForAll(registrant, msg.sender) ) { revert Unauthorised( _makeNode(ROOT_NODE, bytes32(tokenId)), msg.sender ); } // transfer the token from the user to this contract registrar.transferFrom(registrant, address(this), tokenId); // transfer the BDNS record back to the new owner (this contract) registrar.reclaim(tokenId, address(this)); return _wrapROOT(label, wrappedOwner, fuses, expiry, resolver); } /** * @dev Registers a new root second-level domain and wraps it. * Only callable by authorised controllers. * @param label The label to register (Eg, 'foo' for 'foo'). * @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 BDNS 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 root registrar, in seconds since the Unix epoch. */ function registerAndWrap( string calldata label, address wrappedOwner, uint256 duration, address resolver, uint32 fuses, uint64 expiry ) external override onlyController returns (uint256 registrarExpiry) { uint256 tokenId = uint256(keccak256(bytes(label))); registrarExpiry = registrar.register(tokenId, address(this), duration); _wrapROOT(label, wrappedOwner, fuses, expiry, resolver); } /** * @notice Renews a root second-level domain. * @dev Only callable by authorised controllers. * @param tokenId The hash of the label to register (eg, `keccak256('foo')`, for 'foo'). * @param duration The number of seconds to renew the name for. * @return expires The expiry date of the name on the root registrar, in seconds since the Unix epoch. */ function renew( uint256 tokenId, uint256 duration, uint32 fuses, uint64 expiry ) external override onlyController returns (uint256 expires) { bytes32 node = _makeNode(ROOT_NODE, bytes32(tokenId)); expires = registrar.renew(tokenId, duration); if (isWrapped(node)) { (address owner, uint32 oldFuses, uint64 oldExpiry) = getData( uint256(node) ); expiry = _normaliseExpiry(expiry, oldExpiry, uint64(expires)); _setData( node, owner, oldFuses | fuses | PARENT_CANNOT_CONTROL, expiry ); } } /** * @notice Unwraps a root domain. e.g. vitalik * @dev Can be called by the owner in the wrapper or an authorised caller in the wrapper * @param labelhash Labelhash of the root domain * @param registrant Sets the owner in the root registrar to this address * @param controller Sets the owner in the registry to this address */ function unwrap( bytes32 labelhash, address registrant, address controller ) public override onlyTokenOwner(_makeNode(ROOT_NODE, labelhash)) { if (controller == address(0x0)) { revert IncorrectTargetOwner(controller); } if (registrant == address(this)) { revert IncorrectTargetOwner(registrant); } _unwrap(_makeNode(ROOT_NODE, labelhash), controller); registrar.safeTransferFrom( address(this), registrant, uint256(labelhash) ); } /** * @notice Sets fuses of a name * @param node Namehash of the name * @param fuses Fuses to burn (cannot burn PARENT_CANNOT_CONTROL) * @return New fuses */ function setFuses(bytes32 node, uint32 fuses) public onlyTokenOwner(node) operationAllowed(node, CANNOT_BURN_FUSES) returns (uint32) { _checkForParentCannotControl(node, fuses); (address owner, uint32 oldFuses, uint64 expiry) = getData( uint256(node) ); fuses |= oldFuses; _setFuses(node, owner, fuses, expiry); return fuses; } /** * @notice Upgrades a root wrapped domain by calling the wrap 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 root name to upgrade * @param wrappedOwner The owner of the wrapped name */ function upgrade( string calldata label, address wrappedOwner, address resolver ) public { bytes32 labelhash = keccak256(bytes(label)); bytes32 node = _makeNode(ROOT_NODE, labelhash); (uint32 fuses, uint64 expiry) = _prepareUpgrade(node); upgradeContract.wrap( label, wrappedOwner, fuses, expiry, resolver ); } /** * @notice Sets records for the name in the BDNS Registry * @param node Namehash of the name to set a record for * @param owner New owner in the registry * @param resolver Resolver contract * @param ttl Time to live in the registry */ function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) public override onlyTokenOwner(node) operationAllowed( node, CANNOT_TRANSFER | CANNOT_SET_RESOLVER | CANNOT_SET_TTL ) { bdns.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) { bdns.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) { bdns.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 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; } /** * @notice Checks if a name is wrapped or not * @dev Both of these checks need to be true to be considered wrapped if checked without this contract * @param node Namehash of the name * @return Boolean of whether or not the name is wrapped */ function isWrapped(bytes32 node) public view override returns (bool) { return ownerOf(uint256(node)) != address(0) && bdns.owner(node) == address(this); } 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 BDNS record back to the new owner (this contract) registrar.reclaim(uint256(labelhash), address(this)); _wrapROOT(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 owner, uint32 fuses, uint64 expiry ) internal override { _canFusesBeBurned(node, fuses); address oldOwner = ownerOf(uint256(node)); if (oldOwner != address(0)) { // burn and unwrap old token of old owner _burn(uint256(node)); emit NameUnwrapped(node, address(0)); } super._mint(node, owner, fuses, expiry); } function _wrap( bytes32 node, bytes memory name, address wrappedOwner, uint32 fuses, uint64 expiry ) internal { names[node] = name; _mint(node, wrappedOwner, fuses, expiry); emit NameWrapped(node, name, wrappedOwner, fuses, expiry); } function _addLabelAndWrap( bytes32 parentNode, bytes32 node, string memory label, address owner, uint32 fuses, uint64 expiry ) internal { bytes memory name = _addLabel(label, names[parentNode]); _wrap(node, name, owner, 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) = getData(uint256(node)); // burn token and fuse data _burn(uint256(node)); } function _getDataAndNormaliseExpiry( 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 // root names will check registrar, non root check parent if (expiry > maxExpiry) { expiry = maxExpiry; } // Expiry cannot be less than old expiry if (expiry < oldExpiry) { expiry = oldExpiry; } return expiry; } function _wrapROOT( 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(ROOT_NODE, labelhash); uint32 oldFuses; (, oldFuses, expiry) = _getDataAndNormaliseExpiry( node, labelhash, expiry ); _addLabelAndWrap( ROOT_NODE, node, label, wrappedOwner, fuses | PARENT_CANNOT_CONTROL, expiry ); if (resolver != address(0)) { bdns.setResolver(node, resolver); } return expiry; } function _unwrap(bytes32 node, address owner) private { if (allFusesBurned(node, CANNOT_UNWRAP)) { revert OperationProhibited(node); } // Burn token and fuse data _burn(uint256(node)); bdns.setOwner(node, owner); emit NameUnwrapped(node, owner); } 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); } } function _checkForParentCannotControl(bytes32 node, uint32 fuses) internal view { if (fuses & PARENT_CANNOT_CONTROL != 0) { // Only the parent can burn the PARENT_CANNOT_CONTROL fuse. revert Unauthorised(node, msg.sender); } } }
// 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); } }
// 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; }
// 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); }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// 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); }
// 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); }
// 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); } } } }
// 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; } }
// 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; } }
// 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); }
//SPDX-License-Identifier: MIT import "../registry/BDNS.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 BDNS, if you own it in the registrar. */ function reclaim(uint256 id, address owner) external; }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.4; interface BDNS { // 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); }
//SPDX-License-Identifier: MIT pragma solidity >=0.8.17 <0.9.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** @notice Contract is used to recover ERC20 tokens sent to the contract by mistake. */ contract ERC20Recoverable is Ownable { /** @notice Recover ERC20 tokens sent to the contract by mistake. @dev The contract is Ownable and only the owner can call the recover function. @param _to The address to send the tokens to. @param _token The address of the ERC20 token to recover @param _amount The amount of tokens to recover. */ function recoverFunds( address _token, address _to, uint256 _amount ) external onlyOwner { IERC20(_token).transfer(_to, _amount); } }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; 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, uint256 offset, uint256 len ) internal pure returns (bytes32 ret) { require(offset + len <= self.length); assembly { ret := keccak256(add(add(self, 32), offset), len) } } /** * @dev Returns the BDNS 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, uint256 offset) internal pure returns (bytes32) { (bytes32 labelhash, uint256 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, uint256 newIdx) { require(idx < self.length, "readLabel: Index out of bounds"); uint256 len = uint256(uint8(self[idx])); if (len > 0) { labelhash = keccak(self, idx + 1, len); } else { labelhash = bytes32(0); } newIdx = idx + len + 1; } }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; 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) public onlyOwner { controllers[controller] = active; emit ControllerChanged(controller, active); } modifier onlyController() { require( controllers[msg.sender], "Controllable: Caller is not a controller" ); _; } }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; 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 virtual 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 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 *************************************************************************/ /** * @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); } function _canTransfer(uint32 fuses) internal virtual returns (bool); function _mint( bytes32 node, address owner, uint32 fuses, uint64 expiry ) internal virtual { uint256 tokenId = uint256(node); (address oldOwner, uint32 oldFuses, uint64 oldExpiry) = getData( uint256(node) ); if (oldExpiry > expiry) { expiry = oldExpiry; } require(oldOwner == address(0), "ERC1155: mint of existing token"); require(owner != address(0), "ERC1155: mint to the zero address"); require( owner != address(this), "ERC1155: newOwner cannot be the NameWrapper contract" ); _setData(tokenId, owner, fuses | oldFuses, expiry); emit TransferSingle(msg.sender, address(0x0), owner, tokenId, 1); _doSafeTransferAcceptanceCheck( msg.sender, address(0), owner, tokenId, 1, "" ); } function _burn(uint256 tokenId) internal virtual { (address owner, uint32 fuses, uint64 expiry) = getData(tokenId); // Fuses and expiry are kept on burn _setData(tokenId, address(0x0), fuses, expiry); 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 (!_canTransfer(fuses)) { revert OperationProhibited(bytes32(id)); } require( amount == 1 && oldOwner == from, "ERC1155: insufficient balance for transfer" ); if (oldOwner == to) { return; } _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"); } } } }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; interface IMetadataService { function uri(uint256) external view returns (string memory); }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; import "../registry/BDNS.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 PARENT_CANNOT_CONTROL = 32; 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 bdns() external view returns (BDNS); function registrar() external view returns (IBaseRegistrar); function metadataService() external view returns (IMetadataService); function names(bytes32) external view returns (bytes memory); function wrap( string calldata label, address wrappedOwner, uint32 fuses, uint64 _expiry, address resolver ) external returns (uint64 expiry); function registerAndWrap( string calldata label, address wrappedOwner, uint256 duration, address resolver, uint32 fuses, uint64 expiry ) external returns (uint256 registrarExpiry); function renew( uint256 labelHash, uint256 duration, uint32 fuses, uint64 expiry ) external returns (uint256 expires); function unwrap( bytes32 label, address newRegistrant, address newController ) external; function setFuses(bytes32 node, uint32 fuses) external returns (uint32 newFuses); function setRecord( bytes32 node, address owner, address resolver, uint64 ttl ) external; 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 getData(uint256 id) external returns ( address, uint32, uint64 ); function allFusesBurned(bytes32 node, uint32 fuseMask) external view returns (bool); function isWrapped(bytes32 node) external view returns (bool); }
//SPDX-License-Identifier: MIT pragma solidity ~0.8.17; interface INameWrapperUpgrade { function wrap( string calldata label, address wrappedOwner, uint32 fuses, uint64 expiry, address resolver ) external; }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 4000 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract BDNS","name":"_bdns","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":[{"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":[{"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":"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":[],"name":"bdns","outputs":[{"internalType":"contract BDNS","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"getData","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"},{"internalType":"uint64","name":"","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":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"isWrapped","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":"address","name":"_token","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"recoverFunds","outputs":[],"stateMutability":"nonpayable","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":"registerAndWrap","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":"uint32","name":"fuses","type":"uint32"},{"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":"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":"_metadataService","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":"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":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"labelhash","type":"bytes32"},{"internalType":"address","name":"registrant","type":"address"},{"internalType":"address","name":"controller","type":"address"}],"name":"unwrap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"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":"uint256","name":"tokenId","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","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":"wrap","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c06040523480156200001157600080fd5b5060405162004a8038038062004a80833981016040819052620000349162000158565b6200003f33620000ef565b6001600160a01b0383811660805282811660a052600480546001600160a01b031916918316919091179055600163ffffffdf60a01b03197fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb4955604080518082019091526001815260006020808301829052908052600590527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc90620000e5908262000251565b505050506200031d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146200015557600080fd5b50565b6000806000606084860312156200016e57600080fd5b83516200017b816200013f565b60208501519093506200018e816200013f565b6040850151909250620001a1816200013f565b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001d757607f821691505b602082108103620001f857634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200024c57600081815260208120601f850160051c81016020861015620002275750805b601f850160051c820191505b81811015620002485782815560010162000233565b5050505b505050565b81516001600160401b038111156200026d576200026d620001ac565b62000285816200027e8454620001c2565b84620001fe565b602080601f831160018114620002bd5760008415620002a45750858301515b600019600386901b1c1916600185901b17855562000248565b600085815260208120601f198616915b82811015620002ee57888601518255948401946001909101908401620002cd565b50858210156200030d5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60805160a0516146b1620003cf6000396000818161046b01528181610a0d01528181610b040152818161126a015281816113b601528181611604015281816116cb015281816117ce0152818161185d01528181611c4701528181611dc301528181611f9b0152612fd60152600081816104440152818161099301528181610c9601528181611ce501528181611e61015281816121d101528181612564015281816127aa0152612af001526146b16000f3fe608060405234801561001057600080fd5b50600436106102915760003560e01c80635d3590d511610160578063c20a2eb0116100d8578063ed70554d1161008c578063f2fde38b11610071578063f2fde38b146106a3578063f44779b9146106b6578063fd0cd0d9146106c957600080fd5b8063ed70554d14610670578063f242432a1461069057600080fd5b8063da8c229e116100bd578063da8c229e146105fe578063e0dba60f14610621578063e985e9c51461063457600080fd5b8063c20a2eb0146105c3578063cf408823146105eb57600080fd5b806395dc5abf1161012f578063adf4960a11610114578063adf4960a1461058a578063b6bcad261461059d578063bd87b55b146105b057600080fd5b806395dc5abf14610564578063a22cb4651461057757600080fd5b80635d3590d5146105255780636352211e14610538578063715018a61461054b5780638da5cb5b1461055357600080fd5b80631f4e15041161020e57806336580b6f116101c25780634e1273f4116101a75780634e1273f4146104c65780634e3f212d146104e6578063530954671461051257600080fd5b806336580b6f146104a057806347d2e9fe146104b357600080fd5b8063252110ed116101f3578063252110ed1461043f5780632b20e397146104665780632eb2c2d61461048d57600080fd5b80631f4e15041461040157806320c38e2b1461042c57600080fd5b80630e89341c11610265578063150b7a021161024a578063150b7a02146103975780631534e177146103db5780631896f70a146103ee57600080fd5b80630e89341c1461036f57806314ab90381461038257600080fd5b8062fdd58e146102965780630178fe3f146102bc57806301ffc9a71461030357806306fdde0314610326575b600080fd5b6102a96102a436600461374b565b6106dc565b6040519081526020015b60405180910390f35b6102cf6102ca366004613777565b61079d565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff16908201526060016102b3565b6103166103113660046137be565b6107b8565b60405190151581526020016102b3565b6103626040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516102b39190613832565b61036261037d366004613777565b61085a565b610395610390366004613862565b6108e7565b005b6103aa6103a53660046138d7565b610a00565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102b3565b6103956103e936600461394a565b610ba8565b6103956103fc366004613967565b610bea565b600654610414906001600160a01b031681565b6040516001600160a01b0390911681526020016102b3565b61036261043a366004613777565b610cc5565b6104147f000000000000000000000000000000000000000000000000000000000000000081565b6104147f000000000000000000000000000000000000000000000000000000000000000081565b61039561049b366004613b16565b610d5f565b6103956104ae366004613bc4565b6110fd565b6102a96104c1366004613c1a565b6112cc565b6104d96104d4366004613c60565b611479565b6040516102b39190613d68565b6104f96104f4366004613d7b565b6115b7565b60405167ffffffffffffffff90911681526020016102b3565b600454610414906001600160a01b031681565b610395610533366004613e05565b611915565b610414610546366004613777565b6119af565b6103956119ba565b6000546001600160a01b0316610414565b610395610572366004613e46565b6119ce565b610395610585366004613ebc565b611abf565b610316610598366004613eea565b611bc7565b6103956105ab36600461394a565b611bec565b6102a96105be366004613f0d565b611ec0565b6105d66105d1366004613eea565b612064565b60405163ffffffff90911681526020016102b3565b6103956105f9366004613fa0565b61210f565b61031661060c36600461394a565b60036020526000908152604090205460ff1681565b61039561062f366004613ebc565b61226a565b610316610642366004613fd8565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6102a961067e366004613777565b60016020526000908152604090205481565b61039561069e366004614006565b6122f0565b6103956106b136600461394a565b612425565b6103166106c4366004613967565b6124b2565b6103166106d7366004613777565b61250d565b60006001600160a01b03831661075f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061076a8361079d565b50509050836001600160a01b0316816001600160a01b031603610791576001915050610797565b60009150505b92915050565b60008060006107ab846125df565b9250925092509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f381b7e3b00000000000000000000000000000000000000000000000000000000148061084b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b80610797575061079782612616565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610797919081019061406f565b816108f281336124b2565b6109185760405163168ab55d60e31b815260048101829052336024820152604401610756565b82601060006109268361079d565b5091505063ffffffff82821616156109545760405163a2a7201360e01b815260048101849052602401610756565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906314ab9038906044015b600060405180830381600087803b1580156109e057600080fd5b505af11580156109f4573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610a64576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610a76878901896140f1565b84516020860120949950929750909550935091508990808214610acf576040517fc65c3ccc0000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610756565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610b5057600080fd5b505af1158015610b64573d6000803e3d6000fd5b50505050610b7587878787876126f9565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b610bb0612814565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610bf581336124b2565b610c1b5760405163168ab55d60e31b815260048101829052336024820152604401610756565b8260086000610c298361079d565b5091505063ffffffff8282161615610c575760405163a2a7201360e01b815260048101849052602401610756565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a906044016109c6565b60056020526000908152604090208054610cde9061418b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0a9061418b565b8015610d575780601f10610d2c57610100808354040283529160200191610d57565b820191906000526020600020905b815481529060010190602001808311610d3a57829003601f168201915b505050505081565b8151835114610dd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b038416610e525760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b038516331480610e8c57506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b610efe5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610756565b60005b8351811015611090576000848281518110610f1e57610f1e6141de565b602002602001015190506000848381518110610f3c57610f3c6141de565b602002602001015190506000806000610f548561079d565b925092509250610f65826004161590565b610f855760405163a2a7201360e01b815260048101869052602401610756565b836001148015610fa657508a6001600160a01b0316836001600160a01b0316145b6110185760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610756565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790555050505050806110899061420d565b9050610f01565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516110e092919061424e565b60405180910390a46110f633868686868661286e565b5050505050565b6040805160006020808301919091528183018690528251808303840181526060909201909252805191012061113281336124b2565b6111585760405163168ab55d60e31b815260048101829052336024820152604401610756565b6001600160a01b0382166111a3576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610756565b306001600160a01b038416036111f0576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610756565b604080516000602080830191909152818301879052825180830384018152606090920190925280519101206112259083612a7c565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f000000000000000000000000000000000000000000000000000000000000000016906342842e0e90606401600060405180830381600087803b1580156112ae57600080fd5b505af11580156112c2573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff166113515760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c65720000000000000000000000000000000000000000000000006064820152608401610756565b60408051600060208083018290528284018990528351808403850181526060909301909352815191909201206040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063c475abff906044016020604051808303816000875af1158015611407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142b919061427c565b91506114368161250d565b1561147057600080806114488461079d565b925092509250611459868287612b87565b955061146c848460208a86171789612bd1565b5050505b50949350505050565b606081518351146114f25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610756565b6000835167ffffffffffffffff81111561150e5761150e613997565b604051908082528060200260200182016040528015611537578160200160208202803683370190505b50905060005b84518110156115af5761158285828151811061155b5761155b6141de565b6020026020010151858381518110611575576115756141de565b60200260200101516106dc565b828281518110611594576115946141de565b60209081029190910101526115a88161420d565b905061153d565b509392505050565b60008087876040516115ca929190614295565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690636352211e90602401602060405180830381865afa158015611653573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167791906142a5565b90506001600160a01b038116331480159061173857506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f0000000000000000000000000000000000000000000000000000000000000000169063e985e9c590604401602060405180830381865afa158015611712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173691906142c2565b155b15611789576040805160006020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a401610756565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f000000000000000000000000000000000000000000000000000000000000000016906323b872dd90606401600060405180830381600087803b15801561181257600080fd5b505af1158015611826573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b1580156118ab57600080fd5b505af11580156118bf573d6000803e3d6000fd5b5050505061190889898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886126f9565b9998505050505050505050565b61191d612814565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a991906142c2565b50505050565b600061079782612c42565b6119c2612814565b6119cc6000612c58565b565b600084846040516119e0929190614295565b60405190819003902090506000611a1e8183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080611a2c83612cc0565b6006546040517f4e3f212d0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b031690634e3f212d90611a83908b908b908b90889088908d906004016142df565b600060405180830381600087803b158015611a9d57600080fd5b505af1158015611ab1573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b0382163303611b3d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610756565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080611bd38461079d565b50841663ffffffff908116908516149250505092915050565b611bf4612814565b6006546001600160a01b031615611d46576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b158015611c8d57600080fd5b505af1158015611ca1573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b158015611d2d57600080fd5b505af1158015611d41573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515611ebd576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f00000000000000000000000000000000000000000000000000000000000000009091169063a22cb46590604401600060405180830381600087803b158015611e0957600080fd5b505af1158015611e1d573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f0000000000000000000000000000000000000000000000000000000000000000909116925063a22cb4659150604401600060405180830381600087803b158015611ea957600080fd5b505af11580156110f6573d6000803e3d6000fd5b50565b3360009081526003602052604081205460ff16611f455760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c65720000000000000000000000000000000000000000000000006064820152608401610756565b60008888604051611f57929190614295565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611fec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612010919061427c565b915061205789898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896126f9565b5050979650505050505050565b60008261207181336124b2565b6120975760405163168ab55d60e31b815260048101829052336024820152604401610756565b83600260006120a58361079d565b5091505063ffffffff82821616156120d35760405163a2a7201360e01b815260048101849052602401610756565b6120dd8787612d55565b600080806120ea8a61079d565b92509250925081891798506121018a848b84612d84565b509698975050505050505050565b8361211a81336124b2565b6121405760405163168ab55d60e31b815260048101829052336024820152604401610756565b84601c600061214e8361079d565b5091505063ffffffff828216161561217c5760405163a2a7201360e01b815260048101849052602401610756565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000000000000000000000000000000000000000000000169063cf40882390608401600060405180830381600087803b15801561221557600080fd5b505af1158015612229573d6000803e3d6000fd5b50505050600061223b8960001c61079d565b5050905061225f81898b60001c600160405180602001604052806000815250612de0565b505050505050505050565b612272612814565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b6001600160a01b03841661236c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b0385163314806123a657506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6124185760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f76656400000000000000000000000000000000000000000000006064820152608401610756565b6110f68585858585612de0565b61242d612814565b6001600160a01b0381166124a95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610756565b611ebd81612c58565b6000806124be846119af565b9050826001600160a01b0316816001600160a01b0316148061250557506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b600080612519836119af565b6001600160a01b03161415801561079757506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906302571be390602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf91906142a5565b6001600160a01b03161492915050565b6000818152600160205260408120549060c082901c8242821015612606576000925061260e565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a260000000000000000000000000000000000000000000000000000000014806126a957507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610797565b84516020860120600090816127358183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000612744828488612f8e565b9750915061275c90506000838b8b60208c178b613066565b6001600160a01b03851615612807576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f00000000000000000000000000000000000000000000000000000000000000001690631896f70a90604401600060405180830381600087803b1580156127ee57600080fd5b505af1158015612802573d6000803e3d6000fd5b505050505b5093979650505050505050565b6000546001600160a01b031633146119cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610756565b6001600160a01b0384163b15612a74576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906128cb9089908990889088908890600401614345565b6020604051808303816000875af1925050508015612906575060408051601f3d908101601f19168201909252612903918101906143a3565b60015b6129bb576129126143c0565b806308c379a00361294b57506129266143dc565b80612931575061294d565b8060405162461bcd60e51b81526004016107569190613832565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610756565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014612a725760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610756565b505b505050505050565b612a87826001611bc7565b15612aa85760405163a2a7201360e01b815260048101839052602401610756565b612ab182613117565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f00000000000000000000000000000000000000000000000000000000000000001690635b0fc9c390604401600060405180830381600087803b158015612b3457600080fd5b505af1158015612b48573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c491506020016122e4565b60008167ffffffffffffffff168467ffffffffffffffff161115612ba9578193505b8267ffffffffffffffff168467ffffffffffffffff161015612bc9578293505b509192915050565b612bdb84836131d2565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790556119a9565b600080612c4e8361079d565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60065460009081906001600160a01b0316612d07576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d1183336124b2565b612d375760405163168ab55d60e31b815260048101849052336024820152604401610756565b612d408361079d565b9093509150612d50905083613117565b915091565b6020811615612d805760405163168ab55d60e31b815260048101839052336024820152604401610756565b5050565b612d9084848484612bd1565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b6000806000612dee8661079d565b925092509250612dff826004161590565b612e1f5760405163a2a7201360e01b815260048101879052602401610756565b846001148015612e405750876001600160a01b0316836001600160a01b0316145b612eb25760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610756565b866001600160a01b0316836001600160a01b031603612ed3575050506110f6565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46112c233898989898961320b565b6000808080612f9c8761079d565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015613025573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613049919061427c565b9050613056868383612b87565b9550859250505093509350939050565b600086815260056020526040812080546131089187916130859061418b565b80601f01602080910402602001604051908101604052809291908181526020018280546130b19061418b565b80156130fe5780601f106130d3576101008083540402835291602001916130fe565b820191906000526020600020905b8154815290600101906020018083116130e157829003601f168201915b5050505050613366565b9050612a72868286868661340f565b60008060006131258461079d565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b63ffffffdf8116158015906131ea5750602181811614155b15612d805760405163a2a7201360e01b815260048101839052602401610756565b6001600160a01b0384163b15612a74576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906132689089908990889088908890600401614484565b6020604051808303816000875af19250505080156132a3575060408051601f3d908101601f191682019092526132a0918101906143a3565b60015b6132af576129126143c0565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014612a725760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610756565b60606001835110156133a4576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff835111156133e257826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016107569190613832565b825183836040516020016133f8939291906144c7565b604051602081830303815290604052905092915050565b60008581526005602052604090206134278582614573565b5061343485848484613479565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd3408585858560405161346a9493929190614633565b60405180910390a25050505050565b61348384836131d2565b600061348e856119af565b90506001600160a01b038116156134df576134a885613117565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6110f68585858583600080806134f48461079d565b9250925092508467ffffffffffffffff168167ffffffffffffffff16111561351a578094505b6001600160a01b038316156135715760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e006044820152606401610756565b6001600160a01b0387166135ed5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610756565b306001600160a01b0388160361366b5760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e74726163740000000000000000000000006064820152608401610756565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46112c2336000898760016040518060200160405280600081525061320b565b6001600160a01b0381168114611ebd57600080fd5b6000806040838503121561375e57600080fd5b823561376981613736565b946020939093013593505050565b60006020828403121561378957600080fd5b5035919050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611ebd57600080fd5b6000602082840312156137d057600080fd5b81356137db81613790565b9392505050565b60005b838110156137fd5781810151838201526020016137e5565b50506000910152565b6000815180845261381e8160208601602086016137e2565b601f01601f19169290920160200192915050565b6020815260006137db6020830184613806565b803567ffffffffffffffff8116811461385d57600080fd5b919050565b6000806040838503121561387557600080fd5b8235915061388560208401613845565b90509250929050565b60008083601f8401126138a057600080fd5b50813567ffffffffffffffff8111156138b857600080fd5b6020830191508360208285010111156138d057600080fd5b9250929050565b6000806000806000608086880312156138ef57600080fd5b85356138fa81613736565b9450602086013561390a81613736565b935060408601359250606086013567ffffffffffffffff81111561392d57600080fd5b6139398882890161388e565b969995985093965092949392505050565b60006020828403121561395c57600080fd5b81356137db81613736565b6000806040838503121561397a57600080fd5b82359150602083013561398c81613736565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156139ec576139ec613997565b6040525050565b600067ffffffffffffffff821115613a0d57613a0d613997565b5060051b60200190565b600082601f830112613a2857600080fd5b81356020613a35826139f3565b604051613a4282826139c6565b83815260059390931b8501820192828101915086841115613a6257600080fd5b8286015b84811015613a7d5780358352918301918301613a66565b509695505050505050565b600067ffffffffffffffff821115613aa257613aa2613997565b50601f01601f191660200190565b6000613abb83613a88565b604051613ac882826139c6565b809250848152858585011115613add57600080fd5b8484602083013760006020868301015250509392505050565b600082601f830112613b0757600080fd5b6137db83833560208501613ab0565b600080600080600060a08688031215613b2e57600080fd5b8535613b3981613736565b94506020860135613b4981613736565b9350604086013567ffffffffffffffff80821115613b6657600080fd5b613b7289838a01613a17565b94506060880135915080821115613b8857600080fd5b613b9489838a01613a17565b93506080880135915080821115613baa57600080fd5b50613bb788828901613af6565b9150509295509295909350565b600080600060608486031215613bd957600080fd5b833592506020840135613beb81613736565b91506040840135613bfb81613736565b809150509250925092565b803563ffffffff8116811461385d57600080fd5b60008060008060808587031215613c3057600080fd5b8435935060208501359250613c4760408601613c06565b9150613c5560608601613845565b905092959194509250565b60008060408385031215613c7357600080fd5b823567ffffffffffffffff80821115613c8b57600080fd5b818501915085601f830112613c9f57600080fd5b81356020613cac826139f3565b604051613cb982826139c6565b83815260059390931b8501820192828101915089841115613cd957600080fd5b948201945b83861015613d00578535613cf181613736565b82529482019490820190613cde565b96505086013592505080821115613d1657600080fd5b50613d2385828601613a17565b9150509250929050565b600081518084526020808501945080840160005b83811015613d5d57815187529582019590820190600101613d41565b509495945050505050565b6020815260006137db6020830184613d2d565b60008060008060008060a08789031215613d9457600080fd5b863567ffffffffffffffff811115613dab57600080fd5b613db789828a0161388e565b9097509550506020870135613dcb81613736565b9350613dd960408801613c06565b9250613de760608801613845565b91506080870135613df781613736565b809150509295509295509295565b600080600060608486031215613e1a57600080fd5b8335613e2581613736565b92506020840135613e3581613736565b929592945050506040919091013590565b60008060008060608587031215613e5c57600080fd5b843567ffffffffffffffff811115613e7357600080fd5b613e7f8782880161388e565b9095509350506020850135613e9381613736565b91506040850135613ea381613736565b939692955090935050565b8015158114611ebd57600080fd5b60008060408385031215613ecf57600080fd5b8235613eda81613736565b9150602083013561398c81613eae565b60008060408385031215613efd57600080fd5b8235915061388560208401613c06565b600080600080600080600060c0888a031215613f2857600080fd5b873567ffffffffffffffff811115613f3f57600080fd5b613f4b8a828b0161388e565b9098509650506020880135613f5f81613736565b9450604088013593506060880135613f7681613736565b9250613f8460808901613c06565b9150613f9260a08901613845565b905092959891949750929550565b60008060008060808587031215613fb657600080fd5b843593506020850135613fc881613736565b92506040850135613c4781613736565b60008060408385031215613feb57600080fd5b8235613ff681613736565b9150602083013561398c81613736565b600080600080600060a0868803121561401e57600080fd5b853561402981613736565b9450602086013561403981613736565b93506040860135925060608601359150608086013567ffffffffffffffff81111561406357600080fd5b613bb788828901613af6565b60006020828403121561408157600080fd5b815167ffffffffffffffff81111561409857600080fd5b8201601f810184136140a957600080fd5b80516140b481613a88565b6040516140c182826139c6565b8281528660208486010111156140d657600080fd5b6140e78360208301602087016137e2565b9695505050505050565b600080600080600060a0868803121561410957600080fd5b853567ffffffffffffffff81111561412057600080fd5b8601601f8101881361413157600080fd5b61414088823560208401613ab0565b955050602086013561415181613736565b935061415f60408701613c06565b925061416d60608701613845565b9150608086013561417d81613736565b809150509295509295909350565b600181811c9082168061419f57607f821691505b6020821081036141d8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006000198203614247577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6040815260006142616040830185613d2d565b82810360208401526142738185613d2d565b95945050505050565b60006020828403121561428e57600080fd5b5051919050565b8183823760009101908152919050565b6000602082840312156142b757600080fd5b81516137db81613736565b6000602082840312156142d457600080fd5b81516137db81613eae565b60a081528560a0820152858760c0830137600060c08783018101919091526001600160a01b03958616602083015263ffffffff94909416604082015267ffffffffffffffff9290921660608301529092166080830152601f909201601f19160101919050565b60006001600160a01b03808816835280871660208401525060a0604083015261437160a0830186613d2d565b82810360608401526143838186613d2d565b905082810360808401526143978185613806565b98975050505050505050565b6000602082840312156143b557600080fd5b81516137db81613790565b600060033d11156143d95760046000803e5060005160e01c5b90565b600060443d10156143ea5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561443857505050505090565b82850191508151818111156144505750505050505090565b843d870101602082850101111561446a5750505050505090565b614479602082860101876139c6565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526144bc60a0830184613806565b979650505050505050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b168152600083516145048160018501602088016137e2565b83519083019061451b8160018401602088016137e2565b0160010195945050505050565b601f82111561456e57600081815260208120601f850160051c8101602086101561454f5750805b601f850160051c820191505b81811015612a745782815560010161455b565b505050565b815167ffffffffffffffff81111561458d5761458d613997565b6145a18161459b845461418b565b84614528565b602080601f8311600181146145d657600084156145be5750858301515b600019600386901b1c1916600185901b178555612a74565b600085815260208120601f198616915b82811015614605578886015182559484019460019091019084016145e6565b50858210156146235787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080815260006146466080830187613806565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff1660609091015291905056fea26469706673582212204966775eba5507f83e5ca7583875984ed19e860a4818f897f6bb574f1fe040dc64736f6c634300081100330000000000000000000000009c84c93506551b9212f86c0b020c53cfff07210600000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296000000000000000000000000f724bcb58b4a284d9229c148013a10578b3b37d2
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102915760003560e01c80635d3590d511610160578063c20a2eb0116100d8578063ed70554d1161008c578063f2fde38b11610071578063f2fde38b146106a3578063f44779b9146106b6578063fd0cd0d9146106c957600080fd5b8063ed70554d14610670578063f242432a1461069057600080fd5b8063da8c229e116100bd578063da8c229e146105fe578063e0dba60f14610621578063e985e9c51461063457600080fd5b8063c20a2eb0146105c3578063cf408823146105eb57600080fd5b806395dc5abf1161012f578063adf4960a11610114578063adf4960a1461058a578063b6bcad261461059d578063bd87b55b146105b057600080fd5b806395dc5abf14610564578063a22cb4651461057757600080fd5b80635d3590d5146105255780636352211e14610538578063715018a61461054b5780638da5cb5b1461055357600080fd5b80631f4e15041161020e57806336580b6f116101c25780634e1273f4116101a75780634e1273f4146104c65780634e3f212d146104e6578063530954671461051257600080fd5b806336580b6f146104a057806347d2e9fe146104b357600080fd5b8063252110ed116101f3578063252110ed1461043f5780632b20e397146104665780632eb2c2d61461048d57600080fd5b80631f4e15041461040157806320c38e2b1461042c57600080fd5b80630e89341c11610265578063150b7a021161024a578063150b7a02146103975780631534e177146103db5780631896f70a146103ee57600080fd5b80630e89341c1461036f57806314ab90381461038257600080fd5b8062fdd58e146102965780630178fe3f146102bc57806301ffc9a71461030357806306fdde0314610326575b600080fd5b6102a96102a436600461374b565b6106dc565b6040519081526020015b60405180910390f35b6102cf6102ca366004613777565b61079d565b604080516001600160a01b03909416845263ffffffff909216602084015267ffffffffffffffff16908201526060016102b3565b6103166103113660046137be565b6107b8565b60405190151581526020016102b3565b6103626040518060400160405280600b81526020017f4e616d655772617070657200000000000000000000000000000000000000000081525081565b6040516102b39190613832565b61036261037d366004613777565b61085a565b610395610390366004613862565b6108e7565b005b6103aa6103a53660046138d7565b610a00565b6040517fffffffff0000000000000000000000000000000000000000000000000000000090911681526020016102b3565b6103956103e936600461394a565b610ba8565b6103956103fc366004613967565b610bea565b600654610414906001600160a01b031681565b6040516001600160a01b0390911681526020016102b3565b61036261043a366004613777565b610cc5565b6104147f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff07210681565b6104147f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d529681565b61039561049b366004613b16565b610d5f565b6103956104ae366004613bc4565b6110fd565b6102a96104c1366004613c1a565b6112cc565b6104d96104d4366004613c60565b611479565b6040516102b39190613d68565b6104f96104f4366004613d7b565b6115b7565b60405167ffffffffffffffff90911681526020016102b3565b600454610414906001600160a01b031681565b610395610533366004613e05565b611915565b610414610546366004613777565b6119af565b6103956119ba565b6000546001600160a01b0316610414565b610395610572366004613e46565b6119ce565b610395610585366004613ebc565b611abf565b610316610598366004613eea565b611bc7565b6103956105ab36600461394a565b611bec565b6102a96105be366004613f0d565b611ec0565b6105d66105d1366004613eea565b612064565b60405163ffffffff90911681526020016102b3565b6103956105f9366004613fa0565b61210f565b61031661060c36600461394a565b60036020526000908152604090205460ff1681565b61039561062f366004613ebc565b61226a565b610316610642366004613fd8565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205460ff1690565b6102a961067e366004613777565b60016020526000908152604090205481565b61039561069e366004614006565b6122f0565b6103956106b136600461394a565b612425565b6103166106c4366004613967565b6124b2565b6103166106d7366004613777565b61250d565b60006001600160a01b03831661075f5760405162461bcd60e51b815260206004820152602b60248201527f455243313135353a2062616c616e636520717565727920666f7220746865207a60448201527f65726f206164647265737300000000000000000000000000000000000000000060648201526084015b60405180910390fd5b600061076a8361079d565b50509050836001600160a01b0316816001600160a01b031603610791576001915050610797565b60009150505b92915050565b60008060006107ab846125df565b9250925092509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167f381b7e3b00000000000000000000000000000000000000000000000000000000148061084b57507fffffffff0000000000000000000000000000000000000000000000000000000082167f150b7a0200000000000000000000000000000000000000000000000000000000145b80610797575061079782612616565b600480546040517f0e89341c0000000000000000000000000000000000000000000000000000000081529182018390526060916001600160a01b0390911690630e89341c90602401600060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610797919081019061406f565b816108f281336124b2565b6109185760405163168ab55d60e31b815260048101829052336024820152604401610756565b82601060006109268361079d565b5091505063ffffffff82821616156109545760405163a2a7201360e01b815260048101849052602401610756565b6040517f14ab90380000000000000000000000000000000000000000000000000000000081526004810187905267ffffffffffffffff861660248201527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff0721066001600160a01b0316906314ab9038906044015b600060405180830381600087803b1580156109e057600080fd5b505af11580156109f4573d6000803e3d6000fd5b50505050505050505050565b6000336001600160a01b037f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52961614610a64576040517f1931a53800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600080808080610a76878901896140f1565b84516020860120949950929750909550935091508990808214610acf576040517fc65c3ccc0000000000000000000000000000000000000000000000000000000081526004810182905260248101839052604401610756565b6040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018390523060248201527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b0316906328ed4f6c90604401600060405180830381600087803b158015610b5057600080fd5b505af1158015610b64573d6000803e3d6000fd5b50505050610b7587878787876126f9565b507f150b7a02000000000000000000000000000000000000000000000000000000009d9c50505050505050505050505050565b610bb0612814565b600480547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b81610bf581336124b2565b610c1b5760405163168ab55d60e31b815260048101829052336024820152604401610756565b8260086000610c298361079d565b5091505063ffffffff8282161615610c575760405163a2a7201360e01b815260048101849052602401610756565b6040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018790526001600160a01b0386811660248301527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff0721061690631896f70a906044016109c6565b60056020526000908152604090208054610cde9061418b565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0a9061418b565b8015610d575780601f10610d2c57610100808354040283529160200191610d57565b820191906000526020600020905b815481529060010190602001808311610d3a57829003601f168201915b505050505081565b8151835114610dd65760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e6774682060448201527f6d69736d617463680000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b038416610e525760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b038516331480610e8c57506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b610efe5760405162461bcd60e51b815260206004820152603260248201527f455243313135353a207472616e736665722063616c6c6572206973206e6f742060448201527f6f776e6572206e6f7220617070726f76656400000000000000000000000000006064820152608401610756565b60005b8351811015611090576000848281518110610f1e57610f1e6141de565b602002602001015190506000848381518110610f3c57610f3c6141de565b602002602001015190506000806000610f548561079d565b925092509250610f65826004161590565b610f855760405163a2a7201360e01b815260048101869052602401610756565b836001148015610fa657508a6001600160a01b0316836001600160a01b0316145b6110185760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610756565b60008581526001602052604090206001600160a01b038b1677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790555050505050806110899061420d565b9050610f01565b50836001600160a01b0316856001600160a01b0316336001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb86866040516110e092919061424e565b60405180910390a46110f633868686868661286e565b5050505050565b6040805160006020808301919091528183018690528251808303840181526060909201909252805191012061113281336124b2565b6111585760405163168ab55d60e31b815260048101829052336024820152604401610756565b6001600160a01b0382166111a3576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b0383166004820152602401610756565b306001600160a01b038416036111f0576040517f5949361a0000000000000000000000000000000000000000000000000000000081526001600160a01b0384166004820152602401610756565b604080516000602080830191909152818301879052825180830384018152606090920190925280519101206112259083612a7c565b6040517f42842e0e0000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038481166024830152604482018690527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d529616906342842e0e90606401600060405180830381600087803b1580156112ae57600080fd5b505af11580156112c2573d6000803e3d6000fd5b5050505050505050565b3360009081526003602052604081205460ff166113515760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c65720000000000000000000000000000000000000000000000006064820152608401610756565b60408051600060208083018290528284018990528351808403850181526060909301909352815191909201206040517fc475abff00000000000000000000000000000000000000000000000000000000815260048101889052602481018790529091507f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b03169063c475abff906044016020604051808303816000875af1158015611407573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061142b919061427c565b91506114368161250d565b1561147057600080806114488461079d565b925092509250611459868287612b87565b955061146c848460208a86171789612bd1565b5050505b50949350505050565b606081518351146114f25760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e67746860448201527f206d69736d6174636800000000000000000000000000000000000000000000006064820152608401610756565b6000835167ffffffffffffffff81111561150e5761150e613997565b604051908082528060200260200182016040528015611537578160200160208202803683370190505b50905060005b84518110156115af5761158285828151811061155b5761155b6141de565b6020026020010151858381518110611575576115756141de565b60200260200101516106dc565b828281518110611594576115946141de565b60209081029190910101526115a88161420d565b905061153d565b509392505050565b60008087876040516115ca929190614295565b6040519081900381207f6352211e0000000000000000000000000000000000000000000000000000000082526004820181905291506000907f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b031690636352211e90602401602060405180830381865afa158015611653573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167791906142a5565b90506001600160a01b038116331480159061173857506040517fe985e9c50000000000000000000000000000000000000000000000000000000081526001600160a01b0382811660048301523360248301527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296169063e985e9c590604401602060405180830381865afa158015611712573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173691906142c2565b155b15611789576040805160006020808301919091528183018590528251808303840181526060830193849052805191012063168ab55d60e31b909252606481019190915233608482015260a401610756565b6040517f23b872dd0000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152306024830152604482018490527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d529616906323b872dd90606401600060405180830381600087803b15801561181257600080fd5b505af1158015611826573d6000803e3d6000fd5b50506040517f28ed4f6c000000000000000000000000000000000000000000000000000000008152600481018590523060248201527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b031692506328ed4f6c9150604401600060405180830381600087803b1580156118ab57600080fd5b505af11580156118bf573d6000803e3d6000fd5b5050505061190889898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b92508a9150899050886126f9565b9998505050505050505050565b61191d612814565b6040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015611985573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119a991906142c2565b50505050565b600061079782612c42565b6119c2612814565b6119cc6000612c58565b565b600084846040516119e0929190614295565b60405190819003902090506000611a1e8183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b9050600080611a2c83612cc0565b6006546040517f4e3f212d0000000000000000000000000000000000000000000000000000000081529294509092506001600160a01b031690634e3f212d90611a83908b908b908b90889088908d906004016142df565b600060405180830381600087803b158015611a9d57600080fd5b505af1158015611ab1573d6000803e3d6000fd5b505050505050505050505050565b6001600160a01b0382163303611b3d5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2073657474696e6720617070726f76616c2073746174757360448201527f20666f722073656c6600000000000000000000000000000000000000000000006064820152608401610756565b3360008181526002602090815260408083206001600160a01b0387168085529083529281902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b600080611bd38461079d565b50841663ffffffff908116908516149250505092915050565b611bf4612814565b6006546001600160a01b031615611d46576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52969091169063a22cb46590604401600060405180830381600087803b158015611c8d57600080fd5b505af1158015611ca1573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600060248201527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff072106909116925063a22cb4659150604401600060405180830381600087803b158015611d2d57600080fd5b505af1158015611d41573d6000803e3d6000fd5b505050505b600680547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03831690811790915515611ebd576006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52969091169063a22cb46590604401600060405180830381600087803b158015611e0957600080fd5b505af1158015611e1d573d6000803e3d6000fd5b50506006546040517fa22cb4650000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152600160248201527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff072106909116925063a22cb4659150604401600060405180830381600087803b158015611ea957600080fd5b505af11580156110f6573d6000803e3d6000fd5b50565b3360009081526003602052604081205460ff16611f455760405162461bcd60e51b815260206004820152602860248201527f436f6e74726f6c6c61626c653a2043616c6c6572206973206e6f74206120636f60448201527f6e74726f6c6c65720000000000000000000000000000000000000000000000006064820152608401610756565b60008888604051611f57929190614295565b6040519081900381207ffca247ac000000000000000000000000000000000000000000000000000000008252600482018190523060248301526044820188905291507f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b03169063fca247ac906064016020604051808303816000875af1158015611fec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612010919061427c565b915061205789898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508b9250889150879050896126f9565b5050979650505050505050565b60008261207181336124b2565b6120975760405163168ab55d60e31b815260048101829052336024820152604401610756565b83600260006120a58361079d565b5091505063ffffffff82821616156120d35760405163a2a7201360e01b815260048101849052602401610756565b6120dd8787612d55565b600080806120ea8a61079d565b92509250925081891798506121018a848b84612d84565b509698975050505050505050565b8361211a81336124b2565b6121405760405163168ab55d60e31b815260048101829052336024820152604401610756565b84601c600061214e8361079d565b5091505063ffffffff828216161561217c5760405163a2a7201360e01b815260048101849052602401610756565b6040517fcf408823000000000000000000000000000000000000000000000000000000008152600481018990523060248201526001600160a01b03878116604483015267ffffffffffffffff871660648301527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff072106169063cf40882390608401600060405180830381600087803b15801561221557600080fd5b505af1158015612229573d6000803e3d6000fd5b50505050600061223b8960001c61079d565b5050905061225f81898b60001c600160405180602001604052806000815250612de0565b505050505050505050565b612272612814565b6001600160a01b03821660008181526003602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf8791015b60405180910390a25050565b6001600160a01b03841661236c5760405162461bcd60e51b815260206004820152602560248201527f455243313135353a207472616e7366657220746f20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610756565b6001600160a01b0385163314806123a657506001600160a01b038516600090815260026020908152604080832033845290915290205460ff165b6124185760405162461bcd60e51b815260206004820152602960248201527f455243313135353a2063616c6c6572206973206e6f74206f776e6572206e6f7260448201527f20617070726f76656400000000000000000000000000000000000000000000006064820152608401610756565b6110f68585858585612de0565b61242d612814565b6001600160a01b0381166124a95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610756565b611ebd81612c58565b6000806124be846119af565b9050826001600160a01b0316816001600160a01b0316148061250557506001600160a01b0380821660009081526002602090815260408083209387168352929052205460ff165b949350505050565b600080612519836119af565b6001600160a01b03161415801561079757506040517f02571be30000000000000000000000000000000000000000000000000000000081526004810183905230906001600160a01b037f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff07210616906302571be390602401602060405180830381865afa1580156125ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125cf91906142a5565b6001600160a01b03161492915050565b6000818152600160205260408120549060c082901c8242821015612606576000925061260e565b60a081901c92505b509193909250565b60007fffffffff0000000000000000000000000000000000000000000000000000000082167fd9b67a260000000000000000000000000000000000000000000000000000000014806126a957507fffffffff0000000000000000000000000000000000000000000000000000000082167f0e89341c00000000000000000000000000000000000000000000000000000000145b8061079757507f01ffc9a7000000000000000000000000000000000000000000000000000000007fffffffff00000000000000000000000000000000000000000000000000000000831614610797565b84516020860120600090816127358183604080516020808201949094528082019290925280518083038201815260609092019052805191012090565b90506000612744828488612f8e565b9750915061275c90506000838b8b60208c178b613066565b6001600160a01b03851615612807576040517f1896f70a000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0386811660248301527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff0721061690631896f70a90604401600060405180830381600087803b1580156127ee57600080fd5b505af1158015612802573d6000803e3d6000fd5b505050505b5093979650505050505050565b6000546001600160a01b031633146119cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610756565b6001600160a01b0384163b15612a74576040517fbc197c810000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063bc197c81906128cb9089908990889088908890600401614345565b6020604051808303816000875af1925050508015612906575060408051601f3d908101601f19168201909252612903918101906143a3565b60015b6129bb576129126143c0565b806308c379a00361294b57506129266143dc565b80612931575061294d565b8060405162461bcd60e51b81526004016107569190613832565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e204552433131353560448201527f526563656976657220696d706c656d656e7465720000000000000000000000006064820152608401610756565b7fffffffff0000000000000000000000000000000000000000000000000000000081167fbc197c810000000000000000000000000000000000000000000000000000000014612a725760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610756565b505b505050505050565b612a87826001611bc7565b15612aa85760405163a2a7201360e01b815260048101839052602401610756565b612ab182613117565b6040517f5b0fc9c3000000000000000000000000000000000000000000000000000000008152600481018390526001600160a01b0382811660248301527f0000000000000000000000009c84c93506551b9212f86c0b020c53cfff0721061690635b0fc9c390604401600060405180830381600087803b158015612b3457600080fd5b505af1158015612b48573d6000803e3d6000fd5b50506040516001600160a01b03841681528492507fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c491506020016122e4565b60008167ffffffffffffffff168467ffffffffffffffff161115612ba9578193505b8267ffffffffffffffff168467ffffffffffffffff161015612bc9578293505b509192915050565b612bdb84836131d2565b60008481526001602052604090206001600160a01b03841677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790556119a9565b600080612c4e8361079d565b5090949350505050565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60065460009081906001600160a01b0316612d07576040517f24c1d6d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612d1183336124b2565b612d375760405163168ab55d60e31b815260048101849052336024820152604401610756565b612d408361079d565b9093509150612d50905083613117565b915091565b6020811615612d805760405163168ab55d60e31b815260048101839052336024820152604401610756565b5050565b612d9084848484612bd1565b6040805163ffffffff8416815267ffffffffffffffff8316602082015285917f936318e296f824e203b086d97bb155a0200cec4847efea1fb4b9b7f924157355910160405180910390a250505050565b6000806000612dee8661079d565b925092509250612dff826004161590565b612e1f5760405163a2a7201360e01b815260048101879052602401610756565b846001148015612e405750876001600160a01b0316836001600160a01b0316145b612eb25760405162461bcd60e51b815260206004820152602a60248201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60448201527f72207472616e73666572000000000000000000000000000000000000000000006064820152608401610756565b866001600160a01b0316836001600160a01b031603612ed3575050506110f6565b60008681526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000060a085901b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b1617905560408051878152602081018790526001600160a01b03808a1692908b169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46112c233898989898961320b565b6000808080612f9c8761079d565b6040517fd6e4fa86000000000000000000000000000000000000000000000000000000008152600481018a905292965090945091506000907f00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d52966001600160a01b03169063d6e4fa8690602401602060405180830381865afa158015613025573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613049919061427c565b9050613056868383612b87565b9550859250505093509350939050565b600086815260056020526040812080546131089187916130859061418b565b80601f01602080910402602001604051908101604052809291908181526020018280546130b19061418b565b80156130fe5780601f106130d3576101008083540402835291602001916130fe565b820191906000526020600020905b8154815290600101906020018083116130e157829003601f168201915b5050505050613366565b9050612a72868286868661340f565b60008060006131258461079d565b600087815260016020526040902077ffffffff000000000000000000000000000000000000000060a084901b167fffffffffffffffff00000000000000000000000000000000000000000000000060c084901b161790559194509250905060408051858152600160208201526000916001600160a01b0386169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a450505050565b63ffffffdf8116158015906131ea5750602181811614155b15612d805760405163a2a7201360e01b815260048101839052602401610756565b6001600160a01b0384163b15612a74576040517ff23a6e610000000000000000000000000000000000000000000000000000000081526001600160a01b0385169063f23a6e61906132689089908990889088908890600401614484565b6020604051808303816000875af19250505080156132a3575060408051601f3d908101601f191682019092526132a0918101906143a3565b60015b6132af576129126143c0565b7fffffffff0000000000000000000000000000000000000000000000000000000081167ff23a6e610000000000000000000000000000000000000000000000000000000014612a725760405162461bcd60e51b815260206004820152602860248201527f455243313135353a204552433131353552656365697665722072656a6563746560448201527f6420746f6b656e730000000000000000000000000000000000000000000000006064820152608401610756565b60606001835110156133a4576040517f280dacb600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60ff835111156133e257826040517fe3ba295f0000000000000000000000000000000000000000000000000000000081526004016107569190613832565b825183836040516020016133f8939291906144c7565b604051602081830303815290604052905092915050565b60008581526005602052604090206134278582614573565b5061343485848484613479565b847f8ce7013e8abebc55c3890a68f5a27c67c3f7efa64e584de5fb22363c606fd3408585858560405161346a9493929190614633565b60405180910390a25050505050565b61348384836131d2565b600061348e856119af565b90506001600160a01b038116156134df576134a885613117565b6040516000815285907fee2ba1195c65bcf218a83d874335c6bf9d9067b4c672f3c3bf16cf40de7586c49060200160405180910390a25b6110f68585858583600080806134f48461079d565b9250925092508467ffffffffffffffff168167ffffffffffffffff16111561351a578094505b6001600160a01b038316156135715760405162461bcd60e51b815260206004820152601f60248201527f455243313135353a206d696e74206f66206578697374696e6720746f6b656e006044820152606401610756565b6001600160a01b0387166135ed5760405162461bcd60e51b815260206004820152602160248201527f455243313135353a206d696e7420746f20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610756565b306001600160a01b0388160361366b5760405162461bcd60e51b815260206004820152603460248201527f455243313135353a206e65774f776e65722063616e6e6f74206265207468652060448201527f4e616d655772617070657220636f6e74726163740000000000000000000000006064820152608401610756565b60008481526001602052604090206001600160a01b03881677ffffffff000000000000000000000000000000000000000088851760a01b16177fffffffffffffffff00000000000000000000000000000000000000000000000060c088901b1617905560408051858152600160208201526001600160a01b0389169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46112c2336000898760016040518060200160405280600081525061320b565b6001600160a01b0381168114611ebd57600080fd5b6000806040838503121561375e57600080fd5b823561376981613736565b946020939093013593505050565b60006020828403121561378957600080fd5b5035919050565b7fffffffff0000000000000000000000000000000000000000000000000000000081168114611ebd57600080fd5b6000602082840312156137d057600080fd5b81356137db81613790565b9392505050565b60005b838110156137fd5781810151838201526020016137e5565b50506000910152565b6000815180845261381e8160208601602086016137e2565b601f01601f19169290920160200192915050565b6020815260006137db6020830184613806565b803567ffffffffffffffff8116811461385d57600080fd5b919050565b6000806040838503121561387557600080fd5b8235915061388560208401613845565b90509250929050565b60008083601f8401126138a057600080fd5b50813567ffffffffffffffff8111156138b857600080fd5b6020830191508360208285010111156138d057600080fd5b9250929050565b6000806000806000608086880312156138ef57600080fd5b85356138fa81613736565b9450602086013561390a81613736565b935060408601359250606086013567ffffffffffffffff81111561392d57600080fd5b6139398882890161388e565b969995985093965092949392505050565b60006020828403121561395c57600080fd5b81356137db81613736565b6000806040838503121561397a57600080fd5b82359150602083013561398c81613736565b809150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b601f19601f830116810181811067ffffffffffffffff821117156139ec576139ec613997565b6040525050565b600067ffffffffffffffff821115613a0d57613a0d613997565b5060051b60200190565b600082601f830112613a2857600080fd5b81356020613a35826139f3565b604051613a4282826139c6565b83815260059390931b8501820192828101915086841115613a6257600080fd5b8286015b84811015613a7d5780358352918301918301613a66565b509695505050505050565b600067ffffffffffffffff821115613aa257613aa2613997565b50601f01601f191660200190565b6000613abb83613a88565b604051613ac882826139c6565b809250848152858585011115613add57600080fd5b8484602083013760006020868301015250509392505050565b600082601f830112613b0757600080fd5b6137db83833560208501613ab0565b600080600080600060a08688031215613b2e57600080fd5b8535613b3981613736565b94506020860135613b4981613736565b9350604086013567ffffffffffffffff80821115613b6657600080fd5b613b7289838a01613a17565b94506060880135915080821115613b8857600080fd5b613b9489838a01613a17565b93506080880135915080821115613baa57600080fd5b50613bb788828901613af6565b9150509295509295909350565b600080600060608486031215613bd957600080fd5b833592506020840135613beb81613736565b91506040840135613bfb81613736565b809150509250925092565b803563ffffffff8116811461385d57600080fd5b60008060008060808587031215613c3057600080fd5b8435935060208501359250613c4760408601613c06565b9150613c5560608601613845565b905092959194509250565b60008060408385031215613c7357600080fd5b823567ffffffffffffffff80821115613c8b57600080fd5b818501915085601f830112613c9f57600080fd5b81356020613cac826139f3565b604051613cb982826139c6565b83815260059390931b8501820192828101915089841115613cd957600080fd5b948201945b83861015613d00578535613cf181613736565b82529482019490820190613cde565b96505086013592505080821115613d1657600080fd5b50613d2385828601613a17565b9150509250929050565b600081518084526020808501945080840160005b83811015613d5d57815187529582019590820190600101613d41565b509495945050505050565b6020815260006137db6020830184613d2d565b60008060008060008060a08789031215613d9457600080fd5b863567ffffffffffffffff811115613dab57600080fd5b613db789828a0161388e565b9097509550506020870135613dcb81613736565b9350613dd960408801613c06565b9250613de760608801613845565b91506080870135613df781613736565b809150509295509295509295565b600080600060608486031215613e1a57600080fd5b8335613e2581613736565b92506020840135613e3581613736565b929592945050506040919091013590565b60008060008060608587031215613e5c57600080fd5b843567ffffffffffffffff811115613e7357600080fd5b613e7f8782880161388e565b9095509350506020850135613e9381613736565b91506040850135613ea381613736565b939692955090935050565b8015158114611ebd57600080fd5b60008060408385031215613ecf57600080fd5b8235613eda81613736565b9150602083013561398c81613eae565b60008060408385031215613efd57600080fd5b8235915061388560208401613c06565b600080600080600080600060c0888a031215613f2857600080fd5b873567ffffffffffffffff811115613f3f57600080fd5b613f4b8a828b0161388e565b9098509650506020880135613f5f81613736565b9450604088013593506060880135613f7681613736565b9250613f8460808901613c06565b9150613f9260a08901613845565b905092959891949750929550565b60008060008060808587031215613fb657600080fd5b843593506020850135613fc881613736565b92506040850135613c4781613736565b60008060408385031215613feb57600080fd5b8235613ff681613736565b9150602083013561398c81613736565b600080600080600060a0868803121561401e57600080fd5b853561402981613736565b9450602086013561403981613736565b93506040860135925060608601359150608086013567ffffffffffffffff81111561406357600080fd5b613bb788828901613af6565b60006020828403121561408157600080fd5b815167ffffffffffffffff81111561409857600080fd5b8201601f810184136140a957600080fd5b80516140b481613a88565b6040516140c182826139c6565b8281528660208486010111156140d657600080fd5b6140e78360208301602087016137e2565b9695505050505050565b600080600080600060a0868803121561410957600080fd5b853567ffffffffffffffff81111561412057600080fd5b8601601f8101881361413157600080fd5b61414088823560208401613ab0565b955050602086013561415181613736565b935061415f60408701613c06565b925061416d60608701613845565b9150608086013561417d81613736565b809150509295509295909350565b600181811c9082168061419f57607f821691505b6020821081036141d8577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006000198203614247577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b6040815260006142616040830185613d2d565b82810360208401526142738185613d2d565b95945050505050565b60006020828403121561428e57600080fd5b5051919050565b8183823760009101908152919050565b6000602082840312156142b757600080fd5b81516137db81613736565b6000602082840312156142d457600080fd5b81516137db81613eae565b60a081528560a0820152858760c0830137600060c08783018101919091526001600160a01b03958616602083015263ffffffff94909416604082015267ffffffffffffffff9290921660608301529092166080830152601f909201601f19160101919050565b60006001600160a01b03808816835280871660208401525060a0604083015261437160a0830186613d2d565b82810360608401526143838186613d2d565b905082810360808401526143978185613806565b98975050505050505050565b6000602082840312156143b557600080fd5b81516137db81613790565b600060033d11156143d95760046000803e5060005160e01c5b90565b600060443d10156143ea5790565b6040517ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc803d016004833e81513d67ffffffffffffffff816024840111818411171561443857505050505090565b82850191508151818111156144505750505050505090565b843d870101602082850101111561446a5750505050505090565b614479602082860101876139c6565b509095945050505050565b60006001600160a01b03808816835280871660208401525084604083015283606083015260a060808301526144bc60a0830184613806565b979650505050505050565b7fff000000000000000000000000000000000000000000000000000000000000008460f81b168152600083516145048160018501602088016137e2565b83519083019061451b8160018401602088016137e2565b0160010195945050505050565b601f82111561456e57600081815260208120601f850160051c8101602086101561454f5750805b601f850160051c820191505b81811015612a745782815560010161455b565b505050565b815167ffffffffffffffff81111561458d5761458d613997565b6145a18161459b845461418b565b84614528565b602080601f8311600181146145d657600084156145be5750858301515b600019600386901b1c1916600185901b178555612a74565b600085815260208120601f198616915b82811015614605578886015182559484019460019091019084016145e6565b50858210156146235787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6080815260006146466080830187613806565b6001600160a01b039590951660208301525063ffffffff92909216604083015267ffffffffffffffff1660609091015291905056fea26469706673582212204966775eba5507f83e5ca7583875984ed19e860a4818f897f6bb574f1fe040dc64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009c84c93506551b9212f86c0b020c53cfff07210600000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296000000000000000000000000f724bcb58b4a284d9229c148013a10578b3b37d2
-----Decoded View---------------
Arg [0] : _bdns (address): 0x9c84C93506551B9212F86c0b020c53CFFF072106
Arg [1] : _registrar (address): 0x67C8aFF20754629308Ce5bE49F5cfEEF5c7D5296
Arg [2] : _metadataService (address): 0xF724bCB58B4A284D9229c148013A10578b3B37D2
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009c84c93506551b9212f86c0b020c53cfff072106
Arg [1] : 00000000000000000000000067c8aff20754629308ce5be49f5cfeef5c7d5296
Arg [2] : 000000000000000000000000f724bcb58b4a284d9229c148013a10578b3b37d2
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.