gem(EVM) Proxy Doma Record API

User-facing facet for the Proxy DOMA record contract on tokenization chains.

This facet handles user interactions including tokenization requests, ownership claims, cross-chain bridging, and domain record management. It validates vouchers, manages fees, and integrates with EIP-712 for signature verification. Supports both ownership tokens and capability tokens with appropriate access controls.

ABI

Structs

TokenizationVoucher

Tokenization voucher, obtained from a Registrar.

Parameters

Name

Type

Description

struct TokenizationVoucher {
  struct IDomaRecord.NameInfo[] names;
  uint256 nonce;
  uint256 expiresAt;
  address ownerAddress;
}

ProofOfContactsVoucher

Proof of Contacts voucher, obtained from a Registrar or Doma-provided storage.

Parameters

Name

Type

Description

Errors

InsufficientCapabilities

Thrown when a token lacks the required capabilities for an operation.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the token being checked

requiredCapability

uint256

The capability bitmask that was required

NameAlreadyTokenized

Thrown when attempting to tokenize a name that is already tokenized.

Parameters

Name
Type
Description

sld

string

The second-level domain of the name

tld

string

The top-level domain of the name

InvalidRegistrar

Thrown when a registrar ID doesn't match the expected registrar for an operation.

Parameters

Name
Type
Description

ianaId

uint256

The provided registrar IANA ID

expectedIanaId

uint256

The expected registrar IANA ID

NotImplemented

Thrown when attempting to use functionality not yet implemented for synthetic tokens.

UnsupportedTargetChain

Thrown when attempting to bridge to an unsupported target chain.

Parameters

Name
Type
Description

chainId

string

The unsupported chain ID in CAIP-2 format

TransferLocked

Thrown when attempting to transfer a token that is locked for transfers.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the locked token

NameTokenHasExpired

Thrown when attempting to operate on an expired name token.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the expired token

expiresAt

uint256

The expiration timestamp of the token

InvalidSigner

Thrown when a voucher signature is invalid or from an unauthorized signer.

Parameters

Name
Type
Description

signer

address

The address that was recovered from the signature

VoucherExpired

Thrown when a voucher has expired and cannot be used.

Parameters

Name
Type
Description

expiresAt

uint256

The expiration timestamp of the voucher

currentTime

uint256

The current block timestamp

PriceFeedStalePrice

Thrown when the price feed data is stale and cannot be trusted.

Parameters

Name
Type
Description

roundId

uint80

The round ID from the price feed

updatedAt

uint256

The timestamp when the price was last updated

InvalidPrice

Thrown when the price feed returns an invalid price value.

Parameters

Name
Type
Description

price

int256

The invalid price value returned

TransferFailed

Thrown when a native currency transfer fails.

InvalidFee

Thrown when the provided fee doesn't match the expected fee for an operation.

Parameters

Name
Type
Description

expectedFee

uint256

The expected fee amount in wei

providedFee

uint256

The fee amount actually provided

FeeNotRequired

Thrown when a fee is provided for an operation that doesn't require payment.

Parameters

Name
Type
Description

operation

bytes32

The operation identifier

nameCount

uint256

The number of names being processed

NonceAlreadyUsed

Thrown when attempting to reuse a nonce that has already been consumed.

Parameters

Name
Type
Description

nonce

uint256

The nonce that was already used

FeeCollected

Emitted when a fee is collected for an operation.

Parameters

Name
Type
Description

feeWei

uint256

The fee amount collected in wei

feeUsdCents

uint256

The equivalent fee amount in USD cents

correlationId

string

The correlation ID for tracking the operation

Methods

requestTokenization

Request tokenization of domain names using a signed voucher from a registrar.

Validates the voucher signature, collects fees, and initiates cross-chain tokenization. The voucher must be signed by an authorized registrar and not expired. Names are validated for proper format and checked for existing tokenization on this chain.

Parameters

Name
Type
Description

voucher

struct ProxyDomaRecordUserFacet.TokenizationVoucher

The tokenization voucher containing names and authorization details

signature

bytes

The registrar's signature over the voucher data

claimOwnership

Claim ownership of a domain name using proof of contacts voucher.

Allows token owners to establish claim over their domain by providing signed proof from either the registrar or DOMA system. Validates voucher signature, collects fees, and initiates cross-chain ownership claim process.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the ownership token being claimed

isSynthetic

