// SPDX-License-Identifier: MIT pragma solidity >=0.8.24; /* Autogenerated file. Do not edit manually. */ // Import store internals import { IStore } from "@latticexyz/store/src/IStore.sol"; import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol"; import { StoreCore } from "@latticexyz/store/src/StoreCore.sol"; import { Bytes } from "@latticexyz/store/src/Bytes.sol"; import { Memory } from "@latticexyz/store/src/Memory.sol"; import { SliceLib } from "@latticexyz/store/src/Slice.sol"; import { EncodeArray } from "@latticexyz/store/src/tightcoder/EncodeArray.sol"; import { FieldLayout } from "@latticexyz/store/src/FieldLayout.sol"; import { Schema } from "@latticexyz/store/src/Schema.sol"; import { EncodedLengths, EncodedLengthsLib } from "@latticexyz/store/src/EncodedLengths.sol"; import { ResourceId } from "@latticexyz/store/src/ResourceId.sol"; struct EntityRecordMetadataData { string name; string dappURL; string description; } library EntityRecordMetadata { // Hex below is the result of `WorldResourceIdLib.encode({ namespace: "evefrontier", name: "EntityRecordMeta", typeId: RESOURCE_TABLE });` ResourceId constant _tableId = ResourceId.wrap(0x746265766566726f6e74696572000000456e746974795265636f72644d657461); FieldLayout constant _fieldLayout = FieldLayout.wrap(0x0000000300000000000000000000000000000000000000000000000000000000); // Hex-encoded key schema of (uint256) Schema constant _keySchema = Schema.wrap(0x002001001f000000000000000000000000000000000000000000000000000000); // Hex-encoded value schema of (string, string, string) Schema constant _valueSchema = Schema.wrap(0x00000003c5c5c500000000000000000000000000000000000000000000000000); /** * @notice Get the table's key field names. * @return keyNames An array of strings with the names of key fields. */ function getKeyNames() internal pure returns (string[] memory keyNames) { keyNames = new string[](1); keyNames[0] = "smartObjectId"; } /** * @notice Get the table's value field names. * @return fieldNames An array of strings with the names of value fields. */ function getFieldNames() internal pure returns (string[] memory fieldNames) { fieldNames = new string[](3); fieldNames[0] = "name"; fieldNames[1] = "dappURL"; fieldNames[2] = "description"; } /** * @notice Register the table with its config. */ function register() internal { StoreSwitch.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames()); } /** * @notice Register the table with its config. */ function _register() internal { StoreCore.registerTable(_tableId, _fieldLayout, _keySchema, _valueSchema, getKeyNames(), getFieldNames()); } /** * @notice Get name. */ function getName(uint256 smartObjectId) internal view returns (string memory name) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreSwitch.getDynamicField(_tableId, _keyTuple, 0); return (string(_blob)); } /** * @notice Get name. */ function _getName(uint256 smartObjectId) internal view returns (string memory name) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreCore.getDynamicField(_tableId, _keyTuple, 0); return (string(_blob)); } /** * @notice Set name. */ function setName(uint256 smartObjectId, string memory name) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.setDynamicField(_tableId, _keyTuple, 0, bytes((name))); } /** * @notice Set name. */ function _setName(uint256 smartObjectId, string memory name) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.setDynamicField(_tableId, _keyTuple, 0, bytes((name))); } /** * @notice Get the length of name. */ function lengthName(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreSwitch.getDynamicFieldLength(_tableId, _keyTuple, 0); unchecked { return _byteLength / 1; } } /** * @notice Get the length of name. */ function _lengthName(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreCore.getDynamicFieldLength(_tableId, _keyTuple, 0); unchecked { return _byteLength / 1; } } /** * @notice Get an item of name. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function getItemName(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreSwitch.getDynamicFieldSlice(_tableId, _keyTuple, 0, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Get an item of name. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function _getItemName(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreCore.getDynamicFieldSlice(_tableId, _keyTuple, 0, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Push a slice to name. */ function pushName(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 0, bytes((_slice))); } /** * @notice Push a slice to name. */ function _pushName(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.pushToDynamicField(_tableId, _keyTuple, 0, bytes((_slice))); } /** * @notice Pop a slice from name. */ function popName(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 0, 1); } /** * @notice Pop a slice from name. */ function _popName(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.popFromDynamicField(_tableId, _keyTuple, 0, 1); } /** * @notice Update a slice of name at `_index`. */ function updateName(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreSwitch.spliceDynamicData(_tableId, _keyTuple, 0, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Update a slice of name at `_index`. */ function _updateName(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreCore.spliceDynamicData(_tableId, _keyTuple, 0, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Get dappURL. */ function getDappURL(uint256 smartObjectId) internal view returns (string memory dappURL) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreSwitch.getDynamicField(_tableId, _keyTuple, 1); return (string(_blob)); } /** * @notice Get dappURL. */ function _getDappURL(uint256 smartObjectId) internal view returns (string memory dappURL) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreCore.getDynamicField(_tableId, _keyTuple, 1); return (string(_blob)); } /** * @notice Set dappURL. */ function setDappURL(uint256 smartObjectId, string memory dappURL) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.setDynamicField(_tableId, _keyTuple, 1, bytes((dappURL))); } /** * @notice Set dappURL. */ function _setDappURL(uint256 smartObjectId, string memory dappURL) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.setDynamicField(_tableId, _keyTuple, 1, bytes((dappURL))); } /** * @notice Get the length of dappURL. */ function lengthDappURL(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreSwitch.getDynamicFieldLength(_tableId, _keyTuple, 1); unchecked { return _byteLength / 1; } } /** * @notice Get the length of dappURL. */ function _lengthDappURL(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreCore.getDynamicFieldLength(_tableId, _keyTuple, 1); unchecked { return _byteLength / 1; } } /** * @notice Get an item of dappURL. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function getItemDappURL(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreSwitch.getDynamicFieldSlice(_tableId, _keyTuple, 1, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Get an item of dappURL. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function _getItemDappURL(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreCore.getDynamicFieldSlice(_tableId, _keyTuple, 1, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Push a slice to dappURL. */ function pushDappURL(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } /** * @notice Push a slice to dappURL. */ function _pushDappURL(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.pushToDynamicField(_tableId, _keyTuple, 1, bytes((_slice))); } /** * @notice Pop a slice from dappURL. */ function popDappURL(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 1, 1); } /** * @notice Pop a slice from dappURL. */ function _popDappURL(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.popFromDynamicField(_tableId, _keyTuple, 1, 1); } /** * @notice Update a slice of dappURL at `_index`. */ function updateDappURL(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreSwitch.spliceDynamicData(_tableId, _keyTuple, 1, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Update a slice of dappURL at `_index`. */ function _updateDappURL(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreCore.spliceDynamicData(_tableId, _keyTuple, 1, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Get description. */ function getDescription(uint256 smartObjectId) internal view returns (string memory description) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreSwitch.getDynamicField(_tableId, _keyTuple, 2); return (string(_blob)); } /** * @notice Get description. */ function _getDescription(uint256 smartObjectId) internal view returns (string memory description) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); bytes memory _blob = StoreCore.getDynamicField(_tableId, _keyTuple, 2); return (string(_blob)); } /** * @notice Set description. */ function setDescription(uint256 smartObjectId, string memory description) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.setDynamicField(_tableId, _keyTuple, 2, bytes((description))); } /** * @notice Set description. */ function _setDescription(uint256 smartObjectId, string memory description) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.setDynamicField(_tableId, _keyTuple, 2, bytes((description))); } /** * @notice Get the length of description. */ function lengthDescription(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreSwitch.getDynamicFieldLength(_tableId, _keyTuple, 2); unchecked { return _byteLength / 1; } } /** * @notice Get the length of description. */ function _lengthDescription(uint256 smartObjectId) internal view returns (uint256) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); uint256 _byteLength = StoreCore.getDynamicFieldLength(_tableId, _keyTuple, 2); unchecked { return _byteLength / 1; } } /** * @notice Get an item of description. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function getItemDescription(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreSwitch.getDynamicFieldSlice(_tableId, _keyTuple, 2, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Get an item of description. * @dev Reverts with Store_IndexOutOfBounds if `_index` is out of bounds for the array. */ function _getItemDescription(uint256 smartObjectId, uint256 _index) internal view returns (string memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _blob = StoreCore.getDynamicFieldSlice(_tableId, _keyTuple, 2, _index * 1, (_index + 1) * 1); return (string(_blob)); } } /** * @notice Push a slice to description. */ function pushDescription(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.pushToDynamicField(_tableId, _keyTuple, 2, bytes((_slice))); } /** * @notice Push a slice to description. */ function _pushDescription(uint256 smartObjectId, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.pushToDynamicField(_tableId, _keyTuple, 2, bytes((_slice))); } /** * @notice Pop a slice from description. */ function popDescription(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.popFromDynamicField(_tableId, _keyTuple, 2, 1); } /** * @notice Pop a slice from description. */ function _popDescription(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.popFromDynamicField(_tableId, _keyTuple, 2, 1); } /** * @notice Update a slice of description at `_index`. */ function updateDescription(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreSwitch.spliceDynamicData(_tableId, _keyTuple, 2, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Update a slice of description at `_index`. */ function _updateDescription(uint256 smartObjectId, uint256 _index, string memory _slice) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); unchecked { bytes memory _encoded = bytes((_slice)); StoreCore.spliceDynamicData(_tableId, _keyTuple, 2, uint40(_index * 1), uint40(_encoded.length), _encoded); } } /** * @notice Get the full data. */ function get(uint256 smartObjectId) internal view returns (EntityRecordMetadataData memory _table) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); (bytes memory _staticData, EncodedLengths _encodedLengths, bytes memory _dynamicData) = StoreSwitch.getRecord( _tableId, _keyTuple, _fieldLayout ); return decode(_staticData, _encodedLengths, _dynamicData); } /** * @notice Get the full data. */ function _get(uint256 smartObjectId) internal view returns (EntityRecordMetadataData memory _table) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); (bytes memory _staticData, EncodedLengths _encodedLengths, bytes memory _dynamicData) = StoreCore.getRecord( _tableId, _keyTuple, _fieldLayout ); return decode(_staticData, _encodedLengths, _dynamicData); } /** * @notice Set the full data using individual values. */ function set(uint256 smartObjectId, string memory name, string memory dappURL, string memory description) internal { bytes memory _staticData; EncodedLengths _encodedLengths = encodeLengths(name, dappURL, description); bytes memory _dynamicData = encodeDynamic(name, dappURL, description); bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData); } /** * @notice Set the full data using individual values. */ function _set(uint256 smartObjectId, string memory name, string memory dappURL, string memory description) internal { bytes memory _staticData; EncodedLengths _encodedLengths = encodeLengths(name, dappURL, description); bytes memory _dynamicData = encodeDynamic(name, dappURL, description); bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData, _fieldLayout); } /** * @notice Set the full data using the data struct. */ function set(uint256 smartObjectId, EntityRecordMetadataData memory _table) internal { bytes memory _staticData; EncodedLengths _encodedLengths = encodeLengths(_table.name, _table.dappURL, _table.description); bytes memory _dynamicData = encodeDynamic(_table.name, _table.dappURL, _table.description); bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData); } /** * @notice Set the full data using the data struct. */ function _set(uint256 smartObjectId, EntityRecordMetadataData memory _table) internal { bytes memory _staticData; EncodedLengths _encodedLengths = encodeLengths(_table.name, _table.dappURL, _table.description); bytes memory _dynamicData = encodeDynamic(_table.name, _table.dappURL, _table.description); bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.setRecord(_tableId, _keyTuple, _staticData, _encodedLengths, _dynamicData, _fieldLayout); } /** * @notice Decode the tightly packed blob of dynamic data using the encoded lengths. */ function decodeDynamic( EncodedLengths _encodedLengths, bytes memory _blob ) internal pure returns (string memory name, string memory dappURL, string memory description) { uint256 _start; uint256 _end; unchecked { _end = _encodedLengths.atIndex(0); } name = (string(SliceLib.getSubslice(_blob, _start, _end).toBytes())); _start = _end; unchecked { _end += _encodedLengths.atIndex(1); } dappURL = (string(SliceLib.getSubslice(_blob, _start, _end).toBytes())); _start = _end; unchecked { _end += _encodedLengths.atIndex(2); } description = (string(SliceLib.getSubslice(_blob, _start, _end).toBytes())); } /** * @notice Decode the tightly packed blobs using this table's field layout. * * @param _encodedLengths Encoded lengths of dynamic fields. * @param _dynamicData Tightly packed dynamic fields. */ function decode( bytes memory, EncodedLengths _encodedLengths, bytes memory _dynamicData ) internal pure returns (EntityRecordMetadataData memory _table) { (_table.name, _table.dappURL, _table.description) = decodeDynamic(_encodedLengths, _dynamicData); } /** * @notice Delete all data for given keys. */ function deleteRecord(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreSwitch.deleteRecord(_tableId, _keyTuple); } /** * @notice Delete all data for given keys. */ function _deleteRecord(uint256 smartObjectId) internal { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); StoreCore.deleteRecord(_tableId, _keyTuple, _fieldLayout); } /** * @notice Tightly pack dynamic data lengths using this table's schema. * @return _encodedLengths The lengths of the dynamic fields (packed into a single bytes32 value). */ function encodeLengths( string memory name, string memory dappURL, string memory description ) internal pure returns (EncodedLengths _encodedLengths) { // Lengths are effectively checked during copy by 2**40 bytes exceeding gas limits unchecked { _encodedLengths = EncodedLengthsLib.pack(bytes(name).length, bytes(dappURL).length, bytes(description).length); } } /** * @notice Tightly pack dynamic (variable length) data using this table's schema. * @return The dynamic data, encoded into a sequence of bytes. */ function encodeDynamic( string memory name, string memory dappURL, string memory description ) internal pure returns (bytes memory) { return abi.encodePacked(bytes((name)), bytes((dappURL)), bytes((description))); } /** * @notice Encode all of a record's fields. * @return The static (fixed length) data, encoded into a sequence of bytes. * @return The lengths of the dynamic fields (packed into a single bytes32 value). * @return The dynamic (variable length) data, encoded into a sequence of bytes. */ function encode( string memory name, string memory dappURL, string memory description ) internal pure returns (bytes memory, EncodedLengths, bytes memory) { bytes memory _staticData; EncodedLengths _encodedLengths = encodeLengths(name, dappURL, description); bytes memory _dynamicData = encodeDynamic(name, dappURL, description); return (_staticData, _encodedLengths, _dynamicData); } /** * @notice Encode keys as a bytes32 array using this table's field layout. */ function encodeKeyTuple(uint256 smartObjectId) internal pure returns (bytes32[] memory) { bytes32[] memory _keyTuple = new bytes32[](1); _keyTuple[0] = bytes32(uint256(smartObjectId)); return _keyTuple; } }