Uniswap.Contracts.SwapRouter (Uniswap v0.0.5)
View SourceUniswap's Swap Router V2
Summary
Functions
Default address of the contract. Returns nil
if not specified.
Prepares contract constructor values for deployment.
Prepares exactInput((bytes,address,uint256,uint256,uint256) params)
call parameters on the contract.
Prepares exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params)
call parameters on the contract.
Prepares exactOutput((bytes,address,uint256,uint256,uint256) params)
call parameters on the contract.
Prepares exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params)
call parameters on the contract.
Prepares factory()
call parameters on the contract.
Prepares multicall(bytes[] data)
call parameters on the contract.
Prepares refundETH()
call parameters on the contract.
Prepares selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
Prepares selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
Prepares selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
Prepares selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
Prepares sweepToken(address token, uint256 amountMinimum, address recipient)
call parameters on the contract.
Prepares sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient)
call parameters on the contract.
Prepares uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data)
call parameters on the contract.
Prepares unwrapWETH9(uint256 amountMinimum, address recipient)
call parameters on the contract.
Prepares unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient)
call parameters on the contract.
Prepares WETH9()
call parameters on the contract.
Functions
@spec __default_address__() :: Ethers.Types.t_address()
Default address of the contract. Returns nil
if not specified.
To specify a default address see Ethers.Contract
@spec constructor(Ethers.Types.t_address(), Ethers.Types.t_address()) :: binary()
Prepares contract constructor values for deployment.
To deploy a contracts use Ethers.deploy/2
and pass the result of this function as
:encoded_constructor
option.
Parameters
- _factory:
:address
- _WETH9:
:address
@spec exact_input( {binary(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer()} ) :: Ethers.TxData.t()
Prepares exactInput((bytes,address,uint256,uint256,uint256) params)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- params:
{:tuple, [:bytes, :address, {:uint, 256}, {:uint, 256}, {:uint, 256}]}
Return Types (when called with Ethers.call/2
)
- amountOut:
{:uint, 256}
@spec exact_input_single( {Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} ) :: Ethers.TxData.t()
Prepares exactInputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- params:
{:tuple, [:address, :address, {:uint, 24}, :address, {:uint, 256}, {:uint, 256}, {:uint, 256}, {:uint, 160}]}
Return Types (when called with Ethers.call/2
)
- amountOut:
{:uint, 256}
@spec exact_output( {binary(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer()} ) :: Ethers.TxData.t()
Prepares exactOutput((bytes,address,uint256,uint256,uint256) params)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- params:
{:tuple, [:bytes, :address, {:uint, 256}, {:uint, 256}, {:uint, 256}]}
Return Types (when called with Ethers.call/2
)
- amountIn:
{:uint, 256}
@spec exact_output_single( {Ethers.Types.t_address(), Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), non_neg_integer()} ) :: Ethers.TxData.t()
Prepares exactOutputSingle((address,address,uint24,address,uint256,uint256,uint256,uint160) params)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- params:
{:tuple, [:address, :address, {:uint, 24}, :address, {:uint, 256}, {:uint, 256}, {:uint, 256}, {:uint, 160}]}
Return Types (when called with Ethers.call/2
)
- amountIn:
{:uint, 256}
@spec factory() :: Ethers.TxData.t()
Prepares factory()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
:address
@spec multicall([binary()]) :: Ethers.TxData.t()
Prepares multicall(bytes[] data)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- data:
{:array, :bytes}
Return Types (when called with Ethers.call/2
)
- results:
{:array, :bytes}
@spec refund_eth() :: Ethers.TxData.t()
Prepares refundETH()
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec self_permit( Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), <<_::256>>, <<_::256>> ) :: Ethers.TxData.t()
Prepares selfPermit(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- value:
{:uint, 256}
- deadline:
{:uint, 256}
- v:
{:uint, 8}
- r:
{:bytes, 32}
- s:
{:bytes, 32}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec self_permit_allowed( Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), <<_::256>>, <<_::256>> ) :: Ethers.TxData.t()
Prepares selfPermitAllowed(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- nonce:
{:uint, 256}
- expiry:
{:uint, 256}
- v:
{:uint, 8}
- r:
{:bytes, 32}
- s:
{:bytes, 32}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec self_permit_allowed_if_necessary( Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), <<_::256>>, <<_::256>> ) :: Ethers.TxData.t()
Prepares selfPermitAllowedIfNecessary(address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- nonce:
{:uint, 256}
- expiry:
{:uint, 256}
- v:
{:uint, 8}
- r:
{:bytes, 32}
- s:
{:bytes, 32}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec self_permit_if_necessary( Ethers.Types.t_address(), non_neg_integer(), non_neg_integer(), non_neg_integer(), <<_::256>>, <<_::256>> ) :: Ethers.TxData.t()
Prepares selfPermitIfNecessary(address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- value:
{:uint, 256}
- deadline:
{:uint, 256}
- v:
{:uint, 8}
- r:
{:bytes, 32}
- s:
{:bytes, 32}
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec sweep_token( Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address() ) :: Ethers.TxData.t()
Prepares sweepToken(address token, uint256 amountMinimum, address recipient)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- amountMinimum:
{:uint, 256}
- recipient:
:address
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec sweep_token_with_fee( Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address() ) :: Ethers.TxData.t()
Prepares sweepTokenWithFee(address token, uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- token:
:address
- amountMinimum:
{:uint, 256}
- recipient:
:address
- feeBips:
{:uint, 256}
- feeRecipient:
:address
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec uniswap_v3_swap_callback(integer(), integer(), binary()) :: Ethers.TxData.t()
Prepares uniswapV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
No amount of Ether can be sent with this function.
State mutability: non_payable
Function Parameter Types
- amount0Delta:
{:int, 256}
- amount1Delta:
{:int, 256}
- _data:
:bytes
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec unwrap_weth9(non_neg_integer(), Ethers.Types.t_address()) :: Ethers.TxData.t()
Prepares unwrapWETH9(uint256 amountMinimum, address recipient)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- amountMinimum:
{:uint, 256}
- recipient:
:address
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec unwrap_weth9_with_fee( non_neg_integer(), Ethers.Types.t_address(), non_neg_integer(), Ethers.Types.t_address() ) :: Ethers.TxData.t()
Prepares unwrapWETH9WithFee(uint256 amountMinimum, address recipient, uint256 feeBips, address feeRecipient)
call parameters on the contract.
This function can be used for a transaction or additionally called for results (Use Ethers.send_transaction/2
).
It also supports receiving ether from the transaction origin.
State mutability: payable
Function Parameter Types
- amountMinimum:
{:uint, 256}
- recipient:
:address
- feeBips:
{:uint, 256}
- feeRecipient:
:address
Return Types (when called with Ethers.call/2
)
This function does not return any values!
@spec weth9() :: Ethers.TxData.t()
Prepares WETH9()
call parameters on the contract.
This function should only be called for result and never in a transaction on its own. (Use Ethers.call/2
)
State mutability: view
Return Types (when called with Ethers.call/2
)
:address