Functions

constructor

  function constructor(
    uint64 nRoots
  ) public

Create a root store.

Parameters

NameTypeDescription
nRootsuint64The maximum number of roots to store

_addRoot

  function _addRoot(
    uint256 newRoot
  ) internal

Add a root value. Only keep the latest nRoots ones.

Parameters

NameTypeDescription
newRootuint256The value of the new root

_containsRoot

  function _containsRoot(
    uint256 root
  ) internal returns (bool)

Is the root value contained in the store?

Parameters

NameTypeDescription
rootuint256The root value to find

Return Values

ReturnsTypeDescription
uint256True if the root value is in the store, false otherwise

_checkContainsRoot

  function _checkContainsRoot(
    uint256 root
  ) internal

Raise an exception if the root is not present in the store.

Parameters

NameTypeDescription
rootuint256The required root value