Submitted by shenwilly, also found by cccz, Chom, datapunk, kenzo, Picodes, and unforgiven
Redeeming APWine and Tempus PT will always fail, causing a portion of iPT to not be able to be redeemed for the underlying token.
The issue is caused by the incorrect implementation of redeem:
The first line correctly calculates the balance of PT token available in Lender. However, the second line tries to transfer the underlying token u instead of principal from Lender to Redeemer. Therefore, the redeeming process will always fail as both APWine.withdraw and ITempus.redeemToBacking will try to redeem non-existent PT.
Fix the transfer line:
sourabhmarathe (Illuminate) confirmed
kenzo (warden) commented:
gzeoneth (judge) increased severity to High and commented:
