@owlprotocol/contracts-account-abstraction
Version:
ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.
726 lines (725 loc) • 26.7 kB
JavaScript
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var functions_exports = {};
__export(functions_exports, {
functions: () => functions
});
module.exports = __toCommonJS(functions_exports);
const functions = [
{
inputs: [],
name: "UPGRADE_INTERFACE_VERSION",
outputs: [{ internalType: "string", name: "", type: "string" }],
stateMutability: "view",
type: "function"
},
{ inputs: [], name: "addDeposit", outputs: [], stateMutability: "payable", type: "function" },
{
inputs: [],
name: "entryPoint",
outputs: [{ internalType: "contract IEntryPoint", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "dest", type: "address" },
{ internalType: "uint256", name: "value", type: "uint256" },
{ internalType: "bytes", name: "func", type: "bytes" }
],
name: "execute",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "address[]", name: "dest", type: "address[]" },
{ internalType: "uint256[]", name: "value", type: "uint256[]" },
{ internalType: "bytes[]", name: "func", type: "bytes[]" }
],
name: "executeBatch",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "getDeposit",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "getNonce",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [{ internalType: "address", name: "anOwner", type: "address" }],
name: "initialize",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "", type: "address" },
{ internalType: "address", name: "", type: "address" },
{ internalType: "uint256[]", name: "", type: "uint256[]" },
{ internalType: "uint256[]", name: "", type: "uint256[]" },
{ internalType: "bytes", name: "", type: "bytes" }
],
name: "onERC1155BatchReceived",
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "", type: "address" },
{ internalType: "address", name: "", type: "address" },
{ internalType: "uint256", name: "", type: "uint256" },
{ internalType: "uint256", name: "", type: "uint256" },
{ internalType: "bytes", name: "", type: "bytes" }
],
name: "onERC1155Received",
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "", type: "address" },
{ internalType: "address", name: "", type: "address" },
{ internalType: "uint256", name: "", type: "uint256" },
{ internalType: "bytes", name: "", type: "bytes" }
],
name: "onERC721Received",
outputs: [{ internalType: "bytes4", name: "", type: "bytes4" }],
stateMutability: "pure",
type: "function"
},
{
inputs: [],
name: "owner",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [],
name: "proxiableUUID",
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
stateMutability: "view",
type: "function"
},
{
inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
name: "supportsInterface",
outputs: [{ internalType: "bool", name: "", type: "bool" }],
stateMutability: "view",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "newImplementation", type: "address" },
{ internalType: "bytes", name: "data", type: "bytes" }
],
name: "upgradeToAndCall",
outputs: [],
stateMutability: "payable",
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"
},
{ internalType: "bytes32", name: "userOpHash", type: "bytes32" },
{ internalType: "uint256", name: "missingAccountFunds", type: "uint256" }
],
name: "validateUserOp",
outputs: [{ internalType: "uint256", name: "validationData", type: "uint256" }],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "address payable", name: "withdrawAddress", type: "address" },
{ internalType: "uint256", name: "amount", type: "uint256" }
],
name: "withdrawDepositTo",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "accountImplementation",
outputs: [{ internalType: "contract SimpleAccount", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "owner", type: "address" },
{ internalType: "uint256", name: "salt", type: "uint256" }
],
name: "createAccount",
outputs: [{ internalType: "contract SimpleAccount", name: "ret", type: "address" }],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "owner", type: "address" },
{ internalType: "uint256", name: "salt", type: "uint256" }
],
name: "getAddress",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
type: "function"
},
{
inputs: [{ internalType: "uint32", name: "unstakeDelaySec", type: "uint32" }],
name: "addStake",
outputs: [],
stateMutability: "payable",
type: "function"
},
{ inputs: [], name: "deposit", outputs: [], stateMutability: "payable", 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"
},
{ internalType: "uint48", name: "validUntil", type: "uint48" },
{ internalType: "uint48", name: "validAfter", type: "uint48" }
],
name: "getHash",
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
stateMutability: "view",
type: "function"
},
{
inputs: [{ internalType: "bytes", name: "paymasterAndData", type: "bytes" }],
name: "parsePaymasterAndData",
outputs: [
{ internalType: "uint48", name: "validUntil", type: "uint48" },
{ internalType: "uint48", name: "validAfter", type: "uint48" },
{ internalType: "bytes", name: "signature", type: "bytes" }
],
stateMutability: "pure",
type: "function"
},
{
inputs: [
{ internalType: "enum IPaymaster.PostOpMode", name: "mode", type: "uint8" },
{ internalType: "bytes", name: "context", type: "bytes" },
{ internalType: "uint256", name: "actualGasCost", type: "uint256" },
{ internalType: "uint256", name: "actualUserOpFeePerGas", type: "uint256" }
],
name: "postOp",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{ inputs: [], name: "renounceOwnership", outputs: [], stateMutability: "nonpayable", type: "function" },
{
inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
name: "transferOwnership",
outputs: [],
stateMutability: "nonpayable",
type: "function"
},
{ inputs: [], name: "unlockStake", 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"
},
{ internalType: "bytes32", name: "userOpHash", type: "bytes32" },
{ internalType: "uint256", name: "maxCost", type: "uint256" }
],
name: "validatePaymasterUserOp",
outputs: [
{ internalType: "bytes", name: "context", type: "bytes" },
{ internalType: "uint256", name: "validationData", type: "uint256" }
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "verifyingSigner",
outputs: [{ internalType: "address", name: "", type: "address" }],
stateMutability: "view",
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: "amount", type: "uint256" }
],
name: "withdrawTo",
outputs: [],
stateMutability: "nonpayable",
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: "", type: "address" }],
name: "deposits",
outputs: [
{ 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" }
],
stateMutability: "view",
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: [
{ internalType: "bytes", name: "callData", type: "bytes" },
{
components: [
{
components: [
{ internalType: "address", name: "sender", type: "address" },
{ internalType: "uint256", name: "nonce", type: "uint256" },
{ internalType: "uint256", name: "verificationGasLimit", type: "uint256" },
{ internalType: "uint256", name: "callGasLimit", type: "uint256" },
{ internalType: "uint256", name: "paymasterVerificationGasLimit", type: "uint256" },
{ internalType: "uint256", name: "paymasterPostOpGasLimit", type: "uint256" },
{ internalType: "uint256", name: "preVerificationGas", type: "uint256" },
{ internalType: "address", name: "paymaster", type: "address" },
{ internalType: "uint256", name: "maxFeePerGas", type: "uint256" },
{ internalType: "uint256", name: "maxPriorityFeePerGas", type: "uint256" }
],
internalType: "struct EntryPoint.MemoryUserOp",
name: "mUserOp",
type: "tuple"
},
{ internalType: "bytes32", name: "userOpHash", type: "bytes32" },
{ internalType: "uint256", name: "prefund", type: "uint256" },
{ internalType: "uint256", name: "contextOffset", type: "uint256" },
{ internalType: "uint256", name: "preOpGas", type: "uint256" }
],
internalType: "struct EntryPoint.UserOpInfo",
name: "opInfo",
type: "tuple"
},
{ internalType: "bytes", name: "context", type: "bytes" }
],
name: "innerHandleOp",
outputs: [{ internalType: "uint256", name: "actualGasCost", type: "uint256" }],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [
{ internalType: "address", name: "", type: "address" },
{ internalType: "uint192", name: "", type: "uint192" }
],
name: "nonceSequenceNumber",
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
stateMutability: "view",
type: "function"
},
{
inputs: [
{ internalType: "address payable", name: "ep", type: "address" },
{ internalType: "bytes[]", name: "data", type: "bytes[]" }
],
name: "simulateEntryPoint",
outputs: [{ internalType: "bytes[]", name: "", type: "bytes[]" }],
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: [
{
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"
},
{ internalType: "address", name: "target", type: "address" },
{ internalType: "bytes", name: "targetCallData", type: "bytes" }
],
name: "simulateCallData",
outputs: [
{
components: [
{ internalType: "uint256", name: "gasUsed", type: "uint256" },
{ internalType: "bool", name: "success", type: "bool" },
{ internalType: "bytes", name: "returnData", type: "bytes" }
],
internalType: "struct IEntryPointSimulations.TargetCallResult",
name: "",
type: "tuple"
}
],
stateMutability: "nonpayable",
type: "function"
},
{
inputs: [],
name: "helloWorld",
outputs: [{ internalType: "string", name: "", type: "string" }],
stateMutability: "pure",
type: "function"
}
];