From 7070c88ebb9793dd29be3d3d20f37b055dc1d458 Mon Sep 17 00:00:00 2001 From: eboado Date: Wed, 14 Dec 2022 17:01:11 +0100 Subject: [PATCH 1/3] Added clarification on getReserveNormalizedVariableDebt() in IPool --- contracts/interfaces/IPool.sol | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contracts/interfaces/IPool.sol b/contracts/interfaces/IPool.sol index d2e8d94bc..254d78b02 100644 --- a/contracts/interfaces/IPool.sol +++ b/contracts/interfaces/IPool.sol @@ -571,6 +571,13 @@ interface IPool { /** * @notice Returns the normalized variable debt per unit of asset + * IMPORTANT the utility of this function is primarily for the protocol itself, + * to get a "dynamic" variable index based on time, current stored index and + * virtual rate at the current moment (approx. a borrower would get if opening a position). + * This means that is always used in combination with variable debt supply/balances. + * If using this function externally, it is fundamental to understand that is possible + * to have an increasing normalized variable debt that is not equivalent on how the + * variable debt index would be updated in storage (e.g. if there is variable debt supply) * @param asset The address of the underlying asset of the reserve * @return The reserve normalized variable debt */ From 90d1dbc7b001c2c24b0d93666fb40f0f052b91fe Mon Sep 17 00:00:00 2001 From: eboado Date: Mon, 19 Dec 2022 10:24:55 +0100 Subject: [PATCH 2/3] Updated docs on getReserveNormalizedVariableDebt IPool --- contracts/interfaces/IPool.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/interfaces/IPool.sol b/contracts/interfaces/IPool.sol index 254d78b02..c0235b737 100644 --- a/contracts/interfaces/IPool.sol +++ b/contracts/interfaces/IPool.sol @@ -571,13 +571,13 @@ interface IPool { /** * @notice Returns the normalized variable debt per unit of asset - * IMPORTANT the utility of this function is primarily for the protocol itself, - * to get a "dynamic" variable index based on time, current stored index and - * virtual rate at the current moment (approx. a borrower would get if opening a position). - * This means that is always used in combination with variable debt supply/balances. - * If using this function externally, it is fundamental to understand that is possible - * to have an increasing normalized variable debt that is not equivalent on how the - * variable debt index would be updated in storage (e.g. if there is variable debt supply) + * @dev WARNING: This function is intended to be used primarily by the protocol itself to get a + * "dynamic" variable index based on time, current stored index and virtual rate at the current + * moment (approx. a borrower would get if opening a position). This means that is always used in + * combination with variable debt supply/balances. + * If using this function externally, Consider that is possible to have an increasing normalized + * variable debt that is not equivalent to how the variable debt index would be updated in storage + * (e.g. only updates with non-zero variable debt supply) * @param asset The address of the underlying asset of the reserve * @return The reserve normalized variable debt */ From f3e1f261c15bd0261a0c827e869eadf98200b0f3 Mon Sep 17 00:00:00 2001 From: Ernesto Boado Date: Mon, 19 Dec 2022 11:07:20 +0100 Subject: [PATCH 3/3] Updated comment on getReserveNormalizedVariableDebt IPool Co-authored-by: miguelmtz <36620902+miguelmtzinf@users.noreply.github.com> --- contracts/interfaces/IPool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/interfaces/IPool.sol b/contracts/interfaces/IPool.sol index c0235b737..4ac16374b 100644 --- a/contracts/interfaces/IPool.sol +++ b/contracts/interfaces/IPool.sol @@ -575,7 +575,7 @@ interface IPool { * "dynamic" variable index based on time, current stored index and virtual rate at the current * moment (approx. a borrower would get if opening a position). This means that is always used in * combination with variable debt supply/balances. - * If using this function externally, Consider that is possible to have an increasing normalized + * If using this function externally, consider that is possible to have an increasing normalized * variable debt that is not equivalent to how the variable debt index would be updated in storage * (e.g. only updates with non-zero variable debt supply) * @param asset The address of the underlying asset of the reserve