FoundrySolidityLayer 2
7.25 ETH
Submission Details
Impact: low
Likelihood: high

ConfidencePoolFactory::createPool Emitted event doesnt include pool creator this difficults offchain listeners to know who is the creator of the pools

Author Revealed upon completion

Description

ConfidencePoolFactory::createPool function emits an event to inform offchain listeners about created pools
https://github.com/CodeHawks-Contests/2026-07-bc-confidence-pools/blob/58e8ba4ce3f3277866e4926f3140e597f9554a1e/src/ConfidencePoolFactory.sol#L67

/// @inheritdoc IConfidencePoolFactory
function createPool(
address agreement,
//...
address[] calldata accounts
) external whenNotPaused returns (address pool) {
if (agreement == address(0) || stakeToken == address(0)) revert ZeroAddress();
//...
IConfidencePool(pool)
.initialize(
//...
);
_poolsByAgreement[agreement].push(pool);
@> emit PoolCreated(
agreement,
pool,
stakeToken,
expiry,
minStake,
recoveryAddress,
defaultOutcomeModerator,
address(safeHarborRegistry)
);
}

However emitted event doesnt include pool creator, this difficults offchain listeners to know who is the creator of the new created pools
Is it true that pool creator can be get because msg.sender is the agreement's owner , however adding pool creator in the emitted event simplifies data extraction

Risk

Likelihood:
High
All emitted events about pool creation doesnt include pool creators

Impact:
Low
The lack of creator field in emited event difficults offchain listeners to know who is the creator of the new created pools

Proof of Concept

Execute a test that create a pool and observe it does not include the pool creator

forge test --mt test_createPool_success -vvvv | grep 'emit PoolCreated' | head -n1 | tr ',' '\n'

output

├─ emit PoolCreated(agreement: MockAgreement: [0x5991A2dF15A8F6A256D3Ec51E99254Cd3fb576A9]
pool: 0x2B67cF6ae70eA396f9D92F82CeEb4A33cB1b5D87
stakeToken: MockERC20: [0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f]
expiry: 2678401 [2.678e6]
minStake: 1000000000000000000 [1e18]
recoveryAddress: recovery: [0x73030B99950fB19C6A813465E58A0BcA5487FBEa]
outcomeModerator: defaultModerator: [0x97B02EB5Ff6267D8FAfCc4f3Ea8A48Fd20Ef1aC8]
safeHarborRegistry: MockSafeHarborRegistry: [0x2e234DAe75C793f67A35089C9d99245E1C58470b])

Recommended Mitigation

Add creator field for pool in the event
src/interfaces/IConfidencePoolFactory.sol

event PoolCreated(
@> address inxedex pool_creator
address indexed agreement,
address indexed pool,
address stakeToken,
uint256 expiry,
uint256 minStake,
address recoveryAddress,
address outcomeModerator,
address safeHarborRegistry
);

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!