From 8da38d6685b0981b0b5522e5715636998171328f Mon Sep 17 00:00:00 2001 From: phipsae Date: Fri, 5 Jul 2024 12:27:23 +0200 Subject: [PATCH] test recover method --- packages/foundry/contracts/AccountSimple.sol | 12 +- .../contracts/AccountSimpleFactory.sol | 11 + packages/foundry/contracts/Test.sol | 2 + packages/foundry/script/Deploy.s.sol | 51 +- packages/nextjs/app/localChain/page.tsx | 157 +- .../nextjs/contracts/deployedContracts.ts | 1293 +---------------- 6 files changed, 183 insertions(+), 1343 deletions(-) create mode 100644 packages/foundry/contracts/AccountSimpleFactory.sol diff --git a/packages/foundry/contracts/AccountSimple.sol b/packages/foundry/contracts/AccountSimple.sol index 3fdc6ef..ca0e5e0 100644 --- a/packages/foundry/contracts/AccountSimple.sol +++ b/packages/foundry/contracts/AccountSimple.sol @@ -25,9 +25,9 @@ contract AccountSimple is IAccount { } } -contract AccountSimpleFactory { - function createAccount(address owner) external returns (address) { - AccountSimple acc = new AccountSimple(owner); - return address(acc); - } -} \ No newline at end of file +// contract AccountSimpleFactory { +// function createAccount(address owner) external returns (address) { +// AccountSimple acc = new AccountSimple(owner); +// return address(acc); +// } +// } \ No newline at end of file diff --git a/packages/foundry/contracts/AccountSimpleFactory.sol b/packages/foundry/contracts/AccountSimpleFactory.sol new file mode 100644 index 0000000..a996c1f --- /dev/null +++ b/packages/foundry/contracts/AccountSimpleFactory.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.0 <0.9.0; + +import "./AccountSimple.sol"; + +contract AccountSimpleFactory { + function createAccount(address owner) external returns (address) { + AccountSimple acc = new AccountSimple(owner); + return address(acc); + } +} \ No newline at end of file diff --git a/packages/foundry/contracts/Test.sol b/packages/foundry/contracts/Test.sol index a8d6cb1..dcb23fe 100644 --- a/packages/foundry/contracts/Test.sol +++ b/packages/foundry/contracts/Test.sol @@ -5,8 +5,10 @@ import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import "forge-std/console.sol"; +/// to test if ECDSA.recover works contract Test { constructor(bytes memory sig) { + /// first we hash the message hello, then we use the EthSignedMessageHash to sign it address recovered = ECDSA.recover(MessageHashUtils.toEthSignedMessageHash(keccak256("hello")), sig); console.logAddress(recovered); } diff --git a/packages/foundry/script/Deploy.s.sol b/packages/foundry/script/Deploy.s.sol index 47c8013..2484076 100644 --- a/packages/foundry/script/Deploy.s.sol +++ b/packages/foundry/script/Deploy.s.sol @@ -4,8 +4,11 @@ pragma solidity ^0.8.9; import "../contracts/Account123.sol"; import "../contracts/Account123Factory.sol"; import "../contracts/AccountSimple.sol"; +import "../contracts/AccountSimpleFactory.sol"; import "../contracts/Paymaster.sol"; import "../contracts/Test.sol"; +import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; +import "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; import "/Users/philip/Programming/Ethereum/AABuild/PWAA/node_modules/@account-abstraction/contracts/core/EntryPoint.sol"; import "./DeployHelpers.s.sol"; @@ -26,31 +29,43 @@ contract DeployScript is ScaffoldETHDeploy { // Start broadcasting transactions vm.startBroadcast(deployerPrivateKey); - // /// Deploy EntryPoint contract -- 0x5FbDB2315678afecb367f032d93F642f64180aa3 + /// Deploy EntryPoint contract -- 0x5FbDB2315678afecb367f032d93F642f64180aa3 // EntryPoint entryPoint = new EntryPoint(); - /// Deploy Account - Account123 yourAccount = new Account123(vm.addr(deployerPrivateKey)); + // /// Deploy Account + // AccountSimple yourAccount = new AccountSimple(vm.addr(deployerPrivateKey)); - /// Deploy Simple Account Factory --- 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 - AccountSimpleFactory accountSimpleFactory= new AccountSimpleFactory(); - - - Account123Factory accountFactory = new Account123Factory(); + // /// Deploy Simple Account Factory --- 0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 + // AccountSimpleFactory accountSimpleFactory= new AccountSimpleFactory(); + // // Account123Factory accountFactory = new Account123Factory(); + // /// Deploy Paymaster // Paymaster paymaster = new Paymaster(); - // Log deployment addresses - console.logString( - string.concat( - // "EntryPoint deployed at: ", vm.toString(address(entryPoint)) - // "YourAccount deployed at: ", vm.toString(address(yourAccount)), - // "AccountFactory deployed at: ", vm.toString(address(accountFactory)), - "AccountSimpleFactory deployed at: ", vm.toString(address(accountSimpleFactory)) - // "Paymaster deployed at: ", vm.toString(address(paymaster)) - ) - ); + // /// Log deployment addresses + // console.logString( + // string.concat( + // "EntryPoint deployed at: ", vm.toString(address(entryPoint)), + // // "YourAccount deployed at: ", vm.toString(address(yourAccount)), + // // "AccountFactory deployed at: ", vm.toString(address(accountFactory)), + // "AccountSimpleFactory deployed at: ", vm.toString(address(accountSimpleFactory)), + // "Paymaster deployed at: ", vm.toString(address(paymaster)) + // ) + // ); + + /// Test.sol contract test --> to verify signing works correctly + bytes32 messageHash = keccak256(abi.encodePacked("hello")); + bytes32 ethSignedMessageHash = MessageHashUtils.toEthSignedMessageHash(messageHash); + + (uint8 v, bytes32 r, bytes32 s) = vm.sign(deployerPrivateKey, ethSignedMessageHash); + bytes memory signature = abi.encodePacked(r, s, v); + + Test test = new Test(signature); + + console.logString(string.concat("Signer Address: ", vm.toString(vm.addr(deployerPrivateKey)))); + + // Stop broadcasting transactions vm.stopBroadcast(); diff --git a/packages/nextjs/app/localChain/page.tsx b/packages/nextjs/app/localChain/page.tsx index 1fbca8d..9ef8467 100644 --- a/packages/nextjs/app/localChain/page.tsx +++ b/packages/nextjs/app/localChain/page.tsx @@ -1,22 +1,33 @@ "use client"; +import { ethers } from "ethers"; import type { NextPage } from "next"; import { createPublicClient, encodeFunctionData, getContract, getContractAddress, http, parseUnits } from "viem"; +import { foundry } from "viem/chains"; import { useAccount, useWriteContract } from "wagmi"; import { useScaffoldContract, useScaffoldReadContract, useScaffoldWriteContract } from "~~/hooks/scaffold-eth"; import { getMetadata } from "~~/utils/scaffold-eth/getMetadata"; -const EP_ADDRESS = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; -const FACTORY_ADDRESS = "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"; +const EP_ADDRESS = "0x4826533B4897376654Bb4d4AD88B7faFD0C98528"; +const FACTORY_ADDRESS = "0x0E801D84Fa97b50751Dbf25036d067dCf18858bF"; const FACTORY_NONCE = 1; +const SMART_ACCOUNT = "0xD4eF5bFBe5925B905BD3EC0921bFe28b04ac61aE"; +const PM_ADDRESS = "0x8f86403A4DE0BB5791fa46B8e795C547942fE4Cf"; const LocalChain: NextPage = () => { const { data: entryPoint } = useScaffoldContract({ contractName: "EntryPoint", }); - const { data: yourContract } = useScaffoldContract({ - contractName: "YourContract", + const { writeContractAsync: handleOpsAsync } = useScaffoldWriteContract("EntryPoint"); + const { writeContractAsync: depositToAsync } = useScaffoldWriteContract("EntryPoint"); + + const { data: accountSimple } = useScaffoldContract({ + contractName: "AccountSimple", + }); + + const { data: accountSimpleFactory } = useScaffoldContract({ + contractName: "AccountSimpleFactory", }); const signer = useAccount(); @@ -35,54 +46,124 @@ const LocalChain: NextPage = () => { args: [sender, BigInt(0)], }); - // const createAccountEncoded = encodeFunctionData({ - // abi: accountSimpleFactory?.abi, - // functionName: "createAccount", - // args: [signer.address], - // }); + let createAccountEncoded = ""; + + if (accountSimpleFactory) { + createAccountEncoded = encodeFunctionData({ + abi: accountSimpleFactory?.abi, + functionName: "createAccount", + args: [signer.address as `0x${string}`], + }); + } + + let executeEncoded = ""; + + if (accountSimple) { + executeEncoded = encodeFunctionData({ + abi: accountSimple?.abi, + functionName: "execute", + }); + } + + let userOp = {} as any; // const createUserOp = async () => { - // if (executeEncoded && createAccountEncoded) { - // // const initCode = "0x"; - // const initCode = accountFactory?.address + createAccountEncoded.slice(2); - - // console.log("InitCode", initCode); - - // // const callData = "0x"; - // const callData = executeEncoded; - - // const userOp = { - // sender, // smart account address - // nonce: nonceFromEP, // nonce from the entrypoint nonce manager - // initCode, - // callData, - // callGasLimit: 500_000, - // verificationGasLimit: 500_000, - // preVerificationGas: 50_000, - // maxFeePerGas: ethers.parseUnits("10", "gwei"), //parseUnits("10", 9), - // maxPriorityFeePerGas: ethers.parseUnits("5", "gwei"), - // paymasterAndData: "0x", - // signature: "0x", - // }; - // setUserOp(userOp); - // console.log(userOp); - // } + if (executeEncoded && createAccountEncoded) { + /// if already SA created then use 0x + const initCode = "0x"; + // const initCode = accountSimpleFactory?.address + createAccountEncoded.slice(2); + + // console.log("InitCode", initCode); + + // const callData = "0x"; + const callData = executeEncoded; + + userOp = { + sender, // smart account address + nonce: nonceFromEP, // nonce from the entrypoint nonce manager + initCode, + callData, + callGasLimit: 500_000, + verificationGasLimit: 500_000, + preVerificationGas: 50_000, + maxFeePerGas: ethers.parseUnits("10", "gwei"), //parseUnits("10", 9), + maxPriorityFeePerGas: ethers.parseUnits("5", "gwei"), + paymasterAndData: PM_ADDRESS, + signature: "0x", + }; + } // }; + /// read count from account + const publicClient = createPublicClient({ + chain: foundry, + transport: http(), + }); + + const getCount = async () => { + if (accountSimple) { + const data = await publicClient.readContract({ + address: SMART_ACCOUNT, + abi: accountSimple?.abi, + functionName: "count", + }); + console.log(data); + } + }; + return ( <>

