Skip to content

Commit

Permalink
fix: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
jr-alpaca committed Nov 2, 2022
1 parent 27bc755 commit 8aa0510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ contract FixedInterestRateModel is IInterestRateModel {
function getInterestRate(
uint256 debt,
uint256 /*floating*/
) external pure returns (uint256) {
if (debt == 0) {
return 0;
}
return 1e17;
) external pure returns (uint256 _interestRate) {
_interestRate = debt == 0 ? 0 : 1e17;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,25 +196,20 @@ library LibMoneyMarket01 {
function pendingIntest(
address _token,
LibMoneyMarket01.MoneyMarketDiamondStorage storage moneyMarketDs
) internal view returns (uint256) {
) internal view returns (uint256 _pendingInterest) {
uint256 _lastAccureTime = moneyMarketDs.debtLastAccureTime[_token];

if (block.timestamp > _lastAccureTime) {
uint256 _timePast = block.timestamp - _lastAccureTime;
// uint256 balance = ERC20(_token).balanceOf(address(this));
if (address(moneyMarketDs.interestModels[_token]) == address(0)) {
return 0;
}

uint256 _interestRate = IInterestRateModel(
moneyMarketDs.interestModels[_token]
).getInterestRate(moneyMarketDs.debtValues[_token], 0);

// TODO: change it when dynamically comes
return _interestRate * _timePast;
_pendingInterest = _interestRate * _timePast;
// return ratePerSec.mul(vaultDebtVal).mul(timePast).div(1e18);
} else {
return 0;
}
}

Expand Down

0 comments on commit 8aa0510

Please sign in to comment.