Liquid Staking

Stakelink
DeFiHardhatOracle
50,000 USDC
View results
Submission Details
Severity: low
Invalid

`StakingPool::addStrategy` and `StakingPool::removeStrategy` make important state changes, but do not emit events

Summary

In the StakingPool contract we have two functions, one for adding and one for removing strategies. These two functions make importants state changes, however they do not emit an event for it.

Vulnerability Details

The addStrategy and removeStrategy functions in the StakingPool contract modify the set of strategies used by the pool, but they don't emit events to log these changes:

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/StakingPool.sol#L287

https://github.com/Cyfrin/2024-09-stakelink/blob/f5824f9ad67058b24a2c08494e51ddd7efdbb90b/contracts/core/StakingPool.sol#L299

Impact

It is generally a good practice to emit events on important stage changes to better track the state of the system.

Tools Used

Manual Review

Recommendations

Add events to both functions:

event StrategyAdded(address indexed strategy);
event StrategyRemoved(address indexed strategy, uint256 index);
function addStrategy(address _strategy) external onlyOwner {
// logic ...
emit StrategyAdded(_strategy);
}
function removeStrategy(uint256 _index, bytes memory _strategyUpdateData, bytes calldata _strategyWithdrawalData) external onlyOwner {
// logic ...
emit StrategyRemoved(strategies[_index], _index);
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.