Closed c4-bot-10 closed 7 months ago
Validation issue, QA at most
GalloDaSballo marked the issue as insufficient quality report
GalloDaSballo marked the issue as primary issue
trust1995 changed the severity to QA (Quality Assurance)
trust1995 marked the issue as grade-c
Lines of code
https://github.com/code-423n4/2024-02-wise-lending/blob/main/contracts/PowerFarms/PendlePowerFarm/PendlePowerFarmLeverageLogic.sol#L246-L259 https://github.com/code-423n4/2024-02-wise-lending/blob/main/contracts/PowerFarms/PendlePowerFarm/PendlePowerFarmLeverageLogic.sol#L427-L440
Vulnerability details
Impact
Trying to enter a Pendle power farm on Arbitrum where the
ENTRY_ASSET
is the same as theWETH_ADDRESS
will cause the transaction to revert due to the fact that Uniswap V3 doesn't have pools for same-token pairs.Proof of Concept
PendlePowerFarmLeverageLogic
has the following piece of code:This is used inside
_logicOpenPosition
to perform a swap as part of the flash loan repaying logic and is only called into when the chain is Arbitrum:The problem is that Uniswap V3 doesn't allow pools to exist where both tokens in the pair are the same token. This will cause a revert for power farms where the
ENTRY_TOKEN
is WETH.Tools Used
Manual Review
Recommended Mitigation Steps
Check
WETH_ADDRESS != ENTRY_ASSET
as well before entering the block.Assessed type
Uniswap