LFJ Developer Docs
  • Liquidity Book
  • Introduction
  • LB V2.2 Key Changes
  • Guides
    • Swap Tokens
    • Add/Remove Liquidity
    • Tracking Volume
    • Tracking Pool Balances
    • Finding The Best Quote
    • Byte32 Decoding
    • Price From Bin Id
    • Bin Id From Price
    • Finding Liquidity Depth
    • User Balances
  • Concepts
    • Concentrated Liquidity
    • Bin Math
    • Bin Liquidity
    • Swaps
    • Fees
    • Oracle
  • Contracts
    • Interfaces
      • ILBLegacyFactory
      • ILBLegacyToken
      • ILBLegacyPair
      • ILBLegacyRouter
      • ILBFlashLoanCallback
      • IPendingOwnable
      • IJoeFactory
      • IJoePair
      • IJoeRouter01
      • IJoeRouter02
      • IWNATIVE
      • ILBFactory
      • ILBHooks
      • ILBPair
      • ILBRouter
      • ILBToken
    • Libraries
      • Math
        • BitMath
        • Encoded
        • LiquidityConfigurations
        • PackedUint128Math
        • SafeCast
        • SampleMath
        • TreeMath
        • Uint128x128Math
        • Uint256x256Math
      • BinHelper
      • Clone
      • Constants
      • FeeHelper
      • Hooks
      • ImmutableClone
      • JoeLibrary
      • OracleHelper
      • PairParameterHelper
      • PriceHelper
      • ReentrancyGuardUpgradeable
      • TokenHelper
    • LBBaseHooks
    • LBFactory
    • LBPair
    • LBQuoter
    • LBRouter
    • LBToken
  • Deployment Addresses
    • Avalanche C-Chain
    • Fuji Testnet
    • Arbitrum One
    • Binance Smart Chain
    • Binance Smart Chain Testnet
    • Ethereum Mainnet
    • Monad Testnet
  • SDK
    • Introduction
    • Making a Trade
    • Adding Liquidity
    • Removing Liquidity
  • Audits
  • AMM
    • Joe V1 Contracts
    • Joe V1 Audits
  • LFJ DEX API
    • Dex Analytics
    • Pools
    • Rewards
    • User
    • User Lifetime Stats
    • Vaults
    • Models
  • LFJ Aggregator API
    • Default
    • Models
Powered by GitBook
On this page
  • Functions
  • _getArgBytes
  • _getArgAddress
  • _getArgUint256
  • _getArgUint256Array
  • _getArgUint64
  • _getArgUint16
  • _getArgUint8
  • _getImmutableArgsOffset
  1. Contracts
  2. Libraries

Clone

PreviousBinHelperNextConstants

Last updated 8 days ago

Authors: Trader Joe, Solady (https://github.com/vectorized/solady/blob/main/src/utils/Clone.sol), Adapted from clones with immutable args by zefram.eth, Saw-mon & Natalie (https://github.com/Saw-mon-and-Natalie/clones-with-immutable-args)

Class with helper read functions for clone with immutable args.

Functions

_getArgBytes

Reads an immutable arg with type bytes

function _getArgBytes(uint256 argOffset, uint256 length) internal pure returns (bytes memory arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

length

uint256

The length of the arg

Returns

Name
Type
Description

arg

bytes

The immutable bytes arg

_getArgAddress

Reads an immutable arg with type address

function _getArgAddress(uint256 argOffset) internal pure returns (address arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

Returns

Name
Type
Description

arg

address

The immutable address arg

_getArgUint256

Reads an immutable arg with type uint256

function _getArgUint256(uint256 argOffset) internal pure returns (uint256 arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

Returns

Name
Type
Description

arg

uint256

The immutable uint256 arg

_getArgUint256Array

Reads a uint256 array stored in the immutable args.

function _getArgUint256Array(uint256 argOffset, uint256 length) internal pure returns (uint256[] memory arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

length

uint256

The length of the arg

Returns

Name
Type
Description

arg

uint256[]

The immutable uint256 array arg

_getArgUint64

Reads an immutable arg with type uint64

function _getArgUint64(uint256 argOffset) internal pure returns (uint64 arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

Returns

Name
Type
Description

arg

uint64

The immutable uint64 arg

_getArgUint16

Reads an immutable arg with type uint16

function _getArgUint16(uint256 argOffset) internal pure returns (uint16 arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

Returns

Name
Type
Description

arg

uint16

The immutable uint16 arg

_getArgUint8

Reads an immutable arg with type uint8

function _getArgUint8(uint256 argOffset) internal pure returns (uint8 arg);

Parameters

Name
Type
Description

argOffset

uint256

The offset of the arg in the immutable args

Returns

Name
Type
Description

arg

uint8

The immutable uint8 arg

_getImmutableArgsOffset

Reads the offset of the packed immutable args in calldata.

function _getImmutableArgsOffset() internal pure returns (uint256 offset);

Returns

Name
Type
Description

offset

uint256

The offset of the packed immutable args in calldata.

Git Source