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

Token Suite

The token suite is the set of contracts that make one asset: its token, its eligibility registry, its compliance, and the factory, versions and access control around them. This section has one page per contract: every external function, who can call it, what it reverts with, and the events it emits. The Concepts explain why the contracts are built this way and the Guides show each operation end to end. These pages are the lookup tables behind them, written from the code of the develop branch of the T-REX repository. The contracts of the identity layer are in the Identity Suite section.

The contracts

Page
Contract
Deployed as

Token

One beacon proxy per asset, by the TREXFactory

TREXRegistry

One beacon proxy per asset

IdentityRegistryStorage

One beacon proxy per asset, or one shared by several assets of an Issuer

ModularCompliance, with its ledger

One beacon proxy per asset

The validation functions of ModularCompliance

Part of the compliance

IModule, AbstractModuleUpgradeable, the three shipped modules

One ModuleProxy per module, shared by every compliance bound to it

TREXFactory

Once per network

TREXImplementationAuthority

Once per network

TREXAccessManager, RolesLib, AccessManagerSetupLib

One manager per suite, or one shared by several suites of an Issuer

TREXMessaging, TrustedGatewayRegistry, MessageTypesLib

Part of each token. One gateway registry per network

UtilityChecker

Once per network, behind a proxy

ErrorsLib, ERC3643ErrorsLib

How to read a page

Each function table has three columns.

Column
Content

Function

The name and the arguments, in the order of the code. Names in backticks are the names of the code.

Access

Who can call it. A role name means the role of that name in the domain of the asset, checked by the suite's TREXAccessManager. "Anyone" means the function has no caller check.

Reverts with

The custom errors of the function, and the condition of each when the name does not say it.

Conventions shared by every contract

  • Access control. Every restricted function asks the suite's access manager whether the caller holds the role mapped to that function. A caller without the role is refused with OpenZeppelin's AccessManagedUnauthorized. A batch function is authorized by the role of its single-item counterpart: batchMint asks for the role of mint. The mapping of functions to roles is in Access manager and roles.

  • Ownership. owner() of a suite contract returns its access manager, and transferOwnership(newAuthority) points the contract at another manager. No contract of a suite has a single owner key.

  • Errors. Custom errors are declared in ErrorsLib and, for the part that belongs to the standard, in ERC3643ErrorsLib. The errors of the ERC-20 base (ERC20InsufficientBalance, ERC20InsufficientAllowance) and of the pause (EnforcedPause, ExpectedPause) are OpenZeppelin's.

  • Events. Events are declared in EventsLib and in the ERC-3643 interfaces. Full signatures, with the indexed arguments, are in Indexing: events and supply accounting.

  • Addresses and wallets. A function that takes an address concerns the reference chain. A function that takes a wallet as bytes takes an ERC-7930 interoperable address in canonical form, on any chain. A chainKey is the bytes32 that MessageTypesLib.chainKey(chainType, chainReference) returns for a chain.

  • Storage. Every upgradeable contract keeps its state in an ERC-7201 namespace: see Namespaced storage (ERC-7201).

  • Standard and extension. Each suite contract is a standard ERC-3643 base (contracts/ERC-3643/base/) extended by the T-REX contract. The tables list both parts together, as an integrator sees them.

Last updated