@owlprotocol/contracts-account-abstraction
Version:
ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.
1,266 lines (1,264 loc) • 78.3 kB
text/typescript
import { SolcMetadata } from "@owlprotocol/viem-utils";
export const IEntryPointSimulations: SolcMetadata = {
compiler: {
version: "0.8.23+commit.f704f362",
},
language: "Solidity",
output: {
abi: [
{
inputs: [
{
internalType: "bool",
name: "success",
type: "bool",
},
{
internalType: "bytes",
name: "ret",
type: "bytes",
},
],
name: "DelegateAndRevert",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "opIndex",
type: "uint256",
},
{
internalType: "string",
name: "reason",
type: "string",
},
],
name: "FailedOp",
type: "error",
},
{
inputs: [
{
internalType: "uint256",
name: "opIndex",
type: "uint256",
},
{
internalType: "string",
name: "reason",
type: "string",
},
{
internalType: "bytes",
name: "inner",
type: "bytes",
},
],
name: "FailedOpWithRevert",
type: "error",
},
{
inputs: [
{
internalType: "bytes",
name: "returnData",
type: "bytes",
},
],
name: "PostOpReverted",
type: "error",
},
{
inputs: [
{
internalType: "address",
name: "sender",
type: "address",
},
],
name: "SenderAddressResult",
type: "error",
},
{
inputs: [
{
internalType: "address",
name: "aggregator",
type: "address",
},
],
name: "SignatureValidationFailed",
type: "error",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "userOpHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "factory",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "paymaster",
type: "address",
},
],
name: "AccountDeployed",
type: "event",
},
{
anonymous: false,
inputs: [],
name: "BeforeExecution",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "totalDeposit",
type: "uint256",
},
],
name: "Deposited",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "userOpHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
indexed: false,
internalType: "bytes",
name: "revertReason",
type: "bytes",
},
],
name: "PostOpRevertReason",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "aggregator",
type: "address",
},
],
name: "SignatureAggregatorChanged",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "totalStaked",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "unstakeDelaySec",
type: "uint256",
},
],
name: "StakeLocked",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "withdrawTime",
type: "uint256",
},
],
name: "StakeUnlocked",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "withdrawAddress",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "StakeWithdrawn",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "userOpHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: true,
internalType: "address",
name: "paymaster",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
indexed: false,
internalType: "bool",
name: "success",
type: "bool",
},
{
indexed: false,
internalType: "uint256",
name: "actualGasCost",
type: "uint256",
},
{
indexed: false,
internalType: "uint256",
name: "actualGasUsed",
type: "uint256",
},
],
name: "UserOperationEvent",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "userOpHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256",
},
],
name: "UserOperationPrefundTooLow",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "bytes32",
name: "userOpHash",
type: "bytes32",
},
{
indexed: true,
internalType: "address",
name: "sender",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
indexed: false,
internalType: "bytes",
name: "revertReason",
type: "bytes",
},
],
name: "UserOperationRevertReason",
type: "event",
},
{
anonymous: false,
inputs: [
{
indexed: true,
internalType: "address",
name: "account",
type: "address",
},
{
indexed: false,
internalType: "address",
name: "withdrawAddress",
type: "address",
},
{
indexed: false,
internalType: "uint256",
name: "amount",
type: "uint256",
},
],
name: "Withdrawn",
type: "event",
},
{
inputs: [
{
internalType: "uint32",
name: "_unstakeDelaySec",
type: "uint32",
},
],
name: "addStake",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "balanceOf",
outputs: [
{
internalType: "uint256",
name: "",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "target",
type: "address",
},
{
internalType: "bytes",
name: "data",
type: "bytes",
},
],
name: "delegateAndRevert",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "depositTo",
outputs: [],
stateMutability: "payable",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "account",
type: "address",
},
],
name: "getDepositInfo",
outputs: [
{
components: [
{
internalType: "uint256",
name: "deposit",
type: "uint256",
},
{
internalType: "bool",
name: "staked",
type: "bool",
},
{
internalType: "uint112",
name: "stake",
type: "uint112",
},
{
internalType: "uint32",
name: "unstakeDelaySec",
type: "uint32",
},
{
internalType: "uint48",
name: "withdrawTime",
type: "uint48",
},
],
internalType: "struct IStakeManager.DepositInfo",
name: "info",
type: "tuple",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint192",
name: "key",
type: "uint192",
},
],
name: "getNonce",
outputs: [
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
],
name: "getSenderAddress",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
{
internalType: "bytes32",
name: "accountGasLimits",
type: "bytes32",
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256",
},
{
internalType: "bytes32",
name: "gasFees",
type: "bytes32",
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct PackedUserOperation",
name: "userOp",
type: "tuple",
},
],
name: "getUserOpHash",
outputs: [
{
internalType: "bytes32",
name: "",
type: "bytes32",
},
],
stateMutability: "view",
type: "function",
},
{
inputs: [
{
components: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
{
internalType: "bytes32",
name: "accountGasLimits",
type: "bytes32",
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256",
},
{
internalType: "bytes32",
name: "gasFees",
type: "bytes32",
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct PackedUserOperation[]",
name: "userOps",
type: "tuple[]",
},
{
internalType: "contract IAggregator",
name: "aggregator",
type: "address",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct IEntryPoint.UserOpsPerAggregator[]",
name: "opsPerAggregator",
type: "tuple[]",
},
{
internalType: "address payable",
name: "beneficiary",
type: "address",
},
],
name: "handleAggregatedOps",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
{
internalType: "bytes32",
name: "accountGasLimits",
type: "bytes32",
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256",
},
{
internalType: "bytes32",
name: "gasFees",
type: "bytes32",
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct PackedUserOperation[]",
name: "ops",
type: "tuple[]",
},
{
internalType: "address payable",
name: "beneficiary",
type: "address",
},
],
name: "handleOps",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "uint192",
name: "key",
type: "uint192",
},
],
name: "incrementNonce",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
{
internalType: "bytes32",
name: "accountGasLimits",
type: "bytes32",
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256",
},
{
internalType: "bytes32",
name: "gasFees",
type: "bytes32",
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct PackedUserOperation",
name: "op",
type: "tuple",
},
],
name: "simulateHandleOp",
outputs: [
{
components: [
{
internalType: "uint256",
name: "preOpGas",
type: "uint256",
},
{
internalType: "uint256",
name: "paid",
type: "uint256",
},
{
internalType: "uint256",
name: "accountValidationData",
type: "uint256",
},
{
internalType: "uint256",
name: "paymasterValidationData",
type: "uint256",
},
{
internalType: "bool",
name: "targetSuccess",
type: "bool",
},
{
internalType: "bytes",
name: "targetResult",
type: "bytes",
},
],
internalType: "struct IEntryPointSimulations.ExecutionResult",
name: "",
type: "tuple",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
components: [
{
internalType: "address",
name: "sender",
type: "address",
},
{
internalType: "uint256",
name: "nonce",
type: "uint256",
},
{
internalType: "bytes",
name: "initCode",
type: "bytes",
},
{
internalType: "bytes",
name: "callData",
type: "bytes",
},
{
internalType: "bytes32",
name: "accountGasLimits",
type: "bytes32",
},
{
internalType: "uint256",
name: "preVerificationGas",
type: "uint256",
},
{
internalType: "bytes32",
name: "gasFees",
type: "bytes32",
},
{
internalType: "bytes",
name: "paymasterAndData",
type: "bytes",
},
{
internalType: "bytes",
name: "signature",
type: "bytes",
},
],
internalType: "struct PackedUserOperation",
name: "userOp",
type: "tuple",
},
],
name: "simulateValidation",
outputs: [
{
components: [
{
components: [
{
internalType: "uint256",
name: "preOpGas",
type: "uint256",
},
{
internalType: "uint256",
name: "prefund",
type: "uint256",
},
{
internalType: "uint256",
name: "accountValidationData",
type: "uint256",
},
{
internalType: "uint256",
name: "paymasterValidationData",
type: "uint256",
},
{
internalType: "bytes",
name: "paymasterContext",
type: "bytes",
},
],
internalType: "struct IEntryPoint.ReturnInfo",
name: "returnInfo",
type: "tuple",
},
{
components: [
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "uint256",
name: "unstakeDelaySec",
type: "uint256",
},
],
internalType: "struct IStakeManager.StakeInfo",
name: "senderInfo",
type: "tuple",
},
{
components: [
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "uint256",
name: "unstakeDelaySec",
type: "uint256",
},
],
internalType: "struct IStakeManager.StakeInfo",
name: "factoryInfo",
type: "tuple",
},
{
components: [
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "uint256",
name: "unstakeDelaySec",
type: "uint256",
},
],
internalType: "struct IStakeManager.StakeInfo",
name: "paymasterInfo",
type: "tuple",
},
{
components: [
{
internalType: "address",
name: "aggregator",
type: "address",
},
{
components: [
{
internalType: "uint256",
name: "stake",
type: "uint256",
},
{
internalType: "uint256",
name: "unstakeDelaySec",
type: "uint256",
},
],
internalType: "struct IStakeManager.StakeInfo",
name: "stakeInfo",
type: "tuple",
},
],
internalType: "struct IEntryPoint.AggregatorStakeInfo",
name: "aggregatorInfo",
type: "tuple",
},
],
internalType: "struct IEntryPointSimulations.ValidationResult",
name: "",
type: "tuple",
},
],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [],
name: "unlockStake",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address payable",
name: "withdrawAddress",
type: "address",
},
],
name: "withdrawStake",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
{
inputs: [
{
internalType: "address payable",
name: "withdrawAddress",
type: "address",
},
{
internalType: "uint256",
name: "withdrawAmount",
type: "uint256",
},
],
name: "withdrawTo",
outputs: [],
stateMutability: "nonpayable",
type: "function",
},
],
devdoc: {
errors: {
"FailedOp(uint256,string)": [
{
params: {
opIndex:
"- Index into the array of ops to the failed one (in simulateValidation, this is always zero).",
reason: '- Revert reason. The string starts with a unique code "AAmn", where "m" is "1" for factory, "2" for account and "3" for paymaster issues, so a failure can be attributed to the correct entity.',
},
},
],
"FailedOpWithRevert(uint256,string,bytes)": [
{
details: "note that inner is truncated to 2048 bytes",
params: {
inner: "- data from inner cought revert reason",
opIndex:
"- Index into the array of ops to the failed one (in simulateValidation, this is always zero).",
reason: "- Revert reason. see FailedOp(uint256,string), above",
},
},
],
"SignatureValidationFailed(address)": [
{
params: {
aggregator: "The aggregator that failed to verify the signature",
},
},
],
},
events: {
"AccountDeployed(bytes32,address,address,address)": {
params: {
factory: "- The factory used to deploy this account (in the initCode)",
paymaster: "- The paymaster used by this UserOp",
sender: "- The account that is deployed",
userOpHash: "- The userOp that deployed this account. UserOperationEvent will follow.",
},
},
"PostOpRevertReason(bytes32,address,uint256,bytes)": {
params: {
nonce: "- The nonce used in the request.",
revertReason: '- The return bytes from the (reverted) call to "callData".',
sender: "- The sender of this request.",
userOpHash: "- The request unique identifier.",
},
},
"SignatureAggregatorChanged(address)": {
params: {
aggregator: "- The aggregator used for the following UserOperationEvents.",
},
},
"UserOperationPrefundTooLow(bytes32,address,uint256)": {
params: {
nonce: "- The nonce used in the request.",
sender: "- The sender of this request.",
userOpHash: "- The request unique identifier.",
},
},
"UserOperationRevertReason(bytes32,address,uint256,bytes)": {
params: {
nonce: "- The nonce used in the request.",
revertReason: '- The return bytes from the (reverted) call to "callData".',
sender: "- The sender of this request.",
userOpHash: "- The request unique identifier.",
},
},
},
kind: "dev",
methods: {
"addStake(uint32)": {
params: {
_unstakeDelaySec: "- The new lock duration before the deposit can be withdrawn.",
},
},
"balanceOf(address)": {
params: {
account: "- The account to query.",
},
returns: {
_0: "- The deposit (for gas payment) of the account.",
},
},
"delegateAndRevert(address,bytes)": {
details:
"calling this method, the EntryPoint will make a delegatecall to the given data, and report (via revert) the result. The method always revert, so is only useful off-chain for dry run calls, in cases where state-override to replace actual EntryPoint code is less convenient.",
params: {
data: "data to pass to target in a delegatecall",
target: "a target contract to make a delegatecall from entrypoint",
},
},
"depositTo(address)": {
params: {
account: "- The account to add to.",
},
},
"getDepositInfo(address)": {
params: {
account: "- The account to query.",
},
returns: {
info: " - Full deposit information of given account.",
},
},
"getNonce(address,uint192)": {
params: {
key: "the high 192 bit of the nonce",
sender: "the account address",
},
returns: {
nonce: "a full nonce to pass for next UserOp with this sender.",
},
},
"getSenderAddress(bytes)": {
params: {
initCode: "- The constructor code to be passed into the UserOperation.",
},
},
"getUserOpHash((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes))": {
params: {
userOp: "- The user operation to generate the request ID for.",
},
returns: {
_0: "hash the hash of this UserOperation",
},
},
"handleAggregatedOps(((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes)[],address,bytes)[],address)":
{
params: {
beneficiary: "- The address to receive the fees.",
opsPerAggregator:
"- The operations to execute, grouped by aggregator (or address(0) for no-aggregator accounts).",
},
},
"handleOps((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes)[],address)": {
params: {
beneficiary: "- The address to receive the fees.",
ops: "- The operations to execute.",
},
},
"simulateHandleOp((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes))": {
params: {
op: "The UserOperation to simulate.",
},
returns: {
_0: "the execution result structure",
},
},
"simulateValidation((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes))": {
details:
"The node must also verify it doesn't use banned opcodes, and that it doesn't reference storage outside the account's data.",
params: {
userOp: "- The user operation to validate.",
},
returns: {
_0: "the validation result structure",
},
},
"withdrawStake(address)": {
params: {
withdrawAddress: "- The address to send withdrawn value.",
},
},
"withdrawTo(address,uint256)": {
params: {
withdrawAddress: "- The address to send withdrawn value.",
withdrawAmount: "- The amount to withdraw.",
},
},
},
version: 1,
},
userdoc: {
errors: {
"FailedOp(uint256,string)": [
{
notice: "A custom revert error of handleOps, to identify the offending op. Should be caught in off-chain handleOps simulation and not happen on-chain. Useful for mitigating DoS attempts against batchers or for troubleshooting of factory/account/paymaster reverts. NOTE: If simulateValidation passes successfully, there should be no reason for handleOps to fail on it.",
},
],
"FailedOpWithRevert(uint256,string,bytes)": [
{
notice: "A custom revert error of handleOps, to report a revert by account or paymaster.",