-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [v0.8-develop, experimental] split up interfaces by type [1/N] (#…
…58)
- Loading branch information
Showing
18 changed files
with
184 additions
and
260 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity ^0.8.25; | ||
|
||
import {IPlugin} from "./IPlugin.sol"; | ||
|
||
interface IExecutionHook is IPlugin { | ||
/// @notice Run the pre execution hook specified by the `functionId`. | ||
/// @dev To indicate the entire call should revert, the function MUST revert. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param sender The caller address. | ||
/// @param value The call value. | ||
/// @param data The calldata sent. | ||
/// @return Context to pass to a post execution hook, if present. An empty bytes array MAY be returned. | ||
function preExecutionHook(uint8 functionId, address sender, uint256 value, bytes calldata data) | ||
external | ||
returns (bytes memory); | ||
|
||
/// @notice Run the post execution hook specified by the `functionId`. | ||
/// @dev To indicate the entire call should revert, the function MUST revert. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param preExecHookData The context returned by its associated pre execution hook. | ||
function postExecutionHook(uint8 functionId, bytes calldata preExecHookData) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity ^0.8.25; | ||
|
||
import {PackedUserOperation} from "@eth-infinitism/account-abstraction/interfaces/PackedUserOperation.sol"; | ||
|
||
import {IPlugin} from "./IPlugin.sol"; | ||
|
||
interface IValidation is IPlugin { | ||
/// @notice Run the user operation validationFunction specified by the `functionId`. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param userOp The user operation. | ||
/// @param userOpHash The user operation hash. | ||
/// @return Packed validation data for validAfter (6 bytes), validUntil (6 bytes), and authorizer (20 bytes). | ||
function validateUserOp(uint8 functionId, PackedUserOperation calldata userOp, bytes32 userOpHash) | ||
external | ||
returns (uint256); | ||
|
||
/// @notice Run the runtime validationFunction specified by the `functionId`. | ||
/// @dev To indicate the entire call should revert, the function MUST revert. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param sender The caller address. | ||
/// @param value The call value. | ||
/// @param data The calldata sent. | ||
function validateRuntime(uint8 functionId, address sender, uint256 value, bytes calldata data) external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-License-Identifier: CC0-1.0 | ||
pragma solidity ^0.8.25; | ||
|
||
import {PackedUserOperation} from "@eth-infinitism/account-abstraction/interfaces/PackedUserOperation.sol"; | ||
|
||
import {IPlugin} from "./IPlugin.sol"; | ||
|
||
interface IValidationHook is IPlugin { | ||
/// @notice Run the pre user operation validation hook specified by the `functionId`. | ||
/// @dev Pre user operation validation hooks MUST NOT return an authorizer value other than 0 or 1. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param userOp The user operation. | ||
/// @param userOpHash The user operation hash. | ||
/// @return Packed validation data for validAfter (6 bytes), validUntil (6 bytes), and authorizer (20 bytes). | ||
function preUserOpValidationHook(uint8 functionId, PackedUserOperation calldata userOp, bytes32 userOpHash) | ||
external | ||
returns (uint256); | ||
|
||
/// @notice Run the pre runtime validation hook specified by the `functionId`. | ||
/// @dev To indicate the entire call should revert, the function MUST revert. | ||
/// @param functionId An identifier that routes the call to different internal implementations, should there be | ||
/// more than one. | ||
/// @param sender The caller address. | ||
/// @param value The call value. | ||
/// @param data The calldata sent. | ||
function preRuntimeValidationHook(uint8 functionId, address sender, uint256 value, bytes calldata data) | ||
external; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.