ThunderLoan.initialize(address tswapAddress) is the proxy's one-shot initializer (protected by OpenZeppelin's initializer modifier). It forwards tswapAddress to __Oracle_init, which stores it as s_poolFactory in OracleUpgradeable.
Neither initialize nor __Oracle_init_unchained validates that tswapAddress is non-zero. If the deployer accidentally passes address(0) (script bug, copy-paste error, missing environment variable, etc.), the contract is initialized with no oracle. Every subsequent call to getPriceInWeth reverts (calling getPool on address(0)), breaking getCalculatedFee and therefore both deposit and flashloan. Because initialize is initializer, it cannot be called again to fix the misconfiguration — the proxy is permanently bricked.
Likelihood:
Requires the deployer (admin / trusted) to mistakenly pass address(0). Possible via script error, missing config var, or copy-paste from a template.
Detection is on the first user-facing call (deposit / flashloan), not at deploy time — the misconfiguration is silent.
Impact:
The proxy is unrecoverable. initializer prevents re-running initialize; there is no setter for s_poolFactory. The only recovery is an upgrade to a new implementation that adds a setter, which depends on _authorizeUpgrade and the owner's diligence.
Any tokens already deposited before the first oracle-touching call are stuck (they cannot be withdrawn either, because redeem does not need the oracle — actually they can be withdrawn; the impact is the protocol cannot service flash loans or take new deposits, but existing LP funds remain accessible via redeem).
Test passes — initialization with address(0) succeeds.
Add a zero-address guard either in initialize or in __Oracle_init_unchained:
Adding the check in __Oracle_init_unchained is also valid and protects any other contract that inherits the oracle:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.