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.
Initializer for the ZNSDomainToken
proxy. Note that this function does NOT have role protection enforced!
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.
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()
.
Returns the tokenURI for the given tokenId.
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.
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
!
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.
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.
To allow for user extension of the protocol we have to enable checking acceptance of new interfaces to ensure they are supported
ERC721 _burn
function
Return the baseURI
To use UUPS proxy we override this function and revert if msg.sender
isn't authorized
to
address
The address that will recieve the newly minted domain token (new domain owner)
tokenId
uint256
The TokenId that the caller wishes to mint/register.
_tokenURI
string
The tokenURI to be set for the token minted.
tokenId
uint256
The tokenId (as uint256(domainHash)
) that the caller wishes to burn/revoke
tokenId
uint256
The tokenId (as uint256(domainHash)
) that the caller wishes to set the tokenURI for
_tokenURI
string
The tokenURI to be set for the token with the given tokenId
baseURI_
string
The baseURI to be set for all tokens
receiver
address
The address that will receive default royalties
royaltyFraction
uint96
The default royalty fraction (as a base of 10,000)
tokenId
uint256
The tokenId (as uint256(domainHash)
) that the caller wishes to set the royalty for
receiver
address
The address that will receive royalties for the given tokenId
royaltyFraction
uint96
The royalty fraction (as a base of 10,000) for the given tokenId
interfaceId
bytes4
The interface ID
tokenId
uint256
The ID of the token to burn
newImplementation
address
The implementation contract to upgrade to
accessController_
address
The address of the ZNSAccessController
contract
name_
string
The name of the token
symbol_
string
The symbol of the token
defaultRoyaltyReceiver
address
The address that will receive default royalties
defaultRoyaltyFraction
uint96
The default royalty fraction (as a base of 10,000)