UNPKG

@owlprotocol/contracts-account-abstraction

Version:

ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.

149 lines (147 loc) 11.3 kB
import { SolcMetadata } from "@owlprotocol/viem-utils"; export const IAccount: SolcMetadata = { compiler: { version: "0.8.23+commit.f704f362", }, language: "Solidity", output: { abi: [ { 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", }, ], devdoc: { kind: "dev", methods: { "validateUserOp((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes),bytes32,uint256)": { details: "Must validate caller is the entryPoint. Must validate the signature and nonce", params: { missingAccountFunds: '- Missing funds on the account\'s deposit in the entrypoint. This is the minimum amount to transfer to the sender(entryPoint) to be able to make the call. The excess is left as a deposit in the entrypoint for future calls. Can be withdrawn anytime using "entryPoint.withdrawTo()". In case there is a paymaster in the request (or the current deposit is high enough), this value will be zero.', userOp: "- The operation that is about to be executed.", userOpHash: "- Hash of the user's request data. can be used as the basis for signature.", }, returns: { validationData: ' - Packaged ValidationData structure. use `_packValidationData` and `_unpackValidationData` to encode and decode. <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure, otherwise, an address of an "authorizer" contract. <6-byte> validUntil - Last timestamp this operation is valid. 0 for "indefinite" <6-byte> validAfter - First timestamp this operation is valid If an account doesn\'t use time-range, it is enough to return SIG_VALIDATION_FAILED value (1) for signature failure. Note that the validation code cannot use block.timestamp (or block.number) directly.', }, }, }, version: 1, }, userdoc: { kind: "user", methods: { "validateUserOp((address,uint256,bytes,bytes,bytes32,uint256,bytes32,bytes,bytes),bytes32,uint256)": { notice: 'Validate user\'s signature and nonce the entryPoint will make the call to the recipient only if this validation call returns successfully. signature failure should be reported by returning SIG_VALIDATION_FAILED (1). This allows making a "simulation call" without a valid signature Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.', }, }, version: 1, }, }, settings: { compilationTarget: { "@account-abstraction/contracts/interfaces/IAccount.sol": "IAccount", }, evmVersion: "paris", libraries: {}, metadata: { bytecodeHash: "ipfs", useLiteralContent: true, }, optimizer: { enabled: true, runs: 1000000, }, remappings: [], viaIR: true, }, sources: { "@account-abstraction/contracts/interfaces/IAccount.sol": { content: '// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\nimport "./PackedUserOperation.sol";\n\ninterface IAccount {\n /**\n * Validate user\'s signature and nonce\n * the entryPoint will make the call to the recipient only if this validation call returns successfully.\n * signature failure should be reported by returning SIG_VALIDATION_FAILED (1).\n * This allows making a "simulation call" without a valid signature\n * Other failures (e.g. nonce mismatch, or invalid signature format) should still revert to signal failure.\n *\n * @dev Must validate caller is the entryPoint.\n * Must validate the signature and nonce\n * @param userOp - The operation that is about to be executed.\n * @param userOpHash - Hash of the user\'s request data. can be used as the basis for signature.\n * @param missingAccountFunds - Missing funds on the account\'s deposit in the entrypoint.\n * This is the minimum amount to transfer to the sender(entryPoint) to be\n * able to make the call. The excess is left as a deposit in the entrypoint\n * for future calls. Can be withdrawn anytime using "entryPoint.withdrawTo()".\n * In case there is a paymaster in the request (or the current deposit is high\n * enough), this value will be zero.\n * @return validationData - Packaged ValidationData structure. use `_packValidationData` and\n * `_unpackValidationData` to encode and decode.\n * <20-byte> sigAuthorizer - 0 for valid signature, 1 to mark signature failure,\n * otherwise, an address of an "authorizer" contract.\n * <6-byte> validUntil - Last timestamp this operation is valid. 0 for "indefinite"\n * <6-byte> validAfter - First timestamp this operation is valid\n * If an account doesn\'t use time-range, it is enough to\n * return SIG_VALIDATION_FAILED value (1) for signature failure.\n * Note that the validation code cannot use block.timestamp (or block.number) directly.\n */\n function validateUserOp(\n PackedUserOperation calldata userOp,\n bytes32 userOpHash,\n uint256 missingAccountFunds\n ) external returns (uint256 validationData);\n}\n', keccak256: "0x38710bec0cb20ff4ceef46a80475b5bdabc27b7efd2687fd473db68332f61b78", license: "GPL-3.0", }, "@account-abstraction/contracts/interfaces/PackedUserOperation.sol": { content: "// SPDX-License-Identifier: GPL-3.0\npragma solidity >=0.7.5;\n\n/**\n * User Operation struct\n * @param sender - The sender account of this request.\n * @param nonce - Unique value the sender uses to verify it is not a replay.\n * @param initCode - If set, the account contract will be created by this constructor/\n * @param callData - The method call to execute on this account.\n * @param accountGasLimits - Packed gas limits for validateUserOp and gas limit passed to the callData method call.\n * @param preVerificationGas - Gas not calculated by the handleOps method, but added to the gas paid.\n * Covers batch overhead.\n * @param gasFees - packed gas fields maxPriorityFeePerGas and maxFeePerGas - Same as EIP-1559 gas parameters.\n * @param paymasterAndData - If set, this field holds the paymaster address, verification gas limit, postOp gas limit and paymaster-specific extra data\n * The paymaster will pay for the transaction instead of the sender.\n * @param signature - Sender-verified signature over the entire request, the EntryPoint address and the chain ID.\n */\nstruct PackedUserOperation {\n address sender;\n uint256 nonce;\n bytes initCode;\n bytes callData;\n bytes32 accountGasLimits;\n uint256 preVerificationGas;\n bytes32 gasFees;\n bytes paymasterAndData;\n bytes signature;\n}\n", keccak256: "0x1129b46381db68eddbc5cb49e50664667b66b03c480453858e7b25eabe444359", license: "GPL-3.0", }, }, version: 1, };