AntFleet

Disagreement · 1e8fb4a1-openai-0

Invalid use of require(..., CustomError()) across contracts causes compilation failure on Solidity 0.8.26

solo GPT-5
repo a7cc2ed7·PR #1·reviewed 1 week ago

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.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →