You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using redeem() on CompoundV2 wrapper with current implementation, leveraging LibCompound, fails to return appropriate assets calculation when calling redeem(). Issue doesn't touch withdraw().
Exchanging totalAsset() implementation from LibCompound's viewUnderlyingBalanceOf() too:
function totalAssets() public view virtual override returns (uint256) {
return cToken.balanceOf(address(this)).mulWadDown(cToken.exchangeRateStored());
}
fixes shares/assets calculation.
Otherwise, inspecting state change during redeem() yields wrong amount of totalAssets() (AUM), example with hh console.log
totalAssets() 3177334480600619999224 --- with LibCompound
totalAssets() 999999999999801353087 --- with hardcoded division by exchangeRateStored()
I may be missing something as I didn't fully inspect where things go south in LibCompound and my implementation of CompoundWrapper is also protocol specific. Can make a PR later if Issue makes sense.
The text was updated successfully, but these errors were encountered:
Using redeem() on CompoundV2 wrapper with current implementation, leveraging LibCompound, fails to return appropriate assets calculation when calling redeem(). Issue doesn't touch withdraw().
Exchanging totalAsset() implementation from LibCompound's viewUnderlyingBalanceOf() too:
fixes shares/assets calculation.
Otherwise, inspecting state change during redeem() yields wrong amount of totalAssets() (AUM), example with hh console.log
totalAssets() 3177334480600619999224 --- with LibCompound
totalAssets() 999999999999801353087 --- with hardcoded division by exchangeRateStored()
I may be missing something as I didn't fully inspect where things go south in
LibCompound
and my implementation of CompoundWrapper is also protocol specific. Can make a PR later if Issue makes sense.The text was updated successfully, but these errors were encountered: