Sepolia Testnet

Contract

0x2674E4FAe872780F01B99e109E67749B765703fB

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Mint59630752024-05-23 18:18:244 days ago1716488304IN
0x2674E4FA...B765703fB
0.0014 ETH0.000354651.55968059
Mint With Data59500012024-05-21 19:57:246 days ago1716321444IN
0x2674E4FA...B765703fB
0.0004 ETH0.000498281.63942806
Mint With Data59019992024-05-14 15:34:4813 days ago1715700888IN
0x2674E4FA...B765703fB
0.0074 ETH0.009498733.22179702
Mint59009362024-05-14 11:48:2413 days ago1715687304IN
0x2674E4FA...B765703fB
0.0014 ETH0.0037261816.38768278
Mint With Data58313892024-05-03 23:36:3624 days ago1714779396IN
0x2674E4FA...B765703fB
0.02 ETH0.000430971.52057051
Mint58049242024-04-29 21:51:2428 days ago1714427484IN
0x2674E4FA...B765703fB
0.0074 ETH0.000345151.50091783
Mint With Data58035152024-04-29 16:41:1228 days ago1714408872IN
0x2674E4FA...B765703fB
0.0054 ETH0.00155845.49837874
Mint With Data57827182024-04-26 16:21:2431 days ago1714148484IN
0x2674E4FA...B765703fB
0.0004 ETH0.000716042.58779643
Mint57623312024-04-23 19:45:3634 days ago1713901536IN
0x2674E4FA...B765703fB
0.0004 ETH0.000330931.50000001
Mint With Data57623142024-04-23 19:41:4834 days ago1713901308IN
0x2674E4FA...B765703fB
0.0004 ETH0.000414951.50000002
Mint With Data57551532024-04-22 19:39:2435 days ago1713814764IN
0x2674E4FA...B765703fB
0.0004 ETH0.000418761.50000001
Mint With Data57264892024-04-18 18:47:1239 days ago1713466032IN
0x2674E4FA...B765703fB
0.02 ETH0.000430711.50673593
Mint57241542024-04-18 10:46:0040 days ago1713437160IN
0x2674E4FA...B765703fB
0.01 ETH0.000979074.30550083
Mint With Data56911422024-04-13 19:20:0044 days ago1713036000IN
0x2674E4FA...B765703fB
0.0004 ETH0.000415021.50028757
Mint With Data56426362024-04-06 18:02:1251 days ago1712426532IN
0x2674E4FA...B765703fB
0.0004 ETH0.000004620.0165579
Mint With Data56288522024-04-04 17:26:0053 days ago1712251560IN
0x2674E4FA...B765703fB
0.1 ETH0.00044211.5459424
Mint56276182024-04-04 13:04:2453 days ago1712235864IN
0x2674E4FA...B765703fB
0.0044 ETH0.000654542.84629774
Mint56276072024-04-04 13:02:0053 days ago1712235720IN
0x2674E4FA...B765703fB
0.0044 ETH0.000640052.78435791
Mint With Data56275982024-04-04 13:00:1253 days ago1712235612IN
0x2674E4FA...B765703fB
0.0044 ETH0.000721852.54697943
Mint With Data56272002024-04-04 11:35:4853 days ago1712230548IN
0x2674E4FA...B765703fB
0.088 ETH0.000426261.50406863
Mint56242802024-04-04 1:17:0054 days ago1712193420IN
0x2674E4FA...B765703fB
0.01 ETH0.000344871.50000001
Mint56143262024-04-02 15:48:1255 days ago1712072892IN
0x2674E4FA...B765703fB
0.0014 ETH0.000569092.50232004
Mint56143162024-04-02 15:46:1255 days ago1712072772IN
0x2674E4FA...B765703fB
0.0014 ETH0.000583462.56593864
Mint With Data56143012024-04-02 15:43:1255 days ago1712072592IN
0x2674E4FA...B765703fB
0.0014 ETH0.000744252.62588597
Mint With Data56124542024-04-02 9:33:4856 days ago1712050428IN
0x2674E4FA...B765703fB
0.25 ETH0.002015687.04987387
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To Value
59630752024-05-23 18:18:244 days ago1716488304
0x2674E4FA...B765703fB
0.0004 ETH
59630752024-05-23 18:18:244 days ago1716488304
0x2674E4FA...B765703fB
0.001 ETH
59500012024-05-21 19:57:246 days ago1716321444
0x2674E4FA...B765703fB
0.0004 ETH
59019992024-05-14 15:34:4813 days ago1715700888
0x2674E4FA...B765703fB
0.0004 ETH
59019992024-05-14 15:34:4813 days ago1715700888
0x2674E4FA...B765703fB
0.007 ETH
59009362024-05-14 11:48:2413 days ago1715687304
0x2674E4FA...B765703fB
0.0004 ETH
59009362024-05-14 11:48:2413 days ago1715687304
0x2674E4FA...B765703fB
0.001 ETH
58313892024-05-03 23:36:3624 days ago1714779396
0x2674E4FA...B765703fB
0.001 ETH
58313892024-05-03 23:36:3624 days ago1714779396
0x2674E4FA...B765703fB
0.019 ETH
58049242024-04-29 21:51:2428 days ago1714427484
0x2674E4FA...B765703fB
0.0004 ETH
58049242024-04-29 21:51:2428 days ago1714427484
0x2674E4FA...B765703fB
0.007 ETH
58035152024-04-29 16:41:1228 days ago1714408872
0x2674E4FA...B765703fB
0.0004 ETH
58035152024-04-29 16:41:1228 days ago1714408872
0x2674E4FA...B765703fB
0.005 ETH
57827182024-04-26 16:21:2431 days ago1714148484
0x2674E4FA...B765703fB
0.0004 ETH
57623312024-04-23 19:45:3634 days ago1713901536
0x2674E4FA...B765703fB
0.0004 ETH
57623142024-04-23 19:41:4834 days ago1713901308
0x2674E4FA...B765703fB
0.0004 ETH
57551532024-04-22 19:39:2435 days ago1713814764
0x2674E4FA...B765703fB
0.0004 ETH
57264892024-04-18 18:47:1239 days ago1713466032
0x2674E4FA...B765703fB
0.001 ETH
57264892024-04-18 18:47:1239 days ago1713466032
0x2674E4FA...B765703fB
0.019 ETH
57241542024-04-18 10:46:0040 days ago1713437160
0x2674E4FA...B765703fB
0.0005 ETH
57241542024-04-18 10:46:0040 days ago1713437160
0x2674E4FA...B765703fB
0.0095 ETH
56911422024-04-13 19:20:0044 days ago1713036000
0x2674E4FA...B765703fB
0.0004 ETH
56426362024-04-06 18:02:1251 days ago1712426532
0x2674E4FA...B765703fB
0.0004 ETH
56288522024-04-04 17:26:0053 days ago1712251560
0x2674E4FA...B765703fB
0.005 ETH
56288522024-04-04 17:26:0053 days ago1712251560
0x2674E4FA...B765703fB
0.095 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NamespaceMinter

Compiler Version
v0.8.20+commit.a1b79de6

Optimization Enabled:
Yes with 1200 runs

Other Settings:
paris EvmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 23 : NamespaceMinting.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ~0.8.20;

import {MintSubnameContext, ListedENSName } from "./Types.sol";
import {Controllable} from "./controllers/Controllable.sol";
import {INamespaceRegistry} from "./INamespaceRegistry.sol";
import {INameWrapper} from "./ens/INameWrapper.sol";
import {IPublicResolver} from "./ens/IPublicResolver.sol";
import {INameWrapperProxy} from "./INameWrapperProxy.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import {ERC1155Holder} from "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";

error NameNotListed(bytes32 node);
error NotEnoughFunds(uint256 current, uint256 expected);

