From 2004973b072342fbd15a493a09c478f82a8002ef Mon Sep 17 00:00:00 2001 From: 0xean <0xean.eth@gmail.com> Date: Mon, 3 Jun 2024 07:48:39 -0400 Subject: [PATCH 1/2] adds additional comments to warn about indexing events for rune address --- foundry/src/StakingV1.sol | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/foundry/src/StakingV1.sol b/foundry/src/StakingV1.sol index 56b4965..9ff4279 100644 --- a/foundry/src/StakingV1.sol +++ b/foundry/src/StakingV1.sol @@ -35,22 +35,37 @@ contract StakingV1 is uint256 public rewardPerTokenStored; event UpdateCooldownPeriod(uint256 newCooldownPeriod); + + /// @notice emits an event for when a user stakes tokens + /// @dev WARNING: a user can also update their address with setRuneAddress + /// @param account the address of the account that called stake + /// @param amount the amount of tokens being staked + /// @param runeAddress the RUNE address associated with the account event Stake( address indexed account, uint256 amount, string indexed runeAddress ); + event Unstake( address indexed account, uint256 amount, uint256 cooldownExpiry ); event Withdraw(address indexed account, uint256 amount); + + /// @notice emits and event for when user calls setRuneAddress + /// @dev WARNING: this event is not fired when a user calls stake and sets a rune address through that function. + /// Please see the Stake event for that information. + /// @param account The address of the account that called setRuneAddress + /// @param oldRuneAddress The old rune address associated with the account + /// @param newRuneAddress The new rune address associated with the account event SetRuneAddress( address indexed account, string indexed oldRuneAddress, string indexed newRuneAddress ); + event StakingPausedChanged(bool isPaused); event WithdrawalsPausedChanged(bool isPaused); event UnstakingPausedChanged(bool isPaused); From f3448616e11171866cbfdd76855a0827bef6e928 Mon Sep 17 00:00:00 2001 From: 0xean <0xean.eth@gmail.com> Date: Mon, 3 Jun 2024 11:16:13 -0400 Subject: [PATCH 2/2] spelling --- foundry/src/StakingV1.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foundry/src/StakingV1.sol b/foundry/src/StakingV1.sol index 9ff4279..aa0b737 100644 --- a/foundry/src/StakingV1.sol +++ b/foundry/src/StakingV1.sol @@ -35,7 +35,7 @@ contract StakingV1 is uint256 public rewardPerTokenStored; event UpdateCooldownPeriod(uint256 newCooldownPeriod); - + /// @notice emits an event for when a user stakes tokens /// @dev WARNING: a user can also update their address with setRuneAddress /// @param account the address of the account that called stake @@ -53,8 +53,8 @@ contract StakingV1 is uint256 cooldownExpiry ); event Withdraw(address indexed account, uint256 amount); - - /// @notice emits and event for when user calls setRuneAddress + + /// @notice emits an event for when user calls setRuneAddress /// @dev WARNING: this event is not fired when a user calls stake and sets a rune address through that function. /// Please see the Stake event for that information. /// @param account The address of the account that called setRuneAddress @@ -65,7 +65,7 @@ contract StakingV1 is string indexed oldRuneAddress, string indexed newRuneAddress ); - + event StakingPausedChanged(bool isPaused); event WithdrawalsPausedChanged(bool isPaused); event UnstakingPausedChanged(bool isPaused);