Local Chain

+ + + ); diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index 7be4eac..085199d 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -6,1313 +6,44 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { 31337: { - EntryPoint: { - address: "0x5fbdb2315678afecb367f032d93f642f64180aa3", + Test: { + address: "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", abi: [ { - type: "receive", - stateMutability: "payable", - }, - { - type: "function", - name: "SIG_VALIDATION_FAILED", - inputs: [], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "_validateSenderAndPaymaster", - inputs: [ - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "view", - }, - { - type: "function", - name: "addStake", - inputs: [ - { - name: "unstakeDelaySec", - type: "uint32", - internalType: "uint32", - }, - ], - outputs: [], - stateMutability: "payable", - }, - { - type: "function", - name: "balanceOf", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "depositTo", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [], - stateMutability: "payable", - }, - { - type: "function", - name: "deposits", - inputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "deposit", - type: "uint112", - internalType: "uint112", - }, - { - name: "staked", - type: "bool", - internalType: "bool", - }, - { - name: "stake", - type: "uint112", - internalType: "uint112", - }, - { - name: "unstakeDelaySec", - type: "uint32", - internalType: "uint32", - }, - { - name: "withdrawTime", - type: "uint48", - internalType: "uint48", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getDepositInfo", - inputs: [ - { - name: "account", - type: "address", - internalType: "address", - }, - ], - outputs: [ - { - name: "info", - type: "tuple", - internalType: "struct IStakeManager.DepositInfo", - components: [ - { - name: "deposit", - type: "uint112", - internalType: "uint112", - }, - { - name: "staked", - type: "bool", - internalType: "bool", - }, - { - name: "stake", - type: "uint112", - internalType: "uint112", - }, - { - name: "unstakeDelaySec", - type: "uint32", - internalType: "uint32", - }, - { - name: "withdrawTime", - type: "uint48", - internalType: "uint48", - }, - ], - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getNonce", - inputs: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "key", - type: "uint192", - internalType: "uint192", - }, - ], - outputs: [ - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "getSenderAddress", + type: "constructor", inputs: [ { - name: "initCode", + name: "sig", type: "bytes", internalType: "bytes", }, ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "getUserOpHash", - inputs: [ - { - name: "userOp", - type: "tuple", - internalType: "struct UserOperation", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - ], - outputs: [ - { - name: "", - type: "bytes32", - internalType: "bytes32", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "handleAggregatedOps", - inputs: [ - { - name: "opsPerAggregator", - type: "tuple[]", - internalType: "struct IEntryPoint.UserOpsPerAggregator[]", - components: [ - { - name: "userOps", - type: "tuple[]", - internalType: "struct UserOperation[]", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "aggregator", - type: "address", - internalType: "contract IAggregator", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "beneficiary", - type: "address", - internalType: "address payable", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "handleOps", - inputs: [ - { - name: "ops", - type: "tuple[]", - internalType: "struct UserOperation[]", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "beneficiary", - type: "address", - internalType: "address payable", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "incrementNonce", - inputs: [ - { - name: "key", - type: "uint192", - internalType: "uint192", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "innerHandleOp", - inputs: [ - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "opInfo", - type: "tuple", - internalType: "struct EntryPoint.UserOpInfo", - components: [ - { - name: "mUserOp", - type: "tuple", - internalType: "struct EntryPoint.MemoryUserOp", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymaster", - type: "address", - internalType: "address", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "userOpHash", - type: "bytes32", - internalType: "bytes32", - }, - { - name: "prefund", - type: "uint256", - internalType: "uint256", - }, - { - name: "contextOffset", - type: "uint256", - internalType: "uint256", - }, - { - name: "preOpGas", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "context", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [ - { - name: "actualGasCost", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "nonceSequenceNumber", - inputs: [ - { - name: "", - type: "address", - internalType: "address", - }, - { - name: "", - type: "uint192", - internalType: "uint192", - }, - ], - outputs: [ - { - name: "", - type: "uint256", - internalType: "uint256", - }, - ], - stateMutability: "view", - }, - { - type: "function", - name: "simulateHandleOp", - inputs: [ - { - name: "op", - type: "tuple", - internalType: "struct UserOperation", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "target", - type: "address", - internalType: "address", - }, - { - name: "targetCallData", - type: "bytes", - internalType: "bytes", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "simulateValidation", - inputs: [ - { - name: "userOp", - type: "tuple", - internalType: "struct UserOperation", - components: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - internalType: "uint256", - }, - { - name: "initCode", - type: "bytes", - internalType: "bytes", - }, - { - name: "callData", - type: "bytes", - internalType: "bytes", - }, - { - name: "callGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "verificationGasLimit", - type: "uint256", - internalType: "uint256", - }, - { - name: "preVerificationGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "maxPriorityFeePerGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paymasterAndData", - type: "bytes", - internalType: "bytes", - }, - { - name: "signature", - type: "bytes", - internalType: "bytes", - }, - ], - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "unlockStake", - inputs: [], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "withdrawStake", - inputs: [ - { - name: "withdrawAddress", - type: "address", - internalType: "address payable", - }, - ], - outputs: [], - stateMutability: "nonpayable", - }, - { - type: "function", - name: "withdrawTo", - inputs: [ - { - name: "withdrawAddress", - type: "address", - internalType: "address payable", - }, - { - name: "withdrawAmount", - type: "uint256", - internalType: "uint256", - }, - ], - outputs: [], stateMutability: "nonpayable", }, - { - type: "event", - name: "AccountDeployed", - inputs: [ - { - name: "userOpHash", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "sender", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "factory", - type: "address", - indexed: false, - internalType: "address", - }, - { - name: "paymaster", - type: "address", - indexed: false, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "BeforeExecution", - inputs: [], - anonymous: false, - }, - { - type: "event", - name: "Deposited", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "totalDeposit", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "SignatureAggregatorChanged", - inputs: [ - { - name: "aggregator", - type: "address", - indexed: true, - internalType: "address", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "StakeLocked", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "totalStaked", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "StakeUnlocked", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "withdrawTime", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "StakeWithdrawn", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "withdrawAddress", - type: "address", - indexed: false, - internalType: "address", - }, - { - name: "amount", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "UserOperationEvent", - inputs: [ - { - name: "userOpHash", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "sender", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "paymaster", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "success", - type: "bool", - indexed: false, - internalType: "bool", - }, - { - name: "actualGasCost", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "actualGasUsed", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "UserOperationRevertReason", - inputs: [ - { - name: "userOpHash", - type: "bytes32", - indexed: true, - internalType: "bytes32", - }, - { - name: "sender", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "nonce", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - { - name: "revertReason", - type: "bytes", - indexed: false, - internalType: "bytes", - }, - ], - anonymous: false, - }, - { - type: "event", - name: "Withdrawn", - inputs: [ - { - name: "account", - type: "address", - indexed: true, - internalType: "address", - }, - { - name: "withdrawAddress", - type: "address", - indexed: false, - internalType: "address", - }, - { - name: "amount", - type: "uint256", - indexed: false, - internalType: "uint256", - }, - ], - anonymous: false, - }, { type: "error", - name: "ExecutionResult", - inputs: [ - { - name: "preOpGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "paid", - type: "uint256", - internalType: "uint256", - }, - { - name: "validAfter", - type: "uint48", - internalType: "uint48", - }, - { - name: "validUntil", - type: "uint48", - internalType: "uint48", - }, - { - name: "targetSuccess", - type: "bool", - internalType: "bool", - }, - { - name: "targetResult", - type: "bytes", - internalType: "bytes", - }, - ], + name: "ECDSAInvalidSignature", + inputs: [], }, { type: "error", - name: "FailedOp", + name: "ECDSAInvalidSignatureLength", inputs: [ { - name: "opIndex", + name: "length", type: "uint256", internalType: "uint256", }, - { - name: "reason", - type: "string", - internalType: "string", - }, - ], - }, - { - type: "error", - name: "SenderAddressResult", - inputs: [ - { - name: "sender", - type: "address", - internalType: "address", - }, - ], - }, - { - type: "error", - name: "SignatureValidationFailed", - inputs: [ - { - name: "aggregator", - type: "address", - internalType: "address", - }, ], }, { type: "error", - name: "ValidationResult", + name: "ECDSAInvalidSignatureS", inputs: [ { - name: "returnInfo", - type: "tuple", - internalType: "struct IEntryPoint.ReturnInfo", - components: [ - { - name: "preOpGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "prefund", - type: "uint256", - internalType: "uint256", - }, - { - name: "sigFailed", - type: "bool", - internalType: "bool", - }, - { - name: "validAfter", - type: "uint48", - internalType: "uint48", - }, - { - name: "validUntil", - type: "uint48", - internalType: "uint48", - }, - { - name: "paymasterContext", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "senderInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "factoryInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "paymasterInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], - }, - { - type: "error", - name: "ValidationResultWithAggregation", - inputs: [ - { - name: "returnInfo", - type: "tuple", - internalType: "struct IEntryPoint.ReturnInfo", - components: [ - { - name: "preOpGas", - type: "uint256", - internalType: "uint256", - }, - { - name: "prefund", - type: "uint256", - internalType: "uint256", - }, - { - name: "sigFailed", - type: "bool", - internalType: "bool", - }, - { - name: "validAfter", - type: "uint48", - internalType: "uint48", - }, - { - name: "validUntil", - type: "uint48", - internalType: "uint48", - }, - { - name: "paymasterContext", - type: "bytes", - internalType: "bytes", - }, - ], - }, - { - name: "senderInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "factoryInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "paymasterInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - { - name: "aggregatorInfo", - type: "tuple", - internalType: "struct IEntryPoint.AggregatorStakeInfo", - components: [ - { - name: "aggregator", - type: "address", - internalType: "address", - }, - { - name: "stakeInfo", - type: "tuple", - internalType: "struct IStakeManager.StakeInfo", - components: [ - { - name: "stake", - type: "uint256", - internalType: "uint256", - }, - { - name: "unstakeDelaySec", - type: "uint256", - internalType: "uint256", - }, - ], - }, - ], + name: "s", + type: "bytes32", + internalType: "bytes32", }, ], },