Description
AlchemistCurator is the governance and configuration contract for MYT vaults. It allows admins and operators to register or remove strategy adapters for a given MYT and to adjust their absolute and relative caps. In short, it defines which strategies exist within the MYT and how much capital each can hold.
Note: AlchemistCurator inherits from PermissionedProxy, which provides it's access control system for operator roles, and the selector allowlist used to control which calls can be forwarded. The admin role is set using the same pending/accept admin system as the Alchemist and is inherited from PermissionedProxy. For details on the operator role and logic, see PermissionedProxy.
Variables
adapterToMYT
- Description - A mapping that associates each MYT strategy adapter address with the specific MYT vault address it is a part of. This is how the curator knows which vault to target when adding, removing, or adjusting caps for a given strategy.
- Type -
mapping(address => address) - Used By
- Updated By
setStrategy(address adapter, address myt, bool remove)- cannot use the zero address for the adapter or myt
- Read By
adapterToMYT(address)
pendingAdmin
- Description - The first step in a two-step process of setting a new administrator. The pendingAdmin is set by the current admin, then the pendingAdmin must accept the responsibility to lock in the change of admin.
- Type - address
- Updated By
transferAdminOwnerShip(address _newAdmin)(inherited from PermissionedProxy)
- Read By
pendingAdmin()
- Notified By - none
Functions
Admin Actions
transferAdminOwnerShip(address _newAdmin)
- Description - Sets the pending admin. First part of a two-step process to change the admin. The second step is the pendingAdmin accepting the role by calling
acceptAdminOwnership(). Inherited from PermissionedProxy.@param _newAdmin- The address proposed to become the new admin.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"PD"ifmsg.senderis not the current admin.
- With
- Emits - none
acceptAdminOwnership()
- Description - Finalizes an admin ownership transfer by assigning
pendingAdminas the new active admin. Afterwards thependingAdminis reset to the zero address. Inherited from PermissionedProxy. - Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"PD"ifmsg.senderis not the currentpendingAdmin.
- With
- Emits
submitSetAllocator(address myt, address allocator, bool v)
- Description - Queues a change to a vault's allocator permissions via the vault's timelock mechanism. Encodes
IVaultV2.setIsAllocator(allocator, v)and submits it directly to the specified MYT vault.
Unlike other submit functions in this contract, there is no corresponding execution function here. Once the vault's timelock elapses, anyone can callsetIsAllocatordirectly on the MYT vault to finalize the change.@param myt- The MYT vault address to submit the allocator change to.@param allocator- The address to set or unset as a vault allocator.@param v-trueto enable as an allocator,falseto disable.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts - none
- Emits
decreaseAbsoluteCap(address adapter, uint256 amount)
- Description - Delegates to the internal
_decreaseAbsoluteCap(adapter, id, amount)to immediately lowers the absolute cap for a given strategy on its MYT vault. The absolute cap is the maximum quanitity of underlying assets that may be allocated to the strategy.@param adapter- The strategy adapter address.@param amount- The amount denominated in underlying assets to decrease the absolute cap by.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotDecreasing()- if the new cap is higher than the previous. Propgated from the MorphoV2 vault call.
- Emits
decreaseRelativeCap(address adapter, uint256 amount)
- Description - Immediately decreases the relative cap for a given strategy on its MYT vault. The relative cap represents the strategy’s maximum allowed proportion of the vault’s total assets.
Gets the ID from the adapter address, and calls the internal
_decreaseRelativeCap(adapter, id, amount)to immediately decrease the cap.@param adapter- The strategy adapter address.@param amount- The new percentage, expressed as an 18 decimal scaled number, (1e18 = 100%) to set as the relative cap. Must be lower than the previous relative cap.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
RelativeCapNotDecreasing()- if the new cap is higher than the previous. Propgated from the MorphoV2 vault call.
- Emits
increaseAbsoluteCap(address adapter, uint256 amount)
- Description - Executes a previously submitted and timelocked absolute cap increase for a given strategy on its MYT vault. Must be called after
submitIncreaseAbsoluteCap()has been called and the vault's timelock period has elapsed.
The absolute cap is the maximum quantity of underlying assets that may be allocated to the strategy.@param adapter- The strategy adapter address.@param amount- The amount denominated in underlying asset units to increase the absolute cap by.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.- Reverts if the corresponding
submitIncreaseAbsoluteCaphas not been called, or if the vault's timelock has not yet elapsed.
- Emits
increaseRelativeCap(address adapter, uint256 amount)
-
Description - Executes a previously submitted and timelocked relative cap increase for a given strategy on its MYT vault. Must be called after
submitIncreaseRelativeCap()has been called and the vault’s timelock period has elapsed.The relative cap defines the maximum percentage of the vault’s total assets that the strategy can hold. Gets the ID from the adapter address and calls the internal
_increaseRelativeCap(adapter, id, amount)to execute the cap change.@param adapter- The strategy adapter address.@param amount- The new percentage, expressed as an 18-decimal scaled number (1e18 = 100%), to set as the relative cap. Must be higher than the previous relative cap.
-
Visibility Specifier - external
-
State Mutability Specifier - nonpayable
-
Reverts
RelativeCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.- Reverts if the corresponding
submitIncreaseRelativeCaphas not been called, or if the vault's timelock has not yet elapsed.
-
Emits
submitIncreaseAbsoluteCap(address adapter, uint256 amount)
- Description - Queues up an increase of a strategy’s absolute cap on the MYT vault via the vault’s timelock, to be executed at a later date.
Calls the internal
_submitIncreaseAbsoluteCap(adapter, id, amount)to queue the change.@param adapter- The strategy adapter address.@param amount- The amount denominated in underlying asset units to increase the absolute cap by.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.
- Emits
submitIncreaseRelativeCap(address adapter, uint256 amount)
- Description - Queues an increase of the strategy’s relative cap on the MYT vault through the vault’s timelock mechanism, to be executed at a later time. After the vault’s timelock period elapses, the corresponding non-submit version of this function must be called to execute the change.
Calls the internal
_submitIncreaseRelativeCap(adapter, id, amount)to enqueue the update.@param adapter- The strategy adapter address.@param amount- The new percentage to set the relative cap to, expressed as a uint256 scaled by 1e18 (1e18 = 100%). Must be higher than the previous relative cap.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
RelativeCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.
- Emits
Operator Actions
Functions guarded by the onlyOperator modifier.
setStrategy(address adapter, address myt)
- Description - First runs address validity checks, then offloads to the internal
_addStrategy(adapter, myt)to execute the registration. Must be called aftersubmitSetStrategy()has been called and the vault's timelock period has elapsed.@param adapter- The address of the MYT strategy adapter to register.@param myt- The address of the MYT vault that the adapter belongs to.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"INVALID_ADDRESS"if eitheradapterormytis the zero address. - Reverts if the corresponding
submitSetStrategyhas not been called, or if the vault's timelock has not yet elapsed.
- With
- Emits
StrategyAdded(address adapter, address myt)- emitted in the internal_addStrategy()call.
removeStrategy(address adapter, address myt)
- Description - First runs address validity checks, then offloads to the internal
_removeStrategy(adapter, myt)to execute the deregistration. Must be called aftersubmitRemoveStrategy()has been called and the vault's timelock period has elapsed.@param adapter- The address of the MYT strategy adapter to remove.@param myt- The address of the MYT vault that the adapter is currently linked to.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"INVALID_ADDRESS"if eitheradapterormytis the zero address. - Reverts if the corresponding
submitRemoveStrategyhas not been called, or if the vault's timelock has not yet elapsed.
- With
- Emits
StrategyRemoved(address adapter, address myt)- emitted in the internal_removeStrategy()call.
submitSetStrategy(address adapter, address myt)
- Description - Queues the addition of a MYT strategy adapter to a specific MYT vault via the vault’s timelock mechanism to be executed at a later time.
Validates that passed
adapterandmytare valid addresses, delegates to the internal_submitSetStrategy(adapter, myt), which encodesIVaultV2.addAdapter(adapter)and callsvault.submit(data), which enqueues the strategy to be added after the timelock period.@param adapter- The address of the strategy adapter to be registered.@param myt- The MYT vault address to add the adapter to.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"INVALID_ADDRESS"ifadapter == address(0)ormyt == address(0).
- With
- Emits
SubmitSetStrategy(address adapter, address myt)- from the internal _submitSetStrategy call
submitRemoveStrategy(address adapter, address myt)
- Description - Queues the removal of a MYT strategy adapter from a specific MYT vault via the vault's timelock mechanism, to be executed at a later time.
Validates thatadapterandmytare valid addresses, then delegates to the internal_submitRemoveStrategy(adapter, myt), which encodesIVaultV2.removeAdapter(adapter)and callsvault.submit(data).@param adapter- The address of the strategy adapter to be removed.@param myt- The MYT vault address to remove the adapter from.
- Visibility Specifier - external
- State Mutability Specifier - nonpayable
- Reverts
- With
"INVALID_ADDRESS"ifadapter == address(0)ormyt == address(0).
- With
- Emits
SubmitRemoveStrategy(address adapter, address myt)- from the internal_submitRemoveStrategycall
Internal Operations
_addStrategy(address adapter, address myt)
- Description - Internal helper that registers a MYT strategy adapter with the specified MYT vault. Updates the
adapterToMYTmapping to associate the adapter with the provided vault, then callsvault.addAdapter(adapter)to register it.@param adapter- The address of the MYT strategy adapter being added.@param myt- The address of the MYT vault that the adapter is being registered to.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts - none
- Emits
_removeStrategy(address adapter, address myt)
- Description - Internal helper that deregisters a MYT strategy adapter from the specified MYT vault. Calls
vault.removeAdapter(adapter)to deregister the adapter, then deletes the adapter's entry from theadapterToMYTmapping.@param adapter- The address of the MYT strategy adapter being removed.@param myt- The address of the MYT vault that the adapter is being removed from.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts - none
- Emits
_submitSetStrategy(address adapter, address myt)
- Description - Internal helper that calls the MorphoV2 Vault submit() function, which enqueues the adding of an adapter to the target MYT vault to the vault's timelock queue to be executed at a later time.
@param adapter- The address of the strategy adapter to be added.@param myt- The address of the MYT vault to add the strategy to.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts - none
- Emits
_submitRemoveStrategy(address adapter, address myt)
- Description - Internal helper that encodes
IVaultV2.removeAdapter(adapter)and submits it to the MYT vault's timelock queue for later execution.@param adapter- The address of the strategy adapter to be removed.@param myt- The address of the MYT vault to remove the strategy from.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts - none
- Emits
_decreaseAbsoluteCap(address adapter, bytes id, uint256 amount)
- Description - Internal helper that immediately calls decreases a strategy’s absolute cap on the vault.
@param adapter- The strategy adapter address.@param id- The encoded MYT strategy ID.@param amount- The amount denominated in underlying units to decrease the absolute cap by.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotDecreasing()- if the new cap is higher than the previous. Propgated from the MorphoV2 vault call.
- Emits
_decreaseRelativeCap(address adapter, bytes id, uint256 amount)
- Description - Internal helper that calls the
vault.decreaseRelativeCap(id, amount)to immediately decrease a strategy’s relative cap. The relative cap is the maximum percentage of total assets the strategy can make up.@param adapter- The strategy adapter address@param id- The encoded MYT strategy ID@param amount- The new percentage of maximum assets that the strategy can make up. Scaled by 1e18. (1e18 = 100%)
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
RelativeCapNotDecreasing()- if the new cap is higher than the previous. Propgated from the MorphoV2 vault call.
- Emits
_increaseAbsoluteCap(address adapter, bytes id, uint256 amount)
- Description - Internal helper that immediately calls
vault.increaseAbsoluteCap(id, amount)to raise a strategy’s absolute cap. The absolute cap is the maximum quantity of underlying assets that may be allocated to the strategy.@param adapter- The strategy adapter address.@param id- The encoded MYT strategy ID.@param amount- The amount denominated in underlying asset units to increase the absolute cap by.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.
- Emits
_increaseRelativeCap(address adapter, bytes id, uint256 amount)
- Description - Internal helper that immediately calls
vault.increaseRelativeCap(id, amount)to raise a strategy’s relative cap. The relative cap defines the maximum percentage of the vault’s total assets that the strategy can hold.@param adapter- The strategy adapter address.@param id- The encoded MYT strategy ID.@param amount- The new percentage, expressed as an 18-decimal scaled number (1e18 = 100%), to set as the relative cap. Must be higher than the previous relative cap.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
RelativeCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.
- Emits
_submitIncreaseAbsoluteCap(address adapter, bytes id, uint256 amount)
- Description - Internal helper that enqueues a cap increase on the MYT vault by encoding
IVaultV2.increaseAbsoluteCap(id, amount)and delegating to the internal_vaultSubmit(data). After the vault's timelock period elapses, the corresponding non-submit version of this function must be called to execute the change.@param adapter- The strategy adapter address.@param id- The encoded MYT strategy ID.@param amount- The amount denominated in underlying asset units to increase the absolute cap by.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
AbsoluteCapNotIncreasing()- if the new cap is lower than the previous. Propagated from the MorphoV2 vault call.
- Emits
_vaultSubmit(address adapter, bytes data)
- Description - Internal helper that resolves the MYT vault associated with the provided adapter and calls its
submit(bytes)function to queue a governance action via the vault’s timelock.@param adapter- The strategy adapter address, used to look up its corresponding MYT vault.@param data- The ABI-encoded function to be submitted to the vault.
- Visibility Specifier - internal
- State Mutability Specifier - nonpayable
- Reverts
- With
"INVALID_ADDRESS"if the adapter has no registered MYT vault in theadapterToMYTmapping.
- With
- Emits - none
_vault(address adapter)
- Description - Internal helper that retrieves the MYT vault contract associated with a given strategy adapter from the
adapterToMYTmapping.@param adapter- The strategy adapter address.
- Visibility Specifier - internal
- State Mutability Specifier - view
- Reverts
"INVALID_ADDRESS"- if there is no MYT vault registered for the specified adapter inadapterToMYT.
- Emits - none
Events
-
IncreaseAbsoluteCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when the absolute cap for a strategy has been increased. The absolute cap represents the maximum quantity of underlying assets that may be allocated to the strategy. -
SubmitIncreaseAbsoluteCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when an increase to the strategy’s absolute cap has been queued via the vault’s timelock, to be executed later. -
IncreaseRelativeCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when the relative cap for a strategy has been increased. The relative cap defines the maximum percentage of the vault’s total assets that the strategy can hold, scaled by 1e18 (1e18 = 100%). -
SubmitIncreaseRelativeCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when an increase to the strategy’s relative cap has been queued via the vault’s timelock, to be executed later. -
AdminUpdated(address indexed admin)- emitted when the contract's admin address is updated. Inherited from PermissionedProxy. -
DecreaseRelativeCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when the relative cap for a strategy has been decreased. The relative cap defines the maximum percentage of the vault’s total assets that the strategy can hold, scaled by 1e18 (1e18 = 100%). -
SubmitDecreaseRelativeCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when a decrease to the strategy’s relative cap has been queued via the vault’s timelock, to be executed later. -
SubmitSetStrategy(address indexed strategy, address indexed myt)- emitted when a strategy adapter has been queued for addition to a MYT vault via the vault’s timelock mechanism. -
DecreaseAbsoluteCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when the absolute cap for a strategy has been decreased. The absolute cap represents the maximum quantity of underlying assets that may be allocated to the strategy. -
SubmitDecreaseAbsoluteCap(address indexed strategy, uint256 amount, bytes indexed id)- emitted when a decrease to the strategy’s absolute cap has been queued via the vault’s timelock, to be executed later. -
StrategyAdded(address indexed strategy, address indexed myt)- emitted when a strategy adapter has been registered to the specified MYT vault. -
StrategyRemoved(address indexed strategy, address indexed myt)- emitted when a strategy adapter has been deregistered from the specified MYT vault. -
SubmitRemoveStrategy(address indexed strategy, address indexed myt)- emitted when a strategy adapter removal has been queued via the vault's timelock mechanism. -
SubmitSetAllocator(address indexed allocator, bool indexed v)- emitted when a vault allocator permission change has been queued via the vault's timelock mechanism.