Smart Contracts
Contracts
DefaultRegistrationStrategy

DefaultRegistrationStrategy

Git Source (opens in a new tab)

Author: Sam Ward

Inherits: ISldRegistrationStrategy, Ownable, Multicallable

State Variables

registrationManager

ISldRegistrationManager public registrationManager;

reservedNames

mapping(bytes32 => address) public reservedNames;

premiumNames

mapping(bytes32 => uint256) public premiumNames;

lengthCost

mapping(bytes32 => uint256[]) public lengthCost;

multiYearDiscount

mapping(bytes32 => uint256[]) public multiYearDiscount;

isEnabled

mapping(bytes32 => bool) public isEnabled;

Functions

constructor

constructor(ISldRegistrationManager _manager);

setPremiumName

function setPremiumName(bytes32 _parentNamehash, string calldata _label, uint256 _priceInDollarsPerYear) private;

setReservedName

function setReservedName(bytes32 _parentNamehash, string calldata _label, address _claimant) private;

setLengthCost

function setLengthCost(bytes32 _parentNamehash, uint256[] calldata _prices)
    public
    isApprovedOrTokenOwner(_parentNamehash);

setMultiYearDiscount

function setMultiYearDiscount(bytes32 _parentNamehash, uint256[] calldata _discounts)
    public
    isApprovedOrTokenOwner(_parentNamehash);

getLengthCost

function getLengthCost(bytes32 _parentNamehash, uint256 _length) private view returns (uint256);

setPremiumNames

function setPremiumNames(bytes32 _parentNamehash, string[] calldata _labels, uint256[] calldata _priceInDollarsPerYear)
    public
    isApprovedOrTokenOwner(_parentNamehash);

setReservedNames

function setReservedNames(bytes32 _parentNamehash, string[] calldata _labels, address[] calldata _claimants)
    public
    isApprovedOrTokenOwner(_parentNamehash);

setIsEnabled

function setIsEnabled(bytes32 _parentNamehash, bool _isEnabled) external isApprovedOrTokenOwner(_parentNamehash);

getPriceInDollars

function getPriceInDollars(
    address _buyingAddress,
    bytes32 _parentNamehash,
    string memory _label,
    uint256 _registrationLength,
    bool _isRenewal
) public view returns (uint256);

getDiscount

function getDiscount(bytes32 _parentNamehash, uint256 _years) private view returns (uint256);

supportsInterface

function supportsInterface(bytes4 interfaceId) public view override(IERC165, Multicallable) returns (bool);

minDollarPrice

function minDollarPrice() private view returns (uint256);

isApprovedOrTokenOwner

modifier isApprovedOrTokenOwner(bytes32 _namehash);

Events

PremiumNameSet

event PremiumNameSet(bytes32 indexed _tokenNamehash, uint256 _price, string _label);

ReservedNameSet

event ReservedNameSet(bytes32 indexed _tokenNamehash, address indexed _claimant, string _label);