Submitted by scaraven, also found by Franfran
As defined in the docs for Euler, ERC4626, Compound and Aave, when withdrawing and depositing funds the amount specified corresponds excactly to how many of the underlying assets are deposited or withdrawn.
However, as specified by Yearn, the yearn withdraw amount parameter specifies how many shares are burnt instead of underlying assets retrieved. Two scenarios can occur from then on, if there are not enough shares then the transaction will revert and users will not be able to redeem the underlying assets from Yearn. If there are enough shares, then a higher number of assets will be withdrawn then expected (as assets per share will only increase). This means that once the user receives their underlying assets at a 1:1 peg the excess amounts will be permanently locked in the vault contract.
All scenarios use Yearn finance as the protocol, the other protocols are unaffected.
VS Code
In the withdraw() function in Swivel.sol, calculating the price per share and use that to retrieve the correct number of underlying assets
e.g.
JTraversa (Swivel) commented:
scaraven (warden) commented:
JTraversa (Swivel) commented:
scaraven (warden) commented:
JTraversa (Swivel) commented:
bghughes (judge) commented:
robrobbins (Swivel) resolved:
