Users will be unable to remove liquidity if the long and short position token holders are different addresses, effectively locking their funds in the contract.
The protocol fully supports sending tokens to different addresses - it's actually a key feature since you might want to give the long position to one party and the short to another.
But here's where it breaks: When trying to remove liquidity, the wrapper assumes both tokens are held by the same address:
The issue arises because:
The function assumes both long and short tokens are held by msg.sender
The transferFrom calls both use msg.sender as the source
There's no way to specify different addresses for long and short-token holders
The root cause is that the wrapper contract forces both position tokens to come from the same address (msg.sender), while DIVA protocol itself supports adding liquidity for different addresses:
So you can split the tokens on creation/add, but you can't remove liquidity if you do. The wrapper forces both transfers to come from msg.sender, with no way to specify different addresses.
Users can't remove liquidity if long and short tokens are held by different addresses.
Manual Review and DIVA contract.
Add support for different token holders in removeLiquidity:
The `addLiquidity` allows the short and long recipients to be different addresses. Then if a given user has only one of the position tokens, he calls `redeemPositionToken` to redeem position token amount, if this user has amount of the both token types, he can call `removeLiquidity` and in that way an equal amount of short and long tokens will be burned.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.