The user on calling exit calls the updateReward function twice.
First entry is in function withdraw() _burn()
<https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/staking/Staking.sol#L85>
Calling the Hook beforeTokenTransfer
<https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/staking/Staking.sol#L108>
Which in turn calls updateReward
<https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/staking/Staking.sol#L118>
Second Entry
getReward call updateReward directly
<https://github.com/code-423n4/2023-03-wenwin/blob/91b89482aaedf8b8feb73c771d11c257eed997e8/src/staking/Staking.sol#L92>
Slither
Developer should call update Reward not compound the exit function and call getReward and withdraw seperately.
The text was updated successfully, but these errors were encountered:
All reactions