Registry

The FNS registry.

The FNS registry is the core contract that lies at the heart of FNS resolution. All FNS lookups start by querying the registry. The registry maintains a list of domains, recording the owner, resolver, and TTL for each, and allows the owner of a domain to make changes to that data.

Get Owner

function currentOwner(bytes32 node) external view returns (address);

Returns the owner of the name specified by node.

Get Resolver

function currentResolver(bytes32 node) external view returns (address);

Returns the address of the resolver responsible for the name specified by node.

Get Extend Information

function currentText(bytes32 node) external view returns (string memory);

Returns the extend information of the name specified by node. (JSON format)

Set Owner

function setOwner(bytes32 node, address owner) external;

Reassigns ownership of the name identified by node to owner. Only callable by the current owner of the name.

Set Resolver

function setResolver(bytes32 node, address resolver) external;

Updates the resolver associated with the name identified by node to resolver. Only callable by the current owner of the name. resolver must specify the address of a contract that implements the Resolver interface.

Emits the following event:

event NewResolver(bytes32 indexed node, address resolver);

Set Extend Information

function setText(bytes32 node, string memory text) external;

Updates the extend information of the name identified by node. Only callable by the current owner of the name. (JSON format)

Set Subdomain Owner

function setSubnodeOwner(bytes32 parentNode, string memory labelStr, bytes32 label, address owner) external returns(bytes32);

Creates a new subdomain of node, assigning ownership of it to the specified owner. If the domain already exists, ownership is reassigned but the resolver and TTL are left unmodified.

label is the keccak256 hash of the subdomain label to create. For example, if you own alice.fra and want to create the subdomain iam.alice.fra, supply namehash('alice.fra') as the node, and keccak256('iam') as the label.

Emits the following event:

event AddSubOwner(bytes32 indexed parentNode, bytes32 indexed subNode, address owner);

Delete Subdomain Owner

function delSubnodeOwner(bytes32 node) external;

Delate the subdomain of node.

Set Approval

function setApprovalForAll(bytes32 node, address operator) external

Sets or clears an approval. Approved accounts can execute all FNS registry operations on behalf of the caller.

Check Approval

function isApprovedForAll(bytes32 node, address operator) external view returns (bool);

Returns true if operator is approved to make FNS registry operations on behalf of owner.

Check Record Existence

function recordExists(bytes32 node) external view returns (bool);

Returns true if node exists in this FNS registry. This will return false for records that are in the legacy FNS registry but have not yet been migrated to the new one.

Last updated