Smart Contracts
Contracts
HandshakeTld

HandshakeTld

Git Source (opens in a new tab)

Author: Sam Ward

Inherits: HandshakeNft, IHandshakeTld

State Variables

claimManager

ITldClaimManager public claimManager;

namehashToLabelMap

mapping(bytes32 => string) public namehashToLabelMap;

registrationStrategy

mapping(bytes32 => ISldRegistrationStrategy) public registrationStrategy;

claimManagerAddress

address public claimManagerAddress;

royaltyPayoutAddress

address public royaltyPayoutAddress;

royaltyPayoutAmount

uint256 public royaltyPayoutAmount = 50;

Functions

constructor

constructor(ITldClaimManager _claimManager) HandshakeNft("TLD", "Handshake TLD");

setTldClaimManager

function setTldClaimManager(ITldClaimManager _manager) public onlyOwner;

setRoyaltyPayoutAddress

function setRoyaltyPayoutAddress(address _addr) public onlyOwner;

setRoyaltyPayoutAmount

function setRoyaltyPayoutAmount(uint256 _amount) public onlyOwner;

setRoyaltyPayoutAmountAndAddress

function setRoyaltyPayoutAmountAndAddress(address _addr, uint256 _amount) public onlyOwner;

registerWithResolver

function registerWithResolver(address _addr, string calldata _domain, ISldRegistrationStrategy _strategy) external;

setResolver

function setResolver(bytes32 _namehash, IResolver _resolver) public override(IHandshakeTld, HandshakeNft);

name

function name(bytes32 _namehash) public view override returns (string memory _name);

setRegistrationStrategy

Set the registration strategy for a TLD

This function sets the registration strategy of a top level domain. Must be set by the owner of the top level domain

function setRegistrationStrategy(bytes32 _namehash, ISldRegistrationStrategy _strategy)
    public
    onlyApprovedOrOwner(uint256(_namehash));

Parameters

NameTypeDescription
_namehashbytes32namehash of the top level domain
_strategyISldRegistrationStrategyLinked registration strategy to the top level domain. It should implement ISldRegistrationStrategy interface

royaltyInfo

Returns information about the royalty payouts for the contract

function royaltyInfo(uint256, uint256 salePrice) external view returns (address receiver, uint256 royaltyAmount);

Parameters

NameTypeDescription
<none>uint256
salePriceuint256The price of the item being sold

Returns

NameTypeDescription
receiveraddressThe address to receive the royalty payment and the amount to be paid
royaltyAmountuint256The amount of the royalty payment Implements the on-chain royalty payment standard defined in EIP-2981

ownerOf

function ownerOf(uint256 _id) public view override(HandshakeNft, IHandshakeTld) returns (address);

isApprovedOrOwner

function isApprovedOrOwner(address _operator, uint256 _id)
    public
    view
    override(HandshakeNft, IHandshakeTld)
    returns (bool);