yearn / yearn-vaults-v3

GNU Affero General Public License v3.0
96 stars 35 forks source link

cannot decrease debt with lossy Tokenized strategy #174

Closed Schlagonia closed 1 year ago

Schlagonia commented 1 year ago

The update debt function relies on .withdraw(). Which in the Tokenized Strategy implementation by default will revert if a loss is realized during the withdraw.

https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultV3.vy#L946

Should use redeem instead like during the vaults internal _redeem https://github.com/yearn/yearn-vaults-v3/blob/master/contracts/VaultV3.vy#L766-L772