Skip to content

Commit

Permalink
fix: creditManagerTest fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmikko committed Apr 17, 2023
1 parent 84e42b8 commit 465267f
Show file tree
Hide file tree
Showing 2 changed files with 333 additions and 232 deletions.
5 changes: 4 additions & 1 deletion contracts/credit/CreditManagerV3.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ contract CreditManagerV3 is ICreditManagerV2, ACLNonReentrantTrait {
_safeCreditAccountSet(onBehalfOf, creditAccount); // F:[CM-7]

// Initializes the enabled token mask for Credit Account to 1 (only the underlying is enabled)
enabledTokensMap[creditAccount] = 1; // F:[CM-8]
// OUTDATED: enabledTokensMap is set in FullCollateralCheck
// enabledTokensMap[creditAccount] = 1; // F:[CM-8]

if (supportsQuotas) cumulativeQuotaInterest[creditAccount] = 1; // F: [CMQ-1]

Expand Down Expand Up @@ -731,6 +732,8 @@ contract CreditManagerV3 is ICreditManagerV2, ACLNonReentrantTrait {
(enabledTokenMask,, twvUSD, borrowAmountPlusInterestRateUSD,) =
_calcAllCollateral(_priceOracle, creditAccount, enabledTokenMask, minHealthFactor, collateralHints, true);

console.log("FC", twvUSD, borrowAmountPlusInterestRateUSD);

if (twvUSD < borrowAmountPlusInterestRateUSD) {
revert NotEnoughCollateralException();
}
Expand Down
Loading

0 comments on commit 465267f

Please sign in to comment.