๐Ÿ“‚ZNSFixedPricer

Pricer contract that uses the most straightforward fixed pricing model that doesn't depend on the length of the label.

PERCENTAGE_BASIS

uint256 PERCENTAGE_BASIS

priceConfigs

mapping(bytes32 => struct IZNSFixedPricer.PriceConfig) priceConfigs

Mapping of domainHash to price config set by the domain owner/operator

constructor

constructor() public

initialize

function initialize(address _accessController, address _registry) external

setPrice

function setPrice(bytes32 domainHash, uint256 _price) public

Sets the price for a domain. Only callable by domain owner/operator. Emits a PriceSet event.

Parameters

getPrice

function getPrice(bytes32 parentHash, string label, bool skipValidityCheck) public view returns (uint256)

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

function setFeePercentage(bytes32 domainHash, uint256 feePercentage) public

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

function setPriceConfig(bytes32 domainHash, struct IZNSFixedPricer.PriceConfig priceConfig) external

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

function getFeeForPrice(bytes32 parentHash, uint256 price) public view returns (uint256)

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

function getPriceAndFee(bytes32 parentHash, string label, bool skipValidityCheck) external view returns (uint256 price, uint256 fee)

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

function setRegistry(address registry_) public

Sets the registry address in state.

This function is required for all contracts inheriting ARegistryWired.

_setPrice

function _setPrice(bytes32 domainHash, uint256 price) internal

Internal function for set price

Parameters

_setFeePercentage

function _setFeePercentage(bytes32 domainHash, uint256 feePercentage) internal

Internal function for setFeePercentage

Parameters

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal view

To use UUPS proxy we override this function and revert if msg.sender isn't authorized

Parameters