GenericMetadataService
Git Source (opens in a new tab)
Inherits: IMetadataService
This contract is used to manage and provide generic metadata url for Handshake domains.
State Variables
sld
HandshakeSld public immutable sld;
tld
HandshakeTld public immutable tld;
BASE_URI
string public BASE_URI;
Functions
constructor
Constructs a new instance of the contract.
constructor(HandshakeSld _sld, HandshakeTld _tld, string memory _baseUri);
Parameters
Name | Type | Description |
---|---|---|
_sld | HandshakeSld | The address of the Handshake Second-Level Domain (SLD) contract. |
_tld | HandshakeTld | The address of the Handshake Top-Level Domain (TLD) contract. |
_baseUri | string | The base URI for token metadata. |
tokenURI
Returns the token URI for a given namehash.
If the namehash exists in the SLD or TLD contracts, it returns the concatenation of the base URI and the string representation of the namehash. Otherwise, it returns an empty string.
function tokenURI(bytes32 _namehash) external view returns (string memory);
Parameters
Name | Type | Description |
---|---|---|
_namehash | bytes32 | The namehash of the domain. |
Returns
Name | Type | Description |
---|---|---|
<none> | string | The URI of the token. |
supportsInterface
Checks whether the contract supports a given interface, based on the interface ID.
It supports the ERC165 interface (for checking interface support) and the tokenURI function of this contract.
function supportsInterface(bytes4 interfaceID) public pure override returns (bool);
Parameters
Name | Type | Description |
---|---|---|
interfaceID | bytes4 | The ID of the interface to check for support. |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | True if the interface is supported, False otherwise. |