Skip to content

Commit

Permalink
fix: Emit both amounts coming from LQTYStaking and total ones on unst…
Browse files Browse the repository at this point in the history
…aking
  • Loading branch information
bingen committed Nov 19, 2024
1 parent 9632de9 commit b83fad5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/UserProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ contract UserProxy is IUserProxy {
onlyStakingV2
returns (uint256 lusdAmount, uint256 ethAmount)
{
uint256 initialLUSDAmount = lusd.balanceOf(address(this));
uint256 initialETHAmount = address(this).balance;

stakingV1.unstake(_amount);

uint256 lqtyAmount = lqty.balanceOf(address(this));
Expand All @@ -78,7 +81,15 @@ contract UserProxy is IUserProxy {
require(success, "UserProxy: eth-fail");
}

emit Unstake(_amount, _recipient, lusdAmount, ethAmount);
emit Unstake(
_recipient,
_amount,
lqtyAmount,
lusdAmount - initialLUSDAmount,
lusdAmount,
ethAmount - initialETHAmount,
ethAmount
);
}

/// @inheritdoc IUserProxy
Expand Down
10 changes: 9 additions & 1 deletion src/interfaces/IUserProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ import {PermitParams} from "../utils/Types.sol";

interface IUserProxy {
event Stake(uint256 amount, address lqtyFrom);
event Unstake(uint256 lqtyUnstaked, address indexed lqtyRecipient, uint256 lusdAmount, uint256 ethAmount);
event Unstake(
address indexed lqtyRecipient,
uint256 lqtyUnstaked,
uint256 lqtySent,
uint256 lusdAmountReceived,
uint256 lusdAmountSent,
uint256 ethAmountReceived,
uint256 ethAmountSent
);

/// @notice Address of the LQTY token
/// @return lqty Address of the LQTY token
Expand Down

0 comments on commit b83fad5

Please sign in to comment.