```\nfunction registerDomain(\n  uint256 parentId,\n  string memory name,\n  address domainOwner,\n  address minter\n) external override onlyController returns (uint256) {\n  // Create the child domain under the parent domain\n  uint256 labelHash = uint256(keccak256(bytes(name)));\n  address controller = msg.sender;\n\n  // Domain parents must exist\n  require(\_exists(parentId), "Zer0 Registrar: No parent");\n\n  // Calculate the new domain's id and create it\n  uint256 domainId =\n    uint256(keccak256(abi.encodePacked(parentId, labelHash)));\n  \_createDomain(domainId, domainOwner, minter, controller);\n\n  emit DomainCreated(domainId, name, labelHash, parentId, minter, controller);\n\n  return domainId;\n```\n