This repository has been archived by the owner on Jul 14, 2024. It is now read-only.
evmboi32 - Dollar token won't be pegged to 1 USD. #141
Labels
Non-Reward
This issue will not receive a payout
evmboi32
high
Dollar token won't be pegged to 1 USD.
Summary
Incorrect target set for the Dollar token. Won't be pegged to
$1
.Vulnerability Detail
The price of the Dollar token is pegged to the value of 1
3CRV
token from theDAI/USDC/USDT
pool. But currently, the 3CRV token is trading just below$1.03
.When minting or burning dollar tokens the contract uses the
getDollarPriceUsd()
functionThe function reads the price from the TWAP which returns the price of dollar tokens in
DOLLAR TOKENS/3CRV TOKENS
in the pool. So the goal is to peg the Dollar token to the3CRV
token which trades higher than$1
.Marked as high as the goal of the protocol is to peg to 1 USD.
Impact
Dollar token won't be pegged to
$1
but to$1.03
as the 3CRV token is worth~$1.03
Code Snippet
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L418-L421
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L346-L349
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibUbiquityPool.sol#L306
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibTWAPOracle.sol#L161
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibTWAPOracle.sol#L111-L122
https://github.com/sherlock-audit/2023-12-ubiquity/blob/main/ubiquity-dollar/packages/contracts/src/dollar/libraries/LibTWAPOracle.sol#L84-L97
Tool used
Manual Review
Recommendation
Adjust the targets according to the 3CRV price. The price can be obtained by calling
get_virtual_price
on the3CRV
pool located at the address0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7
onmainnet
.Duplicate of #59
The text was updated successfully, but these errors were encountered: