fix: fix: FitnessEvaluator.t.sol broken on Base mainnet fork (#780)

Address review feedback:
- Add comment on FEE_DEST explaining why it differs from DeployBaseMainnet.sol:
  on a Base mainnet fork, 0xf6a3...D9011 has contract code which triggers
  feeDestinationLocked=true; keccak-derived address is a guaranteed EOA
- Expand bytecodes.txt EOF guard with a pipeline-mismatch warning log
- Fix STATE.md entry to use imperative verb form per project convention

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-15 02:13:04 +00:00
parent b3007e8f11
commit cef4c3038b
2 changed files with 10 additions and 2 deletions

View file

@ -143,6 +143,11 @@ contract FitnessEvaluator is Test {
address internal constant NPM_ADDR = 0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1;
// Base mainnet Uniswap V3 Factory https://basescan.org/address/0x33128a8fC17869897dcE68Ed026d694621f6FDfD
address internal constant V3_FACTORY = 0x33128a8fC17869897dcE68Ed026d694621f6FDfD;
/// @dev Intentionally differs from DeployBaseMainnet.sol (0xf6a3...D9011).
/// On a Base mainnet fork that address already has contract bytecode, which
/// causes LiquidityManager.setFeeDestination() to set feeDestinationLocked=true
/// and subsequently revert if called again during snapshot/revert cycles.
/// This keccak-derived address is a guaranteed EOA on any live network.
address internal constant FEE_DEST = 0x8A9145E1Ea4C4d7FB08cF1011c8ac1F0e10F9383;
/// @dev Fixed address used with vm.etch to inject candidate bytecode.
@ -230,7 +235,10 @@ contract FitnessEvaluator is Test {
string memory candidateId = vm.readLine(idsFile);
string memory bytecodeHex = vm.readLine(bytecodesFile);
if (bytes(candidateId).length == 0) break;
if (bytes(bytecodeHex).length == 0) break;
if (bytes(bytecodeHex).length == 0) {
console.log("FitnessEvaluator: bytecodes.txt EOF before ids.txt - pipeline mismatch, stopping");
break;
}
// Revert to clean post-deploy state for each candidate.
vm.revertTo(baseSnap);