The initialize function sets all critical protocol addresses for the Stratax contract including the Aave Pool, Aave Data Provider, 1inch Router, USDC token, and Stratax Oracle. Since the contract uses the Initializable pattern (proxy-based upgradeability), initialize can only be called once and the addresses cannot be changed afterward (only strataxOracle has a setter function via setStrataxOracle).
None of the five address parameters are validated against address(0). A deployment script that accidentally passes a zero address for _aavePool or _aaveDataProvider would permanently brick the contract, as all subsequent operations would call address(0), and the initializer modifier prevents re-initialization.
Likelihood:
Proxy deployments with BeaconProxy encode initialization data off-chain and pass it as a constructor argument. A single error in deployment script parameter ordering or a missing environment variable results in address(0) being silently accepted.
The initializer modifier makes this a one-shot operation. Once set, aavePool, aaveDataProvider, oneInchRouter, and USDC have no setter functions and cannot be corrected.
Impact:
All core operations (createLeveragedPosition, unwindPosition, calculateOpenParams, calculateUnwindParams) call aavePool and aaveDataProvider. With address(0), these calls will revert or produce undefined behavior, permanently bricking the contract.
The proxy would need to be abandoned and a new one deployed, incurring gas costs and requiring all users to migrate.
This Foundry test deploys a fresh Stratax implementation behind a BeaconProxy, passing address(0) for both _aavePool and _aaveDataProvider. The initialize function completes without revert, and subsequent reads confirm the zero addresses are stored. Because the initializer modifier prevents re-initialization, the contract is permanently bricked.
Add require checks for all five address parameters at the top of initialize. Since this function can only execute once (per the initializer modifier), these checks act as a deployment safety net that catches misconfigured deployment scripts before the contract is permanently locked into invalid state.
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.