Index
Table of contents
Contracts
Libraries
- BinHelper
- BitMath
- Math512Bits
- PersistentMap
- ReentrancyGuardUpgradeable
- SafeMath
- SafeMath256
- SafeMathU8
- SwapHelper
- TreeHelper
Interfaces
Structs
- Bin
- Debt
- FeeParameters
- FeesDistribution
- LBPairInformation
- LiquidityParameters
- MintInfo
- Oracle
- OracleParameters
- PairInformation
- Preset
- Sample
Variables
- BASIS_POINT_MAX
- DELIMITER
- EVENT_DELIMITER
- ID_ONE
- MAX_BIN_STEP
- MAX_FEE
- MAX_PROTOCOL_SHARE
- MIN_BIN_STEP
- ONE_COIN
- PRECISION
- REAL_ID_SHIFT
- SCALE_OFFSET
- _KEY_ELEMENT_SUFFIX
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
Name | Type | Description |
---|---|---|
_tokenA | Address | The first token |
_tokenB | Address | The 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
Name | Type | Description |
---|---|---|
key | string | the string event key. |
args | string [] | 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
Name | Type |
---|---|
args | string [] |
Returns
string
Defined in
assembly/libraries/Utils.ts:16
spreadLiqudity
▸ spreadLiqudity(amountYIn
, startId
, numbersBins
, gap
, binStep
): SpreadLiqudityReturn
Parameters
Name | Type |
---|---|
amountYIn | u256 |
startId | u32 |
numbersBins | u32 |
gap | u32 |
binStep | u32 |
Returns
SpreadLiqudityReturn
Defined in
assembly/libraries/Utils.ts:53
transferRemaining
▸ transferRemaining(balanceInit
, balanceFinal
, sent
, to
): void
Parameters
Name | Type | Description |
---|---|---|
balanceInit | u64 | Initial balance of the SC (transferred coins + balance of the SC) |
balanceFinal | u64 | Balance of the SC at the end of the call |
sent | u64 | Number of coins sent to the SC |
to | Address | Caller 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
Name | Type |
---|---|
u | u256 |
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