For the complete documentation index, see llms.txt. This page is also available as Markdown.

TREXRegistry

TREXRegistry is the eligibility gate of an asset. It resolves an address to an ONCHAINID, holds the claim topics the asset requires and the Claim Issuers it trusts, and answers isVerified. One contract carries what ERC-3643 splits into an identity registry, a claim topics registry and a trusted issuers registry. The concept is in Eligibility and compliance: the two gates.

At a glance

Source

contracts/registry/implementation/TREXRegistry.sol, on the standard bases ERC3643IdentityRegistry, ERC3643ClaimTopicsRegistry and ERC3643TrustedIssuersRegistry

Interfaces

ITREXRegistry, IERC3643IdentityRegistry, IERC3643ClaimTopicsRegistry, IERC3643TrustedIssuersRegistry

Deployed as

A beacon proxy per asset. The implementation is built with the address of the IdentityFactory, which never changes

Depends on

An IdentityRegistryStorage for the registrations, the IdentityFactory for the global links and the identity types

Limits

15 required topics by default and 15 per identity type, 50 trusted issuers, 15 topics per trusted issuer

Eligibility reads

View
Returns

isVerified(_userAddress)

Whether an address of the reference chain can receive the asset. The token calls it for the recipient of every transfer and mint

isWalletVerified(wallet)

The same check for a wallet given as bytes, on any chain. Used for a recipient on a satellite and for a spender

identity(_userAddress)

The ONCHAINID an address resolves to: its registration for this asset when there is one, its global link otherwise. A revoked link still resolves, so a position keeps its owner

resolveIdentity(wallet)

The same for a wallet given as bytes. A satellite wallet resolves through the global link only

contains(_userAddress)

Whether the address resolves to an identity

isLocallyRegistered(userAddress)

Whether the address has a registration for this asset

identityFactory(), identityStorage()

The factory and the storage this registry reads

issuersRegistry(), topicsRegistry()

The registry itself

isVerified decides in this order:

  1. Eligibility checks are disabled: true for every address.

  2. The address resolves to no identity, or its link is revoked: false.

  3. The required topics are the ones set for the type of the identity when there are any, the default topics otherwise. With no required topic: true.

  4. For each required topic, the identity holds a claim from at least one Claim Issuer trusted for that topic, and that issuer answers isClaimValid with true. Otherwise false.

Registrations

Function
Access
Reverts with

registerIdentity(_userAddress, _identity, _country), batchRegisterIdentity(_userAddresses, _identities, _countries)

AGENT

ZeroAddress, AddressAlreadyStored, ArrayLengthMismatch. Emits IdentityRegistered. The country is not stored

updateIdentity(_userAddress, _identity)

AGENT

ZeroAddress, AddressNotYetStored. Emits IdentityUpdated

deleteIdentity(_userAddress)

AGENT

ZeroAddress, AddressNotYetStored. Emits IdentityRemoved

A registration is needed only for an address that has no global link, or to name another identity than the global link for this asset. Guides: 06, 17, 18.

Required claim topics

Function
Access
Reverts with

addClaimTopic(_claimTopic)

OWNER

ClaimTopicAlreadyExists, MaxClaimTopicsReached. Emits ClaimTopicAdded

removeClaimTopic(_claimTopic)

OWNER

Nothing: removing an absent topic changes nothing. Emits ClaimTopicRemoved

addClaimTopicForIdentityType(identityType, claimTopic)

OWNER

InvalidIdentityType for type 0, ClaimTopicAlreadyExists, MaxClaimTopicsReached. Emits ClaimTopicAddedForIdentityType

removeClaimTopicForIdentityType(identityType, claimTopic)

OWNER

InvalidIdentityType. Emits ClaimTopicRemovedForIdentityType

getClaimTopics(), getClaimTopicsForIdentityType(identityType)

Anyone, read

Guide: 03 Configure required claim topics.

Trusted Claim Issuers

Function
Access
Reverts with

addTrustedIssuer(_trustedIssuer, _claimTopics)

OWNER

ZeroAddress, TrustedIssuerAlreadyExists, TrustedClaimTopicsCannotBeEmpty, MaxClaimTopicsReached, MaxTrustedIssuersReached. Emits TrustedIssuerAdded

removeTrustedIssuer(_trustedIssuer)

OWNER

ZeroAddress, NotATrustedIssuer. Emits TrustedIssuerRemoved

updateIssuerClaimTopics(_trustedIssuer, _claimTopics)

OWNER

ZeroAddress, NotATrustedIssuer, ClaimTopicsCannotBeEmpty, MaxClaimTopicsReached. Emits ClaimTopicsUpdated

getTrustedIssuers(), getTrustedIssuersForClaimTopic(claimTopic), isTrustedIssuer(_issuer), hasClaimTopic(_issuer, _claimTopic)

Anyone, read

getTrustedIssuerClaimTopics(_trustedIssuer)

Anyone, read

Never reverts: an unknown issuer gives an empty array

Guides: 04, 20.

Settings

Function
Access
Reverts with

disableEligibilityChecks()

OWNER

EligibilityChecksDisabledAlready. Emits EligibilityChecksDisabled

enableEligibilityChecks()

OWNER

EligibilityChecksEnabledAlready. Emits EligibilityChecksEnabled

setIdentityRegistryStorage(_identityRegistryStorage)

OWNER

AuthorityMismatch unless the storage answers to the same access manager, InvalidIdentityRegistryStorage unless it supports the storage interface, RegistryNotBoundToStorage unless the storage already lists this registry. Emits IdentityStorageSet

init(identityStorageAddress, accessManagerAddress, initialTopics, issuers, issuerClaims)

Initializer, called once by the factory

ZeroAddress, InvalidClaimPattern when the two issuer arrays differ in length, and the errors of the topic and issuer functions

With checks disabled, every address is eligible. disableEligibilityChecks turns the first gate off for the whole asset. The compliance rules still apply.

Functions kept for the standard

Function
Behavior

setClaimTopicsRegistry(address), setTrustedIssuersRegistry(address)

Revert with Deprecated: the registry is its own topics and issuers registry

updateCountry(address, uint16)

Reverts with Deprecated: no country is stored

investorCountry(address)

Returns 0

Events

Event
Emitted when

IdentityRegistered(address indexed _investorAddress, IIdentity indexed _identity), IdentityRemoved (same arguments)

An address is registered for this asset, its registration deleted

IdentityUpdated(IIdentity indexed _oldIdentity, IIdentity indexed _newIdentity)

A registration names another identity

ClaimTopicAdded(uint256 indexed _claimTopic), ClaimTopicRemoved (same argument)

A default required topic is added, removed

ClaimTopicAddedForIdentityType(uint256 indexed identityType, uint256 indexed claimTopic), ClaimTopicRemovedForIdentityType (same arguments)

The same, for one type of identity

TrustedIssuerAdded(address indexed _trustedIssuer, uint256[] _claimTopics), ClaimTopicsUpdated (same arguments)

A Claim Issuer is trusted for topics, its topics replaced

TrustedIssuerRemoved(address indexed _trustedIssuer)

It is no longer trusted

EligibilityChecksDisabled(), EligibilityChecksEnabled()

Checks switched off, on. The second also at deployment

IdentityStorageSet(address indexed _identityStorage), ClaimTopicsRegistrySet(address indexed _claimTopicsRegistry), TrustedIssuersRegistrySet(address indexed _trustedIssuersRegistry)

Deployment, and a change of storage for the first

Last updated