// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {CheckpointExtensionBase} from "./CheckpointExtensionBase.sol";
import {CheckpointStorage} from "../storage/CheckpointStorage.sol";

/// @notice ERC-4337 paymaster routing hints (no execution on-chain).
contract PaymasterHintExtension is CheckpointExtensionBase {
    event PaymasterHint(uint64 indexed batchId, address indexed account, address paymaster, uint256 maxCost);

    function HOOK_BEFORE_SUBMIT() external pure override returns (uint32) {
        return 0;
    }

    function HOOK_AFTER_SUBMIT() external pure override returns (uint32) {
        return 1 << 1;
    }

    function HOOK_ON_CCIP() external pure override returns (uint32) {
        return 0;
    }

    function beforeSubmit(CheckpointStorage.CheckpointHeader calldata, bytes calldata) external pure override {}

    function afterSubmit(CheckpointStorage.CheckpointHeader calldata header, bytes calldata data) external {
        if (data.length == 0) return;
        (address account, address paymaster, uint256 maxCost) = abi.decode(data, (address, address, uint256));
        emit PaymasterHint(header.batchId, account, paymaster, maxCost);
    }

    function onCCIPReceive(bytes calldata) external pure override {}
}
