{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/contracts/core/relayer-fee/libraries/RelayerFeeMessage.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "library RelayerFeeMessage {\n  // ============ Libraries ============\n\n  using TypedMemView for bytes;\n  using TypedMemView for bytes29;\n\n  // ============ Enums ============\n\n  // WARNING: do NOT re-write the numbers / order\n  // of message types in an upgrade;\n  // will cause in-flight messages to be mis-interpreted\n  enum Types {\n    Invalid, // 0\n    ClaimFees // 1\n  }\n\n  // ============ Constants ============\n\n  // before: 1 byte identifier + 20 bytes recipient + 32 bytes length + 32 bytes 1 transfer id = 85 bytes\n  uint256 private constant MIN_CLAIM_LEN = 85;\n  // before: 1 byte identifier + 20 bytes recipient = 21 bytes\n  uint256 private constant LENGTH_ID_START = 21;\n  uint8 private constant LENGTH_ID_LEN = 32;\n  // before: 1 byte identifier\n  uint256 private constant RECIPIENT_START = 1;\n  // before: 1 byte identifier + 20 bytes recipient + 32 bytes length = 53 bytes\n  uint256 private constant TRANSFER_IDS_START = 53;\n  uint8 private constant TRANSFER_ID_LEN = 32;\n\n  // ============ Modifiers ============\n\n  /**\n   * @notice Asserts a message is of type `_t`\n   * @param _view The message\n   * @param _t The expected type\n   */\n  modifier typeAssert(bytes29 _view, Types _t) {\n    _view.assertType(uint40(_t));\n    _;\n  }\n\n  // ============ Formatters ============\n\n  /**\n   * @notice Formats an claim fees message\n   * @param _recipient The address of the relayer\n   * @param _transferIds A group of transfers ids to claim for fee bumps\n   * @return The formatted message\n   */\n  function formatClaimFees(address _recipient, bytes32[] calldata _transferIds) internal pure returns (bytes memory) {\n    return abi.encodePacked(uint8(Types.ClaimFees), _recipient, _transferIds.length, _transferIds);\n  }\n\n  // ============ Getters ============\n\n  /**\n   * @notice Parse the recipient address of the fees\n   * @param _view The message\n   * @return The recipient address\n   */\n  function recipient(bytes29 _view) internal pure typeAssert(_view, Types.ClaimFees) returns (address) {\n    // before = 1 byte identifier\n    return _view.indexAddress(1);\n  }\n\n  /**\n   * @notice Parse The group of transfers ids to claim for fee bumps\n   * @param _view The message\n   * @return The group of transfers ids to claim for fee bumps\n   */\n  function transferIds(bytes29 _view) internal pure typeAssert(_view, Types.ClaimFees) returns (bytes32[] memory) {\n    uint256 length = _view.indexUint(LENGTH_ID_START, LENGTH_ID_LEN);\n\n    bytes32[] memory ids = new bytes32[](length);\n    for (uint256 i = 0; i < length; ) {\n      ids[i] = _view.index(TRANSFER_IDS_START + i * TRANSFER_ID_LEN, TRANSFER_ID_LEN);\n\n      unchecked {\n        i++;\n      }\n    }\n    return ids;\n  }\n\n  /**\n   * @notice Checks that view is a valid message length\n   * @param _view The bytes string\n   * @return TRUE if message is valid\n   */\n  function isValidClaimFeesLength(bytes29 _view) internal pure returns (bool) {\n    uint256 _len = _view.len();\n    // at least 1 transfer id where the excess is multiplier of transfer id length\n    return _len >= MIN_CLAIM_LEN && (_len - TRANSFER_IDS_START) % TRANSFER_ID_LEN == 0;\n  }\n\n  /**\n   * @notice Converts to a ClaimFees\n   * @param _view The message\n   * @return The newly typed message\n   */\n  function tryAsClaimFees(bytes29 _view) internal pure returns (bytes29) {\n    if (isValidClaimFeesLength(_view)) {\n      return _view.castTo(uint40(Types.ClaimFees));\n    }\n    return TypedMemView.nullView();\n  }\n\n  /**\n   * @notice Asserts that the message is of type ClaimFees\n   * @param _view The message\n   * @return The message\n   */\n  function mustBeClaimFees(bytes29 _view) internal pure returns (bytes29) {\n    return tryAsClaimFees(_view).assertValid();\n  }\n}"
}