Open sherlock-admin opened 1 year ago
Accepted: This is valid and is indeed something we should fix
Fixed here: https://github.com/sense-finance/sense-v1/pull/352
We removed the redeem
code path if redeem is disabled
Fix looks good. Periphery will swap instead of redeeming if redeem is restricted
0x52
medium
Periphery#_swapPTsForTarget won't work correctly if PT is mature but redeem is restricted
Summary
Periphery#_swapPTsForTarget doesn't properly account for mature PTs that have their redemption restricted
Vulnerability Detail
Periphery.sol#L531-L551
Adapters can have their redeem restricted meaning the even when they are mature they can't be redeemed. In the scenario that it is restricted Periphery#_swapPTsForTarget simply won't work.
Impact
Redemption will fail when redeem is restricted because it tries to redeem instead of swapping
Code Snippet
Tool used
Manual Review
Recommendation
Use the same structure as _removeLiquidity: