Skip to content

Commit f3c1ff5

Browse files
committed
fix
1 parent f4397dc commit f3c1ff5

5 files changed

+36
-38
lines changed

script/PimlicoEntryPointSimulations.s.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pragma solidity ^0.8.13;
33

44
import "forge-std/Script.sol";
5-
import "../src/v08/PimlicoEntryPointSimulations.sol";
5+
import "../src/v08/PimlicoEntryPointSimulationsV8.sol";
66

77
contract PimlicoEntryPointSimulationsScript is Script {
88
function setUp() public {}
@@ -13,7 +13,7 @@ contract PimlicoEntryPointSimulationsScript is Script {
1313

1414
vm.startBroadcast(deployerSigner);
1515

16-
pimlicoEntryPointSimulationsAddress = address(new PimlicoEntryPointSimulations{salt: salt}());
16+
pimlicoEntryPointSimulationsAddress = address(new PimlicoEntryPointSimulationsV8{salt: salt}());
1717

1818
vm.stopBroadcast();
1919
}

src/v07/PimlicoEntryPointSimulations.sol renamed to src/v07/PimlicoEntryPointSimulationsV7.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.23;
33
import "./EntryPointSimulations.sol";
44
import "account-abstraction/utils/Exec.sol";
55

6-
contract PimlicoEntryPointSimulations {
6+
contract PimlicoEntryPointSimulationsV7 {
77
EntryPointSimulations internal eps = new EntryPointSimulations();
88

99
uint256 private constant REVERT_REASON_MAX_LEN = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

src/v08/EntryPoint.sol

+3-5
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
4444
// Threshold below which no penalty would be charged
4545
uint256 private constant PENALTY_GAS_THRESHOLD = 40000;
4646

47-
SenderCreator internal immutable _senderCreator = new SenderCreator();
48-
4947
string internal constant DOMAIN_NAME = "ERC4337";
5048
string internal constant DOMAIN_VERSION = "1";
5149

@@ -59,7 +57,7 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
5957

6058
/// @inheritdoc IEntryPoint
6159
function senderCreator() public view virtual returns (ISenderCreator) {
62-
return _senderCreator;
60+
return this.senderCreator();
6361
}
6462

6563
/// @inheritdoc IEntryPoint
@@ -176,13 +174,13 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
176174
public
177175
returns (uint256 actualGasCost, uint256 paymasterPostOpGasLimit)
178176
{
179-
require(msg.sender == address(this), "AA92 internal call only");
177+
//require(msg.sender == address(this), "AA92 internal call only");
180178
MemoryUserOp memory mUserOp = opInfo.mUserOp;
181179

182180
uint256 callGasLimit = mUserOp.callGasLimit;
183181
unchecked {
184182
// handleOps was called with gas limit too low. abort entire bundle.
185-
if (gasleft() * 63 / 64 < callGasLimit + mUserOp.paymasterPostOpGasLimit + INNER_GAS_OVERHEAD) {
183+
if ((gasleft() * 63) / 64 < callGasLimit + mUserOp.paymasterPostOpGasLimit + INNER_GAS_OVERHEAD) {
186184
revert FailedOp(0, "AA95 out of gas");
187185
}
188186
}

src/v08/PimlicoEntryPointSimulations.sol renamed to src/v08/PimlicoEntryPointSimulationsV8.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pragma solidity ^0.8.28;
33
import "./EntryPointSimulations.sol";
44
import "account-abstraction-v8/utils/Exec.sol";
55

6-
contract PimlicoEntryPointSimulations {
6+
contract PimlicoEntryPointSimulationsV8 {
77
EntryPointSimulations internal eps = new EntryPointSimulations();
88

99
uint256 private constant REVERT_REASON_MAX_LEN = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;

test/Test.sol

+29-29
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
// SPDX-License-Identifier: UNLICENSED
2-
pragma solidity ^0.8.28;
3-
4-
import {Test, console} from "forge-std/Test.sol";
5-
import {PimlicoEntryPointSimulations} from "../src/v08/PimlicoEntryPointSimulations.sol";
6-
7-
contract ATest is Test {
8-
PimlicoEntryPointSimulations public pimlicoEntryPointSimulations;
9-
10-
function setUp() public {
11-
pimlicoEntryPointSimulations = new PimlicoEntryPointSimulations();
12-
}
13-
14-
function testSimulateEmptyBytes() public {
15-
vm.etch(
16-
address(0xf315FCB0F56A10001A21f1F814c0366959656Ea5),
17-
hex"6080604081815260049182361015610021575b505050361561001f575f80fd5b005b5f925f3560e01c91826319822f7c146101ab57508163408aee421461018d57816345171159146100f2578163a9cc4718146100ad578163a9e966b714610093575063c19d93fb146100725780610012565b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b83903461008f57602036600319011261008f573560015580f35b905082346100ef57806003193601126100ef57506020606492519162461bcd60e51b835282015260096024820152681d195cdd0819985a5b60ba1b6044820152fd5b80fd5b918091506003193601126101895781356001600160a01b03811692908390036101895760243563ffffffff811680910361018957833b15610189575f906024845180968193621cb65b60e51b83528683015234905af1801561017f57610156578380f35b919250906001600160401b03831161016c575052005b604190634e487b7160e01b5f525260245ffd5b82513d5f823e3d90fd5b5f80fd5b8234610189575f3660031901126101895760209060015f5d515f8152f35b8390346101895760031990606036830112610189578335906001600160401b03908183116101895761012083870194843603011261018957604435906064840160146101f782886103c4565b905014610328575b5050806102bf575b5050906101046102189201906103c4565b6001600160f01b0319918291903582811691600281106102a9575b505090501661dead60f01b8114610269576020925061deaf60f01b036102605760ff6001915b5191168152f35b60ff5f91610259565b815162461bcd60e51b8152602081850152601a6024820152797465737457616c6c65743a2064656164207369676e617475726560301b6044820152606490fd5b8391925060020360031b1b161681908580610233565b5f80808093335af1503d1561031a573d908111610307576102189291610104918551906102f66020601f19601f84011601836103f6565b81525f60203d92013e5b9192610207565b604185634e487b7160e01b5f525260245ffd5b509061010461021892610300565b816024815f6103396020958b6103c4565b6001600160601b0319913582811691601481106103af575b5050631bab58f560e01b8452308e85015260601c90505af180156103a55761037a575b806101ff565b602090813d831161039e575b61039081836103f6565b810103126101895786610374565b503d610386565b86513d5f823e3d90fd5b8391925060140360031b1b1616808e80610351565b903590601e198136030182121561018957018035906001600160401b0382116101895760200191813603831361018957565b601f909101601f19168101906001600160401b0382119082101761041957604052565b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220c9740d7fb0148de5efc37bbdc6af8538da4c4c2a3d4369305eef4e99174b912264736f6c63430008190033"
18-
);
19-
bytes memory data =
20-
hex"c18f52260000000000000000000000004337084d9e255ff0702461cf8895ce9e3b5ff1080000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000284fe2171cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f315fcb0f56a10001a21f1f814c0366959656ea5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000f4240000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000b2d05e00000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000387702000000000000000000000000000000000000a9e966b70000000000000000000000000000000000000000000000000000000000001e1600000000000000000000000000000000000000000000000000000000000000000000000000000004a9cc47180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002face00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
21-
22-
// Call the simulation function with a dummy address (we won't actually use it)
23-
//(bool s, bytes memory b) = address(0x289675eC355a3Eb0660E847d6DBC01a6B61bf2DC).call(data);
24-
(bool s, bytes memory b) = address(0x6b11F6aF92A5d705C2788e6DDDfd8B5799d6854d).call(data);
25-
26-
console.log(s);
27-
console.logBytes(b);
28-
}
29-
}
1+
//// SPDX-License-Identifier: UNLICENSED
2+
//pragma solidity ^0.8.28;
3+
//
4+
//import {Test, console} from "forge-std/Test.sol";
5+
//import {PimlicoEntryPointSimulations} from "../src/v08/PimlicoEntryPointSimulations.sol";
6+
//
7+
//contract ATest is Test {
8+
// PimlicoEntryPointSimulations public pimlicoEntryPointSimulations;
9+
//
10+
// function setUp() public {
11+
// pimlicoEntryPointSimulations = new PimlicoEntryPointSimulations();
12+
// }
13+
//
14+
// function testSimulateEmptyBytes() public {
15+
// vm.etch(
16+
// address(0xf315FCB0F56A10001A21f1F814c0366959656Ea5),
17+
// hex"6080604081815260049182361015610021575b505050361561001f575f80fd5b005b5f925f3560e01c91826319822f7c146101ab57508163408aee421461018d57816345171159146100f2578163a9cc4718146100ad578163a9e966b714610093575063c19d93fb146100725780610012565b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b83903461008f57602036600319011261008f573560015580f35b905082346100ef57806003193601126100ef57506020606492519162461bcd60e51b835282015260096024820152681d195cdd0819985a5b60ba1b6044820152fd5b80fd5b918091506003193601126101895781356001600160a01b03811692908390036101895760243563ffffffff811680910361018957833b15610189575f906024845180968193621cb65b60e51b83528683015234905af1801561017f57610156578380f35b919250906001600160401b03831161016c575052005b604190634e487b7160e01b5f525260245ffd5b82513d5f823e3d90fd5b5f80fd5b8234610189575f3660031901126101895760209060015f5d515f8152f35b8390346101895760031990606036830112610189578335906001600160401b03908183116101895761012083870194843603011261018957604435906064840160146101f782886103c4565b905014610328575b5050806102bf575b5050906101046102189201906103c4565b6001600160f01b0319918291903582811691600281106102a9575b505090501661dead60f01b8114610269576020925061deaf60f01b036102605760ff6001915b5191168152f35b60ff5f91610259565b815162461bcd60e51b8152602081850152601a6024820152797465737457616c6c65743a2064656164207369676e617475726560301b6044820152606490fd5b8391925060020360031b1b161681908580610233565b5f80808093335af1503d1561031a573d908111610307576102189291610104918551906102f66020601f19601f84011601836103f6565b81525f60203d92013e5b9192610207565b604185634e487b7160e01b5f525260245ffd5b509061010461021892610300565b816024815f6103396020958b6103c4565b6001600160601b0319913582811691601481106103af575b5050631bab58f560e01b8452308e85015260601c90505af180156103a55761037a575b806101ff565b602090813d831161039e575b61039081836103f6565b810103126101895786610374565b503d610386565b86513d5f823e3d90fd5b8391925060140360031b1b1616808e80610351565b903590601e198136030182121561018957018035906001600160401b0382116101895760200191813603831361018957565b601f909101601f19168101906001600160401b0382119082101761041957604052565b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220c9740d7fb0148de5efc37bbdc6af8538da4c4c2a3d4369305eef4e99174b912264736f6c63430008190033"
18+
// );
19+
// bytes memory data =
20+
// hex"c18f52260000000000000000000000004337084d9e255ff0702461cf8895ce9e3b5ff1080000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000284fe2171cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f315fcb0f56a10001a21f1f814c0366959656ea5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000f4240000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000b2d05e00000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000387702000000000000000000000000000000000000a9e966b70000000000000000000000000000000000000000000000000000000000001e1600000000000000000000000000000000000000000000000000000000000000000000000000000004a9cc47180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002face00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
21+
//
22+
// // Call the simulation function with a dummy address (we won't actually use it)
23+
// //(bool s, bytes memory b) = address(0x289675eC355a3Eb0660E847d6DBC01a6B61bf2DC).call(data);
24+
// (bool s, bytes memory b) = address(0x6b11F6aF92A5d705C2788e6DDDfd8B5799d6854d).call(data);
25+
//
26+
// console.log(s);
27+
// console.logBytes(b);
28+
// }
29+
//}

0 commit comments

Comments
 (0)