From a9ab363ed3e151e29192944ebbcb1b304f129d90 Mon Sep 17 00:00:00 2001 From: MathisGD Date: Fri, 10 Jan 2025 16:14:06 +0100 Subject: [PATCH 1/2] docs: improve wording of assumptions for liveness --- src/interfaces/IMorpho.sol | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/interfaces/IMorpho.sol b/src/interfaces/IMorpho.sol index 4684e778..d1e8f980 100644 --- a/src/interfaces/IMorpho.sol +++ b/src/interfaces/IMorpho.sol @@ -112,18 +112,17 @@ interface IMorphoBase { /// on `transfer` and `transferFrom`. In particular, tokens with fees on transfer are not supported. /// - The IRM should not re-enter Morpho. /// - The oracle should return a price with the correct scaling. - /// @dev Here is a list of properties on the market's dependencies that could break Morpho's liveness properties + /// @dev Here is a list of assumptions on the market's dependencies that could break Morpho's liveness properties /// (funds could get stuck): - /// - The token can revert on `transfer` and `transferFrom` for a reason other than an approval or balance issue. - /// - A very high amount of assets (~1e35) supplied or borrowed can make the computation of `toSharesUp` and - /// `toSharesDown` overflow. - /// - The IRM can revert on `borrowRate`. - /// - A very high borrow rate returned by the IRM can make the computation of `interest` in `_accrueInterest` - /// overflow. - /// - The oracle can revert on `price`. Note that this can be used to prevent `borrow`, `withdrawCollateral` and - /// `liquidate` from being used under certain market conditions. - /// - A very high price returned by the oracle can make the computation of `maxBorrow` in `_isHealthy` overflow, or - /// the computation of `assetsRepaid` in `liquidate` overflow. + /// - The token should not revert on `transfer` and `transferFrom` if balances and approvals are right. + /// - The amount of assets supplied and borrowed should not go above ~1e35 (otherwise the computation of + /// `toSharesUp` and `toSharesDown` can overflow). + /// - The IRM should not revert on `borrowRate`. + /// - The IRM should not return a very high borrow rate (otherwise the computation of `interest` in + /// `_accrueInterest` can overflow). + /// - The oracle should not revert `price`. + /// - The oracle should not return a very high price (otherwise the computation of `maxBorrow` in `_isHealthy` or of + /// `assetsRepaid` in `liquidate` can overflow). /// @dev The borrow share price of a market with less than 1e4 assets borrowed can be decreased by manipulations, to /// the point where `totalBorrowShares` is very large and borrowing overflows. function createMarket(MarketParams memory marketParams) external; From 81d922c9d98e6181beab738a89182c50cf890d7a Mon Sep 17 00:00:00 2001 From: MathisGD Date: Fri, 10 Jan 2025 16:27:16 +0100 Subject: [PATCH 2/2] docs: wording --- src/interfaces/IMorpho.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/interfaces/IMorpho.sol b/src/interfaces/IMorpho.sol index d1e8f980..2855a468 100644 --- a/src/interfaces/IMorpho.sol +++ b/src/interfaces/IMorpho.sol @@ -112,8 +112,8 @@ interface IMorphoBase { /// on `transfer` and `transferFrom`. In particular, tokens with fees on transfer are not supported. /// - The IRM should not re-enter Morpho. /// - The oracle should return a price with the correct scaling. - /// @dev Here is a list of assumptions on the market's dependencies that could break Morpho's liveness properties - /// (funds could get stuck): + /// @dev Here is a list of assumptions on the market's dependencies which, if broken, could break Morpho's liveness + /// properties (funds could get stuck): /// - The token should not revert on `transfer` and `transferFrom` if balances and approvals are right. /// - The amount of assets supplied and borrowed should not go above ~1e35 (otherwise the computation of /// `toSharesUp` and `toSharesDown` can overflow).