NameResolver
Git Source (opens in a new tab)
Inherits: INameResolver, BaseResolver
Author: Sam Ward (hodl.esf.eth)
NameResolver is a contract that allows users to set the domain name for their address
State Variables
nameMap
mapping(address => string) public nameMap;
Functions
name
function name(bytes32 node) external view returns (string memory);
setName
setName sets the domain linked to an address.
setName sets the domain value associated with a specific address. It uses msg.sender to get the address and then sets the value for that address.
function setName(string calldata _name) external;
Parameters
Name | Type | Description |
---|---|---|
_name | string | The domain name you wish to set. Can be TLD or SLD. |
getName
getName records the value associated with a specific domain for an address.
getName gets the value associated with a specific domain for an address. This is validated that the address is correct and not invalid or changed
function getName(address _addr, uint256 _coinType) external view returns (string memory);
Parameters
Name | Type | Description |
---|---|---|
_addr | address | The address to query. |
_coinType | uint256 | The coin type to query. |
getText
getText records the value associated with a specific key for an address.
getText records the value associated with a specific key for an address. This is validated that the address is correct and not invalid or changed
function getText(address _addr, string calldata _key, uint256 _coinType) external view returns (string memory);
Parameters
Name | Type | Description |
---|---|---|
_addr | address | The address to query. |
_key | string | The key to query. |
_coinType | uint256 | The coin type to query. |
getResolver
function getResolver(bytes32 node) private view returns (IResolver);
supportsInterface
function supportsInterface(bytes4 _interfaceId) public view virtual override returns (bool);