contract NamespaceMinter is Controllable, EIP712, ERC1155Holder {
    event SubnameMinted(
        bytes32 indexed parentNode,
        string label,
        uint256 mintPrice,
        uint256 mintFee,
        address indexed paymentReceiver,
        address sender,
        address subnameOwner
    );

    bytes32 constant MINT_CONTEXT =
        keccak256(
            "MintContext(string subnameLabel,bytes32 parentNode,address resolver,address subnameOwner,uint32 fuses,uint256 mintPrice,uint256 mintFee,uint64 expiry)"
        );

    address private verifier;
    address private treasury;
    INamespaceRegistry registry;
    INameWrapperProxy wrapperProxy;
    INameWrapper nameWrapper;

    mapping(bytes32 => bool) signatures;

    constructor(
        address _treasury,
        address _verifier,
        address _nameWrapperProxy,
        address _nameWrapper,
        address _namespaceRegistry,
        string memory version
    ) EIP712("namespace", version) {
        treasury = _treasury;
        verifier = _verifier;
        nameWrapper = INameWrapper(_nameWrapper);
        wrapperProxy = INameWrapperProxy(_nameWrapperProxy);
        registry = INamespaceRegistry(_namespaceRegistry);
    }

    function mint(
        MintSubnameContext memory context,
        bytes memory signature
    ) external payable {
        ListedENSName memory listing = _getListing(context.parentNode);

        _verifySignature(context, signature);

        wrapperProxy.setSubnodeRecord(
            context.parentNode,
            context.subnameLabel,
            context.subnameOwner,
            context.resolver,
            context.ttl,
            context.fuses,
            context.expiry
        );

        _transferFunds(
            listing.paymentReceiver,
            context.mintPrice,
            context.mintFee
        );

        emit SubnameMinted(
            context.parentNode,
            context.subnameLabel,
            context.mintPrice,
            context.mintFee,
            listing.paymentReceiver,
            msg.sender,
            context.subnameOwner
        );
    }

    function mintWithData(
        MintSubnameContext calldata context,
        bytes calldata signature,
        bytes[] calldata data
    ) external payable {
        
        if (data.length == 0) {
            this.mint(context,signature);
            return;
        }
    
        require(
            context.resolver != address(0),
            "Resolver address must be set when updating records"
        );

        ListedENSName memory listing = _getListing(context.parentNode);

        _verifySignature(context, signature);

        bytes32 subnameNode = wrapperProxy.setSubnodeRecord(
            context.parentNode,
            context.subnameLabel,
            address(this),
            context.resolver,
            context.ttl,
            context.fuses,
            context.expiry
        );

        _setRecords(context.resolver, subnameNode, data);

        nameWrapper.safeTransferFrom(
            address(this),
            context.subnameOwner,
            uint256(subnameNode),
            1,
            bytes("")
        );

        _transferFunds(
            listing.paymentReceiver,
            context.mintPrice,
            context.mintFee
        );

        emit SubnameMinted(
            context.parentNode,
            context.subnameLabel,
            context.mintPrice,
            context.mintFee,
            listing.paymentReceiver,
            msg.sender,
            context.subnameOwner
        );
    }

    function _getListing(
        bytes32 nameNode
    ) internal view returns (ListedENSName memory) {
        ListedENSName memory listing = registry.get(nameNode);
        if (!listing.isListed) {
            revert NameNotListed(nameNode);
        }
        return listing;
    }

    function _transferFunds(
        address paymentReceiver,
        uint256 mintPrice,
        uint256 mintFee
    ) internal {
        require(msg.value >= mintFee + mintPrice, "Insufficient funds");

        payable(paymentReceiver).transfer(mintPrice);
        payable(treasury).transfer(mintFee);
    }

    function setTreasury(address _treasury) external onlyOwner() {
        treasury = _treasury;
    }

    function withdraw() external onlyOwner() {
        require(address(this).balance > 0, "No funds present.");
        payable(treasury).transfer(address(this).balance);
    }

    function _verifySignature(
        MintSubnameContext memory context,
        bytes memory signature
    ) internal {
        bytes32 signatureHash = keccak256(signature);
        require(!signatures[signatureHash], "Signature already used");

        require(
            _extractSigner(context, signature) == verifier,
            "Invalid signature"
        );

        signatures[signatureHash] = true;
    }

    function _extractSigner(
        MintSubnameContext memory context,
        bytes memory signature
    ) internal view returns (address) {
        bytes32 digest = _hashTypedDataV4(
            keccak256(
                abi.encode(
                    MINT_CONTEXT,
                    keccak256(abi.encodePacked(context.subnameLabel)),
                    context.parentNode,
                    context.resolver,
                    context.subnameOwner,
                    context.fuses,
                    context.mintPrice,
                    context.mintFee,
                    context.expiry
                )
            )
        );
        return ECDSA.recover(digest, signature);
    }

    function _setRecords(
        address resolverAddress,
        bytes32 subnameNode,
        bytes[] calldata data
    ) internal {
        IPublicResolver resolver = IPublicResolver(resolverAddress);
        resolver.multicallWithNodeCheck(subnameNode, data);
    }

    function setVerifier(address _verifier) external onlyOwner {
        verifier = _verifier;
    }

    function setNameWrapper(address _nameWrapper) external onlyOwner {
        nameWrapper = INameWrapper(_nameWrapper);
    }
}

File 2 of 23 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling 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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

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

File 3 of 23 : IERC5267.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)

pragma solidity ^0.8.20;

interface IERC5267 {
    /**
     * @dev MAY be emitted to signal that the domain could have changed.
     */
    event EIP712DomainChanged();

    /**
     * @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
     * signature.
     */
    function eip712Domain()
        external
        view
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        );
}

