Fujicracy / fuji-v2

Cross-chain money market aggregator
https://fuji-v2-frontend.vercel.app
15 stars 10 forks source link

BorrowingVault withdraw paused blocks liquidations #579

Open 0xdcota opened 1 year ago

0xdcota commented 1 year ago

In the BorrowingVault during the liquidate() call, we check that gainedShares are not more than the liquiated owner existing shares. However, in case vault's withdrawals are paused, the existingShares will return zero.

https://github.com/Fujicracy/fuji-v2/blob/c22c3d34d3abf5240412835dac3d8897a0dcab35/packages/protocol/src/vaults/borrowing/BorrowingVault.sol#L863-L873

https://github.com/Fujicracy/fuji-v2/blob/c22c3d34d3abf5240412835dac3d8897a0dcab35/packages/protocol/src/abstracts/BaseVault.sol#L276-L281