TREXImplementationAuthority
TREXImplementationAuthority holds the beacons that every shared suite of a network points at, and the archive of the versions published for them. Moving the beacons to a new version upgrades every shared suite at once. The concept is in Upgradeability: beacons and versions and the operation in 27 Upgrade a suite.
At a glance
Source
contracts/proxy/beacon/TREXImplementationAuthority.sol
Interface
ITREXImplementationAuthority
Deployed as
One contract per network, not upgradeable. Its constructor publishes a first version and deploys the five beacons, whose addresses never change
Role
The platform role VERSION_MANAGER
Versions
A Version is a uint24 that packs a major, a minor and a patch number of 8 bits each (VersionLib.pack(major, minor, patch)), so versions compare as numbers.
publish(version, impls)
VERSION_MANAGER
EmptyImplementations when an implementation address is zero, VersionAlreadyPublished. Archives the version without moving the beacons. Emits VersionPublished
upgrade(version)
VERSION_MANAGER
UnknownVersion, VersionNotNewer unless the version is above the current one. Points the five beacons at the implementations of the version. Emits SuiteUpgraded
publishAndUpgrade(version, impls)
VERSION_MANAGER
The errors of both. Does both in one transaction
currentVersion()
Anyone, read
The version the beacons point at
implementations()
Anyone, read
The implementations of the current version
implementationsFor(version)
Anyone, read
The implementations of a published version. Reverts with UnknownVersion
beacons()
Anyone, read
The five beacons
A published version cannot be replaced, and the beacons only move forward: there is no downgrade function.
The two structs
SuiteImplementations and SuiteBeacons each hold five addresses, in this order.
SuiteImplementations
SuiteBeacons
Contract
tokenImplementation
tokenBeacon
Token
trexRegistryImplementation
trexRegistryBeacon
TREXRegistry
irsImplementation
irsBeacon
IdentityRegistryStorage
mcImplementation
mcBeacon
ModularCompliance
accessManagerImplementation
accessManagerBeacon
TREXAccessManager
What an upgrade reaches
Suite
Effect of upgrade
Deployed with deployTREXSuite
Its five proxies read the shared beacons: it runs the new implementations from that transaction on
Deployed with deployTREXSuiteIsolated
None. Its beacons are its own, owned by its access manager, and the Issuer moves them
Trust statement. The holder of
VERSION_MANAGERcan change the code of every shared suite of the network in one transaction. An Issuer that does not accept this deploys an isolated suite and governs its own beacons.
Events
VersionPublished(Version version, ITREXImplementationAuthority.SuiteImplementations implementations)
A version is archived
SuiteUpgraded(Version version, ITREXImplementationAuthority.SuiteImplementations implementations)
The shared beacons move to a version
BeaconsDeployed(ITREXImplementationAuthority.SuiteBeacons beacons)
Once, at construction
Last updated