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.
BOOL_SIZE
The length of the bytes encoded bool.
NEXT_OFFSET
The offset of a single token address and pool address.
Functions
hasMultiplePools
Returns true iff the path contains two or more pools.
Parameters
Name
Type
Description
path
bytes
The encoded swap path.
Returns
Name
Type
Description
<none>
bool
True if path contains two or more pools, otherwise false.
decodeFirstPool
Decodes the first pool in path.
Parameters
Name
Type
Description
path
bytes
The bytes encoded swap path.
decodeNextPoolAddress
skipToken
Skips a token + pool element from the buffer and returns the remainder.
Parameters
Name
Type
Description
path
bytes
The swap path.
Returns
Name
Type
Description
<none>
bytes
The remaining token + pool elements in the path.
Last updated