The addLiquidity
function accepts two recipient addresses: _longRecipient
and _shortRecipient
. However, this dual-address logic is not carried forward in subsequent functions, such as removeLiquidity
, redeemPositionToken
, and redeemWToken
, which instead use a single address _recipient
.
This inconsistency can lead to potential tracking issues, as the contract does not maintain the relationship between _longRecipient
and _shortRecipient
when handling liquidity.
The mismatch between the parameters in addLiquidity
and subsequent functions creates a risk of inconsistencies in tracking recipient addresses. Below is an example from some of the functions illustrating the issue:
Loss of Tracking:
If a user calls addLiquidity
and passes both _longRecipient
and _shortRecipient
, the contract does not maintain the distinction between the two addresses for later use.
Functions like removeLiquidity
or redeemWToken
relay on a single _recipient
address, potentially leading to:
Incorrect redemption or removal of liquidity.
Locked funds for one of the recipients.
Manual review
1 Simplify addLiquidity
:
Modify addLiquidity
to accept only a single recipient address (_recipient
), ensuring consistency across all functions.
Example:
2 Update Other Functions:
Modify functions such as removeLiquidity
, redeemWToken
and rest of the functions to handle both _longRecipient
and _shortRecipient
. This approach ensures that the dual-address logic from addLiquidity
is preserved throughout the contract.
Example:
The mismatch between addLiquidity
and subsequent functions can lead to significant tracking and usability issues. Adopting one of the above recommendations will ensure consistency and prevent the loss of recipient address data.
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.