Skip to main content

UnoswapRouter

Derives

Functions

unoswapWithPermit

function unoswapWithPermit(
contract IERC20 srcToken,
uint256 amount,
uint256 minReturn,
bytes32[] pools,
bytes permit
) external returns (uint256 returnAmount)

Same as unoswap but calls permit first, allowing to approve token spending and make a swap in one transaction.

Parameters:

NameTypeDescription
srcTokencontract IERC20Source token
amountuint256Amount of source tokens to swap
minReturnuint256Minimal allowed returnAmount to make transaction commit
poolsbytes32[]Pools chain used for swaps. Pools src and dst tokens should match to make swap happen
permitbytesShould contain valid permit that can be used in IERC20Permit.permit calls. See tests for examples

unoswap

function unoswap(
contract IERC20 srcToken,
uint256 amount,
uint256 minReturn,
bytes32[] pools
) public returns (uint256 returnAmount)

Performs swap using Uniswap exchange. Wraps and unwraps ETH if required. Sending non-zero msg.value for anything but ETH swaps is prohibited

Parameters:

NameTypeDescription
srcTokencontract IERC20Source token
amountuint256Amount of source tokens to swap
minReturnuint256Minimal allowed returnAmount to make transaction commit
poolsbytes32[]Pools chain used for swaps. Pools src and dst tokens should match to make swap happen