File 4 of 23 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of 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 value 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 a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * 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 `value` 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 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` 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 values,
        bytes calldata data
    ) external;
}

File 5 of 23 : IERC1155Receiver.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

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

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

File 6 of 23 : ERC1155Holder.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/utils/ERC1155Holder.sol)

pragma solidity ^0.8.20;

import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol";
import {IERC1155Receiver} from "../IERC1155Receiver.sol";

/**
 * @dev Simple implementation of `IERC1155Receiver` that will allow a contract to hold ERC1155 tokens.
 *
 * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be
 * stuck.
 */
abstract contract ERC1155Holder is ERC165, IERC1155Receiver {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
        return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId);
    }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] memory,
        uint256[] memory,
        bytes memory
    ) public virtual override returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }
}

File 7 of 23 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

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

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

File 8 of 23 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.20;

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

    /**
     * @dev The signature derives the `address(0)`.
     */
    error ECDSAInvalidSignature();

    /**
     * @dev The signature has an invalid length.
     */
    error ECDSAInvalidSignatureLength(uint256 length);

    /**
     * @dev The signature has an S value that is in the upper half order.
     */
    error ECDSAInvalidSignatureS(bytes32 s);

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

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

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     */
    function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
        unchecked {
            bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
            // We do not check for an overflow here since the shift operation results in 0 or 1.
            uint8 v = uint8((uint256(vs) >> 255) + 27);
            return tryRecover(hash, v, r, s);
        }
    }

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

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

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

        return (signer, RecoverError.NoError, bytes32(0));
    }

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

    /**
     * @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
     */
    function _throwError(RecoverError error, bytes32 errorArg) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert ECDSAInvalidSignature();
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert ECDSAInvalidSignatureLength(uint256(errorArg));
        } else if (error == RecoverError.InvalidSignatureS) {
            revert ECDSAInvalidSignatureS(errorArg);
        }
    }
}

File 9 of 23 : EIP712.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)

pragma solidity ^0.8.20;

import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";

/**
 * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
 *
 * The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
 * encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
 * does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
 * produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
 *
 * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
 * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
 * ({_hashTypedDataV4}).
 *
 * The implementation of the domain separator was designed to be as efficient as possible while still properly updating
 * the chain id to protect against replay attacks on an eventual fork of the chain.
 *
 * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
 * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
 *
 * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
 * separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
 * separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
 *
 * @custom:oz-upgrades-unsafe-allow state-variable-immutable
 */
abstract contract EIP712 is IERC5267 {
    using ShortStrings for *;

    bytes32 private constant TYPE_HASH =
        keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");

    // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
    // invalidate the cached domain separator if the chain id changes.
    bytes32 private immutable _cachedDomainSeparator;
    uint256 private immutable _cachedChainId;
    address private immutable _cachedThis;

    bytes32 private immutable _hashedName;
    bytes32 private immutable _hashedVersion;

    ShortString private immutable _name;
    ShortString private immutable _version;
    string private _nameFallback;
    string private _versionFallback;

    /**
     * @dev Initializes the domain separator and parameter caches.
     *
     * The meaning of `name` and `version` is specified in
     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
     *
     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
     * - `version`: the current major version of the signing domain.
     *
     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
     * contract upgrade].
     */
    constructor(string memory name, string memory version) {
        _name = name.toShortStringWithFallback(_nameFallback);
        _version = version.toShortStringWithFallback(_versionFallback);
        _hashedName = keccak256(bytes(name));
        _hashedVersion = keccak256(bytes(version));

        _cachedChainId = block.chainid;
        _cachedDomainSeparator = _buildDomainSeparator();
        _cachedThis = address(this);
    }

    /**
     * @dev Returns the domain separator for the current chain.
     */
    function _domainSeparatorV4() internal view returns (bytes32) {
        if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
            return _cachedDomainSeparator;
        } else {
            return _buildDomainSeparator();
        }
    }

    function _buildDomainSeparator() private view returns (bytes32) {
        return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
    }

    /**
     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
     * function returns the hash of the fully encoded EIP712 message for this domain.
     *
     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
     *
     * ```solidity
     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
     *     keccak256("Mail(address to,string contents)"),
     *     mailTo,
     *     keccak256(bytes(mailContents))
     * )));
     * address signer = ECDSA.recover(digest, signature);
     * ```
     */
    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
        return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
    }

    /**
     * @dev See {IERC-5267}.
     */
    function eip712Domain()
        public
        view
        virtual
        returns (
            bytes1 fields,
            string memory name,
            string memory version,
            uint256 chainId,
            address verifyingContract,
            bytes32 salt,
            uint256[] memory extensions
        )
    {
        return (
            hex"0f", // 01111
            _EIP712Name(),
            _EIP712Version(),
            block.chainid,
            address(this),
            bytes32(0),
            new uint256[](0)
        );
    }

    /**
     * @dev The name parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _name which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Name() internal view returns (string memory) {
        return _name.toStringWithFallback(_nameFallback);
    }

    /**
     * @dev The version parameter for the EIP712 domain.
     *
     * NOTE: By default this function reads _version which is an immutable value.
     * It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
     */
    // solhint-disable-next-line func-name-mixedcase
    function _EIP712Version() internal view returns (string memory) {
        return _version.toStringWithFallback(_versionFallback);
    }
}

File 10 of 23 : MessageHashUtils.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)

pragma solidity ^0.8.20;

import {Strings} from "../Strings.sol";

/**
 * @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
 *
 * The library provides methods for generating a hash of a message that conforms to the
 * https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
 * specifications.
 */
library MessageHashUtils {
    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing a bytes32 `messageHash` with
     * `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
     * keccak256, although any bytes32 value can be safely used because the final digest will
     * be re-hashed.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
            mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
            digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
        }
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x45` (`personal_sign` messages).
     *
     * The digest is calculated by prefixing an arbitrary `message` with
     * `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
     * hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
     *
     * See {ECDSA-recover}.
     */
    function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
        return
            keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-191 signed data with version
     * `0x00` (data with intended validator).
     *
     * The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
     * `validator` address. Then hashing the result.
     *
     * See {ECDSA-recover}.
     */
    function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(hex"19_00", validator, data));
    }

    /**
     * @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
     *
     * The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
     * `\x19\x01` and hashing the result. It corresponds to the hash signed by the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
     *
     * See {ECDSA-recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
        /// @solidity memory-safe-assembly
        assembly {
            let ptr := mload(0x40)
            mstore(ptr, hex"19_01")
            mstore(add(ptr, 0x02), domainSeparator)
            mstore(add(ptr, 0x22), structHash)
            digest := keccak256(ptr, 0x42)
        }
    }
}

File 11 of 23 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 12 of 23 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

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

File 13 of 23 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b > a) return (false, 0);
            return (true, a - b);
        }
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
            // benefit is lost if 'b' is also tested.
            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
            if (a == 0) return (true, 0);
            uint256 c = a * b;
            if (c / a != b) return (false, 0);
            return (true, c);
        }
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a / b);
        }
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            if (b == 0) return (false, 0);
            return (true, a % b);
        }
    }

    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a == 0 ? 0 : (a - 1) / b + 1;
    }

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
     * denominator == 0.
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) with further edits by
     * Uniswap Labs also under MIT license.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator.
            // Always >= 1. See https://cs.stackexchange.com/q/138556/92363.

            uint256 twos = denominator & (0 - denominator);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also
            // works in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(uint256 x, uint256 y, uint256 denominator, Rounding rounding) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
     * towards zero.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10 ** 64) {
                value /= 10 ** 64;
                result += 64;
            }
            if (value >= 10 ** 32) {
                value /= 10 ** 32;
                result += 32;
            }
            if (value >= 10 ** 16) {
                value /= 10 ** 16;
                result += 16;
            }
            if (value >= 10 ** 8) {
                value /= 10 ** 8;
                result += 8;
            }
            if (value >= 10 ** 4) {
                value /= 10 ** 4;
                result += 4;
            }
            if (value >= 10 ** 2) {
                value /= 10 ** 2;
                result += 2;
            }
            if (value >= 10 ** 1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 256, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

File 14 of 23 : SignedMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard signed math utilities missing in the Solidity language.
 */
library SignedMath {
    /**
     * @dev Returns the largest of two signed numbers.
     */
    function max(int256 a, int256 b) internal pure returns (int256) {
        return a > b ? a : b;
    }

    /**
     * @dev Returns the smallest of two signed numbers.
     */
    function min(int256 a, int256 b) internal pure returns (int256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two signed numbers without overflow.
     * The result is rounded towards zero.
     */
    function average(int256 a, int256 b) internal pure returns (int256) {
        // Formula from the book "Hacker's Delight"
        int256 x = (a & b) + ((a ^ b) >> 1);
        return x + (int256(uint256(x) >> 255) & (a ^ b));
    }

    /**
     * @dev Returns the absolute unsigned value of a signed value.
     */
    function abs(int256 n) internal pure returns (uint256) {
        unchecked {
            // must be unchecked in order to support `n = type(int256).min`
            return uint256(n >= 0 ? n : -n);
        }
    }
}

File 15 of 23 : ShortStrings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)

pragma solidity ^0.8.20;

import {StorageSlot} from "./StorageSlot.sol";

// | string  | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA   |
// | length  | 0x                                                              BB |
type ShortString is bytes32;

/**
 * @dev This library provides functions to convert short memory strings
 * into a `ShortString` type that can be used as an immutable variable.
 *
 * Strings of arbitrary length can be optimized using this library if
 * they are short enough (up to 31 bytes) by packing them with their
 * length (1 byte) in a single EVM word (32 bytes). Additionally, a
 * fallback mechanism can be used for every other case.
 *
 * Usage example:
 *
 * ```solidity
 * contract Named {
 *     using ShortStrings for *;
 *
 *     ShortString private immutable _name;
 *     string private _nameFallback;
 *
 *     constructor(string memory contractName) {
 *         _name = contractName.toShortStringWithFallback(_nameFallback);
 *     }
 *
 *     function name() external view returns (string memory) {
 *         return _name.toStringWithFallback(_nameFallback);
 *     }
 * }
 * ```
 */
