Skip to main content

Version announcer

Contract sets are never upgraded in place; a new set is deployed beside the old one (see Contract set upgrade). VersionAnnouncer is a public notice board for that: the admin can record "set label lives at these five addresses", once per label, forever. It is advisory. No client follows it. A verifier takes addresses from its own configuration (the deployment manifest), so a wrong or hostile announcement cannot redirect anyone.

Not deployed

As of 2026-10-24 no deploy script deploys the VersionAnnouncer, the app does not read it, its ABI is not exported to src/contracts/v03/, and the timelock handover scripts do not move it. It exists in the code and in the tests only.

Contract​

contract VersionAnnouncer is AccessControlDefaultAdminRules {
uint256 public constant MAX_LABEL_BYTES = 32;

struct SetAddresses {
address issuerRegistry;
address credentialRegistry;
address statusRegistry;
address holderRegistry;
address recordTypeRegistry;
}
  • Constructor: (uint48 adminDelay, address admin), the same delayed two-step admin as the registries.
  • contractVersion() returns "0.4.0", the contract version that introduced it (revision set R1 to R5).

Storage in words​

ItemMeaning
announcementsCount of announcements made
_announced[keccak256(label)]Labels already used

Nothing else is stored. The addresses live only in the event.

Functions​

FunctionWho may callChecksEffectsReverts
announce(string label, string abiVersion, SetAddresses set)Default adminLabel 1 to 32 bytes and abiVersion not empty; label not announced before; all five addresses non-zero and the credential registry's own getters return the other fourMarks the label used, increments announcements, emits VersionAnnouncedInvalidLabel(), LabelAlreadyAnnounced(label), SetMismatch(), AccessControlUnauthorizedAccount
isAnnounced(string label) boolAnyone (view)
announcements() uint256Anyone (view)
event VersionAnnounced(
bytes32 indexed labelHash,
string label,
string abiVersion,
address credentialRegistry,
address issuerRegistry,
address statusRegistry,
address holderRegistry,
address recordTypeRegistry
);

The coherence check (_requireCoherent) catches a mistyped address: since the credential registry stores the other four as immutables, a set announced through it must match what it says about itself.

How an announcement is checked​

Entries cannot be changed or removed. A mistaken announcement can only be followed by a correct one under a new label.

Source files​

  • blockchain/contracts/v03/VersionAnnouncer.sol

Tests​

  • blockchain/test/v03/VersionAnnouncer.test.ts: the event and the counter, admin only, one announcement per label, label and ABI version rules, the coherence check against the credential registry, the delayed two-step admin, ERC-165 and the "0.4.0" label