From d3e785a34a652bf6ab9005721397a90a20aec1dd Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Thu, 7 Dec 2023 10:21:33 +0100 Subject: [PATCH 1/7] docs(shares-math): document borrow share price --- src/libraries/SharesMathLib.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index 514760698..224c5f179 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -18,6 +18,8 @@ library SharesMathLib { /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is /// empty. + /// @dev Warning: virtual borrow assets behave like bad debt, but it is assumed the borrow share price stays low + /// enough to not inflate the virtual borrow assets too much. uint256 internal constant VIRTUAL_ASSETS = 1; /// @dev Calculates the value of `assets` quoted in shares, rounding down. From 38070e3179acbaa36fb3a07b1c0e07be86ff7d52 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Thu, 7 Dec 2023 10:22:37 +0100 Subject: [PATCH 2/7] docs(shares-math): fix wording --- src/libraries/SharesMathLib.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index 224c5f179..cf6176e31 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -18,8 +18,8 @@ library SharesMathLib { /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is /// empty. - /// @dev Warning: virtual borrow assets behave like bad debt, but it is assumed the borrow share price stays low - /// enough to not inflate the virtual borrow assets too much. + /// @dev Warning: virtual borrow assets behave like unrealizable bad debt, but it is assumed the borrow share price + /// stays low enough to not inflate the virtual borrow assets too much. uint256 internal constant VIRTUAL_ASSETS = 1; /// @dev Calculates the value of `assets` quoted in shares, rounding down. From c5f6c94fee665135c47d49fe34034efecc19c458 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Thu, 7 Dec 2023 16:12:14 +0100 Subject: [PATCH 3/7] docs(shares-math): change wording --- src/libraries/SharesMathLib.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index cf6176e31..0a87fe774 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -14,12 +14,12 @@ library SharesMathLib { /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure /// high precision computations. + /// @dev Warning: the assets virtual borrow shares are entitled to behave like unrealizable bad debt, but it is + /// assumed the borrow share price stays low enough to not inflate these assets. uint256 internal constant VIRTUAL_SHARES = 1e6; /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is /// empty. - /// @dev Warning: virtual borrow assets behave like unrealizable bad debt, but it is assumed the borrow share price - /// stays low enough to not inflate the virtual borrow assets too much. uint256 internal constant VIRTUAL_ASSETS = 1; /// @dev Calculates the value of `assets` quoted in shares, rounding down. From 7ab8eb523565801f2de090ad1422d0c9b2c94f19 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Thu, 7 Dec 2023 17:33:08 +0100 Subject: [PATCH 4/7] docs(shares-math): capitalize natspec --- src/libraries/SharesMathLib.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index 0a87fe774..cbbe908ef 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -14,7 +14,7 @@ library SharesMathLib { /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure /// high precision computations. - /// @dev Warning: the assets virtual borrow shares are entitled to behave like unrealizable bad debt, but it is + /// @dev Warning: The assets virtual borrow shares are entitled to behave like unrealizable bad debt, but it is /// assumed the borrow share price stays low enough to not inflate these assets. uint256 internal constant VIRTUAL_SHARES = 1e6; From 867ca89089f0af975dcc7a2060f7bcb83198a4ca Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Fri, 8 Dec 2023 17:14:31 +0100 Subject: [PATCH 5/7] docs(shares-math): fix wording --- src/libraries/SharesMathLib.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index cbbe908ef..ff6bc94b4 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -14,8 +14,8 @@ library SharesMathLib { /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure /// high precision computations. - /// @dev Warning: The assets virtual borrow shares are entitled to behave like unrealizable bad debt, but it is - /// assumed the borrow share price stays low enough to not inflate these assets. + /// @dev Warning: The assets to which virtual borrow shares are entitled behave like unrealizable bad debt, but it + /// is assumed the borrow share price stays low enough to not inflate these assets. uint256 internal constant VIRTUAL_SHARES = 1e6; /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is From d10c4e5fb4508c81b67cfe1479d4cf9c92173cbf Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Mon, 11 Dec 2023 10:45:55 +0100 Subject: [PATCH 6/7] docs(shares-math): complete warning --- src/libraries/SharesMathLib.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index ff6bc94b4..34da853d8 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -15,7 +15,7 @@ library SharesMathLib { /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure /// high precision computations. /// @dev Warning: The assets to which virtual borrow shares are entitled behave like unrealizable bad debt, but it - /// is assumed the borrow share price stays low enough to not inflate these assets. + /// is assumed the borrow share price stays low enough not to inflate these assets to a significant value. uint256 internal constant VIRTUAL_SHARES = 1e6; /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is From dfe479e38668c1a05b0af55d90a7dfbb0ef0ab21 Mon Sep 17 00:00:00 2001 From: Rubilmax Date: Mon, 11 Dec 2023 11:32:31 +0100 Subject: [PATCH 7/7] docs(shares-math): generalize doc --- src/libraries/SharesMathLib.sol | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libraries/SharesMathLib.sol b/src/libraries/SharesMathLib.sol index 34da853d8..3ed7115b5 100644 --- a/src/libraries/SharesMathLib.sol +++ b/src/libraries/SharesMathLib.sol @@ -14,8 +14,9 @@ library SharesMathLib { /// @dev The number of virtual shares has been chosen low enough to prevent overflows, and high enough to ensure /// high precision computations. - /// @dev Warning: The assets to which virtual borrow shares are entitled behave like unrealizable bad debt, but it - /// is assumed the borrow share price stays low enough not to inflate these assets to a significant value. + /// @dev Virtual shares can never be redeemed for the assets they are entitled to, but it is assumed the share price + /// stays low enough not to inflate these assets to a significant value. + /// @dev Warning: The assets to which virtual borrow shares are entitled behave like unrealizable bad debt. uint256 internal constant VIRTUAL_SHARES = 1e6; /// @dev A number of virtual assets of 1 enforces a conversion rate between shares and assets when a market is