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 chipRegistryers
IERS public immutable ersdeveloperRegistry
IDeveloperRegistry public immutable developerRegistryservicesRegistry
IServicesRegistry public immutable servicesRegistryinitialized
bool public initializedrootNode
bytes32 public rootNodeprojects
address[] public projectsprojectIndex
mapping(address => uint256) internal projectIndexconstructor
constructor(IChipRegistry _chipRegistry, IERS _ers, IDeveloperRegistry _developerRegistry, IServicesRegistry _servicesRegistry) publicConstructor for DeveloperRegistrar. Sets the owner and ChipRegistry.
Parameters
| Name | Type | Description |
|---|---|---|
| _chipRegistry | contract IChipRegistry | ChipRegistry contract |
| _ers | contract IERS | ERS registry |
| _developerRegistry | contract IDeveloperRegistry | DeveloperRegistry contract |
| _servicesRegistry | contract IServicesRegistry | ServicesRegistry contract |
initialize
function initialize(address _owner, bytes32 _rootNode) externalONLY Developer REGISTRY: Initialize DeveloperRegistrar contract with root node. Required due to order of operations during deploy.
Parameters
| Name | Type | Description |
|---|---|---|
| _owner | address | Owner of the DeveloperRegistrar |
| _rootNode | bytes32 | Root node of the Developer |
addProject
function addProject(IProjectRegistrar _projectRegistrar, bytes32 _nameHash, bytes32 _serviceId, uint256 _lockinPeriod) externalONLY OWNER: Add a new project to the Developer. Creates a new subnode in the ENS registry and adds the project to the ChipRegistry.
Parameters
| Name | Type | Description |
|---|---|---|
| _projectRegistrar | contract IProjectRegistrar | ProjectRegistrar contract |
| _nameHash | bytes32 | Namehash of the project |
| _serviceId | bytes32 | Service ID of the project |
| _lockinPeriod | uint256 | Lockin period of the project |
removeProject
function removeProject(IProjectRegistrar _projectRegistrar) externalONLY OWNER: Remove a project from the Developer. Removes the project from the ChipRegistry.
Parameters
| Name | Type | Description |
|---|---|---|
| _projectRegistrar | contract IProjectRegistrar | ProjectRegistrar contract |
getProjects
function getProjects() external view returns(address[] memory)