SMBSwap
  • SMBSwap Intro
  • 1️⃣Get Started (BSC)
    • Create a Wallet
    • Get BEP20 Tokens
    • Using SMBSwap without Centralized Exchanges
    • Connect Your Wallet to SMBSwap
  • πŸ†˜Help Area
    • General FAQ
    • Troubleshooting Errors
    • Fixing Stuck Pending Transactions in MetaMask
  • πŸ“§Contact Us
    • Business Partnerships
    • Community
    • Customer Support
  • πŸ‘©β€πŸ³The SMB Team
  • πŸ—ΊοΈRoadmap
  • PRODUCTS
    • πŸ”„Exchange
      • πŸͺ™Token Swaps
      • ↕️How To Trade
      • πŸ“³Smart Router
        • How to trade using Smart Router
      • πŸ’΅Liquidity Pools
      • ⚑Zap
      • πŸ“ How to Add/ Remove Liquidity
      • FAQ
    • 🚜Yield Farming
      • How to Use Farms
      • bSELF
        • How to Use bSELF
        • FAQ
      • FAQ
    • πŸ’΅Made Pools - Stake SELF
      • New SELF Made Pool
        • How to Use the Flexible Staking Option
        • How to Use the Fixed-Term Staking Option
        • SELF Made Pool FAQ
      • Other Made Pools
        • Made Pool FAQ & Troubleshooting
    • 🎟️Lottery
      • How to Play SMB Lottery
      • How to Play BUSD Lottery
      • Lottery FAQ
    • πŸ“ŠAnalytics
    • β˜‘οΈVoting
      • How to Vote
  • TOKENOMICS
    • πŸͺ™SELF
      • SELF Tokenomics
      • Controlling SELF Supply
  • DEVELOPERS
    • 🚚v3 Migration
      • How to migrate
      • How v3 APR is calculated
      • FAQ
    • 🚚v2 Migration
      • Migrate Your Stakings
      • MasterChef v2
        • List of Farms
      • SELF Made Pool
    • Smart Contracts (EVM)
      • SMBSwap Exchange
        • v3
          • SMBV3Factory
          • SmartRouterV3
            • V3SwapRouter
            • V2SwapRouter
            • StableSwapRouter
          • NonfungiblePositionManager
          • SMBV3Pool
        • v2
          • Factory v2
          • Router v2
        • Stable Swap
          • StableSwap Pools
        • Smart Router
      • MasterChef
        • MasterChef V3
      • Made Pools
      • SELF Made Pool
      • Lottery
      • Farm Booster (bSELF)
    • 🧠Smart Contracts (BSC)
      • SMBSwap Exchange
        • Factory v2
        • Router v2
      • MasterChef
      • Made Pools
      • SELF Made Pool
      • Lottery
      • Farm Booster (bSELF)
    • πŸͺ°Report a Bug
  • JOIN THE TEAM
    • πŸ”‘Opportunities
  • REFERENCE/ ARCHIVE
    • Auto SELF Made Pool
    • How to Use Farms with BscScan
    • Main Staking/ Made Pool/ MasterChef Contract
    • Auto SELF Made Pool (SelfVault)
Powered by GitBook
On this page
  1. DEVELOPERS
  2. Smart Contracts (EVM)
  3. SMBSwap Exchange
  4. v3
  5. SmartRouterV3

V2SwapRouter

Router for stateless execution of swaps against SMBSwap V2

Solidity API

swapExactTokensForTokens

function swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to) external payable returns (uint256 amountOut)

Swaps amountIn of one token for as much as possible of another token

Setting amountIn to 0 will cause the contract to look up its own balance, and swap the entire amount, enabling contracts to send tokens before calling this function.

Parameters

Name
Type
Description

amountIn

uint256

The amount of token to swap

amountOutMin

uint256

The minimum amount of output that must be received

path

address[]

The ordered list of tokens to swap through

to

address

The recipient address

Return Values

Name
Type
Description

amountOut

uint256

The amount of the received token

swapTokensForExactTokens

function swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to) external payable returns (uint256 amountIn)

Swaps as little as possible of one token for an exact amount of another token

Parameters

Name
Type
Description

amountOut

uint256

The amount of token to swap for

amountInMax

uint256

The maximum amount of input that the caller will pay

path

address[]

The ordered list of tokens to swap through

to

address

The recipient address

Return Values

Name
Type
Description

amountIn

uint256

The amount of token to pay

PreviousV3SwapRouterNextStableSwapRouter

Last updated 2 years ago