StabilityPool's getExchangeRate()
function hardcodes a static 1e18
rate, allowing attackers to mint unlimited deTokens
without proper rToken
backing, leading to protocol insolvency.
The getExchangeRate
function is hardcoded to 1e18
, ignoring actual token balances. This breaks the intended 1:1 peg between rToken and DEToken.
Current code: getExchangeRate()
This static rate ignores the actual pool dynamics that should determine the exchange rate:
Total rToken
deposits
Outstanding deToken
supply
Liquidation events
Protocol fees
Imagine this scenario:
Attacker deposits minimal rToken
Receives deToken
at 1:1 rate
Pool becomes undercollateralized
System insolvency when redemptions exceed deposits
Users can mint unlimited DEToken without sufficient backing, leading to insolvency.
Manual review
Implement dynamic exchange rate calculation using actual balances (uncomment the existing logic and validate).
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.