Functions

constructor

  function constructor(
    uint8 merkleTreeHeight
  ) public

Create a records Merkle tree of the given height.

Parameters

NameTypeDescription
merkleTreeHeightuint8The height

_buildTreeFromFrontier

  function _buildTreeFromFrontier(
    struct RecordsMerkleTree.Node[] nodes
  ) internal returns (uint64)

Create a Merkle tree from the given frontier.

Parameters

NameTypeDescription
nodesstruct RecordsMerkleTree.Node[]The list of nodes to be filled or updated

Return Values

ReturnsTypeDescription
struct RecordsMerkleTree.Node[]cursor to the root node of the create tree

updateRecordsMerkleTree

  function updateRecordsMerkleTree(
    uint256[] elements
  ) external

Update the state of the record merkle tree by inserting new elements.

Parameters

NameTypeDescription
elementsuint256[]The list of elements to be appended to the current merkle tree described by the frontier.

getRootValue

  function getRootValue(
  ) external returns (uint256)

Returns the root value of the Merkle tree.


getHeight

  function getHeight(
  ) external returns (uint8)

Returns the height of the Merkle tree.


getNumLeaves

  function getNumLeaves(
  ) external returns (uint64)

Returns the number of leaves of the Merkle tree.