-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getTotalCredit() to UnionLens #185
base: master
Are you sure you want to change the base?
Add getTotalCredit() to UnionLens #185
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #185 +/- ##
==========================================
- Coverage 88.06% 87.38% -0.69%
==========================================
Files 21 21
Lines 1274 1284 +10
Branches 179 179
==========================================
Hits 1122 1122
- Misses 151 161 +10
Partials 1 1 ☔ View full report in Codecov by Sentry. |
function getTotalCredit(address underlying, address borrower) external view returns (uint256 total) { | ||
IUserManager userManager = IUserManager(marketRegistry.userManagers(underlying)); | ||
|
||
uint256 voucherCount = userManager.getVoucherCount(borrower); | ||
for (uint256 i = 0; i < voucherCount; i++) { | ||
(address staker, uint96 trust, , ) = userManager.vouchers(borrower, i); | ||
(, uint96 stakedAmount, , , , ) = userManager.stakers(staker); | ||
total += _min(stakedAmount, trust); | ||
} | ||
return decimalReducing(total, userManager.stakingTokenDecimal()); | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
function getTotalCredit(address underlying, address borrower) external view returns (uint256 total) { | ||
IUserManager userManager = IUserManager(marketRegistry.userManagers(underlying)); | ||
|
||
uint256 voucherCount = userManager.getVoucherCount(borrower); | ||
for (uint256 i = 0; i < voucherCount; i++) { | ||
(address staker, uint96 trust, , ) = userManager.vouchers(borrower, i); | ||
(, uint96 stakedAmount, , , , ) = userManager.stakers(staker); | ||
total += _min(stakedAmount, trust); | ||
} | ||
return decimalReducing(total, userManager.stakingTokenDecimal()); | ||
} |
Check warning
Code scanning / Slither
Unused return Medium
Add getTotalCredit() to UnionLens
🚨 Report Summary
For more details view the full report in OpenZeppelin Code Inspector |
No description provided.