M-09: Liquidation reward sent to msg.sender instead of recipient
Comments
The liquidate function allows liquidators to pass in a LiquidateParams.recipient. This value designates the recipient of the liquidation reward. Unfortunately, the liquidate function doesn't utilize this value. Instead, the protocol sets the msg.sender as the liquidation recipient. This can be seen when _sendPositionValue is called:
Instead of passing msg.sender into _sendPositionValue, the code now passes in params.recipient. This change now sends the liquidation reward to the correct address, aka params.recipient.
Lines of code
Vulnerability details
C4 issue
M-09: Liquidation reward sent to msg.sender instead of recipient
Comments
The liquidate function allows liquidators to pass in a LiquidateParams.recipient. This value designates the recipient of the liquidation reward. Unfortunately, the liquidate function doesn't utilize this value. Instead, the protocol sets the msg.sender as the liquidation recipient. This can be seen when _sendPositionValue is called:
Mitigation
PR #20
Instead of passing msg.sender into _sendPositionValue, the code now passes in params.recipient. This change now sends the liquidation reward to the correct address, aka params.recipient.
Conclusion
LGTM