Skip to content

Commit 0af6f7d

Browse files
authored
Merge pull request #10 from pimlicolabs/fix/oob-error
fix out of bounds error
2 parents e84f267 + 4963d8e commit 0af6f7d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/v07/EntryPointSimulations.sol

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ contract EntryPointSimulations is EntryPoint, IEntryPointSimulations {
125125
{
126126
try EP(payable(entryPoint)).delegateAndRevert{gas: gas}(address(thisContract), payload) {}
127127
catch (bytes memory reason) {
128+
if (reason.length < 4) {
129+
// Calls that revert due to out of gas revert with empty bytes.
130+
return (false, new bytes(0));
131+
}
132+
128133
bytes memory reasonData = new bytes(reason.length - 4);
129134
for (uint256 i = 4; i < reason.length; i++) {
130135
reasonData[i - 4] = reason[i];

0 commit comments

Comments
 (0)