-
Notifications
You must be signed in to change notification settings - Fork 69
/
ISessionValidationModule.sol
45 lines (41 loc) · 1.87 KB
/
ISessionValidationModule.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "../BaseAuthorizationModule.sol";
import {UserOperation} from "@account-abstraction/contracts/interfaces/UserOperation.sol";
abstract contract ISessionValidationModule {
// execute(address,uint256,bytes)
bytes4 public constant EXECUTE_SELECTOR = 0xb61d27f6;
// execute_ncC(address,uint256,bytes)
bytes4 public constant EXECUTE_OPTIMIZED_SELECTOR = 0x0000189a;
/**
* @dev validates if the _op (UserOperation) matches the SessionKey permissions
* and that _op has been signed by this SessionKey
* @param _op User Operation to be validated.
* @param _userOpHash Hash of the User Operation to be validated.
* @param _sessionKeyData SessionKey data, that describes sessionKey permissions
* @param _sessionKeySignature Signature over the the _userOpHash.
* @return true if the _op is valid, false otherwise.
*/
function validateSessionUserOp(
UserOperation calldata _op,
bytes32 _userOpHash,
bytes calldata _sessionKeyData,
bytes calldata _sessionKeySignature
) external virtual returns (bool);
/**
* @dev validates that the call (destinationContract, callValue, funcCallData)
* complies with the Session Key permissions represented by sessionKeyData
* @param destinationContract address of the contract to be called
* @param callValue value to be sent with the call
* @param funcCallData the data for the call.
* is parsed inside the Session Validation Module (SVM)
* @param sessionKeyData SessionKey data, that describes sessionKey permissions
*/
function validateSessionParams(
address destinationContract,
uint256 callValue,
bytes calldata funcCallData,
bytes calldata sessionKeyData,
bytes calldata callSpecificData
) external virtual returns (address);
}