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
IdentityRegistryStorage
One beacon proxy per asset, or one shared by several assets of an Issuer
IModule, AbstractModuleUpgradeable, the three shipped modules
One ModuleProxy per module, shared by every compliance bound to it
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
How to read a page
Each function table has three columns.
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:batchMintasks for the role ofmint. The mapping of functions to roles is in Access manager and roles.Ownership.
owner()of a suite contract returns its access manager, andtransferOwnership(newAuthority)points the contract at another manager. No contract of a suite has a single owner key.Errors. Custom errors are declared in
ErrorsLiband, for the part that belongs to the standard, inERC3643ErrorsLib. The errors of the ERC-20 base (ERC20InsufficientBalance,ERC20InsufficientAllowance) and of the pause (EnforcedPause,ExpectedPause) are OpenZeppelin's.Events. Events are declared in
EventsLiband 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
addressconcerns the reference chain. A function that takes a wallet asbytestakes an ERC-7930 interoperable address in canonical form, on any chain. AchainKeyis thebytes32thatMessageTypesLib.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