ScalarRuleQuantAMMStorage

Git Sourcearrow-up-right

Inherits:QuantAMMStoragearrow-up-right

Contains the logic for packing and unpacking storage slots with 128 bit integers for rule weights

Functions

_quantAMMPack128Array

Packs n 128 bit integers into n/2 256 bit integers

function _quantAMMPack128Array(int256[] memory _sourceArray) internal pure returns (int256[] memory targetArray);

Parameters

Name
Type
Description

_sourceArray

int256[]

the array to pack

_quantAMMUnpack128Array

Unpacks n/2 256 bit integers into n 128 bit integers

function _quantAMMUnpack128Array(int256[] memory _sourceArray, uint256 _targetArrayLength)
    internal
    pure
    returns (int256[] memory targetArray);

Parameters

Name
Type
Description

_sourceArray

int256[]

the array to unpack

_targetArrayLength

uint256

the number of 128 bit integers to unpack

Last updated