Overview
The FolioDeployer contract is a factory that deploys new Folio instances. It supports two deployment patterns:- Raw Folio: Deploy with predefined roles for manual governance
- Governed Folio: Deploy with full on-chain governance including timelock and voting
Key Features
- Deterministic deployments using CREATE2
- Integrated governance setup (optional)
- Automatic role configuration
- Asset transfer and initialization
Contract Details
FolioDeployer.sol
Deployment Functions
Deploy Raw Folio
Deploy a Folio with predefined role assignments.FolioBasicDetails
Basic configuration including name, symbol, initial assets and shares
FolioAdditionalDetails
Additional settings including fees, auction length, and mandate
FolioFlags
Feature flags for trusted filler, rebalance control, and bids
address
Address to receive DEFAULT_ADMIN_ROLE
address[]
Addresses to receive REBALANCE_MANAGER role
address[]
Addresses to receive AUCTION_LAUNCHER role
address[]
Addresses to receive BRAND_MANAGER role
bytes32
Unique nonce for deterministic deployment
FolioDeployer.sol
The function automatically transfers the initial assets from msg.sender to the new Folio contract.
Deploy Governed Folio
Deploy a Folio with integrated on-chain governance.IVotes
Staking vault for governance voting power (use address(0) for self-governance)
FolioBasicDetails
Basic Folio configuration
FolioAdditionalDetails
Additional Folio settings
FolioFlags
Feature flags
GovParams
Governance parameters for owner governor (reused for stToken if self-governed)
GovParams
Governance parameters for trading governor
GovRoles
Role assignments including existing basket managers
bytes32
Unique deployment nonce
FolioDeployer.sol
Deployment Process
Raw Folio Deployment
- CREATE2 Deployment: Deploys FolioProxyAdmin and FolioProxy deterministically
- Asset Transfer: Transfers initial assets from caller to Folio
- Initialization: Calls Folio.initialize() with provided parameters
- Role Setup: Grants roles to specified addresses
- Renounce: Deployer renounces admin role (unless deployer is owner)
Example Deployment
Governed Folio Deployment
- Folio Deployment: Uses deployFolio() internally with temporary owner
- Governance Deployment: Creates governor and timelock for ownership
- Optional Trading Governance: Creates separate governor for rebalancing (if no existing basket managers)
- Role Transfer: Swaps ownership to timelock
- ProxyAdmin Transfer: Transfers upgrade control to timelock
Events
event
Emitted when a raw Folio is deployedParameters:
owner- Admin addressfolio- Deployed Folio addressproxyAdmin- ProxyAdmin address
event
Emitted when a governed Folio is deployedParameters:
stToken- Staking token addressfolio- Deployed Folio addressownerGovernor- Owner governor addressownerTimelock- Owner timelock addresstradingGovernor- Trading governor addresstradingTimelock- Trading timelock address
Data Structures
GovRoles
FolioDeployer.sol
address[]
Existing basket managers (pass empty array to deploy trading governor)
address[]
Addresses for AUCTION_LAUNCHER role
address[]
Addresses for BRAND_MANAGER role
Constructor
FolioDeployer.sol
- Sets immutable registry addresses
- Deploys the Folio implementation contract
- Stores the governance deployer reference
Deterministic Addresses
Deployments use CREATE2 for deterministic addresses:Deployment Salt Calculation