From a82219688f848463fbc899e228ffe94196c20772 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Tue, 5 Dec 2023 15:16:39 +0100 Subject: [PATCH 1/3] docs(ifc): add edge case --- src/libraries/periphery/MorphoBalancesLib.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libraries/periphery/MorphoBalancesLib.sol b/src/libraries/periphery/MorphoBalancesLib.sol index 844c891dd..21874bd15 100644 --- a/src/libraries/periphery/MorphoBalancesLib.sol +++ b/src/libraries/periphery/MorphoBalancesLib.sol @@ -90,8 +90,8 @@ library MorphoBalancesLib { /// @notice Returns the expected supply assets balance of `user` on a market after having accrued interest. /// @dev Warning: Wrong for `feeRecipient` because their supply shares increase is not taken into account. - /// @dev Warning: Withdrawing a supply position using the expected assets balance can lead to a revert due to - /// conversion roundings between shares and assets. + /// @dev Warning: Withdrawing using the expected supply assets can lead to a revert due to conversion roundings from + /// assets to shares. function expectedSupplyAssets(IMorpho morpho, MarketParams memory marketParams, address user) internal view @@ -105,8 +105,10 @@ library MorphoBalancesLib { } /// @notice Returns the expected borrow assets balance of `user` on a market after having accrued interest. - /// @dev Warning: repaying a borrow position using the expected assets balance can lead to a revert due to - /// conversion roundings between shares and assets. + /// @dev Warning: The expected balance is rounded up, so it can be greater than the market's expected total supply + /// assets. + /// @dev Warning: Repaying using the expected supply assets can lead to a revert due to conversion roundings from + /// assets to shares. function expectedBorrowAssets(IMorpho morpho, MarketParams memory marketParams, address user) internal view From 4d18f5970892820119f3ddd28fa45da555457b16 Mon Sep 17 00:00:00 2001 From: Romain Milon Date: Tue, 5 Dec 2023 16:17:51 +0100 Subject: [PATCH 2/3] docs(ifc): fix supply -> borrow Co-authored-by: Quentin Garchery Signed-off-by: Romain Milon --- src/libraries/periphery/MorphoBalancesLib.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/periphery/MorphoBalancesLib.sol b/src/libraries/periphery/MorphoBalancesLib.sol index 21874bd15..47963af71 100644 --- a/src/libraries/periphery/MorphoBalancesLib.sol +++ b/src/libraries/periphery/MorphoBalancesLib.sol @@ -105,9 +105,9 @@ library MorphoBalancesLib { } /// @notice Returns the expected borrow assets balance of `user` on a market after having accrued interest. - /// @dev Warning: The expected balance is rounded up, so it can be greater than the market's expected total supply + /// @dev Warning: The expected balance is rounded up, so it can be greater than the market's expected total borrow /// assets. - /// @dev Warning: Repaying using the expected supply assets can lead to a revert due to conversion roundings from + /// @dev Warning: Repaying using the expected borrow assets can lead to a revert due to conversion roundings from /// assets to shares. function expectedBorrowAssets(IMorpho morpho, MarketParams memory marketParams, address user) internal From 9772375127c484121ed3459d20067fdd7dfe1536 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Tue, 5 Dec 2023 17:24:20 +0100 Subject: [PATCH 3/3] docs(ifc): remove comment --- src/libraries/periphery/MorphoBalancesLib.sol | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libraries/periphery/MorphoBalancesLib.sol b/src/libraries/periphery/MorphoBalancesLib.sol index 21874bd15..8b1c0f815 100644 --- a/src/libraries/periphery/MorphoBalancesLib.sol +++ b/src/libraries/periphery/MorphoBalancesLib.sol @@ -105,10 +105,8 @@ library MorphoBalancesLib { } /// @notice Returns the expected borrow assets balance of `user` on a market after having accrued interest. - /// @dev Warning: The expected balance is rounded up, so it can be greater than the market's expected total supply + /// @dev Warning: The expected balance is rounded up, so it may be greater than the market's expected total borrow /// assets. - /// @dev Warning: Repaying using the expected supply assets can lead to a revert due to conversion roundings from - /// assets to shares. function expectedBorrowAssets(IMorpho morpho, MarketParams memory marketParams, address user) internal view