Omniscia Alliance Block Audit
StakeTransfererFeature Code Style Findings
StakeTransfererFeature Code Style Findings
STF-01C: Inconsistent Reward Multiplier Sync
| Type | Severity | Location |
|---|---|---|
| Code Style | Informational | StakeTransfererFeature.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];2526updateRewardMultipliers(); // Update the accumulated multipliers for everyone2728if (user.amountStaked == 0) {29 return;30}3132updateUserAccruedReward(msg.sender); // Update the accrued reward for this specific userRecommendation:
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.