From e5bf908d1ceca2b5ba49f90e523b58c00a5d22fc Mon Sep 17 00:00:00 2001 From: emilio Date: Thu, 9 Jul 2020 16:50:56 +0200 Subject: [PATCH] polished stable rate debt token comments --- contracts/tokenization/StableDebtToken.sol | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/contracts/tokenization/StableDebtToken.sol b/contracts/tokenization/StableDebtToken.sol index 9a45933f..2cef37b7 100644 --- a/contracts/tokenization/StableDebtToken.sol +++ b/contracts/tokenization/StableDebtToken.sol @@ -67,20 +67,36 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { uint256 _balanceIncrease ); + /** + * @dev returns the average stable rate across all the stable rate debt + * @return the average stable rate + **/ function getAverageStableRate() external virtual override view returns (uint256) { return avgStableRate; } + /** + * @dev returns the timestamp of the last user action + * @return the last update timestamp + **/ function getUserLastUpdated(address _user) external virtual override view returns (uint40) { return usersData[_user].lastUpdateTimestamp; } - + /** + * @dev returns the stable rate of the user + * @param _user the address of the user + * @return the stable rate of _user + **/ function getUserStableRate(address _user) external virtual override view returns (uint256) { return usersData[_user].currentRate; } + /** + * @dev calculates the current user debt balance + * @return the accumulated debt of the user + **/ function balanceOf(address account) public virtual override view returns (uint256) { if(balances[account] == 0) { return 0;