UniswapV2Adapter Smart Contract Module in Bunzz

The UniswapV2Adapter module serves as a common interface for external contracts to perform queries and swaps for Uniswap V2 Factories. 

The DexAggregator can use the adapter to find the best offer between two assets for a given amount and execute this offer. It also accounts for query & swap gas-cost of the offer and for that needs gasEstimate from the adapter.

You can access this Module and the code here: https://bit.ly/407Ets0

How to Use

  1. Deploy smart contract via Bunzz. When deploying, users can specify name, factory address, fee and swapGasEstimate.
  2. Users can call query function to perform queries (find the best offer) betwen two assets for a given amount.
  3. Users can also call swap function to perform swaps between two assets for a given amount.

Functions

#WRITE

  • addMaintainer
  • grantRole
  • recoverERC20
  • recoverETH
  • removeMaintainer
  • renounceRole
  • renounceRole
  • revokeAllowance
  • revokeRole
  • setSwapGasEstimate
  • swap
  • transferOwnership

#READ

  • MAINTAINER_ROLE
  • factory
  • feeCompliment
  • getRoleAdmin
  • hasRole
  • name
  • query
  • supportsInterface
  • swapGasEstimate
  • DEFAULT_ADMIN_ROL

You can access this Module and the code here: https://bit.ly/407Ets0

If you still haven’t signed up to Bunzz, what are you waiting for?

Sign up here https://app.bunzz.dev/signup and get your smart contracts deployed in 5 minutes through our great GUI.

Share this article: