VaultProxy
, which is moved between releases by upgrading its VaultLib
and permissioned accessor
via a global Dispatcher
contract.VaultProxy
contract instances, which are upgradable contracts following the EIP-1822 proxy pattern.VaultProxy
specifies a VaultLib
as its target logic, and these logic contracts are deployed per release, and swapped out during a migration.VaultLibBaseCore
contract defines the absolutely essential state and logic for every VaultProxy. This includes:SharesTokenBase
IProxiableVault
called by the Dispatcher
owner
, accessor
, creator
, and migrator
owner
is the fund's owner.migrator
is an optional role to allow a non-owner to migrate the fund.creator
is the Dispatcher
contract, which is allowed to update the accessor
and vaultLib
values.accessor
is the primary account that can make state-changing calls to the VaultProxy
. In practice, this is the release-level contract that interacts with a vault's assets, updates shares balances, etc.VaultProxy
needs no knowledge about a release other than which caller can write state - allows for nearly limitless possibilities for release-level architecture.Dispatcher
contract is charged with:VaultProxy
VaultProxy
from an old release to the current releasesymbol
value for fund shares tokensDispatcher
stores the currentFundDeployer
(a generic reference to the latest release's contract that is responsible for deploying and migrating funds), and only a msg.sender
with that value is allowed to call functions to deploy or migrate a VaultProxy
. FundDeployer
can optionally implement migration hooks provided by IMigrationHookHandler
, which give the release an opportunity to run arbitrary logic as the Dispatcher
invokes those hooks at every step of the migration process.VaultLibBaseCore
, this abstracted notion of a FundDeployer
- in which the Dispatcher
only cares about its identity for access and for optional callbacks - is totally unrestrictive to the shape of the release-level protocol.ProtocolFeeReserveProxy
serves as a repository that stores collected fees, with upgradable logic for what can be done with the collected assets.ExternalPositionProxy
instances, which are upgradable proxy contracts used to manage positions that live outside of the vault, e.g., CDPs.