Skip to main content

Index

Table of contents

Contracts

Libraries

Interfaces

Structs

Variables

Functions

Variables

BASIS_POINT_MAX

Const BASIS_POINT_MAX: 10000

Defined in

assembly/libraries/Constants.ts:5


DELIMITER

Const DELIMITER: ":"

Defined in

assembly/libraries/Utils.ts:15


EVENT_DELIMITER

Const EVENT_DELIMITER: ";?!"

Defined in

assembly/libraries/Utils.ts:100


ID_ONE

Const ID_ONE: u32

Defined in

assembly/libraries/Constants.ts:4


MAX_BIN_STEP

Const MAX_BIN_STEP: 100

Defined in

assembly/libraries/Constants.ts:10


MAX_FEE

Const MAX_FEE: u64

Defined in

assembly/libraries/Constants.ts:12


MAX_PROTOCOL_SHARE

Const MAX_PROTOCOL_SHARE: 2500

Defined in

assembly/libraries/Constants.ts:11


MIN_BIN_STEP

Const MIN_BIN_STEP: 1

Defined in

assembly/libraries/Constants.ts:9


ONE_COIN

Const ONE_COIN: u64

Defined in

assembly/libraries/Constants.ts:7


PRECISION

Const PRECISION: u256

Defined in

assembly/libraries/Constants.ts:6


REAL_ID_SHIFT

Const REAL_ID_SHIFT: i64

Defined in

assembly/libraries/Constants.ts:3


SCALE_OFFSET

Const SCALE_OFFSET: 128

Defined in

assembly/libraries/Constants.ts:8


_KEY_ELEMENT_SUFFIX

Const _KEY_ELEMENT_SUFFIX: "::"

Defined in

assembly/libraries/PersistentMap.ts:17

Functions

_sortTokens

_sortTokens(_tokenA, _tokenB): SortTokensReturn

Parameters

NameTypeDescription
_tokenAAddressThe first token
_tokenBAddressThe second token

Returns

SortTokensReturn

SortTokensReturn: token0, token1

Notice

Private view function to sort 2 tokens in ascending order

Defined in

assembly/libraries/Utils.ts:33


createEvent

createEvent(key, args): string

Parameters

NameTypeDescription
keystringthe string event key.
argsstring[]the string array arguments.

Returns

string

the stringified event.

Notice

Overrides Massa default createEvent function (use a custom delimiter to avoid collisions)

Constructs a pretty formatted event with given key and arguments.

Remarks

The result is meant to be used with the generateEvent function. It is useful to generate events from an array.

Defined in

assembly/libraries/Utils.ts:117


createKey

createKey(args): string

Parameters

NameType
argsstring[]

Returns

string

Defined in

assembly/libraries/Utils.ts:16


spreadLiqudity

spreadLiqudity(amountYIn, startId, numbersBins, gap, binStep): SpreadLiqudityReturn

Parameters

NameType
amountYInu256
startIdu32
numbersBinsu32
gapu32
binStepu32

Returns

SpreadLiqudityReturn

Defined in

assembly/libraries/Utils.ts:53


transferRemaining

transferRemaining(balanceInit, balanceFinal, sent, to): void

Parameters

NameTypeDescription
balanceInitu64Initial balance of the SC (transferred coins + balance of the SC)
balanceFinalu64Balance of the SC at the end of the call
sentu64Number of coins sent to the SC
toAddressCaller of the function to transfer the remaining coins to

Returns

void

Notice

Function to transfer remaining Massa coins to a recipient at the end of a call

Defined in

assembly/libraries/Utils.ts:136


u256ToString

u256ToString(u): string

Parameters

NameType
uu256

Returns

string

Notice

Function to convert a u256 to a UTF-16 bytes then to a string

Dev

u256.toString() is too expensive in as-bignum so we use this instead

Defined in

assembly/libraries/Utils.ts:125