๐ZNSDomainToken
A contract for tokenizing domains under ZNS. Every domain in ZNS has a corresponding token minted at register time. This token is also an NFT that is fully ERC-721 compliant.
Note that all ZNS related functions on this contract can ONLY be called by either the ZNSRootRegistrar.sol
contract or any address holding a REGISTRAR_ROLE.
constructor
initialize
Initializer for the ZNSDomainToken
proxy. Note that this function does NOT have role protection enforced!
Parameters
register
Mints a token with a specified tokenId, using _safeMint, and sends it to the given address. Used ONLY as a part of the Register flow that starts from ZNSRootRegistrar.registerRootDomain()
or ZNSSubRegistrar.registerSubdomain()
and sets the individual tokenURI for the token minted.
TokenId is created as a hash of the domain name casted to uint256.
Parameters
revoke
Burns the token with the specified tokenId and removes the royalty information for this tokenID. Used ONLY as a part of the Revoke flow that starts from ZNSRootRegistrar.revokeDomain()
.
Parameters
tokenURI
Returns the tokenURI for the given tokenId.
setTokenURI
Sets the tokenURI for the given tokenId. This is an external setter that can only be called by the ADMIN_ROLE of zNS. This functions is not a part of any flows and is here only to change faulty or outdated token URIs in case of corrupted metadata or other problems. Fires the TokenURISet
event, which is NOT fired when tokenURI is set during the registration process.
Parameters
setBaseURI
Sets the baseURI for ALL tokens. Can only be called by the ADMIN_ROLE of zNS. Fires the BaseURISet
event.
This contract supports both, baseURI and individual tokenURI that can be used interchangeably.
Note that if
baseURI
andtokenURI
are set, thetokenURI
will be appended to thebaseURI
!
Parameters
setDefaultRoyalty
Sets the default royalty for ALL tokens. Can only be called by the ADMIN_ROLE of zNS. Fires the DefaultRoyaltySet
event.
This contract supports both, default royalties and individual token royalties per tokenID.
Parameters
setTokenRoyalty
Sets the royalty for the given tokenId. Can only be called by the ADMIN_ROLE of zNS. Fires the TokenRoyaltySet
event.
This contract supports both, default royalties and individual token royalties per tokenID.
Parameters
supportsInterface
To allow for user extension of the protocol we have to enable checking acceptance of new interfaces to ensure they are supported
Parameters
_burn
ERC721 _burn
function
Parameters
_baseURI
Return the baseURI
_authorizeUpgrade
To use UUPS proxy we override this function and revert if msg.sender
isn't authorized