You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
sherlock-admin opened this issue
Mar 13, 2023
· 0 comments
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
DuplicateA valid issue that is a duplicate of an issue with `Has Duplicates` labelHighA valid High severity issueRewardA payout will be made for this issue
jonatascm
high
Incorrect calculation of the max liquidation
Summary
The function
_getMaxliquidation()
is calculating incorrectly maximum to repay when collateral and debt have different decimals.Vulnerability Detail
Calculating the maximum liquidation does not taking into account the collateral and debt decimals.
POC
In the case of collateral is a token with different decimals than 18, example 6 decimals and debit is TAU (decimals 18):
If Alice borrowed some tokens and now the price of collateral dropped, the calculation of amount to repay in
getMaxLiquidation()
:Impact
The users could be forced to repay all debt because of miss calculating of max liquidation
Code Snippet
https://github.com/sherlock-audit/2023-03-taurus-jonatascm/tree/main/taurus-contracts/contracts/Vault/BaseVault.sol#L240-L261
Tool used
Manual Review
Recommendation
It's recommended to cache and use the collateral decimals and debt decimals in the account:
Duplicate of #35
The text was updated successfully, but these errors were encountered: