Skip to content

Commit

Permalink
v6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocodrilette committed Dec 3, 2023
1 parent 81c12f6 commit 9cb20c4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions blockchain/contracts/LendingManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,7 @@ contract LendingManager is KYCAdmin, RewardAdmin {
_validateQuotas(quotas);
if (approvedLimit[user] < amount) revert LendingManager_LimitExceeded();

uint256 lendId = lendsPerUser[user].length == 0
? 0
: lendsPerUser[user].length - 1;

uint256 lendId = lendsPerUser[user].length;
uint256 netAmount = amount + _calcCompoundInterest(amount, quotas);
Lend memory newLend = Lend({
id: lendId,
Expand Down Expand Up @@ -319,8 +316,9 @@ contract LendingManager is KYCAdmin, RewardAdmin {
uint256 quotas
) internal view returns (uint256) {
return
amount.mulDivDown(
((SCALE /** 1 */ + INTERESTS_RATE) / SCALE) ** quotas,
FixedPointMathLib.mulDivDown(
amount,
((SCALE /** 1 */ + INTERESTS_RATE)) ** quotas,
SCALE
);
}
Expand Down

0 comments on commit 9cb20c4

Please sign in to comment.