Offer

Git Source

State Variables

_tableId

ResourceId constant _tableId = ResourceId.wrap(0x746200000000000000000000000000004f666665720000000000000000000000);

_fieldLayout

FieldLayout constant _fieldLayout = FieldLayout.wrap(0x004e03000e202000000000000000000000000000000000000000000000000000);

_keySchema

Schema constant _keySchema = Schema.wrap(0x002001005f000000000000000000000000000000000000000000000000000000);

_valueSchema

Schema constant _valueSchema = Schema.wrap(0x004e03004d1f1f00000000000000000000000000000000000000000000000000);

Functions

getKeyNames

Get the table's key field names.

function getKeyNames() internal pure returns (string[] memory keyNames);

Returns

NameTypeDescription
keyNamesstring[]An array of strings with the names of key fields.

getFieldNames

Get the table's value field names.

function getFieldNames() internal pure returns (string[] memory fieldNames);

Returns

NameTypeDescription
fieldNamesstring[]An array of strings with the names of value fields.

register

Register the table with its config.

function register() internal;

_register

Register the table with its config.

function _register() internal;

getMaterialId

Get materialId.

function getMaterialId(bytes32 key) internal view returns (MaterialId materialId);

_getMaterialId

Get materialId.

function _getMaterialId(bytes32 key) internal view returns (MaterialId materialId);

setMaterialId

Set materialId.

function setMaterialId(bytes32 key, MaterialId materialId) internal;

_setMaterialId

Set materialId.

function _setMaterialId(bytes32 key, MaterialId materialId) internal;

getAmount

Get amount.

function getAmount(bytes32 key) internal view returns (uint256 amount);

_getAmount

Get amount.

function _getAmount(bytes32 key) internal view returns (uint256 amount);

setAmount

Set amount.

function setAmount(bytes32 key, uint256 amount) internal;

_setAmount

Set amount.

function _setAmount(bytes32 key, uint256 amount) internal;

getCost

Get cost.

function getCost(bytes32 key) internal view returns (uint256 cost);

_getCost

Get cost.

function _getCost(bytes32 key) internal view returns (uint256 cost);

setCost

Set cost.

function setCost(bytes32 key, uint256 cost) internal;

_setCost

Set cost.

function _setCost(bytes32 key, uint256 cost) internal;

get

Get the full data.

function get(bytes32 key) internal view returns (OfferData memory _table);

_get

Get the full data.

function _get(bytes32 key) internal view returns (OfferData memory _table);

set

Set the full data using individual values.

function set(bytes32 key, MaterialId materialId, uint256 amount, uint256 cost) internal;

_set

Set the full data using individual values.

function _set(bytes32 key, MaterialId materialId, uint256 amount, uint256 cost) internal;

set

Set the full data using the data struct.

function set(bytes32 key, OfferData memory _table) internal;

_set

Set the full data using the data struct.

function _set(bytes32 key, OfferData memory _table) internal;

decodeStatic

Decode the tightly packed blob of static data using this table's field layout.

function decodeStatic(bytes memory _blob) internal pure returns (MaterialId materialId, uint256 amount, uint256 cost);

decode

Decode the tightly packed blobs using this table's field layout.

function decode(bytes memory _staticData, EncodedLengths, bytes memory)
    internal
    pure
    returns (OfferData memory _table);

Parameters

NameTypeDescription
_staticDatabytesTightly packed static fields.
<none>EncodedLengths
<none>bytes

deleteRecord

Delete all data for given keys.

function deleteRecord(bytes32 key) internal;

_deleteRecord

Delete all data for given keys.

function _deleteRecord(bytes32 key) internal;

encodeStatic

Tightly pack static (fixed length) data using this table's schema.

function encodeStatic(MaterialId materialId, uint256 amount, uint256 cost) internal pure returns (bytes memory);

Returns

NameTypeDescription
<none>bytesThe static data, encoded into a sequence of bytes.

encode

Encode all of a record's fields.

function encode(MaterialId materialId, uint256 amount, uint256 cost)
    internal
    pure
    returns (bytes memory, EncodedLengths, bytes memory);

Returns

NameTypeDescription
<none>bytesThe static (fixed length) data, encoded into a sequence of bytes.
<none>EncodedLengthsThe lengths of the dynamic fields (packed into a single bytes32 value).
<none>bytesThe dynamic (variable length) data, encoded into a sequence of bytes.

encodeKeyTuple

Encode keys as a bytes32 array using this table's field layout.

function encodeKeyTuple(bytes32 key) internal pure returns (bytes32[] memory);