路由合约

读函数

工厂

function factory() external pure returns (address);

返回规范地址 Factory.

给定输入,询问可能的输出

function getAmountOut(
        uint amountIn,
        uint reserveIn,
        uint reserveOut,
        uint24 fee
    ) public pure virtual override returns (uint amountOut)

给定输出,询问可能的输入

function getAmountIn(
        uint amountOut,
        uint reserveIn,
        uint reserveOut,
        uint24 fee
    ) public pure virtual override returns (uint amountIn)

给定输入,和一组路径,询问可能的输出

给定输出,和一组路径,询问可能的输入

quote


写函数

添加流动性(ERC20和ERC20交易对)

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

amountADesired

uint

The amount of tokenA you'd like to provide as liquidity.

amountBDesired

uint

The amount of tokenA you'd like to provide as liquidity.

amountAMin

uint

The minimum amount of tokenA to provide (slippage impact).

amountBMin

uint

The minimum amount of tokenB to provide (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

添加流动性(ERC20和WJU交易对)

Adds liquidity to a ERC20⇄WJU pool.

撤出流动性(ERC20和ERC20交易对)

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountAMin

uint

The minimum amount of the token to remove (slippage impact).

amountBMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

撤出流动性(ERC20和WJU交易对)

Name
Type

token

address

The contract address of the token to remove liquidity.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

撤出流动性并支持转账收取费用(ERC20和WJU交易对)

Removes liquidity from a ERC20⇄WJU for tokens that take a fee on transfer.

Name
Type

token

address

The contract address of the token to remove liquidity.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

从 ERC20⇄WJU 中移除流动性并通过许可证接收 JU,无需预先批准

Name
Type

token

address

The contract address of the token to remove liquidity.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

从 ERC20⇄WJU 中移除流动性,并通过许可接收收取转账费用的代币的 JU

Name
Type

token

address

The contract address of the token to remove liquidity.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

通过许可证,无需预先批准即可从 ERC20⇄ERC20 中移除流动性

Name
Type

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

fee

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of JU to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

根据输入代币的精确数量接收尽可能多的输出代币

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

用尽可能少的输入代币获得精确数量的输出代币

Name
Type

amountOut

uint

Payable amount of input tokens.

amountInMax

uint

The maximum amount tokens to input.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

以精确数量的输入代币接收尽可能多的输出代币。支持转账收取手续费的代币。

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

以精确数量的 JU 接收尽可能多的输出代币

Name
Type

swapExactETHForTokens

uint

Payable JU amount.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

用尽可能少的 JU 获得准确数量的输出代币

Name
Type

swapETHForExactTokens

uint

Payable JU amount.

amountOut

uint

The amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

用一定数量的输入代币获得尽可能多的 JU

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

用尽可能少的输入代币获得准确数量的 JU

Name
Type

amountOut

uint

Payable amount of input tokens.

amountInMax

uint

The minimum amount tokens to input.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

以精确数量的 JU 接收尽可能多的输出代币,支持在转账时收取手续费的代币

Name
Type

swapExactETHForTokensSupportingFeeOnTransferTokens

uint

Payable JU amount.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

fees

uint24

Transaction fee, optional values: 50(0.5%), 100(1%), 200(2%), 300(3%)

to

address

Address of recipient.

referrer

address

The previous level inviter of the transaction address.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

Last updated