Skip to content

Commit

Permalink
Add owner to StakeDeposited
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkeating authored and apbendi committed Feb 7, 2024
1 parent f071a89 commit 6b2d20e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/UniStaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ contract UniStaker is INotifiableRewardReceiver, ReentrancyGuard, Multicall {

/// @notice Emitted when stake is deposited by a depositor, either to a new deposit or one that
/// already exists.
event StakeDeposited(DepositIdentifier indexed depositId, uint256 amount, uint256 depositBalance);
event StakeDeposited(
address owner, DepositIdentifier indexed depositId, uint256 amount, uint256 depositBalance
);

/// @notice Emitted when a depositor withdraws some portion of stake from a given deposit.
event StakeWithdrawn(DepositIdentifier indexed depositId, uint256 amount, uint256 depositBalance);
Expand Down Expand Up @@ -260,7 +262,7 @@ contract UniStaker is INotifiableRewardReceiver, ReentrancyGuard, Multicall {
totalDeposits[msg.sender] += _amount;
earningPower[deposit.beneficiary] += _amount;
deposit.balance += _amount;
emit StakeDeposited(_depositId, _amount, deposit.balance);
emit StakeDeposited(msg.sender, _depositId, _amount, deposit.balance);
}

/// @notice For an existing deposit, change the address to which governance voting power is
Expand Down Expand Up @@ -426,7 +428,7 @@ contract UniStaker is INotifiableRewardReceiver, ReentrancyGuard, Multicall {
delegatee: _delegatee,
beneficiary: _beneficiary
});
emit StakeDeposited(_depositId, _amount, _amount);
emit StakeDeposited(msg.sender, _depositId, _amount, _amount);
emit BeneficiaryAltered(_depositId, address(0), _beneficiary);
emit DelegateeAltered(_depositId, address(0), _delegatee);
}
Expand Down
6 changes: 5 additions & 1 deletion test/UniStaker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ contract Stake is UniStakerTest {
govToken.approve(address(uniStaker), _amount);
vm.expectEmit();
emit UniStaker.StakeDeposited(
_depositor,
UniStaker.DepositIdentifier.wrap(UniStaker.DepositIdentifier.unwrap(depositId) + 1),
_amount,
_amount
Expand Down Expand Up @@ -255,6 +256,7 @@ contract Stake is UniStakerTest {
govToken.approve(address(uniStaker), _amount);
vm.expectEmit();
emit UniStaker.StakeDeposited(
_depositor,
UniStaker.DepositIdentifier.wrap(UniStaker.DepositIdentifier.unwrap(depositId) + 1),
_amount,
_amount
Expand Down Expand Up @@ -811,7 +813,9 @@ contract StakeMore is UniStakerTest {
uniStaker.stakeMore(_depositId, _addAmount);

vm.expectEmit();
emit UniStaker.StakeDeposited(_depositId, _addAmount, _depositAmount + _totalAdditionalStake);
emit UniStaker.StakeDeposited(
_depositor, _depositId, _addAmount, _depositAmount + _totalAdditionalStake
);

uniStaker.stakeMore(_depositId, _addAmount);
vm.stopPrank();
Expand Down

0 comments on commit 6b2d20e

Please sign in to comment.