Closed code423n4 closed 1 year ago
Will keep for the sponsor's review. Looks like a low risk.
hansfriese marked the issue as satisfactory
hansfriese changed the severity to 2 (Med Risk)
hansfriese marked the issue as primary issue
There is no attack present here: every use of these functions is already wrapped in a reentrancy guard.
TimTinkers marked the issue as sponsor disputed
hansfriese marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L927-L929 https://github.com/code-423n4/2023-03-neotokyo/blob/main/contracts/staking/NeoTokyoStaker.sol#L1618-L1627
Vulnerability details
Impact
To avoid unexpected behavior in the future (be it for the solution or for a fork), it's recommended to always follow the checks-effects-interactions pattern.
Consider always moving the state-changes before the external calls.
I found the 2 specifc issues with funcation _stakeS1Citizen() and _withdrawLP() in NeoTokyoStaker.sol
Proof of Concept
Tools Used
Manual
Recommended Mitigation Steps
Follow the check-effect-interaction pattern.