Comment on page
CNS NFT
CNS NFT contract responsible for domain ownership and trading.
CNS NFT contract is a CIS-1 NFT contract for CNS that features token expiry. It's responsible for keeping ownership data for CNS. The address that ownes the token with id equal to namehash of the domain name is allowed to operate on the corresponding domain name via CNS contract. For namehash algorithm description see either ENS or CNS documentation.
Token data is stored in a storage contract, so existing tokens can be used with other compatible and authorized NFT contracts that are allowed to implement different token standards, like CIS-2.
Creating new tokens and extending the token subscription must happen via the CNS contract.
- 1.Token data is stored separately, inside storage contract. This allows to update contract logic without loosing the token data.
- 2.Unlike token data, address operators are stored locally per each NFT contract.
TokenId ::= (size: u8) (buffer: u8 * size)
Address ::= (tag: u8 = 0) (address: AccountAddress)
| (tag: u8 = 1) (address: ContractAddress)
AccountAddress ::= (address: u8 * 32)
ContractAddress ::= (index: u8 * 8) (subindex: u8 * 8)
Timestamp ::= (milliseconds: u64 as LE)
Percentage ::= (micro_percent: u64 as LE)
Receive name:
BictoryCnsNft.burn
Anyone is allowed to call this function.
Can be called if token ownership and grace period have expired to clear the token data.
Parameters in binary
Parameter ::= (token_id: TokenId)
CIS-1 BurnEvent
Receive name:
BictoryCnsNft.getTokenExpiry
Get token expiry info.
Parameters in binary
Parameter ::= (token_id: TokenId)
Return value
If result tag is
0
, token does not exist. Otherwise, following variants can be returned:Owned
- Token is owned by given address and expires atexpiry
;Grace
- Token was owned by given address, but ownership expired token entered grace period that ends atexpiry
;Expired
- Token was owned by given address, but it expired and grace period ended. This token can be burnt;
SubscriptionExpiryStatus ::= (tag: u8 = 0; Owned) (expiry: Timestamp)
| (tag: u8 = 1; Grace) (expiry: Timestamp)
| (tag: u8 = 2; Expired)
TokenSubscriptionStatus ::= (owner: Address) (expiry: SubscriptionExpiryStatus)
Result ::= (tag: u8 = 0; Token doesn't exist)
| (tag: u8 = 1) (status: TokenSubscriptionStatus)
Receive name:
BictoryCnsNft.getTokenInfo
Get token info.
Parameters in binary
Parameter ::= (token_id: TokenId)
Return value
If result tag is
0
, token does not exist. Otherwise, following variants can be returned:TokenInfo ::= (domain: String) (royalty: Percentage)
Result ::= (tag: u8 = 0; Token doesn't exist)
| (tag: u8 = 1) (info: TokenInfo)
Last modified 1yr ago