How to use ModuleKit to test ERC-4337 restrictions
The ModuleKit is integrated with the ERC-4337 Validation library in order to make it effortless to ensure modules comply with the restrictions required by the ERC-4337 mempool. You can find the restrictions in the ERC-7562 specifications. Note: alternatively to the below, you can also use the simulateUserOp function to simulate only specific UserOperations.
When you write your tests, you can use the makeAccountInstance function to create an account instance. Then, you can use this instance to execute transactions, for example:
Copy
Ask AI
// Create an account instanceAccountInstance memory instance = makeAccountInstance("account1");// Execute a UserOperation on the accountinstance.exec({ target: address(1), value: 1 wei, callData: "" });