PaySwap
English
English
  • PaySwap Intro
    • Get Started
      • Create a Wallet
      • Get Tokens
      • Using PaySwap without Centralized Exchanges
      • Connect Your Wallet to PaySwap
      • Sell/Buy Native Tokens
    • Click Here for Help
      • Troubleshooting Errors
      • What is an Approval Transaction?
      • Fixing Stuck Pending Transactions on MetaMask
  • 🐲Leviathans
    • 👚Apparel, Beauty & Cosmetics Leviathan
    • 🚰Beverage Leviathan
    • 🎥Culture & Entertainment Leviathan
    • 🔌Energy Leviathan
    • 🥕Food Leviathan
    • 😷Healthcare Leviathan
    • 🪖Law & Order Leviathan
    • 🪓Mining Leviathan
    • 😈NSFW Leviathan
    • 🏠Real Estate Leviathan
    • 💻Software, Telco & Other Leviathan
    • 🚌Transportation Leviathan
    • 🏦The Money Bank
    • NWO
  • Products
    • 🌉ARPs
      • Manual ARPs
        • Setting Up Your Company's Payroll
        • Setting Up A Tontine
        • Selling Shares In An Asset
      • Percentage Based ARPs
        • Roommates Paying Bills Together
      • Automatic ARPs
      • Minting & Claiming Notes
    • 🟪Auditors
      • Natural Resource Audits
      • SSID Audits
      • Tokenizing Real Estate
      • Tokenizing Personal Posessions
      • Nature Tokens
      • Bounty Hunters
    • 🔮Betting Contracts
      • Bets without alphabet-encoding
      • Bets with alphabet-encoding
      • Partner Betting Events
    • 💧Bills
      • Taxes
      • Bookkeeping
      • Bank Accounts
      • Selling Shares In An Asset
    • 🖼️CanCan
      • Products/Services
        • Listing Products/Services
        • Buying Products/Services
          • Buying With Your Wallet
          • Buying Through The Stake Market
          • Selling Through The Stake Market
          • Buying Through Valuepools/DAOs
      • Articles
        • Listing Articles
        • Tipping Writers
      • Paywalls
        • Listing Paywalls
        • Adding Items To Paywalls
        • Removing Items From Paywalls
        • Partnering With Paywalls
        • Buying Paywall Subscriptions
        • Activating Paywall Subscriptions
      • NFTickets
      • Discounts & Cashbacks
        • Discounts
        • Cashbacks
        • Manual Rewards
      • List Partner Valuepools
      • Announcements
      • Reviews
      • Dynamic Pricing
      • Partnerships
      • Memberships
      • Identity Requirements
      • Sponsorships
      • Auctions & Bids
      • Drops
      • Votes
    • 🧑‍⚖️dRamps
      • Adding A Token Market
      • Deploying & Adding An Extra Token
      • Activating A Token Market
      • Update Prices On A Token Market
      • Automatic Ramps
        • Minting tFIAT Tokens
        • Burning tFIAT Tokens
      • Manual Ramps
        • Minting tFIAT Tokens
        • Burning tFIAT Tokens
      • Sponsor Ramp
      • Sell/Buy Native Tokens
      • Ramps Valuepool
      • Partnerships
      • Bootstrapping
      • Selling Token Markets
      • Use Cases
        • Paying For Tuition
        • Paying For Products/Services
        • Remittances
        • Forex
        • Blockchain Bridge
        • Store of Value
    • 🖼️eCollectibles
      • The Default Minter
      • Custom Minters
      • Listing Pre-Minted NFTs
    • 🔄Exchange
      • Token Swaps
      • How to Trade
      • Fees and Routes
      • Liquidity Pools
      • How to Add/Remove Liquidity
      • FAQ
    • 🧈Future Collaterals
    • 🎮Games
      • Game Objects
      • Game Scholarships
    • 🎟️Lottery
      • How to Play Lottery
      • Lottery FAQ
      • Marketplace Lottery
      • FT Lottery
      • NFT Lottery
    • 💳PayCards
      • MarketPlace Purchases
    • 🐞Profile
      • Building Your Social Graph
      • Transferring Money
      • Credit Reports
      • Security & Others
    • 💹Revenue Sharing
      • Accelerator
      • Businesses
      • Contributors
      • Referrals
    • 🍯Sponsors
    • 🍏SSI
      • Creating Data
      • Creating An SSID
      • Creating A Unique Profile
    • 📈StakeMarket
      • Buying A Listed Product
      • Call For Tenders
      • Collateralized Loans
      • Stake Applications
      • Litigations
    • 🖥️TrustBounties
      • FT Bounties
      • NFT Bounties
      • Approvals
    • 🌐ValuePools/DAOs
      • Minting An NFT Token
      • Sponsoring A Valuepool
      • Shopping With A Valuepool
      • Lending & Investing With A Valuepool
      • Creating A Proposal
    • 👾Wills
      • Setting Up Your Will
      • Using Wills For Storage
    • 🛍️Worlds
      • Red Pill Worlds
      • Blue Pill Worlds
      • Green Worlds
  • Use Cases
    • CanCan
      • Item MarketPlace: Amazon
      • Item MarketPlace: Rentals
      • Talent MarketPlace
      • AirBnB
      • Ride Hailing
      • Delivery App
      • Rent The Runway
      • Subscription App
      • Dating App
      • Friend.tech
      • TeleHealth
      • Product Remixes
    • Valuepools
      • BNPL App
      • Group Investment App
      • Insurance App
      • Marketing App
      • Savings App
    • ARPs
      • Budgetting
      • Group Vacation Planning
      • Proxy Investment
      • Spend Management
      • Loan Management
      • Rent Management
      • Tipping
      • Play & Earn Loan Management
    • Bills
      • Flexible Loan Management
      • Bill Payment
      • Taxes
      • Proxy Investment
    • Auditors
      • Address Verification
      • Identity Verification
      • Luxury Item Authentication
      • Awards & Trophees
      • Credit Wothiness
    • Games
      • Play To Earn For Your Game
      • Play To Earn For Tripe A Game
      • Betting
    • Betting
      • Stock Market
      • Sports
      • General
      • Companies
      • Swaps
    • Lottery
      • Data Collection
      • Sale Incentive
    • SSI
      • Supply Chain
      • Medical Records
      • Zero Knowledge Proofs
      • Background Checks
      • Single Sign-On
    • StakeMarket
      • Pre Sales
      • Construction Contract
      • Collateralized Employment Contract
    • TrustBounty
      • Volatility Hedge
  • Governance & Tokenomics
  • Culture & Vision
  • RoadMap
  • Developers
    • Smart Contracts (EVM)
      • PaySwap Exchange
        • v3 contracts
          • PancakeV3Factory
          • SmartRouterV3
            • V3SwapRouter
            • V2SwapRouter
            • StableSwapRouter
          • NonfungiblePositionManager
          • PancakeV3Pool
      • MasterChef
        • MasterChef V3
      • dRamps
        • dRamp Contract
      • Lottery
        • Lottery Contract
  • Team
  • Contact Us
    • Customer Support
    • Social Accounts & Communities
Powered by GitBook
On this page

Was this helpful?

  1. Developers
  2. Smart Contracts (EVM)
  3. PaySwap Exchange
  4. v3 contracts
  5. SmartRouterV3

V2SwapRouter

Router for stateless execution of swaps against PancakeSwap 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 1 year ago

Was this helpful?