Contracts
DeveloperRegistrar

Solidity API

DeveloperRegistrar

Contract that coordinates adding a new project for a Developer. Each Developer has their own DeveloperRegistrar which is associated with a .ers subnode in the ERS registry ([developer].ers). When adding a new project, a subnode under the developer.ers sub- domain is added ([projectName].developer.ers) and the project is enrolled in the ChipRegistry.

ProjectAdded

event ProjectAdded(address indexed projectRegistrar, bytes32 projectRootNode)

ProjectRemoved

event ProjectRemoved(address indexed projectRegistrar)

RegistrarInitialized

event RegistrarInitialized(bytes32 rootNode)

chipRegistry

IChipRegistry public immutable chipRegistry

ers

IERS public immutable ers

developerRegistry

IDeveloperRegistry public immutable developerRegistry

servicesRegistry

IServicesRegistry public immutable servicesRegistry

initialized

bool public initialized

rootNode

bytes32 public rootNode

projects

address[] public projects

projectIndex

mapping(address => uint256) internal projectIndex

constructor

constructor(IChipRegistry _chipRegistry, IERS _ers, IDeveloperRegistry _developerRegistry, IServicesRegistry _servicesRegistry) public

Constructor for DeveloperRegistrar. Sets the owner and ChipRegistry.

Parameters

NameTypeDescription
_chipRegistrycontract IChipRegistryChipRegistry contract
_erscontract IERSERS registry
_developerRegistrycontract IDeveloperRegistryDeveloperRegistry contract
_servicesRegistrycontract IServicesRegistryServicesRegistry contract

initialize

function initialize(address _owner, bytes32 _rootNode) external

ONLY Developer REGISTRY: Initialize DeveloperRegistrar contract with root node. Required due to order of operations during deploy.

Parameters

NameTypeDescription
_owneraddressOwner of the DeveloperRegistrar
_rootNodebytes32Root node of the Developer

addProject

function addProject(IProjectRegistrar _projectRegistrar, bytes32 _nameHash, bytes32 _serviceId, uint256 _lockinPeriod) external

ONLY OWNER: Add a new project to the Developer. Creates a new subnode in the ENS registry and adds the project to the ChipRegistry.

Parameters

NameTypeDescription
_projectRegistrarcontract IProjectRegistrarProjectRegistrar contract
_nameHashbytes32Namehash of the project
_serviceIdbytes32Service ID of the project
_lockinPerioduint256Lockin period of the project

removeProject

function removeProject(IProjectRegistrar _projectRegistrar) external

ONLY OWNER: Remove a project from the Developer. Removes the project from the ChipRegistry.

Parameters

NameTypeDescription
_projectRegistrarcontract IProjectRegistrarProjectRegistrar contract

getProjects

function getProjects() external view returns(address[] memory)