This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
T1MOH - BuyUSSDSellCollateral()
always sells 0 amount if need to sell part of collateral
#656
Labels
Escalation Resolved
This issue's escalations have been approved/rejected
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
Comments
github-actions
bot
added
High
A valid High severity issue
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
labels
Jun 5, 2023
sherlock-admin
added
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
and removed
High
A valid High severity issue
labels
Jun 23, 2023
You've created a valid escalation for 10 USDC! To remove the escalation from consideration: Delete your comment. You may delete or edit your escalation comment anytime before the 48-hour escalation window closes. After that, the escalation becomes final. |
sherlock-admin
added
Non-Reward
This issue will not receive a payout
Reward
A payout will be made for this issue
and removed
Reward
A payout will be made for this issue
Non-Reward
This issue will not receive a payout
labels
Jul 14, 2023
hrishibhat
added
Non-Reward
This issue will not receive a payout
and removed
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Reward
A payout will be made for this issue
labels
Jul 14, 2023
sherlock-admin
added
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
Reward
A payout will be made for this issue
and removed
Non-Reward
This issue will not receive a payout
Duplicate
A valid issue that is a duplicate of an issue with `Has Duplicates` label
labels
Jul 14, 2023
Result: |
Escalations have been resolved successfully! Escalation status:
|
sherlock-admin
added
Escalation Resolved
This issue's escalations have been approved/rejected
and removed
Escalated
This issue contains a pending escalation
labels
Jul 14, 2023
sherlock-admin2
added
the
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
label
Jul 17, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Escalation Resolved
This issue's escalations have been approved/rejected
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
Medium
A valid Medium severity issue
Reward
A payout will be made for this issue
T1MOH
high
BuyUSSDSellCollateral()
always sells 0 amount if need to sell part of collateralSummary
Due to rounding error there is misbehaviour in
BuyUSSDSellCollateral()
function. It results in selling 0 amount of collateral.Vulnerability Detail
Suppose the only collateral in protocol is 1 WBTC; 1 WBTC costs 30_000 USD;
UniV3Pool DAI/ USSD has following liquidity: (3000e6 USSD, 2000e18 DAI)
And also USSD is underpriced so call rebalance:
Take a look into BuyUSSDSellCollateral (follow comments):
So protocol will not buy DAI and will not sell DAI for USSD in UniswapV3Pool to support peg of USSD to DAI
Impact
Protocol is not able of partial selling of collateral for token. It block algorithmic pegging of USSD to DAI
Code Snippet
https://github.com/sherlock-audit/2023-05-USSD/blob/main/ussd-contracts/contracts/USSDRebalancer.sol#L121
Tool used
Manual Review, VS Code
Recommendation
Refactor formula of amountToSellUnits
The text was updated successfully, but these errors were encountered: