Documentation Index
Fetch the complete documentation index at: https://mintlify.com/reserve-protocol/reserve-index-dtf/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The FolioVersionRegistry contract maintains a registry of Folio implementation versions. It tracks which deployer contracts are available for creating new Folios and allows the protocol to deprecate insecure or outdated versions.Key Features
- Version Tracking: Maps version strings to FolioDeployer contracts
- Latest Version: Maintains pointer to most recent deployment
- Deprecation: Can mark versions as deprecated for security
- Version Queries: Retrieve deployer and implementation for any version
Registration Functions
Register Version
Register a new Folio version with its deployer.Address of the FolioDeployer contract for this version
FolioVersionRegistry.sol
The version string is automatically read from the deployer contract using
Versioned(address(folioDeployer)).version(). Each version can only be registered once.Deprecate Version
Mark a version as deprecated, preventing its use in UI and warning users.Keccak256 hash of the version string to deprecate
FolioVersionRegistry.sol
Query Functions
Get Latest Version
Retrieve the most recently registered version.FolioVersionRegistry.sol
versionHash: Keccak256 hash of version stringversion: Human-readable version string (e.g., “3.4.1”)folioDeployer: Deployer contract addressdeprecated: Whether this version is deprecated
The latest version may be deprecated if it was the most recent registration before being flagged. Always check the
deprecated flag.Get Implementation for Version
Retrieve the Folio implementation address for a specific version.Version hash to look up
FolioVersionRegistry.sol
Get Deployer
Direct mapping access to get deployer for a version hash.FolioVersionRegistry.sol
Check Deprecation Status
Check if a version is deprecated.FolioVersionRegistry.sol
Events
Emitted when a new version is registeredParameters:
versionHash- Keccak256 hash of version stringfolioDeployer- Deployer contract address
Emitted when a version is deprecatedParameters:
versionHash- Hash of deprecated version
Errors
Thrown when trying to register a zero address
Thrown when caller lacks required permissions
Thrown when trying to register an already-registered version
Thrown when trying to deprecate an already-deprecated version
Thrown when querying an unregistered version
Access Control
Immutable reference to the RoleRegistry for permission checks
registerVersion(): Requires owner roledeprecateVersion(): Requires owner or emergency council role
Version Hash Calculation
Version hashes are calculated as:Usage Example
Integration with Versioned Contract
All FolioDeployer contracts must inherit from the
Versioned base contract, which implements a version() function returning a semantic version string.Frontend Integration
Frontends should always check both if a version exists and whether it’s deprecated before allowing users to deploy with it. Use
getLatestVersion() to show the recommended version.