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

V3SwapRouter

Router for stateless execution of swaps against PancakeSwap V3

Solidity API

SwapCallbackData

struct SwapCallbackData {
  bytes path;
  address payer;
}

pancakeV3SwapCallback

function pancakeV3SwapCallback(int256 amount0Delta, int256 amount1Delta, bytes _data) external

Called to msg.sender after executing a swap via IPancakeV3Pool#swap.

In the implementation you must pay the pool tokens owed for the swap. The caller of this method must be checked to be a PancakeV3Pool deployed by the canonical PancakeV3Factory. amount0Delta and amount1Delta can both be 0 if no tokens were swapped.

Parameters

Name
Type
Description

amount0Delta

int256

The amount of token0 that was sent (negative) or must be received (positive) by the pool by the end of the swap. If positive, the callback must send that amount of token0 to the pool.

amount1Delta

int256

The amount of token1 that was sent (negative) or must be received (positive) by the pool by the end of the swap. If positive, the callback must send that amount of token1 to the pool.

_data

bytes

exactInputSingle

function exactInputSingle(struct IV3SwapRouter.ExactInputSingleParams params) 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

params

struct IV3SwapRouter.ExactInputSingleParams

The parameters necessary for the swap, encoded as ExactInputSingleParams in calldata

Return Values

Name
Type
Description

amountOut

uint256

The amount of the received token

exactInput

function exactInput(struct IV3SwapRouter.ExactInputParams params) external payable returns (uint256 amountOut)

Swaps amountIn of one token for as much as possible of another along the specified path

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

params

struct IV3SwapRouter.ExactInputParams

The parameters necessary for the multi-hop swap, encoded as ExactInputParams in calldata

Return Values

Name
Type
Description

amountOut

uint256

The amount of the received token

exactOutputSingle

function exactOutputSingle(struct IV3SwapRouter.ExactOutputSingleParams params) external payable returns (uint256 amountIn)

Swaps as little as possible of one token for amountOut of another token that may remain in the router after the swap.

Parameters

Name
Type
Description

params

struct IV3SwapRouter.ExactOutputSingleParams

The parameters necessary for the swap, encoded as ExactOutputSingleParams in calldata

Return Values

Name
Type
Description

amountIn

uint256

The amount of the input token

exactOutput

function exactOutput(struct IV3SwapRouter.ExactOutputParams params) external payable returns (uint256 amountIn)

Swaps as little as possible of one token for amountOut of another along the specified path (reversed) that may remain in the router after the swap.

Parameters

Name
Type
Description

params

struct IV3SwapRouter.ExactOutputParams

The parameters necessary for the multi-hop swap, encoded as ExactOutputParams in calldata

Return Values

Name
Type
Description

amountIn

uint256

The amount of the input token

PreviousSmartRouterV3NextV2SwapRouter

Last updated 1 year ago

Was this helpful?