Hardcoding Exchange Rate to 1e18 makes the system assume that the value of deCRVUSD and RcrvUSD is always 1:1 (the same)
leading to Arbitrage when they are not pegged 1:1 .
When exchanging deCRVUSD for RcrvUSD happens currently through the deposit and withdraw mechanism it assumes that 1:1 value will be held always
but that cannot be guaranteed . if TotalSupply / Value Changes in one of the tokens an arbitrage opportunity will be created where people will abuse the hardcoded 1e18 exchange rate for the tokens , exchanging the less valuable asset for the better priced one essentially profiting till one of the tokens is left worthless .
Hardcoded Exchange Rate 1e18 can lead to arbitrage and loss of funds .
manual review
possible fixes :
1.incorporate Chainlink Oracle to fetch prices of the two tokens and compare them when calculating exchange Rate .
2.TotalSupply Comparison to maintain an accurate valuation based on total circulation of the two tokens (could be manipulated).
the commented version also takes uint256TotalrcrvUSD= rToken.balanceOf(address(this)); which will not account properly for all of the rcrvUSD in circulation only for rcrvUSD that is in the StabilitityPool currently .
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.