Skip to main content

IUniswapRouter

Masa Finance

Uniswap Router interface

Interface of the Uniswap Router contract

This interface is used to interact with the Uniswap Router contract, and gets the most important functions of the contract. It's based on https://github.com/Uniswap/v2-periphery/blob/master/contracts/interfaces/IUniswapV2Router01.sol

Methods

getAmountsIn

function getAmountsIn(uint256 amountOut, address[] path) external view returns (uint256[] amounts)

Parameters

NameTypeDescription
amountOutuint256undefined
pathaddress[]undefined

Returns

NameTypeDescription
amountsuint256[]undefined

getAmountsOut

function getAmountsOut(uint256 amountIn, address[] path) external view returns (uint256[] amounts)

Parameters

NameTypeDescription
amountInuint256undefined
pathaddress[]undefined

Returns

NameTypeDescription
amountsuint256[]undefined

swapExactETHForTokens

function swapExactETHForTokens(uint256 amountOutMin, address[] path, address to, uint256 deadline) external payable returns (uint256[] amounts)

Parameters

NameTypeDescription
amountOutMinuint256undefined
pathaddress[]undefined
toaddressundefined
deadlineuint256undefined

Returns

NameTypeDescription
amountsuint256[]undefined

swapExactTokensForETH

function swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external nonpayable returns (uint256[] amounts)

Parameters

NameTypeDescription
amountInuint256undefined
amountOutMinuint256undefined
pathaddress[]undefined
toaddressundefined
deadlineuint256undefined

Returns

NameTypeDescription
amountsuint256[]undefined

swapExactTokensForTokens

function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) external nonpayable returns (uint256[] amounts)

Parameters

NameTypeDescription
amountInuint256undefined
amountOutMinuint256undefined
pathaddress[]undefined
toaddressundefined
deadlineuint256undefined

Returns

NameTypeDescription
amountsuint256[]undefined