Files
2023-09-12 16:55:12 +07:00

46 lines
1.9 KiB
Solidity

// 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);
}