uniswap-roi
uniswap-roi copied to clipboard
A serious bug in APR.
When yDaiv2/yDaiv3 call recommend(),it wil call method (IEarnAPRWithPool/getAPROptionsInc) for getting DAI APR. However the apr contract of yDaiv2 is the same as the apr contract of yDaiv3,so the APR of them is same. And the APR of yDaiv3 is equal to yDaiv3.
Watching flow code. https://github.com/yearn/uniswap-roi/blob/098d7506d8bce4c4e987165182b6dc2872ac652d/contracts/IEarnAPRWithPool.sol#L518-L523
I search yTokens[DAI.address] is yDaiv2.address. result
When executing code called by yDaiv3 _supply = IYToken(yToken).calcPoolValueInToken()
, _supply
is the supply of yDaiv2,it expect supply of yDaiv3.
Then,the value of _supply
called by yDaiv2 is equal to _supply
called by yDaiv3.
So,the APR which yDaiv3 get is equal to the APR of yDaiv2.
And yDaiv2 and yDaiv3 is running in Earn ,so i think it is serious bug.
yDaiv2.address = 0x16de59092dAE5CcF4A1E6439D611fd0653f0Bd01
yDaiv3.address = 0xC2cB1040220768554cf699b0d863A3cd4324ce32
yDaiv2.apr =yDaiv3.apr= 0xdd6d648c991f7d47454354f4ef326b04025a48a8
apr.yTokens[0x6B175474E89094C44Da98b954EedeAC495271d0F]=0x16de59092dAE5CcF4A1E6439D611fd0653f0Bd01