Omniscia Colony Lab Audit
PrivilegedGroupUpgradeable Static Analysis Findings
PrivilegedGroupUpgradeable Static Analysis Findings
PGU-01S: Inexistent Event Emission
| Type | Severity | Location |
|---|---|---|
| Language Specific | ![]() | PrivilegedGroupUpgradeable.sol:L13-L15 |
Description:
The linked function adjusts a sensitive contract data entry yet does not emit an event for it.
Example:
contracts/StakingV2/PrivilegedGroupUpgradeable.sol
13function updatePrivileged(address account, bool enabled) public onlyOwner {14 privileged[account] = enabled;15}Recommendation:
We advise an event to be coded and correspondingly emitted each time the function is invoked to ensure off-chain processes can properly identify the action and react as necessary.
Alleviation:
A PrivilegeUpdated event was introduced to the codebase and is correspondingly emitted for the linked statement.
PGU-02S: Redundant bool Variable Comparison
| Type | Severity | Location |
|---|---|---|
| Gas Optimization | ![]() | PrivilegedGroupUpgradeable.sol:L24 |
Description:
The linked statements perform a direct comparison between a bool variable and a bool literal.
Example:
contracts/StakingV2/PrivilegedGroupUpgradeable.sol
24owner() == _msgSender() || privileged[_msgSender()] == true,Recommendation:
We advise the bool variable to be utilized directly instead either in its normal or negated (!) form.
Alleviation:
The redundant bool comparison was replaced by a direct utilization of the bool variable alleviating this exhibit.
