Replies: 1 comment 7 replies
-
Hello @mustby, If I remember correctly Patrick mentions that you can't run that test on a test net and you have to run it on a real blockchain if you want to see it in action. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! (This is the first discussion thread I've ever created so let me know what I can do to format this better/provide more information) I'm currently trying to run this command in my VS Code terminal:
"forge test --match-test testEntryPointCanExecuteCommands -vvvv"
And the response I get is below:
[⠊] Compiling...
[⠰] Compiling 25 files with Solc 0.8.26
[⠔] Solc 0.8.26 finished in 278.71ms
Compiler run successful!
Ran 1 test for test/ethereum/MinimalAccountTest.t.sol:MinimalAccountTest
[FAIL: EvmError: Revert] testEntryPointCanExecuteCommands() (gas: 69378)
Logs:
handleOps called with opslen: 1
Beneficiary address: 0xc7be087fF5E8811dcED44BB1a098832Ea3663dE8
Processing operation at index: 0
Traces:
[12370199] MinimalAccountTest::setUp()
├─ [4113204] → new DeployMinimal@0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f
│ └─ ← [Return] 20432 bytes of code
├─ [7231695] DeployMinimal::deployMinimalAccount()
│ ├─ [3461936] → new HelperConfig@0x104fBc016F4bb334D775a19E8A6510109AC63E00
│ │ └─ ← [Return] 16958 bytes of code
│ ├─ [3260054] HelperConfig::getConfig()
│ │ ├─ [0] VM::startBroadcast(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
│ │ │ └─ ← [Return]
│ │ ├─ [3175222] → new EntryPoint@0x5FbDB2315678afecb367f032d93F642f64180aa3
│ │ │ ├─ [101745] → new SenderCreator@0xa16E02E87b7454126E5E10d957A927A7F5B5d2be
│ │ │ │ └─ ← [Return] 508 bytes of code
│ │ │ └─ ← [Return] 15079 bytes of code
│ │ ├─ [0] VM::stopBroadcast()
│ │ │ └─ ← [Return]
│ │ └─ ← [Return] NetworkConfig({ entryPoint: 0x5FbDB2315678afecb367f032d93F642f64180aa3, account: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 })
│ ├─ [0] VM::startBroadcast(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
│ │ └─ ← [Return]
│ ├─ [435832] → new MinimalAccount@0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
│ │ ├─ emit OwnershipTransferred(previousOwner: 0x0000000000000000000000000000000000000000, newOwner: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
│ │ └─ ← [Return] 2057 bytes of code
│ ├─ [2417] MinimalAccount::transferOwnership(0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
│ │ ├─ emit OwnershipTransferred(previousOwner: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, newOwner: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266)
│ │ └─ ← [Stop]
│ ├─ [0] VM::stopBroadcast()
│ │ └─ ← [Return]
│ └─ ← [Return] HelperConfig: [0x104fBc016F4bb334D775a19E8A6510109AC63E00], MinimalAccount: [0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512]
├─ [436157] → new ERC20Mock@0x2e234DAe75C793f67A35089C9d99245E1C58470b
│ └─ ← [Return] 1953 bytes of code
├─ [413952] → new SendPackedUserOp@0xF62849F9A0B5Bf2913b396098F7c7019b51A820a
│ └─ ← [Return] 1957 bytes of code
└─ ← [Stop]
[69378] MinimalAccountTest::testEntryPointCanExecuteCommands()
├─ [2559] ERC20Mock::balanceOf(MinimalAccount: [0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512]) [staticcall]
│ └─ ← [Return] 0
├─ [0] VM::assertEq(0, 0) [staticcall]
│ └─ ← [Return]
├─ [4986] HelperConfig::getConfig()
│ └─ ← [Return] NetworkConfig({ entryPoint: 0x5FbDB2315678afecb367f032d93F642f64180aa3, account: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 })
├─ [10128] SendPackedUserOp::generateSignedUserOperation(0xb61d27f60000000000000000000000002e234dae75c793f67a35089c9d99245e1c58470b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004440c10f19000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000, NetworkConfig({ entryPoint: 0x5FbDB2315678afecb367f032d93F642f64180aa3, account: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 }), MinimalAccount: [0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512]) [staticcall]
│ ├─ [0] VM::getNonce(MinimalAccount: [0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512]) [staticcall]
│ │ └─ ← [Return] 1
│ ├─ [2044] EntryPoint::getUserOpHash(PackedUserOperation({ sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, nonce: 0, initCode: 0x, callData: 0xb61d27f60000000000000000000000002e234dae75c793f67a35089c9d99245e1c58470b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004440c10f19000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000, accountGasLimits: 0x0000000000000000000000000100000000000000000000000000000001000000, preVerificationGas: 16777216 [1.677e7], gasFees: 0x0000000000000000000000000000010000000000000000000000000000000100, paymasterAndData: 0x, signature: 0x })) [staticcall]
│ │ └─ ← [Return] 0xd4caf9d9a22406fc1be98da33112bd794102467c1fbe1b10ed613ffa6674e230
│ ├─ [0] VM::sign("", 0xd7fac3f43f8ad88c183bb6e7c81c10038503c101a32c2ce252895c816c8ead3b) [staticcall]
│ │ └─ ← [Return] 28, 0x89429d7c8ba4b5b16355cc9c0c0c7f135396cc93da80a1398bd0414a94114cba, 0x7929576bfdea1acdfb8049885c098add3e850e9a6c51e72a7e74fea6515ebd10
│ └─ ← [Return] PackedUserOperation({ sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, nonce: 0, initCode: 0x, callData: 0xb61d27f60000000000000000000000002e234dae75c793f67a35089c9d99245e1c58470b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004440c10f19000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000, accountGasLimits: 0x0000000000000000000000000100000000000000000000000000000001000000, preVerificationGas: 16777216 [1.677e7], gasFees: 0x0000000000000000000000000000010000000000000000000000000000000100, paymasterAndData: 0x, signature: 0x89429d7c8ba4b5b16355cc9c0c0c7f135396cc93da80a1398bd0414a94114cba7929576bfdea1acdfb8049885c098add3e850e9a6c51e72a7e74fea6515ebd101c })
├─ [0] VM::deal(MinimalAccount: [0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512], 1000000000000000000 [1e18])
│ └─ ← [Return]
├─ [0] VM::prank(randomUser: [0xc7be087fF5E8811dcED44BB1a098832Ea3663dE8])
│ └─ ← [Return]
├─ [986] HelperConfig::getConfig()
│ └─ ← [Return] NetworkConfig({ entryPoint: 0x5FbDB2315678afecb367f032d93F642f64180aa3, account: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 })
├─ [20929] EntryPoint::handleOps([PackedUserOperation({ sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, nonce: 0, initCode: 0x, callData: 0xb61d27f60000000000000000000000002e234dae75c793f67a35089c9d99245e1c58470b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004440c10f19000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000, accountGasLimits: 0x0000000000000000000000000100000000000000000000000000000001000000, preVerificationGas: 16777216 [1.677e7], gasFees: 0x0000000000000000000000000000010000000000000000000000000000000100, paymasterAndData: 0x, signature: 0x89429d7c8ba4b5b16355cc9c0c0c7f135396cc93da80a1398bd0414a94114cba7929576bfdea1acdfb8049885c098add3e850e9a6c51e72a7e74fea6515ebd101c })], randomUser: [0xc7be087fF5E8811dcED44BB1a098832Ea3663dE8])
│ ├─ [0] console::log("handleOps called with opslen:", 1) [staticcall]
│ │ └─ ← [Stop]
│ ├─ [0] console::log("Beneficiary address:", randomUser: [0xc7be087fF5E8811dcED44BB1a098832Ea3663dE8]) [staticcall]
│ │ └─ ← [Stop]
│ ├─ [0] console::log("Processing operation at index:", 0) [staticcall]
│ │ └─ ← [Stop]
│ ├─ [0] 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266::validateUserOp(PackedUserOperation({ sender: 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266, nonce: 0, initCode: 0x, callData: 0xb61d27f60000000000000000000000002e234dae75c793f67a35089c9d99245e1c58470b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004440c10f19000000000000000000000000e7f1725e7734ce288f8367e1bb143e90bb3f05120000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000, accountGasLimits: 0x0000000000000000000000000100000000000000000000000000000001000000, preVerificationGas: 16777216 [1.677e7], gasFees: 0x0000000000000000000000000000010000000000000000000000000000000100, paymasterAndData: 0x, signature: 0x89429d7c8ba4b5b16355cc9c0c0c7f135396cc93da80a1398bd0414a94114cba7929576bfdea1acdfb8049885c098add3e850e9a6c51e72a7e74fea6515ebd101c }), 0xd4caf9d9a22406fc1be98da33112bd794102467c1fbe1b10ed613ffa6674e230, 12884901888 [1.288e10])
│ │ └─ ← [Stop]
│ └─ ← [Revert] EvmError: Revert
└─ ← [Revert] EvmError: Revert
Suite result: FAILED. 0 passed; 1 failed; 0 skipped; finished in 31.95ms (8.31ms CPU time)
Ran 1 test suite in 774.95ms (31.95ms CPU time): 0 tests passed, 1 failed, 0 skipped (1 total tests)
Failing tests:
Encountered 1 failing test in test/ethereum/MinimalAccountTest.t.sol:MinimalAccountTest
[FAIL: EvmError: Revert] testEntryPointCanExecuteCommands() (gas: 69378)
Encountered a total of 1 failing tests, 0 tests succeeded
I've been adding some console.log statements to the EntryPoint.sol contract and I'm just getting more and more lost. I'll attach my MinimalAccountTest.t.sol and SendPackedUserOp.s.sol below! Let me know what else would be helpful. First, I'm adding MinimalAccountTest.t.sol:
'''
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Test} from "lib/forge-std/src/Test.sol";
import {MinimalAccount} from "src/ethereum/MinimalAccount.sol";
import {DeployMinimal} from "script/DeployMinimal.s.sol";
import {HelperConfig} from "script/HelperConfig.s.sol";
import {ERC20Mock} from "lib/openzeppelin-contracts/contracts/mocks/token/ERC20Mock.sol";
import {SendPackedUserOp, PackedUserOperation, IEntryPoint} from "script/SendPackedUserOp.s.sol";
import {ECDSA} from "lib/openzeppelin-contracts/contracts/utils/cryptography/ECDSA.sol";
import {MessageHashUtils} from "lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol";
import {IEntryPoint} from "lib/account-abstraction/contracts/interfaces/IEntryPoint.sol";
contract MinimalAccountTest is Test {
using MessageHashUtils for bytes32;
}
'''
And here is SendPackedUserOp.s.sol:
'''
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Script} from "lib/forge-std/src/Script.sol";
import {PackedUserOperation} from "lib/account-abstraction/contracts/interfaces/PackedUserOperation.sol";
import {HelperConfig} from "script/HelperConfig.s.sol";
import {IEntryPoint} from "lib/account-abstraction/contracts/interfaces/IEntryPoint.sol";
import {MessageHashUtils} from "lib/openzeppelin-contracts/contracts/utils/cryptography/MessageHashUtils.sol";
// import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
// import {MinimalAccount} from "src/ethereum/MinimalAccount.sol";
// import {DevOpsTools} from "lib/foundry-devops/src/DevOpsTools.sol"; // need to install foundry devops tool?
contract SendPackedUserOp is Script {
using MessageHashUtils for bytes32;
}
'''
Beta Was this translation helpful? Give feedback.
All reactions