Basic

Abs

Name: Abs

Type: integer

Get the absolute value of an integer

Max

Name: Max

Type: integer

Get the largest item from a sequence of integers

Min

Name: Min

Type: integer

Get the smallest item from a sequence of integers

Sum

Name: Sum

Type: integer

Sum over a sequence of integers

Average

Name: Average

Type: integer

Get the average of a sequence of integers.

The average will be rounded down to the closest integer

Median

Name: Median

Type: integer

Get the median of a sequence of integers.

If the sequence has an even number of elements, the lower median will be returned

Flatten

Name: Flatten

Type: list<varies>

Flatten a list of lists.

Unique

Name: Unique

Type: list<varies>

Returns a version of the list where each element appears only once.

The order of the list is preserved. Each element appears at the index of its first occurrence

Len

Name: Len

Type: integer

Get the length of a list

Contains

Name: Contains

Type: boolean

Check whether an item is contained within a list

Zip

Name: Zip

Type: list<tuple<varies, varies>>

"Zip" together two lists of the same type (similar to python's zip method). If the optional truncate is true (defaults to false), the result's length is the minimum of the two. Otherwise, the two lists have to be the same length.

The return value would a list of tuples, each tuple holding 2 values, one from each list.

Aggregate

Name: Aggregate

Type: list<varies>

Aggregates the values of a data source over a specified window

The type of this source depends on the base source provided. See the Example section for more information.

Range

Name: Range

Type: list<integer>

Generate a list of integers within a specified range.

Keccak256

Name: Keccak256

Type: bytes

Calculates the Keccak256 digest of a bytes data source.

Map Contains

Name: MapContains

Type: boolean

Checks if an items exists in a given map

Encode

Name: Encode

Type: bytes

Encode given parameters for a given function signature using ABI.encode

Decode

Name: Decode

Type: tuple<varies>

0Decode given bytes to parameters of a given function signature using ABI.decode

Group

Name: Group

Type: map<varies | tuple<varies>, list<tuple<varies>>>

Group list items by a given criterion based on selected indices.

Last updated