(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.
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
struct ProofOfContactsVoucher {
uint256 registrantHandle;
enum IDomaRecord.ProofOfContactsSource proofSource;
uint256 nonce;
uint256 expiresAt;
}Errors
InsufficientCapabilities
error InsufficientCapabilities(uint256 tokenId, uint256 requiredCapability)Thrown when a token lacks the required capabilities for an operation.
Parameters
tokenId
uint256
The ID of the token being checked
requiredCapability
uint256
The capability bitmask that was required
NameAlreadyTokenized
error NameAlreadyTokenized(string sld, string tld)Thrown when attempting to tokenize a name that is already tokenized.
Parameters
sld
string
The second-level domain of the name
tld
string
The top-level domain of the name
InvalidRegistrar
error InvalidRegistrar(uint256 ianaId, uint256 expectedIanaId)Thrown when a registrar ID doesn't match the expected registrar for an operation.
Parameters
ianaId
uint256
The provided registrar IANA ID
expectedIanaId
uint256
The expected registrar IANA ID
NotImplemented
error NotImplemented()Thrown when attempting to use functionality not yet implemented for synthetic tokens.
UnsupportedTargetChain
error UnsupportedTargetChain(string chainId)Thrown when attempting to bridge to an unsupported target chain.
Parameters
chainId
string
The unsupported chain ID in CAIP-2 format
TransferLocked
error TransferLocked(uint256 tokenId)Thrown when attempting to transfer a token that is locked for transfers.
Parameters
tokenId
uint256
The ID of the locked token
NameTokenHasExpired
error NameTokenHasExpired(uint256 tokenId, uint256 expiresAt)Thrown when attempting to operate on an expired name token.
Parameters
tokenId
uint256
The ID of the expired token
expiresAt
uint256
The expiration timestamp of the token
InvalidSigner
error InvalidSigner(address signer)Thrown when a voucher signature is invalid or from an unauthorized signer.
Parameters
signer
address
The address that was recovered from the signature
VoucherExpired
error VoucherExpired(uint256 expiresAt, uint256 currentTime)Thrown when a voucher has expired and cannot be used.
Parameters
expiresAt
uint256
The expiration timestamp of the voucher
currentTime
uint256
The current block timestamp
PriceFeedStalePrice
error PriceFeedStalePrice(uint80 roundId, uint256 updatedAt)Thrown when the price feed data is stale and cannot be trusted.
Parameters
roundId
uint80
The round ID from the price feed
updatedAt
uint256
The timestamp when the price was last updated
InvalidPrice
error InvalidPrice(int256 price)Thrown when the price feed returns an invalid price value.
Parameters
price
int256
The invalid price value returned
TransferFailed
error TransferFailed()Thrown when a native currency transfer fails.
InvalidFee
error InvalidFee(uint256 expectedFee, uint256 providedFee)Thrown when the provided fee doesn't match the expected fee for an operation.
Parameters
expectedFee
uint256
The expected fee amount in wei
providedFee
uint256
The fee amount actually provided
FeeNotRequired
error FeeNotRequired(bytes32 operation, uint256 nameCount)Thrown when a fee is provided for an operation that doesn't require payment.
Parameters
operation
bytes32
The operation identifier
nameCount
uint256
The number of names being processed
NonceAlreadyUsed
error NonceAlreadyUsed(uint256 nonce)Thrown when attempting to reuse a nonce that has already been consumed.
Parameters
nonce
uint256
The nonce that was already used
FeeCollected
event FeeCollected(uint256 feeWei, uint256 feeUsdCents, string correlationId)Emitted when a fee is collected for an operation.
Parameters
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
function requestTokenization(struct ProxyDomaRecordUserFacet.TokenizationVoucher voucher, bytes signature) external payableRequest 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
voucher
struct ProxyDomaRecordUserFacet.TokenizationVoucher
The tokenization voucher containing names and authorization details
signature
bytes
The registrar's signature over the voucher data
claimOwnership
function claimOwnership(uint256 tokenId, bool isSynthetic, struct ProxyDomaRecordUserFacet.ProofOfContactsVoucher proofOfContactsVoucher, bytes signature) external payableClaim 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
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
function bridge(uint256 tokenId, bool isSynthetic, string targetChainId, string targetOwnerAddress) external payableBridge 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
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
function requestDetokenization(uint256 tokenId, bool isSynthetic) externalRequest 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
tokenId
uint256
The ID of the ownership token to detokenize
isSynthetic
bool
Whether the token is synthetic (currently not supported)
setNameservers
function setNameservers(uint256 tokenId, string[] nameservers, bool isSynthetic) external payableUpdate nameservers for a domain.
Requires CAPABILITY_REGISTRY_RECORDS_MANAGEMENT. Relays change to Doma Chain.
Parameters
tokenId
uint256
The ownership token ID.
nameservers
string[]
List of nameserver hostnames.
isSynthetic
bool
Must be false (synthetic tokens not supported).
setDSKeys
function setDSKeys(uint256 tokenId, struct IDomaRecord.DSKey[] dsKeys, bool isSynthetic) external payableUpdate DNSSEC DS keys for a domain.
Requires CAPABILITY_REGISTRY_RECORDS_MANAGEMENT. Relays change to Doma Chain.
Parameters
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
function setDNSRRSet(uint256 tokenId, string host, string recordType, uint32 ttl, string[] records, bool isSynthetic) external payableSet DNS resource record set for a domain.
Requires CAPABILITY_DNS_RECORDS_MANAGEMENT. Relays change to Doma Chain.
Parameters
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
function feesUSDCents(bytes32 operation) public view returns (uint256)Get the fee in USD cents for a specific operation.
Parameters
operation
bytes32
The operation identifier to query
Return Values
[0]
uint256
The fee amount in USD cents
isTargetChainSupported
function isTargetChainSupported(string targetChainId) public view returns (bool)Check if a target chain is supported for bridging operations.
Parameters
targetChainId
string
The CAIP-2 chain identifier to check
Return Values
[0]
bool
Whether the target chain is supported
getNativePrice
function getNativePrice(uint256 feeUSDCents) public view returns (uint256 nativeFee)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
feeUSDCents
uint256
The fee amount in USD cents
Return Values
nativeFee
uint256
The equivalent fee in native token wei
getOperationFeeInNative
function getOperationFeeInNative(bytes32 operation) public view returns (uint256)Get the fee in native tokens for a specific operation.
Combines USD cent fee lookup with current price conversion.
Parameters
operation
bytes32
The operation identifier to query
Return Values
[0]
uint256
The fee amount in native token wei (0 if operation has no fee)
version
function version() external pure returns (string)Get the contract version.
Return Values
[0]
string
The version string of this contract
REQUEST_TOKENIZATION_OPERATION
function REQUEST_TOKENIZATION_OPERATION() external pure returns (bytes32)Get the REQUEST_TOKENIZATION_OPERATION constant
Return Values
[0]
bytes32
The operation hash for request tokenization
CLAIM_OWNERSHIP_OPERATION
function CLAIM_OWNERSHIP_OPERATION() external pure returns (bytes32)Get the CLAIM_OWNERSHIP_OPERATION constant
Return Values
[0]
bytes32
The operation hash for claim ownership
BRIDGE_OPERATION
function BRIDGE_OPERATION() external pure returns (bytes32)Get the BRIDGE_OPERATION constant
Return Values
[0]
bytes32
The operation hash for bridge
SET_NAMESERVERS_OPERATION
function SET_NAMESERVERS_OPERATION() external pure returns (bytes32)Get the SET_NAMESERVERS_OPERATION constant
Return Values
[0]
bytes32
The operation hash for set nameservers
SET_DS_KEYS_OPERATION
function SET_DS_KEYS_OPERATION() external pure returns (bytes32)Get the SET_DS_KEYS_OPERATION constant
Return Values
[0]
bytes32
The operation hash for set DS keys
SET_DNS_RRSET_OPERATION
function SET_DNS_RRSET_OPERATION() external pure returns (bytes32)Get the SET_DNS_RRSET_OPERATION constant
Return Values
[0]
bytes32
The operation hash for set DNS RRSet
Last updated