DotnsResolver
Inherits: Initializable, UUPSUpgradeable, OwnableUpgradeable, ERC165Upgradeable, IDotnsResolver
Title: Dotns Resolver
Stores forward-resolution address records for DotNS nodes
Writes are gated on node ownership in the forward registry, not on a privileged writer address. Address records describe where a name points and only the current node owner has the authority to set that target.
Note: security-contact: admin@parity.io
State Variables
protocolRegistry
Protocol-level address registry for all DotNS contracts.
IDotnsProtocolRegistry public protocolRegistry
__gap
Reserved storage space to allow for layout changes in the future.
uint256[50] private __gap
addresses
Node => resolved address.
mapping(bytes32 node => address owner) private addresses
Functions
onlyNodeOwner
Restricts access to the owner of node as recorded in the registry.
modifier onlyNodeOwner(bytes32 node) ;
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Node identifier. |
constructor
Note: oz-upgrades-unsafe-allow: constructor
constructor() ;
initialize
Initialises the resolver.
Runs once through the UUPS proxy; a repeat call reverts with
Note:
reverts: InvalidInitialization. Emits @custom:emits OwnershipTransferred when
msg.sender is recorded as the initial owner and @custom:emits Initialized once
setup completes.
function initialize(IDotnsProtocolRegistry registry) external initializer;
Parameters
| Name | Type | Description |
|---|---|---|
registry | IDotnsProtocolRegistry | Protocol-level address registry used to resolve sibling contracts. |
setAddress
Sets the resolved address for a node.
The caller must be the current owner of node in the forward registry, otherwise
Note: reverts: NotAuthorised. Emits @custom:emits AddressSet on every successful write.
function setAddress(bytes32 node, address value) external override onlyNodeOwner(node);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node identifier. |
value | address | The address to associate with the node. |
addressOf
Returns the resolved address for a node.
function addressOf(bytes32 node) external view override returns (address value);
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | The node identifier. |
Returns
| Name | Type | Description |
|---|---|---|
value | address | The resolved address, or zero if unset. |
supportsInterface
function supportsInterface(bytes4 interfaceId) public view override returns (bool);
_onlyNodeOwner
Internal ownership check for a registry node.
Resolves the registry lazily through protocolRegistry so a registry
upgrade or rewire is picked up automatically without a resolver upgrade.
function _onlyNodeOwner(bytes32 node) internal view;
Parameters
| Name | Type | Description |
|---|---|---|
node | bytes32 | Node identifier. |
version
Returns implementation version.
function version() external pure virtual returns (string memory versionString);
Returns
| Name | Type | Description |
|---|---|---|
versionString | string | Current version string. |
_authorizeUpgrade
Function that should revert when msg.sender is not authorized to upgrade the contract.
Called by
{upgradeToAndCall}.
Normally, this function will use an xref:access.adoc[access control] modifier such as
{Ownable-onlyOwner}.
function _authorizeUpgrade(address) internal onlyOwner {}
function _authorizeUpgrade(address newImplementation) internal override onlyOwner;