Omniscia Boson Protocol Audit
BosonTypes Code Style Findings
BosonTypes Code Style Findings
BTS-01C: Potentially Harmful Default Enum State
Type | Severity | Location |
---|---|---|
Language Specific | ![]() | BosonTypes.sol:L11-L25, L33-L40, L42-L49 |
Description:
The linked enum
declaration has a default state (the first "state" defined) that does not represent "zero" and instead alludes to an active state.
Example:
contracts/domain/BosonTypes.sol
11enum PausableRegion {12 Offers,13 Twins,14 Bundles,15 Groups,16 Sellers,17 Buyers,18 DisputeResolvers,19 Agents,20 Exchanges,21 Disputes,22 Funds,23 Orchestration,24 MetaTransaction25}
Recommendation:
We advise a default state to be defined (i.e. Undefined
or None
) to ensure that uninitialized variables such as mapping
entries do not represent an active state that should otherwise be attained by valid entities.
Alleviation (44009967e4f68092941d841e9e0f5dd2bb31bf0b):
The Boson Protocol team evaluated this exhibit and opted to retain the current enum
definition in place as the values are utilized as powers of two and thus behave as expected. As a result, we consider this exhibit nullified.