Balance check for swapToken in ShortLongSpell#_deposit is incorrect and will result in nonfunctional contract
Summary
The balance checks on ShortLongSpell#_withdraw are incorrect and will make contract basically nonfunctional
Vulnerability Detail
swapToken is always vault.uToken. borrowToken is always required to be vault.uToken which means that swapToken == borrowToken. This means that the token borrowed is always required to be swapped.
Because swapToken == borrowToken if there is ever a swap then the swapToken balance will decrease. This causes L89 to always revert when a swap happens, making the contract completely non-functional
0x52
medium
Balance check for swapToken in ShortLongSpell#_deposit is incorrect and will result in nonfunctional contract
Summary
The balance checks on ShortLongSpell#_withdraw are incorrect and will make contract basically nonfunctional
Vulnerability Detail
swapToken is always vault.uToken. borrowToken is always required to be vault.uToken which means that swapToken == borrowToken. This means that the token borrowed is always required to be swapped.
ShortLongSpell.sol#L83-L89
Because swapToken == borrowToken if there is ever a swap then the swapToken balance will decrease. This causes L89 to always revert when a swap happens, making the contract completely non-functional
Impact
ShortLongSpell is nonfunctional
Code Snippet
ShortLongSpell.sol#L160-L202
Tool used
Manual Review
Recommendation
Remove check