Contracts
DeveloperRegistry

Solidity API

DeveloperRegistry

Contract responsible for tracking and permissioning Developers. Developers are given the ability to create a new DeveloperRegistrar by governance. When creating a new Registrar, the Developer is given a new [x].ers name. Governance has the ability to revoke Developer permissions and reassign the ERS name to a new Developer.

DeveloperRegistrarAdded

event DeveloperRegistrarAdded(address indexed developerRegistrar, address indexed owner, bytes32 rootNode)

DeveloperRegistrarRevoked

event DeveloperRegistrarRevoked(address indexed developerRegistrar, bytes32 subnode, bytes32 _nameHash)

DeveloperAllowed

event DeveloperAllowed(address indexed developerOwner, bytes32 nameHash)

DeveloperDisallowed

event DeveloperDisallowed(address indexed developerOwner)

RegistrarFactoryAdded

event RegistrarFactoryAdded(address indexed factory)

RegistrarFactoryRemoved

event RegistrarFactoryRemoved(address indexed factory)

RegistryInitialized

event RegistryInitialized(address ers)

ROOT_NODE

bytes32 public constant ROOT_NODE

ersRegistry

IERS public ersRegistry

initialized

bool public initialized

nameGovernor

address public nameGovernor

registrarFactories

mapping(IDeveloperRegistrarFactory => bool) public registrarFactories

pendingDevelopers

mapping(address => bytes32) public pendingDevelopers

isDeveloperRegistrar

mapping(address => bool) public isDeveloperRegistrar

developerRegistrars

address[] internal developerRegistrars

constructor

constructor(address _governance) public

initialize

function initialize(IERS _ers, IDeveloperRegistrarFactory[] calldata _factories, address _nameGovernor) external

ONLY OWNER: Initialize DeveloperRegistry contract with ERS and Services Registry addresses. Required due to order of operations during deploy.

Parameters

NameTypeDescription
_erscontract IERSAddress of the ERS contract
_factoriescontract IDeveloperRegistrarFactory[]Array of DeveloperRegistrarFactory contracts
_nameGovernoraddressAddress of the Name Governor which can assign names to Developers

createNewDeveloperRegistrar

function createNewDeveloperRegistrar(IDeveloperRegistrarFactory _factory) external returns(address)

Create a new DeveloperRegistrar for a Developer. In order to call, the calling address must be approved by governance.

Parameters

NameTypeDescription
_factorycontract IDeveloperRegistrarFactoryAddress of the DeveloperRegistrarFactory to use for deploying the DeveloperRegistrar

revokeDeveloperRegistrar

function revokeDeveloperRegistrar(address _developerRegistrar, bytes32 _nameHash) external

ONLY OWNER: Revoke permissions from a DeveloperRegistrar.

Parameters

NameTypeDescription
_developerRegistraraddressAddress of the DeveloperRegistrar that is being revoked
_nameHashbytes32Bytes32 hash of the ERS name the Developer wants for their Registrar

addAllowedDeveloper

function addAllowedDeveloper(address _developerOwner, bytes32 _nameHash) external

ONLY OWNER: Add a new address that can create a new DeveloperRegistrar.

Parameters

NameTypeDescription
_developerOwneraddressAddress that has the ability to create a new DeveloperRegistrar
_nameHashbytes32Bytes32 hash of the ERS name the Developer wants for their Registrar

removeAllowedDeveloper

function removeAllowedDeveloper(address _developerOwner) external

ONLY OWNER: Remove an address from creating a new DeveloperRegistrar.

Parameters

NameTypeDescription
_developerOwneraddressAddress that has the ability to create a new DeveloperRegistrar

addRegistrarFactory

function addRegistrarFactory(IDeveloperRegistrarFactory _factory) external

ONLY OWNER: Add a new DeveloperRegistrarFactory that can be used for creating new DeveloperRegistrars.

Parameters

NameTypeDescription
_factorycontract IDeveloperRegistrarFactoryAddress of DeveloperRegistrarFactory to add

removeRegistrarFactory

function removeRegistrarFactory(IDeveloperRegistrarFactory _factory) external

ONLY OWNER: Remove a DeveloperRegistrarFactory.

Parameters

NameTypeDescription
_factorycontract IDeveloperRegistrarFactoryAddress of DeveloperRegistrarFactory to remove

getDeveloperRegistrars

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

_addRegistrarFactory

function _addRegistrarFactory(IDeveloperRegistrarFactory _factory) internal