RegistrationController
Overview
RegistrationController
is a contract that manages the registration process for Payment ID tokens. The contract allows users to register new Payment IDs and configure their address records across different source types and chains. It enforces registration rules and ensures proper initialization of associated resolver records.
Key Concepts
Name Registration
Handles the process of registering a unique Payment ID name and creating the associated token.
Address Configuration
Sets up initial address records for newly registered Payment IDs.
Availability Check
Verifies that a Payment ID name is available before allowing registration.
Token ID Generation
Creates a deterministic token ID by hashing the requested name.
Data Structures
State Variables
pidRegistry
IPIDRegistry
Reference to the PID Registry contract.
resolver
PublicResolver
Reference to the Public Resolver contract.
pid
IPID
Reference to the PID token contract.
Functions
Constructor
function constructor(
address _pidRegistry,
address _resolver,
address _pid
) public
_pidRegistry
address
Address of the PID Registry contract.
_resolver
address
Address of the Public Resolver contract.
_pid
address
Address of the PID token contract.
Registration
register
function register(
string calldata name,
uint256[] calldata sourceTypes,
uint256[] calldata addrTypes,
bytes[] calldata destAddress
) external
name
string
The Payment ID name to register.
sourceTypes
uint256[]
Array of source types (e.g., exchange, wallet).
addrTypes
uint256[]
Array of address types (e.g., blockchain identifiers).
destAddress
bytes[]
Array of destination addresses for each source/address type pair.
RegistrationController__InvalidInput
Thrown when input arrays have mismatched lengths.
RegistrationController__AlreadyRegistered
Thrown when sender already owns a Payment ID.
RegistrationController__NameAlreadyTaken
Thrown when the requested name is already registered.
available
function available(uint256 _tokenId) public view returns (bool)
_tokenId
uint256
Token ID to check availability for.
bool
true
if the token ID is available, false
otherwise.
Internal Functions
_setAddresses
function _setAddresses(
uint256 tokenId,
uint256[] calldata sourceTypes,
uint256[] calldata addrTypes,
bytes[] calldata destAddress
) internal
tokenId
uint256
The token ID to set addresses for.
sourceTypes
uint256[]
Array of source types (e.g., exchange, wallet).
addrTypes
uint256[]
Array of address types (e.g., blockchain identifiers).
destAddress
bytes[]
Array of destination addresses for each source/address type pair.
Errors
RegistrationController__InvalidInput
Thrown when input arrays have mismatched lengths.
RegistrationController__AlreadyRegistered
Thrown when sender already owns a Payment ID.
RegistrationController__NameAlreadyTaken
Thrown when the requested name is already registered.
Last updated