creation_sourcecode: {{
    "language": "Solidity",
    "sources": {
      "src/ENSUltraBulk.sol": {
        "content": "// SPDX-License-Identifier: GPLv3\npragma solidity ~0.8.17;\n\nimport \"./IETHRegistrarController.sol\";\nimport \"./IUltraBulkRenewal.sol\";\nimport \"solmate/auth/Owned.sol\";\n\ncontract UltraBulk is IUltraBulkRenewal, Owned {\n    IETHRegistrarController public controller;\n\n    constructor(IETHRegistrarController _controller) Owned(msg.sender) {\n        controller = _controller;\n    }\n\n    function renewAll(\n        string[] calldata names,\n        uint256 duration,\n        uint256 price\n    ) external payable override {\n        uint256 length = names.length;\n        uint256 i = 0;\n\n        uint256 total = price * length;\n        require(msg.value > total, \"insufficient balance\");\n\n        while (i < length) {\n            controller.renew{value: price}(names[i], duration);\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    function multiCommit(\n        bytes32[] calldata commitments\n    ) external payable {\n        uint256 length = commitments.length;\n        uint256 i = 0;\n        while (i < length) {\n            controller.commit(commitments[i]);\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    function multiRegisterWithAddress(\n        string[] calldata names,\n        address[] calldata owners,\n        uint256 duration,\n        bytes32 secret,\n        address resolver,\n        address addr\n    ) external payable {\n        multiRegisterInternal(names, owners, duration, secret, resolver, addr);\n    }\n\n    function multiRegister(\n        string[] calldata names,\n        address[] calldata owners,\n        uint256 duration,\n        bytes32 secret,\n        address resolver\n    ) external payable {\n        multiRegisterInternal(names, owners, duration, secret, resolver, address(0));\n    }\n\n    function multiRegisterInternal(\n        string[] calldata names,\n        address[] calldata owners,\n        uint256 duration,\n        bytes32 secret,\n        address resolver,\n        address addr\n    ) internal {\n        require(names.length == owners.length, \"names and owners length mismatch\");\n\n        uint256 v = controller.rentPrice(names[0], duration);\n\n        uint256 length = names.length;\n        uint256 i = 0;\n\n        uint256 total = v * length;\n        require(msg.value > total, \"insufficient balance\");\n\n        while (i < length) {\n            controller.registerWithConfig{value: v}(names[i], owners[i], duration, secret, resolver, addr);\n            unchecked {\n                ++i;\n            }\n        }\n    }\n\n    function ethcall(\n        address to,\n        bytes calldata data\n    ) external payable onlyOwner {\n        (bool success, ) = to.call{value: msg.value}(data);\n        require(success, \"ethcall failed\");\n    }\n\n    function refund() external payable {\n        payable(owner).transfer(address(this).balance);\n    }\n}\n"
      },
      "src/IETHRegistrarController.sol": {
        "content": "// SPDX-License-Identifier: MIT\npragma solidity ~0.8.17;\n\ninterface IETHRegistrarController {\n    function renew(string calldata name, uint256 duration) external payable;\n\n    function rentPrice(\n        string memory name,\n        uint256 duration\n    ) external view returns (uint256 price);\n\n    function makeCommitment(\n        string memory name,\n        address owner,\n        uint256 duration,\n        bytes32 secret,\n        address resolver,\n        bytes[] calldata data,\n        bool reverseRecord,\n        uint16 ownerControlledFuses\n    ) external pure returns (bytes32);\n\n    function commit(bytes32 commitment) external;\n\n    function makeCommitmentWithConfig(\n        string memory name,\n        address owner,\n        bytes32 secret,\n        address resolver,\n        address addr\n    ) external pure returns (bytes32);\n\n    function registerWithConfig(\n        string memory name,\n        address owner,\n        uint duration,\n        bytes32 secret,\n        address resolver,\n        address addr\n    ) external payable;\n}\n"
      },
      "src/IUltraBulkRenewal.sol": {
        "content": "// SPDX-License-Identifier: GPLv3\npragma solidity ~0.8.17;\n\ninterface IUltraBulkRenewal {\n    function renewAll(\n        string[] calldata names,\n        uint256 duration,\n        uint256 price\n    ) external payable;\n\n    function refund() external payable;\n\n    function multiCommit(\n        bytes32[] calldata commitments\n    ) external payable;\n\n    function multiRegisterWithAddress(\n        string[] calldata names,\n        address[] calldata owners,\n        uint256 duration,\n        bytes32 secret,\n        address resolver,\n        address addr\n    ) external payable;\n\n    function multiRegister(\n        string[] calldata names,\n        address[] calldata owners,\n        uint256 duration,\n        bytes32 secret,\n        address resolver\n    ) external payable;\n}\n"
      },
      "lib/solmate/src/auth/Owned.sol": {
        "content": "// SPDX-License-Identifier: AGPL-3.0-only\npragma solidity >=0.8.0;\n\n/// @notice Simple single owner authorization mixin.\n/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol)\nabstract contract Owned {\n    /*//////////////////////////////////////////////////////////////\n                                 EVENTS\n    //////////////////////////////////////////////////////////////*/\n\n    event OwnershipTransferred(address indexed user, address indexed newOwner);\n\n    /*//////////////////////////////////////////////////////////////\n                            OWNERSHIP STORAGE\n    //////////////////////////////////////////////////////////////*/\n\n    address public owner;\n\n    modifier onlyOwner() virtual {\n        require(msg.sender == owner, \"UNAUTHORIZED\");\n\n        _;\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                               CONSTRUCTOR\n    //////////////////////////////////////////////////////////////*/\n\n    constructor(address _owner) {\n        owner = _owner;\n\n        emit OwnershipTransferred(address(0), _owner);\n    }\n\n    /*//////////////////////////////////////////////////////////////\n                             OWNERSHIP LOGIC\n    //////////////////////////////////////////////////////////////*/\n\n    function transferOwnership(address newOwner) public virtual onlyOwner {\n        owner = newOwner;\n\n        emit OwnershipTransferred(msg.sender, newOwner);\n    }\n}\n"
      }
    },
    "settings": {
      "remappings": [
        "ds-test/=lib/solmate/lib/ds-test/src/",
        "forge-std/=lib/forge-std/src/",
        "solmate/=lib/solmate/src/"
      ],
      "optimizer": {
        "enabled": true,
        "runs": 200
      },
      "metadata": {
        "bytecodeHash": "ipfs",
        "appendCBOR": true
      },
      "outputSelection": {
        "*": {
          "*": [
            "evm.bytecode",
            "evm.deployedBytecode",
            "devdoc",
            "userdoc",
            "metadata",
            "abi"
          ]
        }
      },
      "evmVersion": "paris",
      "libraries": {}
    }
  }}