This repository has been archived by the owner on May 26, 2023. It is now read-only.
kenzo - ERC5095.redeem/withdraw
do not work before token maturity
#50
Labels
kenzo
low
ERC5095.redeem/withdraw
do not work before token maturitySummary
When trying to redeem before maturity,
both of these functions call
marketplace.sellPrincipalToken
, which tries to pull the PT from the sender.But
ERC5095
itself doesn't hold the PTs and doesn't pull them from the user.Therefore the call will fail.
Vulnerability Detail
Detailed above.
Impact
Impaired functionality.
Assets can still be sold straight via
Marketplace
.Code Snippet
For example we can see that
redeem
callsIMarketPlace(marketplace).sellPrincipalToken
without pulling the PTs from the user:And
sellPrincipalToken
tries to pull the PTs frommsg.sender
:Since
msg.sender
isERC5095
at that point, andERC5095
didn't pull the tokens from the original sender, no tokens will be sent to the yield pool, and the redemption will fail.Tool used
Manual Review
Recommendation
Pull the tokens from the user in
ERC5095.redeem/withdraw
.(The flow can also be changed to make the process a little more efficient.)
Duplicate of #195
The text was updated successfully, but these errors were encountered: