Under normal behavior, the ConfidencePoolFactory.createPool() function handles the deployment and initialization of new Confidence Pools. Because the factory is the only authorized caller to initialize(), any input validation performed in the factory does not need to be repeated in the pool's initialization function. Additionally, certain state variables default to their zero or uninitialized values in Solidity, meaning explicit assignments to these defaults are unnecessary.
The ConfidencePool.initialize() and ConfidencePool.stake() functions contain multiple redundant checks and assignments. Specifically:
agreement_, stakeToken_, recoveryAddress_, expiry_, and isAgreementValid are all strictly validated in ConfidencePoolFactory.createPool() before initialize() is even called.
safeHarborRegistry_, outcomeModerator_, and owner_ are passed directly from trusted factory state or msg.sender and cannot be address(0).
outcome = PoolStates.Outcome.UNRESOLVED is redundant because UNRESOLVED is the first enum variant (value 0), which is the default value for an uninitialized storage variable.
In stake(), if (amount == 0) is redundant because minStake is already strictly required to be > 0 during initialization, and stake() immediately checks if (amount < minStake). Any amount == 0 will naturally fail the minStake check.
Likelihood: High
These redundant checks execute on every pool initialization and every stake action.
Impact: Low
Wastes deployment and runtime gas with no security benefit.
The redundancy is self-evident by cross-referencing ConfidencePoolFactory.createPool() and ConfidencePool.initialize().
Remove the redundant checks and assignments to optimize gas consumption.
In addition to the redundant checks, the codebase includes @inheritdoc tags for functions that have no corresponding NatSpec in the interface.
sweepUnclaimedBonus() is annotated with /// @inheritdoc IConfidencePool in ConfidencePool.sol, but the docs don't exist in IConfidencePool.
sweepUnclaimedCorrupted() is also annotated with /// @inheritdoc IConfidencePool, but the docs are missing in the interface.
Recommendation: Add the missing NatSpec documentation for both functions directly to IConfidencePool.sol.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.