Component: MorphoService
Description
The MorphoService is a service adapter contract that enables ManagementAccounts to interact with the Morpho lending protocol. It constructs Morpho-specific call payloads that ManagementAccounts can execute.
Invariants
Market registration integrity
Only the service owner can register markets.
Once registered, market parameters stored in
marketParamsByIdcannot be modified.
Asset verification
When building action calldata for a collateral asset, the function verifies that the market for that collateral asset is already registered.
When building action calldata for a loan asset, the function verifies that the market for that loan asset is already registered.
Authorization integrity
Only the
MORPHO_AUTHORIZATIONtype is supported for authorization operations.Morpho authorization for the operator is binary (granted or revoked) and does not support granular amounts.
Attack surface
The
assetinput validation. Theassetparameter in build functions is validated by verifying it maps to a registered market. Unregistered assets cause transactions to revert, preventing interaction with unsupported tokens.