A critical vulnerability has been identified in the DEX adapter contracts' initialization pattern. All DEX adapters (UniswapV2Adapter, UniswapV3Adapter, etc.) inheriting from BaseAdapter contain multiple initializer modifiers in their inheritance chain. This violates the OpenZeppelin initializable contract pattern and can lead to partially initialized contracts or completely blocked initialization functions.
This is the BaseAdapter Contract Implementation:
This function is marked with initializer modifier. It's responsible for critical base initialization like setting up contract ownership and configuring slippage tolerance.
Now see the DEX Adapter Implementation (e.g., UniswapV3Adapter):
This function is also marked with initializer modifier.
The issue is that both initialize() and __BaseAdapter_init() have initializer modifier. The initializer modifier sets a boolean flag when first called.
Subsequent calls to any function with initializer modifier will revert. It is designed to be used only once in the entire inheritance chain.
Example Scenario:
UniswapV3Adapter.initialize() is called
It Sets initialized = true inside initializer modifier
BaseAdapter.__BaseAdapter_init() can never be called.
Contract lacks ownership and slippage settings
Completely blocked initialization of Dex Adaptors.
Manual Review
Implement the proper initialization pattern:
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.