IMultipass#

Interface for the Multipass contract. Multipass contract acts as cross-domain registry, allowing owner to specify registrars and domains that can be used to register names. It also allows for referral program, where referrers can earn rewards for referring new registrations.

InvalidQueryReasons#

enum InvalidQueryReasons {
  EMPTY_ID,
  EMPTY_DOMAIN,
  EMPTY_ADDRESS
}

invalidQuery#

error invalidQuery(enum IMultipass.InvalidQueryReasons reason)

nameExists#

error nameExists(bytes32 name)

recordExists#

error recordExists(struct LibMultipass.Record newRecord)

isActive#

error isActive(bytes32 name, bool isActive)

signatureExpired#

error signatureExpired(uint256 signatureDeadline)

invalidSignature#

error invalidSignature()

mathOverflow#

error mathOverflow(uint256 a, uint256 b)

invalidDomain#

error invalidDomain(bytes32 domainName)

referralRewardsTooHigh#

error referralRewardsTooHigh(uint256 referrerReward, uint256 referralDiscount, uint256 fee)

invalidRegistrar#

error invalidRegistrar(address registrar)

paymentTooLow#

error paymentTooLow(uint256 fee, uint256 value)

paymendFailed#

error paymendFailed()

referredSelf#

error referredSelf()

domainNotActive#

error domainNotActive(bytes32 domainName)

userNotFound#

error userNotFound(struct LibMultipass.NameQuery query)

invalidnameChange#

error invalidnameChange(bytes32 domainName, bytes32 newName)

invalidNonce#

error invalidNonce(uint256 nonce)

invalidNonceIncrement#

error invalidNonceIncrement(uint256 old, uint256 newer)

resolveRecord#

function resolveRecord(struct LibMultipass.NameQuery query) external view returns (bool, struct LibMultipass.Record)
Input Type Description
query struct LibMultipass.NameQuery The name query to resolve.
Output
0 bool A boolean indicating whether the record was found, and the resolved record.
1 struct LibMultipass.Record

Notice

Retrieves the resolved record for a given name query.

initializeDomain#

function initializeDomain(address registrar, uint256 fee, uint256 renewalFee, bytes32 domainName, uint256 referrerReward, uint256 referralDiscount) external

Notice

Initializes new LibMultipass.Domain and configures it's parameters

Notice

Requirements: registrar is not zero domainName is not empty domainIndex is either zero(auto assign) or can be one of preoccupied LibMultipass.Domain names domainName does not exist yet onlyOwner referrerReward+referralDiscount cannot be larger than fee @param registrar address of registrar @param fee fee in base currency of network @param domainName name of LibMultipass.Domain @param referrerReward referral fee share in base currency of network @param referralDiscount referral discount in base currency of network

Notice

Emits an InitializedDomain event.

activateDomain#

function activateDomain(bytes32 domainName) external

Notice

Activates LibMultipass.Domain name

Notice

Requirements: msg.sender is Owner

Notice

Emits an DomainActivated event.

deactivateDomain#

function deactivateDomain(bytes32 domainName) external

Notice

Deactivates LibMultipass.Domain name

Notice

Deactivated LibMultipass.Domain cannot mutate names and will return zeros

Notice

Requirements: msg.sender is Owner OR registrar

Notice

Emits an DomainDeactivated event.

changeFee#

function changeFee(bytes32 domainName, uint256 fee) external

Notice

Changes registrar address

Notice

Requirements: msg.sender is Owner

Notice

Emits an DomainFeeChanged event.

changeRegistrar#

function changeRegistrar(bytes32 domainName, address newRegistrar) external

Notice

Changes registrar address

Notice

Requirements: msg.sender is Owner

Notice

Emits an RegistrarChangeRequested event.

deleteName#

function deleteName(struct LibMultipass.NameQuery query) external

Notice

deletes name

Notice

Requirements: msg.sender is Owner

Notice

Emits an DomainTTLChangeRequested event.

changeReferralProgram#

function changeReferralProgram(uint256 referrerFeeShare, uint256 referralDiscount, bytes32 domainName) external

Notice

executes all pending changes to LibMultipass.Domain that fulfill TTL

Notice

Requirements: domainName must be set referrerFeeShare+referralDiscount cannot be larger than 2^32

Notice

Emits an ReferralProgramChangeRequested event.

changeRenewalFee#

function changeRenewalFee(uint256 fee, bytes32 domainName) external

Notice

changes renewal fee for domain

Notice

Requirements: domainName must be set fee must be set

Notice

Emits an RenewalFeeChangeRequested event.

register#

function register(struct LibMultipass.Record newRecord, bytes registrarSignature, struct LibMultipass.NameQuery referrer, bytes referralCode) external payable

