The _addLiquidity function allows the caller to specify different addresses for receiving the long and short position tokens (_longRecipient and _shortRecipient). This means that a liquidity provider can add collateral and have the long and short tokens sent to different addresses based on a custom use case or agreement.
However, _removeLiquidity enforces that both long and short tokens must be transferred from a single msg.sender.
_addLiquidity::AaveDivaWrapperCore.sol
_removeLiquidity::AaveDivaWrapperCore.sol
This is problematic because the long and short tokens may belong to different addresses (if _addLiquidity assigned them to different recipients). As a result:
Denial of Service (DoS) Risk:
If the long and short tokens are held by different addresses, neither address can successfully call _removeLiquidity to retrieve collateral.
This effectively locks the liquidity in the protocol and prevents proper withdrawal.
Inconsistent User Experience:
Users who originally received separate long and short tokens may not expect that withdrawal requires both tokens to be held by the same wallet.
This creates unnecessary complexity and limits usability.
Manual review
Modify _removeLiquidity to allow separate addresses for long and short token withdrawals. Instead of enforcing msg.sender to hold both, allow:
_longOwner and _shortOwner parameters so that long and short tokens can be retrieved from different wallets.
Checking balances for each separately before executing transfers.
This way, any address that holds a valid amount of long or short tokens can participate in liquidity removal, ensuring fairer access and preventing DoS risks.
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.