TldClaimManager
Git Source (opens in a new tab)
Author: Sam Ward
Inherits: OwnableUpgradeable, ITldClaimManager, HasLabelValidator, HasUsdOracle
This contract is for managing the TLDs that can be claimed TLD managers can add allowed TLDs that can be minted by address
State Variables
isNodeRegistered
mapping(bytes32 => bool) public isNodeRegistered;
allowedTldManager
mapping(address => bool) public allowedTldManager;
tldClaimantMap
mapping(bytes32 => address) public tldClaimantMap;
tldProviderMap
mapping(bytes32 => address) public tldProviderMap;
handshakeTldContract
IHandshakeTld public handshakeTldContract;
handshakeWalletPayoutAddress
address public handshakeWalletPayoutAddress;
defaultRegistrationStrategy
ISldRegistrationStrategy public defaultRegistrationStrategy;
mintPriceInDollars
uint256 public mintPriceInDollars;
Functions
constructor
constructor();
init
function init(
ILabelValidator _validator,
address _owner,
IHandshakeTld _tld,
ISldRegistrationStrategy _strategy,
IPriceOracle _oracle,
uint256 _mintPriceInDollars,
address _handshakeWalletPayoutAddress
) public initializer;
canClaim
Helper function to check if an address can claim a TLD
This function is public so that it can be used by UI if required.
function canClaim(address _addr, bytes32 _namehash) public view returns (bool _canClaim);
Parameters
Name | Type | Description |
---|---|---|
_addr | address | address of the claimant |
_namehash | bytes32 | Namehash of the TLD label. Use namehash library. |
Returns
Name | Type | Description |
---|---|---|
_canClaim | bool | Return bool value |
setHandshakeTldContract
function setHandshakeTldContract(IHandshakeTld _tld) external onlyOwner;
updatePriceOracle
Update the chainlink price oracle.
Probably should never need updating.
function updatePriceOracle(IPriceOracle _oracle) public onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_oracle | IPriceOracle | Address of the internal price oracle (this proxies to chainlink in current instance) |
updateMintPrice
Update the mint price in dollars
Can be updated by contract owner
function updateMintPrice(uint256 _priceInDollarDecimals) public onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_priceInDollarDecimals | uint256 | Price in dollars |
claimTld
This function calls through to the TLD NFT contract and registers TLD NFT.
Only whitelisted TLDs can be claimed/minted
function claimTld(string calldata _domain, address _addr) external payable;
Parameters
Name | Type | Description |
---|---|---|
_domain | string | string domain TLD |
_addr | address |
addTldAndClaimant
This function adds addresses / domains to whitelist. Only one address per TLD
Can be removed from the whitelist by using address(0). Both arrays should be the same size
function addTldAndClaimant(address[] calldata _addr, string[] calldata _domain) external onlyAuthorisedTldManager;
Parameters
Name | Type | Description |
---|---|---|
_addr | address[] | Addresses of the wallets allowed to claim |
_domain | string[] | string representation of the domains that will be claimed |
updateAllowedTldManager
This function adds addresses that are allowed to add TLD claimers
Only can be ran by the contract owner
function updateAllowedTldManager(address _addr, bool _allowed) external onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_addr | address | Address of a wallet allowed to add TLD claimers |
_allowed | bool | true/false. Wallets can be removed by using false |
updateLabelValidator
Update the label validator contract. This just contains a function that checks the label is acceptable
This should implement the ILabelValidator interface. Can only be run from the contract owner wallet
function updateLabelValidator(ILabelValidator _validator) public onlyOwner;
Parameters
Name | Type | Description |
---|---|---|
_validator | ILabelValidator | Address of the label validator. This can be updated in the future if required. |
getMintPriceInWei
function getMintPriceInWei() public view returns (uint256);
onlyAuthorisedTldManager
modifier onlyAuthorisedTldManager();