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
getSwappingPrice() is intended to get swapping price between to underlying assets in the tranche but this function and its implementation doesn't make sense when only one ERC4626 is deposited into the tranche.
Technical Details
The Gro protocol as examined only has one token that is deposited into it, as the return value of getYieldToken() shows. The current implementation of getSwappingPrice() allows any uint256 input values for function arguments i and j and always returns the input _amount which implies a 1-to-1 exchange rate between token i and token j. This return value doesn't make sense. It would make more sense to follow an implementation like getYieldToken() shows and only allow an i and j value of zero, reverting in other cases.
Impact
Informational.
Recommendation
Consider a different implementation for getSwappingPrice() rather than returning a value that assumes a 1-to-1 exchange rate between arbitrary input tokens. The function is not called by the existing Gro implementation so it is not very important.
The text was updated successfully, but these errors were encountered:
getSwappingPrice()
is intended toget swapping price between to underlying assets in the tranche
but this function and its implementation doesn't make sense when only one ERC4626 is deposited into the tranche.Technical Details
The Gro protocol as examined only has one token that is deposited into it, as the return value of
getYieldToken()
shows. The current implementation ofgetSwappingPrice()
allows any uint256 input values for function argumentsi
andj
and always returns the input_amount
which implies a 1-to-1 exchange rate between tokeni
and tokenj
. This return value doesn't make sense. It would make more sense to follow an implementation likegetYieldToken()
shows and only allow ani
andj
value of zero, reverting in other cases.Impact
Informational.
Recommendation
Consider a different implementation for
getSwappingPrice()
rather than returning a value that assumes a 1-to-1 exchange rate between arbitrary input tokens. The function is not called by the existing Gro implementation so it is not very important.The text was updated successfully, but these errors were encountered: