USDMPegRecovery
Will Most Certainly Lead To Failed Withdrawals When All Supplied Liquidity Is Removed
#93
Labels
3 (High Risk)
Assets can be stolen/lost/compromised directly
bug
Something isn't working
duplicate
This issue or pull request already exists
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Lines of code
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/USDMPegRecovery.sol
Vulnerability details
Impact
The
USDMPegRecovery
contract intends to bootstrap theusdm3crv
Curve liquidity pool such thatUSDM
can recover its peg. Users are allowed todeposit
andwithdraw
theirusdm
andpool3
tokens to contribute to the peg recovery process. Upon depositing, the contract will update the user'susdm
andpool3
token balance and the contract's total liquidity.Guardians can then use deposited tokens to provide liquidity in multiples of the configured
step
amount which equates to250000e18
tokens. However, the contract fails to consider two important things:usdm
/pool3
tokens.As a result, it is almost impossible for users to withdraw all deposited tokens once all liquidity has been removed from the Curve pool. If there are more
usdm
tokens (after LP withdrawal) as compared tototal.pool3
, then some users will not be able to retrieve their initialpool3
token deposit.Proof of Concept
https://github.com/code-423n4/2022-02-concur/blob/main/contracts/USDMPegRecovery.sol
Tools Used
Manual code review.
Recommended Mitigation Steps
Consider accounting for the incorrect assumption that once all liquidity is removed, the contract will receive
usdm
andpool3
tokens equal to or greater thantotal.usdm
andtotal.pool3
respectively.The text was updated successfully, but these errors were encountered: