IDotnsPricing

Git Source

Title: DotNS Pricing Cost Model

Prices a registration from the base length of its label alone.

The seam between name policy and the wei amount a registration costs. PopRules and the public commit-reveal controller keep the classification, reservation, and tier rules; the model owns only the amount for a given base length, so the curve can be swapped by registering a new model under DotnsConstants.COST_MODEL without touching either. Only the base length crosses the seam: the model reads no personhood band or PopStatus. The public controller prices NoStatus deposits through this same path, so the model carries no PoP name.

Note: security-contact: admin@parity.io

Functions

priceForBaseLength

Returns the registration cost in wei for a label of the given base length.

Pure amount lookup: the caller supplies the digit-stripped base length and the model returns the curve value for it. Runs on the ERC721 transfer floor read, so it stays a view with no state writes.

function priceForBaseLength(uint256 baseLength) external view returns (uint256 weiPrice);

Parameters

NameTypeDescription
baseLengthuint256Digit-stripped length of the label being priced.

Returns

NameTypeDescription
weiPriceuint256Registration cost in wei for that base length.

version

Returns a stable identifier for this model and its parameters.

Changes when the model shape or its parameters change, so clients and telemetry can tell one live curve from another. Not consulted on the pricing path.

function version() external view returns (uint256 modelVersion);

Returns

NameTypeDescription
modelVersionuint256Identifier derived from the model form and its parameters.

Errors

PricingError

Thrown when a model constructor parameter breaks a pricing invariant.

error PricingError(string reason);

Parameters

NameTypeDescription
reasonstringHuman-readable explanation of the failed invariant.