The AssetSwapPath.configure() function lacks validation to ensure that the length of dexSwapStrategyIds array matches assets.length - 1, which could lead to runtime errors in _performMultiDexSwap() function.
In AssetSwapPath.sol, the configure() function allows setting up swap paths without validating the relationship between the assets and dexSwapStrategyIds arrays:
However, in FeeDistributionBranch.sol, the _performMultiDexSwap() function assumes this relationship exists:
If dexSwapStrategyIds.length < assets.length - 1, there will be an array out of bounds error in _performMultiDexSwap() or if dexSwapStrategyIds.length > assets.length - 1, there will be unused strategy IDs and also waste of storage
Manual code review
Add validation in the configure() function of AssetSwapPath.sol:
This will ensure that the swap paths are configured correctly and prevent potential runtime errors in _performMultiDexSwap().
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.