The CommunityVCS contract contains upgrade initialization logic within its initialize function that's guarded by the OpenZeppelin initializer modifier. Due to how this modifier works, the upgrade logic will never execute as the modifier will revert during upgrades, leaving the contract in a potentially inconsistent state.
The initialize function in CommunityVCS contains two paths: one for first-time initialization and another for upgrades, determined by checking if token address is zero. However, the entire function is guarded by OpenZeppelin's initializer modifier which prevents any subsequent calls after the first initialization. This means the upgrade path in the else block becomes unreachable code as the modifier will revert before reaching it.
as it can be seen below OpenZeppelin's initializer modifier ensures the function can only be called when _initialized < 1. And since _initialized is set to 1 on the proxy when the very first CommunityVCS version is initialized, it means that any other call to the initialize function would revert essentially making the else block in the function above unreachable.
Deploy CommunityVCS contract and call initialize() - succeeds
Upgrade the contract implementation
Try to call initialize() again - reverts with "Initializable: contract is already initialized"
upgrade initialization logic in the else block never executes
The upgrade initialization logic that sets critical contract parameters (globalVaultState, maxDepositSizeBP, fundFlowController, vaultMaxDeposits) will never execute during upgrades. This could leave the contract in an inconsistent state with outdated or incorrect parameters, potentially affecting core functionality like deposit limits and vault management.
Manual review
Separate the initialization and upgrade logic into two distinct functions using OpenZeppelin's reinitializer pattern.
Note: only add the reinitialize function in the implementation to be upgraded to
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.