library ShortStrings {
    // Used as an identifier for strings longer than 31 bytes.
    bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;

    error StringTooLong(string str);
    error InvalidShortString();

    /**
     * @dev Encode a string of at most 31 chars into a `ShortString`.
     *
     * This will trigger a `StringTooLong` error is the input string is too long.
     */
    function toShortString(string memory str) internal pure returns (ShortString) {
        bytes memory bstr = bytes(str);
        if (bstr.length > 31) {
            revert StringTooLong(str);
        }
        return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
    }

    /**
     * @dev Decode a `ShortString` back to a "normal" string.
     */
    function toString(ShortString sstr) internal pure returns (string memory) {
        uint256 len = byteLength(sstr);
        // using `new string(len)` would work locally but is not memory safe.
        string memory str = new string(32);
        /// @solidity memory-safe-assembly
        assembly {
            mstore(str, len)
            mstore(add(str, 0x20), sstr)
        }
        return str;
    }

    /**
     * @dev Return the length of a `ShortString`.
     */
    function byteLength(ShortString sstr) internal pure returns (uint256) {
        uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
        if (result > 31) {
            revert InvalidShortString();
        }
        return result;
    }

    /**
     * @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
     */
    function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
        if (bytes(value).length < 32) {
            return toShortString(value);
        } else {
            StorageSlot.getStringSlot(store).value = value;
            return ShortString.wrap(FALLBACK_SENTINEL);
        }
    }

    /**
     * @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
     */
    function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return toString(value);
        } else {
            return store;
        }
    }

    /**
     * @dev Return the length of a string that was encoded to `ShortString` or written to storage using
     * {setWithFallback}.
     *
     * WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
     * actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
     */
    function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
        if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
            return byteLength(value);
        } else {
            return bytes(store).length;
        }
    }
}

File 16 of 23 : StorageSlot.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

File 17 of 23 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)

pragma solidity ^0.8.20;

import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";

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

    /**
     * @dev The `value` string doesn't fit in the specified `length`.
     */
    error StringsInsufficientHexLength(uint256 value, uint256 length);

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

    /**
     * @dev Converts a `int256` to its ASCII `string` decimal representation.
     */
    function toStringSigned(int256 value) internal pure returns (string memory) {
        return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

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

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal
     * representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), ADDRESS_LENGTH);
    }

    /**
     * @dev Returns true if the two strings are equal.
     */
    function equal(string memory a, string memory b) internal pure returns (bool) {
        return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
    }
}

File 18 of 23 : Controllable.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;

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

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

    event ControllerChanged(address indexed controller, bool enabled);

    constructor() Ownable(msg.sender) {}

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

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

File 19 of 23 : INameWrapper.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
uint32 constant CANNOT_UNWRAP = 1;

interface INameWrapper is IERC1155 {
    error Unauthorised(bytes32 node, address addr);
    error IncompatibleParent();
    error IncorrectTokenType();
    error LabelMismatch(bytes32 labelHash, bytes32 expectedLabelhash);
    error LabelTooShort();
    error LabelTooLong(string label);
    error IncorrectTargetOwner(address owner);
    error CannotUpgrade();
    error OperationProhibited(bytes32 node);
    error NameIsNotWrapped();
    error NameIsStillExpired();

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

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

    function setFuses(
        bytes32 node,
        uint16 ownerControlledFuses
    ) external returns (uint32 newFuses);
}

File 20 of 23 : IPublicResolver.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;

interface IPublicResolver {

    function setApprovalForAll(address, bool) external;

    function approve(bytes32 node, address delegate, bool approved) external;

    function isApprovedForAll(address account, address operator) external;

    function isApprovedFor(
        address owner,
        bytes32 node,
        address delegate
    ) external;

    function setABI(
        bytes32 node,
        uint256 contentType,
        bytes calldata data
    ) external;

    function setAddr(bytes32 node, address addr) external;

    function setAddr(bytes32 node, uint256 coinType, bytes calldata a) external;

    function setContenthash(bytes32 node, bytes calldata hash) external;

    function setDnsrr(bytes32 node, bytes calldata data) external;

    function setName(bytes32 node, string calldata _name) external;

    function setPubkey(bytes32 node, bytes32 x, bytes32 y) external;

    function setText(
        bytes32 node,
        string calldata key,
        string calldata value
    ) external;

    function setInterface(
        bytes32 node,
        bytes4 interfaceID,
        address implementer
    ) external;

    function multicall(
        bytes[] calldata data
    ) external returns (bytes[] memory results);

    function multicallWithNodeCheck(
        bytes32 nodehash,
        bytes[] calldata data
    ) external returns (bytes[] memory results);

    /* Deprecated functions */
    function content(bytes32 node) external view returns (bytes32);

    function multihash(bytes32 node) external view returns (bytes memory);

    function setContent(bytes32 node, bytes32 hash) external;

    function setMultihash(bytes32 node, bytes calldata hash) external;
}

File 21 of 23 : INamespaceRegistry.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;

import "./Types.sol";

interface INamespaceRegistry {
    function set(bytes32 node, ListedENSName calldata name) external;

    function get(bytes32 node) external view returns (ListedENSName memory);

    function remove(bytes32 node) external;
}

File 22 of 23 : INameWrapperProxy.sol
//SPDX-License-Identifier: UNLICENSED
pragma solidity ~0.8.20;

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

    function setFuses(
        bytes32 node,
        uint16 ownerControlledFuses
    ) external returns (uint32 newFuses);
}

File 24 of 23 : Types.sol
//SPDX-License-Identifier: MIT
pragma solidity ~0.8.20;

struct MintSubnameContext {
    bytes32 parentNode;
    string subnameLabel;
    address resolver;
    address subnameOwner;
    uint32 fuses;
    uint256 mintPrice;
    uint256 mintFee;
    uint64 ttl;
    uint64 expiry;
}

