Like plain pools, lending pools have the exchange method. However, in the case of lending pools, calling exchange performs a swap between two wrapped tokens in the pool.
For example, calling exchange on the Compound Pool, would result in a swap between the wrapped tokens cDAI and cUSDC.
ctf_sec
medium
CurveAdapter.sol does support function exchange_underlying method.
Summary
CurveAdapter.sol does support function exchange_underlying method.
Vulnerability Detail
The current implementation of the CurveAdapter.sol only support the function exchange
however, there is limitation
From Curve Documentation
in this case, the function
comes in handy.
the function Perform an exchange between two underlying tokens. Index values can be found via the underlying_coins public getter method.
Source: https://curve.readthedocs.io/exchange-pools.html
Impact
Missing the function exchange_underlying method make the CurveAdapter.sol support only wrapped token but not underlying token.
Code Snippet
https://github.com/sherlock-audit/2022-09-notional/blob/main/leveraged-vaults/contracts/trading/adapters/CurveAdapter.sol#L25-L32
Tool used
Manual Review
Recommendation
We recommend the project add support for the method exchange_underlying