Notice

registers new name under LibMultipass.Domain

Notice

Requirements: all arguments must be set domainName must be active resolveRecord for given arguments should return no LibMultipass.Record

Notice

Emits an Registered event.

getDomainState#

function getDomainState(bytes32 domainName) external view returns (struct LibMultipass.Domain)
Input Type Description
domainName bytes32 name of the LibMultipass.Domain
Output
0 struct LibMultipass.Domain (name, fee, referrerReward, referralDiscount, isActive, registrar, ttl, registerSize)

Notice

returns LibMultipass.Domain state variables

getContractState#

function getContractState() external view returns (uint256)
Output Type Description
0 uint256 (s_numDomains)

Notice

returns contract state variables

fundsWithdawn#

event fundsWithdawn(uint256 amount, address account)

Notice

returns price for registering name

InitializedDomain#

event InitializedDomain(address registrar, uint256 fee, bytes32 domainName, uint256 renewalFee, uint256 referrerReward, uint256 referralDiscount)
Input Type Description
registrar address The address of the registrar for the domain.
fee uint256 The fee required for registration in the domain.
domainName bytes32 The name of the domain.
renewalFee uint256
referrerReward uint256 The reward for referring new registrations to the domain.
referralDiscount uint256 The discount for referrals in the domain.

Notice

Initializes a new domain with the specified parameters.

DomainActivated#

event DomainActivated(bytes32 domainName)
Input Type Description
domainName bytes32 The name of the activated domain.

Notice

Emitted when a domain is activated.

DomainDeactivated#

event DomainDeactivated(bytes32 domainName)
Input Type Description
domainName bytes32 The name of the deactivated domain.

Notice

Emitted when a domain is deactivated.

DomainFeeChanged#

event DomainFeeChanged(bytes32 domainName, uint256 newFee)
Input Type Description
domainName bytes32 The name of the domain.
newFee uint256 The new fee for the domain.

Notice

Emitted when the fee for a domain is changed.

RegistrarChanged#

event RegistrarChanged(bytes32 domainName, address registrar)
Input Type Description
domainName bytes32 The name of the domain.
registrar address The address of the new registrar.

Notice

Emitted when a registrar change is requested for a domain.

nameDeleted#

event nameDeleted(bytes32 domainName, address wallet, bytes32 id, bytes32 name)
Input Type Description
domainName bytes32 The domain name.
wallet address The address of the wallet.
id bytes32 The ID of the name.
name bytes32 The name.

Notice

Emitted when a name is deleted.

ReferralProgramChanged#

event ReferralProgramChanged(bytes32 domainName, uint256 reward, uint256 discount)
Input Type Description
domainName bytes32 The domain name.
reward uint256 The referral reward amount.
discount uint256 The referral discount amount.

Notice

Emitted when the referral program for a domain is changed.

Registered#

event Registered(bytes32 domainName, struct LibMultipass.Record NewRecord)
Input Type Description
domainName bytes32 The domain name.
NewRecord struct LibMultipass.Record The new record.

Notice

Emitted when a domain is registered.

Referred#

event Referred(struct LibMultipass.Record refferrer, struct LibMultipass.Record newRecord, bytes32 domainName)
Input Type Description
refferrer struct LibMultipass.Record The record of the referrer.
newRecord struct LibMultipass.Record The new record.
domainName bytes32 The domain name.

Notice

Emitted when a user is referred.

Renewed#

event Renewed(address wallet, bytes32 domainName, bytes32 id, struct LibMultipass.Record newRecord)
Input Type Description
wallet address The address of the wallet.
domainName bytes32 The domain name.
id bytes32 The ID of the record.
newRecord struct LibMultipass.Record The new record.

Notice

Emitted when a user record is renewed.

RenewalFeeChanged#

event RenewalFeeChanged(bytes32 domainName, uint256 newFee)
Input Type Description
domainName bytes32 The domain name.
newFee uint256 The new renewal fee.

Notice

Emitted when a domain renewal fee is changed.

getDomainStateById#

function getDomainStateById(uint256 id) external view returns (struct LibMultipass.Domain)
Input Type Description
id uint256 The ID of the domain.
Output
0 struct LibMultipass.Domain The domain state as a LibMultipass.Domain struct.

Notice

Retrieves the domain state by its ID.

renewRecord#

renews record for given query

function renewRecord(struct LibMultipass.NameQuery query, struct LibMultipass.Record record, bytes registrarSignature) external payable
Input Type Description
query struct LibMultipass.NameQuery name query
record struct LibMultipass.Record new record
registrarSignature bytes registrar signature