VulpeFI Docs
  • Whitepaper
  • VulpeFI Overview
  • Wallet VulpeFI
    • Wallet auto-connect
  • Aggregation Protocol
    • Introduction
    • Guide
      • Quick start
    • API
      • Swagger
        • Binance Smart Chain
        • Ethereum Network
        • BASE
        • Arbitrum
        • Polygon
      • Swap params
      • Quote params
    • Smart contracts
      • Aggregation VulpeFI
      • ClipperRouter
      • LimitOrderProtocol
      • UnoswapRouter
    • Limit order protocol
      • Introduction
      • Limit vs. RFQ Orders
      • Smart contracts
        • LimitOrderProtocol
        • LimitOrderProtocolPro
        • OrderLib
        • OrderMixin
        • OrderRFQMixin
        • helpers
          • AmountCalculator
          • ChainlinkCalculator
          • ERC1155Proxy
          • ERC721Proxy
          • ERC721ProxySafe
          • ImmutableOwner
          • NonceManager
          • PredicateHelper
          • SeriesNonceManager
          • WethUnwrapper
        • Interfaces
          • IDaiLikePermit
          • IWithdrawable
          • Interaction
          • PostInteraction
          • PreInteraction
      • Liquidity Source and API
        • Ethereum Network
        • Binance Smart Chain
        • Polygon
        • Avalanche
        • Gnosis Chain
    • Spot Price aggregator
      • Examples
      • Spot Price Aggregator
Powered by GitBook
On this page
  • Derives​
  • Functions​
  • unoswapWithPermit​
  • unoswap​
  1. Aggregation Protocol
  2. Smart contracts

UnoswapRouter

PreviousLimitOrderProtocolNextLimit order protocol

Last updated 4 months ago

Derives

  • Permitable

  • EthReceiver

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:

Name
Type
Description

srcToken

contract IERC20

Source token

amount

uint256

Amount of source tokens to swap

minReturn

uint256

Minimal allowed returnAmount to make transaction commit

pools

bytes32[]

Pools chain used for swaps. Pools src and dst tokens should match to make swap happen

permit

bytes

Should contain valid permit that can be used in IERC20Permit.permit calls. See tests for examples

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

Name
Type
Description

srcToken

contract IERC20

Source token

amount

uint256

Amount of source tokens to swap

minReturn

uint256

Minimal allowed returnAmount to make transaction commit

pools

bytes32[]

Pools chain used for swaps. Pools src and dst tokens should match to make swap happen

unoswap

Parameters:

​
​
​
​
​
​