struct ListedENSName {
    string label;
    bytes32 nameNode;
    address paymentReceiver;
    bool isListed;
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"address","name":"_verifier","type":"address"},{"internalType":"address","name":"_nameWrapperProxy","type":"address"},{"internalType":"address","name":"_nameWrapper","type":"address"},{"internalType":"address","name":"_namespaceRegistry","type":"address"},{"internalType":"string","name":"version","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"bytes32","name":"node","type":"bytes32"}],"name":"NameNotListed","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"controller","type":"address"},{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"ControllerChanged","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","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":"bytes32","name":"parentNode","type":"bytes32"},{"indexed":false,"internalType":"string","name":"label","type":"string"},{"indexed":false,"internalType":"uint256","name":"mintPrice","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintFee","type":"uint256"},{"indexed":true,"internalType":"address","name":"paymentReceiver","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"subnameOwner","type":"address"}],"name":"SubnameMinted","type":"event"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"controllers","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"subnameLabel","type":"string"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"subnameOwner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"mintFee","type":"uint256"},{"internalType":"uint64","name":"ttl","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"internalType":"struct MintSubnameContext","name":"context","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"parentNode","type":"bytes32"},{"internalType":"string","name":"subnameLabel","type":"string"},{"internalType":"address","name":"resolver","type":"address"},{"internalType":"address","name":"subnameOwner","type":"address"},{"internalType":"uint32","name":"fuses","type":"uint32"},{"internalType":"uint256","name":"mintPrice","type":"uint256"},{"internalType":"uint256","name":"mintFee","type":"uint256"},{"internalType":"uint64","name":"ttl","type":"uint64"},{"internalType":"uint64","name":"expiry","type":"uint64"}],"internalType":"struct MintSubnameContext","name":"context","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"mintWithData","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"controller","type":"address"},{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_nameWrapper","type":"address"}],"name":"setNameWrapper","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_verifier","type":"address"}],"name":"setVerifier","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":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101608060405234620002e557620023128038038091620000218285620002ea565b833981019060c081830312620002e5576200003c816200030e565b6200004a602083016200030e565b9162000059604082016200030e565b62000067606083016200030e565b62000075608084016200030e565b60a084015190936001600160401b038211620002e557019486601f87011215620002e5578551956001600160401b038711620002b65760405196620000c5601f8201601f191660200189620002ea565b808852602088019860208284010111620002e557886020620000e8930162000323565b60408051959086016001600160401b03811187821017620002b657604052600986526020860197686e616d65737061636560b81b89523315620002cc5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a3620001758762000348565b98610120998a52620001878962000506565b97610140988952519020978860e0525190209687610100524660a0526040519760208901917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f835260408a015260608901524660808901523060a089015260a0885260c088019780891060018060401b038a1117620002b65760408990525190206080523060c052600580546001600160a01b03199081166001600160a01b0393841617909155600480548216938316939093179092556008805483169382169390931790925560078054821693831693909317909255600680549092169216919091179055611cb792836200065b843960805183611b8f015260a05183611c5b015260c05183611b60015260e05183611bde01526101005183611c0401525182610640015251816106690152f35b634e487b7160e01b600052604160045260246000fd5b604051631e4fbdf760e01b815260006004820152602490fd5b600080fd5b601f909101601f19168101906001600160401b03821190821017620002b657604052565b51906001600160a01b0382168203620002e557565b60005b838110620003375750506000910152565b818101518382015260200162000326565b805160209081811015620003c65750601f8251116200038457808251920151908083106200037557501790565b82600019910360031b1b161790565b604490620003b89260405193849263305a27a960e01b84528060048501528251928391826024870152868601910162000323565b601f01601f19168101030190fd5b906001600160401b038211620002b657600254926001938481811c91168015620004fb575b83821014620004e557601f8111620004ab575b5081601f84116001146200043f575092829391839260009462000433575b50501b916000199060031b1c19161760025560ff90565b0151925038806200041c565b919083601f198116600260005284600020946000905b8883831062000490575050501062000476575b505050811b0160025560ff90565b015160001960f88460031b161c1916905538808062000468565b85870151885590960195948501948793509081019062000455565b600260005284601f84600020920160051c820191601f860160051c015b828110620004d8575050620003fe565b60008155018590620004c8565b634e487b7160e01b600052602260045260246000fd5b90607f1690620003eb565b8051602091908281101562000535575090601f8251116200038457808251920151908083106200037557501790565b6001600160401b038111620002b6576003928354926001938481811c911680156200064f575b83821014620004e557601f811162000616575b5081601f8411600114620005ad5750928293918392600094620005a1575b50501b9160001990841b1c191617905560ff90565b0151925038806200058c565b919083601f1981168760005284600020946000905b88838310620005fb5750505010620005e2575b505050811b01905560ff90565b015160001983861b60f8161c19169055388080620005d5565b858701518855909601959485019487935090810190620005c2565b8560005284601f84600020920160051c820191601f860160051c015b828110620006425750506200056e565b6000815501859062000632565b90607f16906200055b56fe6080604081815260048036101561001557600080fd5b600092833560e01c90816301ffc9a7146108cf57508063371412f1146108835780633ccfd60b146107ea5780635437988d1461079f578063715018a61461073957806384b0196e1461062857806388268dee1461046b5780638da5cb5b14610445578063bc197c81146103a5578063da8c229e14610369578063e0dba60f146102e7578063ea6f48f114610235578063f0f44260146101e9578063f23a6e61146101775763f2fde38b146100c857600080fd5b34610173576020366003190112610173576100e161096e565b906100ea610c76565b6001600160a01b0380921692831561014457505082548273ffffffffffffffffffffffffffffffffffffffff198216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b908460249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b8280fd5b5091346101e65760a03660031901126101e65761019261096e565b5061019b610989565b506084359067ffffffffffffffff82116101e657506020926101bf91369101610be2565b50517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b80fd5b83346101e65760203660031901126101e6576001600160a01b0361020b61096e565b610213610c76565b1673ffffffffffffffffffffffffffffffffffffffff19600554161760055580f35b83826003196060368201126101735781359167ffffffffffffffff918284116102df576101209084360301126102e357602435908282116102df57366023830112156102df5781810135908382116102db5736602483850101116102db57604435948486116102d757366023870112156102d757858201359485116102d7573660248660051b880101116102d7576024806102d4970194019101610f7e565b80f35b8680fd5b8580fd5b8480fd5b8380fd5b50503461036557806003193601126103655761030161096e565b602435908115158092036102e3577f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87916001600160a01b03602092610344610c76565b16938486526001835280862060ff1981541660ff841617905551908152a280f35b5080fd5b5050346103655760203660031901126103655760ff816020936001600160a01b0361039261096e565b1681526001855220541690519015158152f35b5091346101e65760a03660031901126101e6576103c061096e565b506103c9610989565b5067ffffffffffffffff90604435828111610365576103eb9036908601610c18565b50606435828111610365576104039036908601610c18565b506084359182116101e6575060209261041e91369101610be2565b50517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b5050346103655781600319360112610365576001600160a01b0360209254169051908152f35b5090806003193601126101735767ffffffffffffffff9082358281116102df576104989036908501610b14565b6024358381116102db576104af9036908601610be2565b9381516104bb90611589565b946104c690836117af565b6001600160a01b0380958160075416958451966020948591828801998c8b519360608b019d8e51168c8c8b8282015116998060e08301511690608083015163ffffffff169261010001511692519a8b998a9889976309306bd160e21b89528801526024870160e0905260e4870161053c916109d6565b9460448701526064860152608485015260a484015260c483015203925af1801561061e576105e9575b5090847fd4519935409c914a6d0b06647baf7f7e4c82c1e7b66c5fff781e1178d8dd44a6956105d1959493019082825116928060a08701966105b088519660c08301978851916116f7565b5199519651945193511699511692815196879660a0885260a08801906109d6565b9486015284015233606084015260808301520390a380f35b928092919493813d8311610617575b6106028183610a79565b810103126106135790919238610565565b8780fd5b503d6105f8565b86513d8b823e3d90fd5b505034610365578160031936011261036557906106647f0000000000000000000000000000000000000000000000000000000000000000610cba565b61068d7f0000000000000000000000000000000000000000000000000000000000000000610df9565b9183519161069a83610a41565b8183526106eb85519586957f0f0000000000000000000000000000000000000000000000000000000000000087526106de60209460e0868a015260e08901906109d6565b91878303908801526109d6565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b82811061072257505050500390f35b835185528695509381019392810192600101610713565b83346101e657806003193601126101e657610752610c76565b806001600160a01b03815473ffffffffffffffffffffffffffffffffffffffff1981168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b838234610365576020366003190112610365576001600160a01b036107c261096e565b6107ca610c76565b1673ffffffffffffffffffffffffffffffffffffffff1982541617905580f35b5034610173578260031936011261017357610803610c76565b47156108415750818080806001600160a01b03600554164790828215610838575bf11561082e575080f35b51903d90823e3d90fd5b506108fc610824565b6020606492519162461bcd60e51b8352820152601160248201527f4e6f2066756e64732070726573656e742e0000000000000000000000000000006044820152fd5b83346101e65760203660031901126101e6576001600160a01b036108a561096e565b6108ad610c76565b1673ffffffffffffffffffffffffffffffffffffffff19600854161760085580f35b9250503461017357602036600319011261017357357fffffffff00000000000000000000000000000000000000000000000000000000811680910361017357602092507f4e2312e0000000000000000000000000000000000000000000000000000000008114908115610944575b5015158152f35b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150143861093d565b600435906001600160a01b038216820361098457565b600080fd5b602435906001600160a01b038216820361098457565b35906001600160a01b038216820361098457565b60005b8381106109c65750506000910152565b81810151838201526020016109b6565b906020916109ef815180928185528580860191016109b3565b601f01601f1916010190565b67ffffffffffffffff8111610a0f57604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610a0f57604052565b6020810190811067ffffffffffffffff821117610a0f57604052565b6040810190811067ffffffffffffffff821117610a0f57604052565b90601f8019910116810190811067ffffffffffffffff821117610a0f57604052565b67ffffffffffffffff8111610a0f57601f01601f191660200190565b929192610ac382610a9b565b91610ad16040519384610a79565b829481845281830111610984578281602093846000960137010152565b359063ffffffff8216820361098457565b359067ffffffffffffffff8216820361098457565b919091610120908181850312610984576040519182019367ffffffffffffffff9483811086821117610a0f5760405282948235845260208301359081116109845782019080601f8301121561098457816020610b7293359101610ab7565b6020830152610b836040820161099f565b6040830152610b946060820161099f565b6060830152610ba560808201610aee565b608083015260a081013560a083015260c081013560c0830152610bca60e08201610aff565b60e0830152610bdd610100809201610aff565b910152565b9080601f8301121561098457816020610bfd93359101610ab7565b90565b67ffffffffffffffff8111610a0f5760051b60200190565b81601f8201121561098457803591610c2f83610c00565b92610c3d6040519485610a79565b808452602092838086019260051b820101928311610984578301905b828210610c67575050505090565b81358152908301908301610c59565b6001600160a01b03600054163303610c8a57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b60ff8114610d105760ff811690601f8211610ce65760405191610cdc83610a5d565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600060025490600182811c90808416938415610def575b6020948584108114610ddb5783875286949392918115610dbb5750600114610d5c575b5050610bfd92500382610a79565b9093915060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000915b818310610da3575050610bfd93508201013880610d4e565b85548784018501529485019486945091830191610d8b565b915050610bfd94925060ff191682840152151560051b8201013880610d4e565b602485634e487b7160e01b81526022600452fd5b91607f1691610d2b565b60ff8114610e1b5760ff811690601f8211610ce65760405191610cdc83610a5d565b50604051600060035490600182811c90808416938415610ec5575b6020948584108114610ddb5783875286949392918115610dbb5750600114610e66575050610bfd92500382610a79565b9093915060036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b936000915b818310610ead575050610bfd93508201013880610d4e565b85548784018501529485019486945091830191610e95565b91607f1691610e36565b9035601e198236030181121561098457016020813591019167ffffffffffffffff821161098457813603831361098457565b908060209392818452848401376000828201840152601f01601f1916010190565b356001600160a01b03811681036109845790565b903590601e1981360301821215610984570180359067ffffffffffffffff82116109845760200191813603831361098457565b3567ffffffffffffffff811681036109845790565b9192938015611420576040936001600160a01b03610f9d868601610f22565b16156113b757610fcd90610fc7610fb48635611589565b94610fbf3688610b14565b923691610ab7565b906117af565b6001600160a01b036007541690610fe76020850185610f36565b96610ff3878701610f22565b9361100060e08801610f69565b60808801359363ffffffff85168503610984576110206101008a01610f69565b8a516309306bd160e21b81528a35600482015260e060248201529b909161104b9160e48e0191610f01565b963060448d01526001600160a01b031660648c015267ffffffffffffffff948580931660848d015263ffffffff1660a48c01521660c48a015288806000960381875a94602095f19788156113ad578498611379575b509183906001600160a01b036110b7898901610f22565b1688519485927fe32954eb00000000000000000000000000000000000000000000000000000000845280604485018d60048701528c602487015252606484019060648160051b86010192809287915b83831061133d5750505050508383809203925af1801561133357611286575b50506001600160a01b036008541690606084019561114287610f22565b9286519361114f85610a41565b838552813b156102e357906001600160a01b03848094936111be8b51988996879586947ff242432a00000000000000000000000000000000000000000000000000000000865230600487015216602485015260448401526001606484015260a0608484015260a48301906109d6565b03925af190811561127b5750926001600160a01b038561121e969482947fd4519935409c914a6d0b06647baf7f7e4c82c1e7b66c5fff781e1178d8dd44a69761126c575b5001938185511660a084013597889160c08601359283916116f7565b61123961122e6020860186610f36565b969097511699610f22565b91611250815197889760a0895260a0890191610f01565b98602087015285015233606085015216608083015235930390a3565b611275906109fb565b38611202565b8551903d90823e3d90fd5b3d8084843e6112958184610a79565b8201916020818403126102e3578051908282116102df57019082601f830112156102e3578151906020806112c884610c00565b6112d48b519182610a79565b848152019260051b840101928484116102db5760208101925b8484106112fd5750505050611125565b835183811161061357820186603f820112156106135760209161132888838e86809601519101611554565b8152019301926112ed565b86513d85823e3d90fd5b92959750929550926020806113676001936063198d82030187526113618a87610ecf565b90610f01565b9701930193018895938a979592611106565b9097506020813d6020116113a5575b8161139560209383610a79565b810103126102e3575196386110a0565b3d9150611388565b87513d86823e3d90fd5b6084855162461bcd60e51b815260206004820152603260248201527f5265736f6c7665722061646472657373206d757374206265207365742077686560448201527f6e207570646174696e67207265636f72647300000000000000000000000000006064820152fd5b5091909250303b156109845760009161152a60405194859384937f88268dee000000000000000000000000000000000000000000000000000000008552604060048601528235604486015261148e61147b6020850185610ecf565b6101206064890152610164880191610f01565b926001600160a01b03806114a46040840161099f565b1660848801526114b66060830161099f565b1660a487015263ffffffff6114cd60808301610aee565b1660c487015260a081013560e487015260c081013561010487015261151261010067ffffffffffffffff928361150560e08301610aff565b166101248a015201610aff565b16610144860152848303600319016024860152610f01565b038183305af180156115485761153d5750565b611546906109fb565b565b6040513d6000823e3d90fd5b9092919261156181610a9b565b9161156f6040519384610a79565b8294828452828201116109845760206115469301906109b3565b6060906040805161159981610a25565b83815260009381856020819401528284820152015260246001600160a01b03938085600654168451938480927f8eaa6ac00000000000000000000000000000000000000000000000000000000082528860048301525afa9485156116eb578195611640575b50505060608301511561161057505090565b6024925051907fa159eeb60000000000000000000000000000000000000000000000000000000082526004820152fd5b90919294503d8083853e6116548185610a79565b83019060208483031261017357835167ffffffffffffffff948582116102df5701916080838203126102e35786519461168c86610a25565b83519081116102df57830181601f820112156102df5780516116b19291602001611554565b8452602082015160208501528582015190811681036101735783860152606001519081151582036101e657506060820152913880806115fe565b508251903d90823e3d90fd5b908083018084116117995734106117555760008080809381811561174c575b6001600160a01b0380971690f115611548576000808093819360055416828215611743575bf11561154857565b506108fc61173b565b506108fc611716565b606460405162461bcd60e51b815260206004820152601260248201527f496e73756666696369656e742066756e647300000000000000000000000000006044820152fd5b634e487b7160e01b600052601160045260246000fd5b8151602090818401206000928184526009835260409460ff86862054166119795785848084015182516117fe8382816117f181830196878151938492016109b3565b8101038084520182610a79565b5190208451906001600160a01b0395868582015116908760608201511663ffffffff60808301511660a08301519160c08401519467ffffffffffffffff97886101008097015116978b519a8b019b7f9b90ff1ecdfcf1ed42682b506bb874eda95ea29201ac719b8ed69e969cdd27ff8d528b015260608a0152608089015260a088015260c087015260e0860152840152610120908184015282526101408201908282109082111761196557885251902061190292916118f9916042906118c2611b56565b908a51917f1901000000000000000000000000000000000000000000000000000000000000835260028301526022820152206119bc565b90939193611a88565b80600454169116036119225782526009905220805460ff19166001179055565b60648285519062461bcd60e51b82526004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152fd5b602488634e487b7160e01b81526041600452fd5b60648487519062461bcd60e51b82526004820152601660248201527f5369676e617475726520616c72656164792075736564000000000000000000006044820152fd5b81519190604183036119ed576119e692506020820151906060604084015193015160001a906119f8565b9192909190565b505060009160029190565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611a7c57926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa15611a705780516001600160a01b03811615611a6757918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b6004811015611b405780611a9a575050565b60018103611acc5760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b60028103611b0557602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b600314611b0f5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016301480611c58575b15611bb1577f000000000000000000000000000000000000000000000000000000000000000090565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f000000000000000000000000000000000000000000000000000000000000000060408201527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff821117610a0f5760405251902090565b507f00000000000000000000000000000000000000000000000000000000000000004614611b8856fea26469706673582212202782a4081db9d55dd1570c3d350b99bd187c175078930a16aac9323287d7474064736f6c634300081400330000000000000000000000000b31eb15d388d2345902ac5a126f60b43f7b93b70000000000000000000000003d2fca5c6d40cbb8c2a93a0a8525a29865d596a90000000000000000000000000ff41b99d7185b01ba47ca85e9049166cb3cd6bd0000000000000000000000000635513f179d50a207757e05759cbd106d7dfce8000000000000000000000000ee0b1452efef8b68928bee72a2b54e9ea4efc4ab00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604081815260048036101561001557600080fd5b600092833560e01c90816301ffc9a7146108cf57508063371412f1146108835780633ccfd60b146107ea5780635437988d1461079f578063715018a61461073957806384b0196e1461062857806388268dee1461046b5780638da5cb5b14610445578063bc197c81146103a5578063da8c229e14610369578063e0dba60f146102e7578063ea6f48f114610235578063f0f44260146101e9578063f23a6e61146101775763f2fde38b146100c857600080fd5b34610173576020366003190112610173576100e161096e565b906100ea610c76565b6001600160a01b0380921692831561014457505082548273ffffffffffffffffffffffffffffffffffffffff198216178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b908460249251917f1e4fbdf7000000000000000000000000000000000000000000000000000000008352820152fd5b8280fd5b5091346101e65760a03660031901126101e65761019261096e565b5061019b610989565b506084359067ffffffffffffffff82116101e657506020926101bf91369101610be2565b50517ff23a6e61000000000000000000000000000000000000000000000000000000008152f35b80fd5b83346101e65760203660031901126101e6576001600160a01b0361020b61096e565b610213610c76565b1673ffffffffffffffffffffffffffffffffffffffff19600554161760055580f35b83826003196060368201126101735781359167ffffffffffffffff918284116102df576101209084360301126102e357602435908282116102df57366023830112156102df5781810135908382116102db5736602483850101116102db57604435948486116102d757366023870112156102d757858201359485116102d7573660248660051b880101116102d7576024806102d4970194019101610f7e565b80f35b8680fd5b8580fd5b8480fd5b8380fd5b50503461036557806003193601126103655761030161096e565b602435908115158092036102e3577f4c97694570a07277810af7e5669ffd5f6a2d6b74b6e9a274b8b870fd5114cf87916001600160a01b03602092610344610c76565b16938486526001835280862060ff1981541660ff841617905551908152a280f35b5080fd5b5050346103655760203660031901126103655760ff816020936001600160a01b0361039261096e565b1681526001855220541690519015158152f35b5091346101e65760a03660031901126101e6576103c061096e565b506103c9610989565b5067ffffffffffffffff90604435828111610365576103eb9036908601610c18565b50606435828111610365576104039036908601610c18565b506084359182116101e6575060209261041e91369101610be2565b50517fbc197c81000000000000000000000000000000000000000000000000000000008152f35b5050346103655781600319360112610365576001600160a01b0360209254169051908152f35b5090806003193601126101735767ffffffffffffffff9082358281116102df576104989036908501610b14565b6024358381116102db576104af9036908601610be2565b9381516104bb90611589565b946104c690836117af565b6001600160a01b0380958160075416958451966020948591828801998c8b519360608b019d8e51168c8c8b8282015116998060e08301511690608083015163ffffffff169261010001511692519a8b998a9889976309306bd160e21b89528801526024870160e0905260e4870161053c916109d6565b9460448701526064860152608485015260a484015260c483015203925af1801561061e576105e9575b5090847fd4519935409c914a6d0b06647baf7f7e4c82c1e7b66c5fff781e1178d8dd44a6956105d1959493019082825116928060a08701966105b088519660c08301978851916116f7565b5199519651945193511699511692815196879660a0885260a08801906109d6565b9486015284015233606084015260808301520390a380f35b928092919493813d8311610617575b6106028183610a79565b810103126106135790919238610565565b8780fd5b503d6105f8565b86513d8b823e3d90fd5b505034610365578160031936011261036557906106647f6e616d6573706163650000000000000000000000000000000000000000000009610cba565b61068d7f3100000000000000000000000000000000000000000000000000000000000001610df9565b9183519161069a83610a41565b8183526106eb85519586957f0f0000000000000000000000000000000000000000000000000000000000000087526106de60209460e0868a015260e08901906109d6565b91878303908801526109d6565b904660608601523060808601528260a086015284820360c08601528080855193848152019401925b82811061072257505050500390f35b835185528695509381019392810192600101610713565b83346101e657806003193601126101e657610752610c76565b806001600160a01b03815473ffffffffffffffffffffffffffffffffffffffff1981168355167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b838234610365576020366003190112610365576001600160a01b036107c261096e565b6107ca610c76565b1673ffffffffffffffffffffffffffffffffffffffff1982541617905580f35b5034610173578260031936011261017357610803610c76565b47156108415750818080806001600160a01b03600554164790828215610838575bf11561082e575080f35b51903d90823e3d90fd5b506108fc610824565b6020606492519162461bcd60e51b8352820152601160248201527f4e6f2066756e64732070726573656e742e0000000000000000000000000000006044820152fd5b83346101e65760203660031901126101e6576001600160a01b036108a561096e565b6108ad610c76565b1673ffffffffffffffffffffffffffffffffffffffff19600854161760085580f35b9250503461017357602036600319011261017357357fffffffff00000000000000000000000000000000000000000000000000000000811680910361017357602092507f4e2312e0000000000000000000000000000000000000000000000000000000008114908115610944575b5015158152f35b7f01ffc9a7000000000000000000000000000000000000000000000000000000009150143861093d565b600435906001600160a01b038216820361098457565b600080fd5b602435906001600160a01b038216820361098457565b35906001600160a01b038216820361098457565b60005b8381106109c65750506000910152565b81810151838201526020016109b6565b906020916109ef815180928185528580860191016109b3565b601f01601f1916010190565b67ffffffffffffffff8111610a0f57604052565b634e487b7160e01b600052604160045260246000fd5b6080810190811067ffffffffffffffff821117610a0f57604052565b6020810190811067ffffffffffffffff821117610a0f57604052565b6040810190811067ffffffffffffffff821117610a0f57604052565b90601f8019910116810190811067ffffffffffffffff821117610a0f57604052565b67ffffffffffffffff8111610a0f57601f01601f191660200190565b929192610ac382610a9b565b91610ad16040519384610a79565b829481845281830111610984578281602093846000960137010152565b359063ffffffff8216820361098457565b359067ffffffffffffffff8216820361098457565b919091610120908181850312610984576040519182019367ffffffffffffffff9483811086821117610a0f5760405282948235845260208301359081116109845782019080601f8301121561098457816020610b7293359101610ab7565b6020830152610b836040820161099f565b6040830152610b946060820161099f565b6060830152610ba560808201610aee565b608083015260a081013560a083015260c081013560c0830152610bca60e08201610aff565b60e0830152610bdd610100809201610aff565b910152565b9080601f8301121561098457816020610bfd93359101610ab7565b90565b67ffffffffffffffff8111610a0f5760051b60200190565b81601f8201121561098457803591610c2f83610c00565b92610c3d6040519485610a79565b808452602092838086019260051b820101928311610984578301905b828210610c67575050505090565b81358152908301908301610c59565b6001600160a01b03600054163303610c8a57565b60246040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152fd5b60ff8114610d105760ff811690601f8211610ce65760405191610cdc83610a5d565b8252602082015290565b60046040517fb3512b0c000000000000000000000000000000000000000000000000000000008152fd5b50604051600060025490600182811c90808416938415610def575b6020948584108114610ddb5783875286949392918115610dbb5750600114610d5c575b5050610bfd92500382610a79565b9093915060026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace936000915b818310610da3575050610bfd93508201013880610d4e565b85548784018501529485019486945091830191610d8b565b915050610bfd94925060ff191682840152151560051b8201013880610d4e565b602485634e487b7160e01b81526022600452fd5b91607f1691610d2b565b60ff8114610e1b5760ff811690601f8211610ce65760405191610cdc83610a5d565b50604051600060035490600182811c90808416938415610ec5575b6020948584108114610ddb5783875286949392918115610dbb5750600114610e66575050610bfd92500382610a79565b9093915060036000527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b936000915b818310610ead575050610bfd93508201013880610d4e565b85548784018501529485019486945091830191610e95565b91607f1691610e36565b9035601e198236030181121561098457016020813591019167ffffffffffffffff821161098457813603831361098457565b908060209392818452848401376000828201840152601f01601f1916010190565b356001600160a01b03811681036109845790565b903590601e1981360301821215610984570180359067ffffffffffffffff82116109845760200191813603831361098457565b3567ffffffffffffffff811681036109845790565b9192938015611420576040936001600160a01b03610f9d868601610f22565b16156113b757610fcd90610fc7610fb48635611589565b94610fbf3688610b14565b923691610ab7565b906117af565b6001600160a01b036007541690610fe76020850185610f36565b96610ff3878701610f22565b9361100060e08801610f69565b60808801359363ffffffff85168503610984576110206101008a01610f69565b8a516309306bd160e21b81528a35600482015260e060248201529b909161104b9160e48e0191610f01565b963060448d01526001600160a01b031660648c015267ffffffffffffffff948580931660848d015263ffffffff1660a48c01521660c48a015288806000960381875a94602095f19788156113ad578498611379575b509183906001600160a01b036110b7898901610f22565b1688519485927fe32954eb00000000000000000000000000000000000000000000000000000000845280604485018d60048701528c602487015252606484019060648160051b86010192809287915b83831061133d5750505050508383809203925af1801561133357611286575b50506001600160a01b036008541690606084019561114287610f22565b9286519361114f85610a41565b838552813b156102e357906001600160a01b03848094936111be8b51988996879586947ff242432a00000000000000000000000000000000000000000000000000000000865230600487015216602485015260448401526001606484015260a0608484015260a48301906109d6565b03925af190811561127b5750926001600160a01b038561121e969482947fd4519935409c914a6d0b06647baf7f7e4c82c1e7b66c5fff781e1178d8dd44a69761126c575b5001938185511660a084013597889160c08601359283916116f7565b61123961122e6020860186610f36565b969097511699610f22565b91611250815197889760a0895260a0890191610f01565b98602087015285015233606085015216608083015235930390a3565b611275906109fb565b38611202565b8551903d90823e3d90fd5b3d8084843e6112958184610a79565b8201916020818403126102e3578051908282116102df57019082601f830112156102e3578151906020806112c884610c00565b6112d48b519182610a79565b848152019260051b840101928484116102db5760208101925b8484106112fd5750505050611125565b835183811161061357820186603f820112156106135760209161132888838e86809601519101611554565b8152019301926112ed565b86513d85823e3d90fd5b92959750929550926020806113676001936063198d82030187526113618a87610ecf565b90610f01565b9701930193018895938a979592611106565b9097506020813d6020116113a5575b8161139560209383610a79565b810103126102e3575196386110a0565b3d9150611388565b87513d86823e3d90fd5b6084855162461bcd60e51b815260206004820152603260248201527f5265736f6c7665722061646472657373206d757374206265207365742077686560448201527f6e207570646174696e67207265636f72647300000000000000000000000000006064820152fd5b5091909250303b156109845760009161152a60405194859384937f88268dee000000000000000000000000000000000000000000000000000000008552604060048601528235604486015261148e61147b6020850185610ecf565b6101206064890152610164880191610f01565b926001600160a01b03806114a46040840161099f565b1660848801526114b66060830161099f565b1660a487015263ffffffff6114cd60808301610aee565b1660c487015260a081013560e487015260c081013561010487015261151261010067ffffffffffffffff928361150560e08301610aff565b166101248a015201610aff565b16610144860152848303600319016024860152610f01565b038183305af180156115485761153d5750565b611546906109fb565b565b6040513d6000823e3d90fd5b9092919261156181610a9b565b9161156f6040519384610a79565b8294828452828201116109845760206115469301906109b3565b6060906040805161159981610a25565b83815260009381856020819401528284820152015260246001600160a01b03938085600654168451938480927f8eaa6ac00000000000000000000000000000000000000000000000000000000082528860048301525afa9485156116eb578195611640575b50505060608301511561161057505090565b6024925051907fa159eeb60000000000000000000000000000000000000000000000000000000082526004820152fd5b90919294503d8083853e6116548185610a79565b83019060208483031261017357835167ffffffffffffffff948582116102df5701916080838203126102e35786519461168c86610a25565b83519081116102df57830181601f820112156102df5780516116b19291602001611554565b8452602082015160208501528582015190811681036101735783860152606001519081151582036101e657506060820152913880806115fe565b508251903d90823e3d90fd5b908083018084116117995734106117555760008080809381811561174c575b6001600160a01b0380971690f115611548576000808093819360055416828215611743575bf11561154857565b506108fc61173b565b506108fc611716565b606460405162461bcd60e51b815260206004820152601260248201527f496e73756666696369656e742066756e647300000000000000000000000000006044820152fd5b634e487b7160e01b600052601160045260246000fd5b8151602090818401206000928184526009835260409460ff86862054166119795785848084015182516117fe8382816117f181830196878151938492016109b3565b8101038084520182610a79565b5190208451906001600160a01b0395868582015116908760608201511663ffffffff60808301511660a08301519160c08401519467ffffffffffffffff97886101008097015116978b519a8b019b7f9b90ff1ecdfcf1ed42682b506bb874eda95ea29201ac719b8ed69e969cdd27ff8d528b015260608a0152608089015260a088015260c087015260e0860152840152610120908184015282526101408201908282109082111761196557885251902061190292916118f9916042906118c2611b56565b908a51917f1901000000000000000000000000000000000000000000000000000000000000835260028301526022820152206119bc565b90939193611a88565b80600454169116036119225782526009905220805460ff19166001179055565b60648285519062461bcd60e51b82526004820152601160248201527f496e76616c6964207369676e61747572650000000000000000000000000000006044820152fd5b602488634e487b7160e01b81526041600452fd5b60648487519062461bcd60e51b82526004820152601660248201527f5369676e617475726520616c72656164792075736564000000000000000000006044820152fd5b81519190604183036119ed576119e692506020820151906060604084015193015160001a906119f8565b9192909190565b505060009160029190565b91907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08411611a7c57926020929160ff608095604051948552168484015260408301526060820152600092839182805260015afa15611a705780516001600160a01b03811615611a6757918190565b50809160019190565b604051903d90823e3d90fd5b50505060009160039190565b6004811015611b405780611a9a575050565b60018103611acc5760046040517ff645eedf000000000000000000000000000000000000000000000000000000008152fd5b60028103611b0557602482604051907ffce698f70000000000000000000000000000000000000000000000000000000082526004820152fd5b600314611b0f5750565b602490604051907fd78bce0c0000000000000000000000000000000000000000000000000000000082526004820152fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b037f0000000000000000000000002674e4fae872780f01b99e109e67749b765703fb16301480611c58575b15611bb1577fd2a2a7f5cc37ffa945182b71abaa002bccb3997dcc75f4b396194581eed80f6790565b60405160208101907f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82527f300f800aee223ec4f0f7f13ec0e9fb1b8a8186bbfdb275780ce621887215518960408201527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260a0815260c0810181811067ffffffffffffffff821117610a0f5760405251902090565b507f0000000000000000000000000000000000000000000000000000000000aa36a74614611b8856fea26469706673582212202782a4081db9d55dd1570c3d350b99bd187c175078930a16aac9323287d7474064736f6c63430008140033

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

