Skip to content

fix #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 30, 2025
Merged

fix #15

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions script/PimlicoEntryPointSimulations.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity ^0.8.13;

import "forge-std/Script.sol";
import "../src/v08/PimlicoEntryPointSimulations.sol";
import "../src/v08/PimlicoEntryPointSimulationsV8.sol";

contract PimlicoEntryPointSimulationsScript is Script {
function setUp() public {}
Expand All @@ -13,7 +13,7 @@ contract PimlicoEntryPointSimulationsScript is Script {

vm.startBroadcast(deployerSigner);

pimlicoEntryPointSimulationsAddress = address(new PimlicoEntryPointSimulations{salt: salt}());
pimlicoEntryPointSimulationsAddress = address(new PimlicoEntryPointSimulationsV8{salt: salt}());

vm.stopBroadcast();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.23;
import "./EntryPointSimulations.sol";
import "account-abstraction/utils/Exec.sol";

contract PimlicoEntryPointSimulations {
contract PimlicoEntryPointSimulationsV7 {
EntryPointSimulations internal eps = new EntryPointSimulations();

uint256 private constant REVERT_REASON_MAX_LEN = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
Expand Down
8 changes: 3 additions & 5 deletions src/v08/EntryPoint.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
// Threshold below which no penalty would be charged
uint256 private constant PENALTY_GAS_THRESHOLD = 40000;

SenderCreator internal immutable _senderCreator = new SenderCreator();

string internal constant DOMAIN_NAME = "ERC4337";
string internal constant DOMAIN_VERSION = "1";

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

/// @inheritdoc IEntryPoint
function senderCreator() public view virtual returns (ISenderCreator) {
return _senderCreator;
return this.senderCreator();
}

/// @inheritdoc IEntryPoint
Expand Down Expand Up @@ -176,13 +174,13 @@ contract EntryPoint is IEntryPoint, StakeManager, NonceManager, ReentrancyGuardT
public
returns (uint256 actualGasCost, uint256 paymasterPostOpGasLimit)
{
require(msg.sender == address(this), "AA92 internal call only");
//require(msg.sender == address(this), "AA92 internal call only");
MemoryUserOp memory mUserOp = opInfo.mUserOp;

uint256 callGasLimit = mUserOp.callGasLimit;
unchecked {
// handleOps was called with gas limit too low. abort entire bundle.
if (gasleft() * 63 / 64 < callGasLimit + mUserOp.paymasterPostOpGasLimit + INNER_GAS_OVERHEAD) {
if ((gasleft() * 63) / 64 < callGasLimit + mUserOp.paymasterPostOpGasLimit + INNER_GAS_OVERHEAD) {
revert FailedOp(0, "AA95 out of gas");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.28;
import "./EntryPointSimulations.sol";
import "account-abstraction-v8/utils/Exec.sol";

contract PimlicoEntryPointSimulations {
contract PimlicoEntryPointSimulationsV8 {
EntryPointSimulations internal eps = new EntryPointSimulations();

uint256 private constant REVERT_REASON_MAX_LEN = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
Expand Down
58 changes: 29 additions & 29 deletions test/Test.sol
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;

import {Test, console} from "forge-std/Test.sol";
import {PimlicoEntryPointSimulations} from "../src/v08/PimlicoEntryPointSimulations.sol";

contract ATest is Test {
PimlicoEntryPointSimulations public pimlicoEntryPointSimulations;

function setUp() public {
pimlicoEntryPointSimulations = new PimlicoEntryPointSimulations();
}

function testSimulateEmptyBytes() public {
vm.etch(
address(0xf315FCB0F56A10001A21f1F814c0366959656Ea5),
hex"6080604081815260049182361015610021575b505050361561001f575f80fd5b005b5f925f3560e01c91826319822f7c146101ab57508163408aee421461018d57816345171159146100f2578163a9cc4718146100ad578163a9e966b714610093575063c19d93fb146100725780610012565b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b83903461008f57602036600319011261008f573560015580f35b905082346100ef57806003193601126100ef57506020606492519162461bcd60e51b835282015260096024820152681d195cdd0819985a5b60ba1b6044820152fd5b80fd5b918091506003193601126101895781356001600160a01b03811692908390036101895760243563ffffffff811680910361018957833b15610189575f906024845180968193621cb65b60e51b83528683015234905af1801561017f57610156578380f35b919250906001600160401b03831161016c575052005b604190634e487b7160e01b5f525260245ffd5b82513d5f823e3d90fd5b5f80fd5b8234610189575f3660031901126101895760209060015f5d515f8152f35b8390346101895760031990606036830112610189578335906001600160401b03908183116101895761012083870194843603011261018957604435906064840160146101f782886103c4565b905014610328575b5050806102bf575b5050906101046102189201906103c4565b6001600160f01b0319918291903582811691600281106102a9575b505090501661dead60f01b8114610269576020925061deaf60f01b036102605760ff6001915b5191168152f35b60ff5f91610259565b815162461bcd60e51b8152602081850152601a6024820152797465737457616c6c65743a2064656164207369676e617475726560301b6044820152606490fd5b8391925060020360031b1b161681908580610233565b5f80808093335af1503d1561031a573d908111610307576102189291610104918551906102f66020601f19601f84011601836103f6565b81525f60203d92013e5b9192610207565b604185634e487b7160e01b5f525260245ffd5b509061010461021892610300565b816024815f6103396020958b6103c4565b6001600160601b0319913582811691601481106103af575b5050631bab58f560e01b8452308e85015260601c90505af180156103a55761037a575b806101ff565b602090813d831161039e575b61039081836103f6565b810103126101895786610374565b503d610386565b86513d5f823e3d90fd5b8391925060140360031b1b1616808e80610351565b903590601e198136030182121561018957018035906001600160401b0382116101895760200191813603831361018957565b601f909101601f19168101906001600160401b0382119082101761041957604052565b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220c9740d7fb0148de5efc37bbdc6af8538da4c4c2a3d4369305eef4e99174b912264736f6c63430008190033"
);
bytes memory data =
hex"c18f52260000000000000000000000004337084d9e255ff0702461cf8895ce9e3b5ff1080000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000284fe2171cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f315fcb0f56a10001a21f1f814c0366959656ea5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000f4240000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000b2d05e00000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000387702000000000000000000000000000000000000a9e966b70000000000000000000000000000000000000000000000000000000000001e1600000000000000000000000000000000000000000000000000000000000000000000000000000004a9cc47180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002face00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";

// Call the simulation function with a dummy address (we won't actually use it)
//(bool s, bytes memory b) = address(0x289675eC355a3Eb0660E847d6DBC01a6B61bf2DC).call(data);
(bool s, bytes memory b) = address(0x6b11F6aF92A5d705C2788e6DDDfd8B5799d6854d).call(data);

console.log(s);
console.logBytes(b);
}
}
//// SPDX-License-Identifier: UNLICENSED
//pragma solidity ^0.8.28;
//
//import {Test, console} from "forge-std/Test.sol";
//import {PimlicoEntryPointSimulations} from "../src/v08/PimlicoEntryPointSimulations.sol";
//
//contract ATest is Test {
// PimlicoEntryPointSimulations public pimlicoEntryPointSimulations;
//
// function setUp() public {
// pimlicoEntryPointSimulations = new PimlicoEntryPointSimulations();
// }
//
// function testSimulateEmptyBytes() public {
// vm.etch(
// address(0xf315FCB0F56A10001A21f1F814c0366959656Ea5),
// hex"6080604081815260049182361015610021575b505050361561001f575f80fd5b005b5f925f3560e01c91826319822f7c146101ab57508163408aee421461018d57816345171159146100f2578163a9cc4718146100ad578163a9e966b714610093575063c19d93fb146100725780610012565b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b83903461008f57602036600319011261008f573560015580f35b905082346100ef57806003193601126100ef57506020606492519162461bcd60e51b835282015260096024820152681d195cdd0819985a5b60ba1b6044820152fd5b80fd5b918091506003193601126101895781356001600160a01b03811692908390036101895760243563ffffffff811680910361018957833b15610189575f906024845180968193621cb65b60e51b83528683015234905af1801561017f57610156578380f35b919250906001600160401b03831161016c575052005b604190634e487b7160e01b5f525260245ffd5b82513d5f823e3d90fd5b5f80fd5b8234610189575f3660031901126101895760209060015f5d515f8152f35b8390346101895760031990606036830112610189578335906001600160401b03908183116101895761012083870194843603011261018957604435906064840160146101f782886103c4565b905014610328575b5050806102bf575b5050906101046102189201906103c4565b6001600160f01b0319918291903582811691600281106102a9575b505090501661dead60f01b8114610269576020925061deaf60f01b036102605760ff6001915b5191168152f35b60ff5f91610259565b815162461bcd60e51b8152602081850152601a6024820152797465737457616c6c65743a2064656164207369676e617475726560301b6044820152606490fd5b8391925060020360031b1b161681908580610233565b5f80808093335af1503d1561031a573d908111610307576102189291610104918551906102f66020601f19601f84011601836103f6565b81525f60203d92013e5b9192610207565b604185634e487b7160e01b5f525260245ffd5b509061010461021892610300565b816024815f6103396020958b6103c4565b6001600160601b0319913582811691601481106103af575b5050631bab58f560e01b8452308e85015260601c90505af180156103a55761037a575b806101ff565b602090813d831161039e575b61039081836103f6565b810103126101895786610374565b503d610386565b86513d5f823e3d90fd5b8391925060140360031b1b1616808e80610351565b903590601e198136030182121561018957018035906001600160401b0382116101895760200191813603831361018957565b601f909101601f19168101906001600160401b0382119082101761041957604052565b634e487b7160e01b5f52604160045260245ffdfea2646970667358221220c9740d7fb0148de5efc37bbdc6af8538da4c4c2a3d4369305eef4e99174b912264736f6c63430008190033"
// );
// bytes memory data =
// hex"c18f52260000000000000000000000004337084d9e255ff0702461cf8895ce9e3b5ff1080000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000284fe2171cb000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f315fcb0f56a10001a21f1f814c0366959656ea5000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000f4240000000000000000000000000000493e000000000000000000000000000000000000000000000000000000000000493e0000000000000000000000000b2d05e00000000000000000000000000ee6b280000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000000387702000000000000000000000000000000000000a9e966b70000000000000000000000000000000000000000000000000000000000001e1600000000000000000000000000000000000000000000000000000000000000000000000000000004a9cc47180000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002face00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
//
// // Call the simulation function with a dummy address (we won't actually use it)
// //(bool s, bytes memory b) = address(0x289675eC355a3Eb0660E847d6DBC01a6B61bf2DC).call(data);
// (bool s, bytes memory b) = address(0x6b11F6aF92A5d705C2788e6DDDfd8B5799d6854d).call(data);
//
// console.log(s);
// console.logBytes(b);
// }
//}
Loading