Omniscia Alliance Block Audit

StakeTransfererFeature Code Style Findings

StakeTransfererFeature Code Style Findings

STF-01C: Inconsistent Reward Multiplier Sync

TypeSeverityLocation
Code StyleInformationalStakeTransfererFeature.sol:L26

Description:

The reward multiplier is consistently updated after the user has been validated to at least have some amountStaked whereas in the linked statement it is synchronized before the validation occurs.

Example:

contracts/pool-features/StakeTransfererFeature.sol
24UserInfo storage user = userInfo[msg.sender];
25
26updateRewardMultipliers(); // Update the accumulated multipliers for everyone
27
28if (user.amountStaked == 0) {
29 return;
30}
31
32updateUserAccruedReward(msg.sender); // Update the accrued reward for this specific user

Recommendation:

We advise that the updateRewardMultipliers function is instead moved after the subceding if clause to ensure consistency across the codebase.

Alleviation:

The reward multiplier synchronization was relocated accordingly to how it is invoked in other segments of the codebase.