GPT-5 finding
Invalid use of require(..., CustomError()) across contracts causes compilation failure on Solidity 0.8.26
criticalbuild-releasehigh
- src/Airlock.sol
- src/StreamableFeesLocker.sol
- src/StreamableFeesLocker.sol
- src/StreamableFeesLocker.sol
- src/StreamableFeesLockerV2.sol
- src/StreamableFeesLockerV2.sol
- src/TopUpDistributor.sol
- src/TopUpDistributor.sol
- src/UniswapV2Locker.sol
- src/base/BaseDopplerHookInitializer.sol
- src/base/BaseDopplerHookMigrator.sol
- src/base/ImmutableAirlock.sol
- src/base/ProceedsSplitter.sol
In Solidity 0.8.x (including 0.8.26 configured in foundry.toml), require(condition, ...) accepts only a string message. Passing a custom error to require’s second parameter results in a type mismatch and compilation failure. This pattern appears throughout multiple contracts, so the project cannot compile or deploy as-is.
Recommendation
Replace all require(..., CustomError()) with explicit condition checks and revert using the custom error, e.g.: if (getModuleState[module] != state) revert WrongModuleState(module, state, getModuleState[module]); Do this consistently across all files where a custom error is currently passed to require.