bool

Whether the token is synthetic (currently not supported)

proofOfContactsVoucher

struct ProxyDomaRecordUserFacet.ProofOfContactsVoucher

The voucher containing proof of contact information

signature

bytes

The signature over the voucher (from registrar or DOMA)

bridge

Bridge a domain token to another supported chain.

Burns the token on this chain and initiates minting on the target chain. Validates target chain support, transfer lock status, and token expiration. Collects fees and relays the bridge request to the DOMA chain.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the ownership token to bridge

isSynthetic

bool

Whether the token is synthetic (currently not supported)

targetChainId

string

The CAIP-2 chain ID of the destination chain

targetOwnerAddress

string

The owner address on the target chain

requestDetokenization

Request detokenization of a domain name by the owner.

Initiates the detokenization process on the DOMA chain, which will remove the domain from the protocol and return it to traditional DNS management. Only the token owner can request detokenization.

Parameters

Name
Type
Description

tokenId

uint256

The ID of the ownership token to detokenize

isSynthetic

bool

Whether the token is synthetic (currently not supported)

setNameservers

Update nameservers for a domain.

Requires CAPABILITY_REGISTRY_RECORDS_MANAGEMENT. Relays change to Doma Chain.

Parameters

Name
Type
Description

tokenId

uint256

The ownership token ID.

nameservers

string[]

List of nameserver hostnames.

isSynthetic

bool

Must be false (synthetic tokens not supported).

setDSKeys

Update DNSSEC DS keys for a domain.

Requires CAPABILITY_REGISTRY_RECORDS_MANAGEMENT. Relays change to Doma Chain.

Parameters

Name
Type
Description

tokenId

uint256

The ownership token ID.

dsKeys

struct IDomaRecord.DSKey[]

Array of DS key records.

isSynthetic

bool

Must be false (synthetic tokens not supported).

setDNSRRSet

Set DNS resource record set for a domain.

Requires CAPABILITY_DNS_RECORDS_MANAGEMENT. Relays change to Doma Chain.

Parameters

Name
Type
Description

tokenId

uint256

The ownership token ID.

host

string

The hostname (e.g., "www" or "@" for apex).

recordType

string

DNS record type (e.g., "A", "AAAA", "CNAME").

ttl

uint32

Time-to-live in seconds.

records

string[]

Array of record values. Empty array deletes the RRSet.

isSynthetic

bool

Must be false (synthetic tokens not supported).

feesUSDCents

Get the fee in USD cents for a specific operation.

Parameters

Name
Type
Description

operation

bytes32

The operation identifier to query

Return Values

Name
Type
Description

[0]

uint256

The fee amount in USD cents

isTargetChainSupported

Check if a target chain is supported for bridging operations.

Parameters

Name
Type
Description

targetChainId

string

The CAIP-2 chain identifier to check

Return Values

Name
Type
Description

[0]

bool

Whether the target chain is supported

getNativePrice

Convert a USD cent amount to the equivalent native token amount.

Uses Chainlink price feed to get current exchange rate. Validates price feed data.

Parameters

Name
Type
Description

feeUSDCents

uint256

The fee amount in USD cents

Return Values

Name
Type
Description

nativeFee

uint256

The equivalent fee in native token wei

getOperationFeeInNative

Get the fee in native tokens for a specific operation.

Combines USD cent fee lookup with current price conversion.

Parameters

Name
Type
Description

operation

bytes32

The operation identifier to query

Return Values

Name
Type
Description

[0]

uint256

The fee amount in native token wei (0 if operation has no fee)

version

Get the contract version.

Return Values

Name
Type
Description

[0]

string

The version string of this contract

REQUEST_TOKENIZATION_OPERATION

Get the REQUEST_TOKENIZATION_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for request tokenization

CLAIM_OWNERSHIP_OPERATION

Get the CLAIM_OWNERSHIP_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for claim ownership

BRIDGE_OPERATION

Get the BRIDGE_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for bridge

SET_NAMESERVERS_OPERATION

Get the SET_NAMESERVERS_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for set nameservers

SET_DS_KEYS_OPERATION

Get the SET_DS_KEYS_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for set DS keys

SET_DNS_RRSET_OPERATION

Get the SET_DNS_RRSET_OPERATION constant

Return Values

Name
Type
Description

[0]

bytes32

The operation hash for set DNS RRSet

Last updated