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

/**
 * @title CheckpointFlags
 * @notice Bitfield for CheckpointHeader.flags — extensible without upgrades when bits are reserved.
 */
library CheckpointFlags {
    uint32 internal constant PARTIAL_BATCH = 1 << 0;
    uint32 internal constant CALLDATA_ONLY = 1 << 1;
    uint32 internal constant CCIP_INGRESS = 1 << 2;
    uint32 internal constant RELAYER_SUBMIT = 1 << 3;
    uint32 internal constant HAS_CONTENT_URI = 1 << 4;
    uint32 internal constant HAS_RECEIPTS_ROOT = 1 << 5;
    uint32 internal constant EMERGENCY = 1 << 6;

    function has(uint32 flags, uint32 bit) internal pure returns (bool) {
        return flags & bit != 0;
    }
}
