{
    "Function": "slitherConstructorConstantVariables",
    "File": "contracts/contracts/core/connext/libraries/LibCrossDomainProperty.sol",
    "Parent Contracts": [],
    "High-Level Calls": [],
    "Internal Calls": [],
    "Library Calls": [],
    "Low-Level Calls": [],
    "Code": "library LibCrossDomainProperty {\n  // ============ Libraries ============\n\n  using TypedMemView for bytes29;\n  using TypedMemView for bytes;\n\n  // ============ Enums ============\n\n  /**\n   * Contains information so the properties can be type-checked properly\n   */\n  enum Types {\n    Invalid, // 0\n    DomainAndSender // 1\n  }\n\n  // ============ Structs ============\n\n  /**\n   * Struct containing the domain and an address of the caller of a function on that\n   * domain.\n   */\n  struct DomainAndSender {\n    uint32 domain;\n    address sender;\n  }\n\n  // ============ Constants ============\n\n  uint256 private constant PROPERTY_LEN = 25; // 1 byte identifer + 4 bytes domain + 20 bytes address\n  // default value is the TypedMemView null view\n  bytes29 public constant EMPTY = hex\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\";\n  bytes public constant EMPTY_BYTES = hex\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\";\n\n  // ============ Modifiers ============\n\n  /**\n   * @notice Asserts a property is of type `_t`\n   * @param _view The stored property\n   * @param _t The expected type\n   */\n  modifier typeAssert(bytes29 _view, Types _t) {\n    _view.assertType(uint40(_t));\n    _;\n  }\n\n  // ============ Internal Functions ============\n\n  /**\n   * @notice Checks that view is a valid property length\n   * @param _view The bytes string\n   * @return TRUE if length is valid\n   */\n  function isValidPropertyLength(bytes29 _view) internal pure returns (bool) {\n    uint256 _len = _view.len();\n    return _len == PROPERTY_LEN;\n  }\n\n  /**\n   * @notice Checks that the property is of the specified type\n   * @param _type the type to check for\n   * @param _property The property\n   * @return True if the property is of the specified type\n   */\n  function isType(bytes29 _property, Types _type) internal pure returns (bool) {\n    return propertyType(_property) == uint8(_type);\n  }\n\n  /**\n   * @notice Checks that the property is of type DomainAndSender\n   * @param _property The property\n   * @return True if the property is of type DomainAndSender\n   */\n  function isDomainAndSender(bytes29 _property) internal pure returns (bool) {\n    return isValidPropertyLength(_property) && isType(_property, Types.DomainAndSender);\n  }\n\n  /**\n   * @notice Retrieves the identifier from property\n   * @param _property The property\n   * @return The property type\n   */\n  function propertyType(bytes29 _property) internal pure returns (uint8) {\n    return uint8(_property.indexUint(0, 1));\n  }\n\n  /**\n   * @notice Converts to a Property\n   * @param _view The property\n   * @return The newly typed property\n   */\n  function tryAsProperty(bytes29 _view) internal pure returns (bytes29) {\n    if (isValidPropertyLength(_view)) {\n      return _view.castTo(uint40(Types.DomainAndSender));\n    }\n    return TypedMemView.nullView();\n  }\n\n  /**\n   * @notice Asserts that the property is of type DomainAndSender\n   * @param _view The property\n   * @return The property\n   */\n  function mustBeProperty(bytes29 _view) internal pure returns (bytes29) {\n    return tryAsProperty(_view).assertValid();\n  }\n\n  /**\n   * @notice Retrieves the sender from a property\n   * @param _property The property\n   * @return The sender address\n   */\n  function sender(bytes29 _property) internal pure typeAssert(_property, Types.DomainAndSender) returns (address) {\n    // before = 1 byte id + 4 bytes domain = 5 bytes\n    return _property.indexAddress(5);\n  }\n\n  /**\n   * @notice Retrieves the domain from a property\n   * @param _property The property\n   * @return The sender address\n   */\n  function domain(bytes29 _property) internal pure typeAssert(_property, Types.DomainAndSender) returns (uint32) {\n    // before = 1 byte identifier = 1 byte\n    return uint32(_property.indexUint(1, 4));\n  }\n\n  /**\n   * @notice Creates a serialized property from components\n   * @param _domain The domain\n   * @param _sender The sender\n   * @return The formatted view\n   */\n  function formatDomainAndSender(uint32 _domain, address _sender) internal pure returns (bytes29) {\n    return abi.encodePacked(Types.DomainAndSender, _domain, _sender).ref(0).castTo(uint40(Types.DomainAndSender));\n  }\n\n  /**\n   * @notice Creates a serialized property from components\n   * @param _domain The domain\n   * @param _sender The sender\n   * @return The formatted view\n   */\n  function formatDomainAndSenderBytes(uint32 _domain, address _sender) internal pure returns (bytes memory) {\n    return abi.encodePacked(Types.DomainAndSender, _domain, _sender);\n  }\n\n  /**\n   * @notice Creates a serialized property from components\n   * @param _property The bytes representation of the property\n   */\n  function parseDomainAndSenderBytes(bytes memory _property) internal pure returns (bytes29) {\n    return mustBeProperty(_property.ref(0));\n  }\n}"
}