Path

Path is [pool_addr, tokenAIn, pool_addr, tokenAIn ...], alternating 20 bytes and then one byte for the tokenAIn bool.

State Variables

ADDR_SIZE

The length of the bytes encoded address.

uint256 private constant ADDR_SIZE = 20;

BOOL_SIZE

The length of the bytes encoded bool.

uint256 private constant BOOL_SIZE = 1;

NEXT_OFFSET

The offset of a single token address and pool address.

uint256 private constant NEXT_OFFSET = ADDR_SIZE + BOOL_SIZE;

Functions

hasMultiplePools

Returns true iff the path contains two or more pools.

function hasMultiplePools(bytes memory path) internal pure returns (bool);

Parameters

Returns

decodeFirstPool

Decodes the first pool in path.

function decodeFirstPool(bytes memory path) internal pure returns (IMaverickV2Pool pool, bool tokenAIn);

Parameters

decodeNextPoolAddress

function decodeNextPoolAddress(bytes memory path) internal pure returns (address pool);

skipToken

Skips a token + pool element from the buffer and returns the remainder.

function skipToken(bytes memory path) internal pure returns (bytes memory);

Parameters

Returns

Last updated