Skip to content

Commit

Permalink
fix infinite callgaslimit binary search
Browse files Browse the repository at this point in the history
  • Loading branch information
mouseless0x committed Dec 18, 2024
1 parent e7c1310 commit 694253b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/v07/EntryPointSimulations.sol
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ contract EntryPointSimulations is EntryPoint, IEntryPointSimulations {
uint256 remainingGas = gasleft();
(targetSuccess, targetResult) = thisContract.simulateCall(entryPoint, target, targetCallData, gasleft());
minGas = remainingGas - gasleft();

// If the call reverts then don't binary search.
if (!targetSuccess) {
return TargetCallResult(0, targetSuccess, targetResult);
}
}

// Set bounds for binary search.
Expand Down

0 comments on commit 694253b

Please sign in to comment.