Omniscia Colony Lab Audit

RewardingStaking Code Style Findings

RewardingStaking Code Style Findings

RSG-01C: Unconventional Initialization Methodology

Description:

The PrivilegedGroupUpgradeable is meant to be used as a dependency of an upgrade-able contract yet does not implement an _init or _init_unchained hook.

Example:

contracts/StakingV2/RewardingStaking.sol
47/**
48 * @dev Constructor/Initializer
49 * @param stakeToken_ The address of stake token contract
50 * @param authorizedStakeAmount_ Minimum stake amount in wei
51 * @param authorizedStakePeriod_ Period in seconds needed to become authorized
52 */
53function initialize (
54 address stakeToken_,
55 uint256 authorizedStakeAmount_,
56 uint256 authorizedStakePeriod_
57) public override initializer {
58 __ReentrancyGuard_init();
59 PrivilegedGroupUpgradeable.initialize();
60 AuthorizedStaking.initialize(stakeToken_, authorizedStakeAmount_, authorizedStakePeriod_);
61}

Recommendation:

We advise both hooks to be implemented as per the OpenZeppelin standard to ensure consistent behaviour across the codebase.

Alleviation:

Both hooks were introduced in the PrivilegedGroupUpgradeable implementation as advised rendering this exhibit dealt with.