๐ZNSFixedPricer
Pricer contract that uses the most straightforward fixed pricing model that doesn't depend on the length of the label.
PERCENTAGE_BASIS
priceConfigs
Mapping of domainHash to price config set by the domain owner/operator
constructor
initialize
setPrice
Sets the price for a domain. Only callable by domain owner/operator. Emits a PriceSet
event.
Parameters
getPrice
Gets the price for a subdomain candidate label under the parent domain.
skipValidityCheck
param is added to provide proper revert when the user is calling this to find out the price of a domain that is not valid. But in Registrar contracts we want to do this explicitly and before we get the price to have lower tx cost for reverted tx. So Registrars will pass this bool as "true" to not repeat the validity check. Note that if calling this function directly to find out the price, a user should always pass "false" as skipValidityCheck
param, otherwise, the price will be returned for an invalid label that is not possible to register.
Parameters
setFeePercentage
Sets the feePercentage for a domain. Only callable by domain owner/operator. Emits a FeePercentageSet
event.
feePercentage
is set as a part of the PERCENTAGE_BASIS
of 10,000 where 1% = 100
Parameters
setPriceConfig
Setter for priceConfigs[domainHash]
. Only domain owner/operator can call this function.
Sets both PriceConfig.price
and PriceConfig.feePercentage
in one call, fires PriceSet
and FeePercentageSet
events.
This function should ALWAYS be used to set the config, since it's the only place where
isSet
is set to true. Use the other individual setters to modify only, since they do not set this variable!
Parameters
getFeeForPrice
Part of the IZNSPricer interface - one of the functions required for any pricing contracts used with ZNS. It returns fee for a given price based on the value set by the owner of the parent domain.
Parameters
getPriceAndFee
Part of the IZNSPricer interface - one of the functions required for any pricing contracts used with ZNS. Returns both price and fee for a given label under the given parent.
Parameters
setRegistry
Sets the registry address in state.
This function is required for all contracts inheriting ARegistryWired
.
_setPrice
Internal function for set price
Parameters
_setFeePercentage
Internal function for setFeePercentage
Parameters
_authorizeUpgrade
To use UUPS proxy we override this function and revert if msg.sender
isn't authorized