0000000000000000000000000b31eb15d388d2345902ac5a126f60b43f7b93b70000000000000000000000003d2fca5c6d40cbb8c2a93a0a8525a29865d596a90000000000000000000000000ff41b99d7185b01ba47ca85e9049166cb3cd6bd0000000000000000000000000635513f179d50a207757e05759cbd106d7dfce8000000000000000000000000ee0b1452efef8b68928bee72a2b54e9ea4efc4ab00000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000013100000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _treasury (address): 0x0B31EB15d388d2345902ac5a126f60b43F7B93b7
Arg [1] : _verifier (address): 0x3d2fcA5C6D40cbB8c2A93A0a8525a29865D596a9
Arg [2] : _nameWrapperProxy (address): 0x0Ff41b99D7185B01bA47Ca85e9049166Cb3CD6bd
Arg [3] : _nameWrapper (address): 0x0635513f179D50A207757E05759CbD106d7dFcE8
Arg [4] : _namespaceRegistry (address): 0xEe0b1452efef8B68928beE72a2B54E9EA4EFc4Ab
Arg [5] : version (string): 1

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000b31eb15d388d2345902ac5a126f60b43f7b93b7
Arg [1] : 0000000000000000000000003d2fca5c6d40cbb8c2a93a0a8525a29865d596a9
Arg [2] : 0000000000000000000000000ff41b99d7185b01ba47ca85e9049166cb3cd6bd
Arg [3] : 0000000000000000000000000635513f179d50a207757e05759cbd106d7dfce8
Arg [4] : 000000000000000000000000ee0b1452efef8b68928bee72a2b54e9ea4efc4ab
Arg [5] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [7] : 3100000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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