PancakeSwap
Launch App
中文
中文
  • PancakeSwap 介绍
    • 入门指南 (BSC)
      • 创建钱包
      • 获取 BEP-20 代币
      • 在没有中心化交易所账户的情况下使用PancakeSwap
      • 连接钱包
    • 入门指南 (Aptos)
      • 创建钱包
      • 获取 Aptos 代币
      • Cake 跨链指南
      • 在 PancakeSwap 连接钱包
      • Aptos 常见问题解答
    • V3/V2 迁移
      • 如何进行迁移?
      • v3 的 APR 是怎么计算的?
      • 常见问题解答
      • V2 迁移
        • 迁移到 MasterChef v2
        • MasterChef v2
          • 农场列表
        • CAKE 糖浆池
    • 审计报告
    • veCAKE 退场计划
      • 质押 CAKE 赎回
    • 路线图
    • 需要帮助?点我
      • 故障排除指南
      • 常见问题解答
      • 什么是授权操作?
      • 如何修复 MetaMask 上卡住的交易
      • 来自币安学院的指南
  • 产品
    • 🔄交易
      • 代币兑换
      • 如何进行交易
      • 交易手续费和路由设置
      • 流动性资金池
      • 添加/移除流动性
      • 交易 FAQ
      • 做市商整合
      • 智能路由 (V2)
        • 如何通过智能路由进行交易?
      • Zap
        • Zap- 一键添加流动性 (V2)
      • 稳定币兑换
        • 如何使用稳定币兑换
      • 限价單交易 & 时间加权平均价格 (TWAP)
        • 如何使用限价单?
        • 如何使用时间加权平均价格(TWAP)?
        • 限价单 FAQ(旧)
    • 🚜农场
      • 如何使用农场
        • 如何使用农场 (旧版农场页面)
      • APR/ROI/IL 计算器
      • 农场 FAQ
      • 在 Aptos 链上参与农场
        • Aptos链 农场 FAQ
      • 跨链农场
        • 跨链农场 FAQ
      • bCAKE
        • 如何使用新的 bCAKE ?
        • 迁移指南
        • bCAKE FAQ
        • V2 (已弃用)
          • 如何使用 bCAKE?
    • 🔷veCAKE
      • 什么是 veCAKE?
      • 如何获得 veCAKE?
      • 从 CAKE 糖浆池迁移
      • 每周赚取 CAKE
        • 每周赚取 CAKE FAQ
      • Gauges Voting
        • Gauge Voting FAQ
      • 贿选 (投票激励)
      • veCAKE 管理协议
      • 为项目激励流动性
      • 将你的 veCAKE 跨链
      • veCAKE FAQ
    • 🍯糖浆池-质押 CAKE
      • 其他糖浆池
        • 糖浆池 FAQ 与排错指南
      • CAKE 糖浆池
        • 如何使用灵活质押糖浆池
        • 如何使用锁仓质押糖浆池
        • CAKE 糖浆池 FAQ
    • 🧑‍⚖️农场竞拍
    • 💹收入分成
      • 如何参与?
      • 收入分成 FAQ
    • 🛍️IFO (初次农场发行)
      • 如何参加 IFO
      • 如何参与跨链 IFO?
      • FAQ
      • iCAKE
      • 合约详情
    • 🌉跨链
      • EVM 链之间跨链
      • EVM 链与 Aptos 之间跨链
      • 跨链 FAQ
      • Wormhole Bridge Guide
      • 虫洞跨链桥 FAQ
    • 🤝简单赚币
      • 如何使用简单赚币
      • 简单赚币 FAQ
      • 条款和条件
    • 💧流动权益质押整合
      • 如何进行流动权益质押?
      • WBETH
        • WBETH FAQ
      • SnBNB
        • SnBNB FAQ
    • 🟪永续合约交易
      • 什么是永续合约交易
      • 永续合约交易 V2
        • 我应该如何使用它?
        • Dumb 模式
          • Dumb 模式指南
        • Degen Mode
          • Degen 模式动态费用
        • MADBTCUSD
          • MADBTCUSD FAQ
        • 永续合约 V2 术语表
        • 外汇交易
        • 永续合约交易 FAQ
          • Arbitrum
            • ALP 糖浆池 (Arbitrum)
              • ALP 购买&出售手续费
        • 交易奖励计划
          • Arbitrum
        • 支持的区块链、模式和交易对
      • 永续合约交易 V1
        • 永续合约 V1 术语表
        • 我应该如何使用它?
        • 永续合约 V1 FAQ
    • 🎮游戏平台
      • 📒品牌工具套件
      • 🎓Pancake Mayer
      • 🛡️Pancake Protectors 游戏
        • FAQ
    • 🎯PancakeSwap 任务平台
      • 准备工作
      • 如何参与并完成一个任务
      • 奖励
    • 🧈交易返利
      • 如何参与
        • 顶级交易者交易返利活动
        • CAKE 锁仓用户交易返利活动
      • 交易返利 FAQ
    • 🔮预测
      • 如何使用预测功能
      • AI 预测
      • 预测功能 FAQ
      • 预测功能故障排除
      • 预测 Telegram 小程序
    • 🎟️彩票 v2
      • 如何玩转彩票v2
      • 彩票 FAQ
    • 🍯糖浆彩票
      • 如何玩转糖浆彩票
      • 糖浆彩票抽奖延迟说明
      • 糖浆彩票 FAQ
    • 🖼️NFT市场
      • 🖼️NFT 个人资料系统
        • 如何设置 NFT 个人资料?
        • 战队
    • 💳购买加密货币
    • 🌐PancakeSwap 迷你小程序
      • 如何使用 PancakeSwap 迷你小程序
      • 迷你小程序常见问题解答
      • ⛓️PancakeSwap CEDEFI 整合
    • 📈信息站
    • 🖥️PancakeSwap 私人 RPC
    • 🔔通知服务
    • PancakeSwap v4
      • v4 FAQ
    • 💸期权
      • 期权入门
      • CLAMM 期权
      • 期权 FAQ
  • 治理&代币经济
    • CAKE 代币经济模型
      • CAKE 的总量上限
    • 🗳️投票(旧)
    • 治理(新)
      • 如何投票
        • 如何使用SafePal钱包进行投票
      • vCAKE
  • 生态系统&合作伙伴关系
    • 联盟计划
      • 联盟仪表板&返佣链接
      • 佣金结构及支付详情
      • 联盟计划规则和指南
      • 条款及细则
    • 大使计划
      • 👥社区管理
      • 🌎社区翻译者
      • ❓大使计划 FAQs
    • 品牌和标志
    • 联系我们
      • 客户服务
      • 社交媒体与社区
    • 💼商务合作
      • ⛽Vecake-Gauges
      • 🧑‍🌾初次农场发行- IFO
      • 🥞糖浆池和农场
      • 🖼️NFT 交易市场
      • ❓商务合作常见 FAQ
  • 给开发者们
    • 为项目做出贡献
      • 代码库概览
    • Bug 赏金
    • 智能合约 (EVM)
      • veCAKE & Gauge Voting
      • PancakeSwap 交易相关
        • v3 相关合约
          • PancakeV3Factory
          • 智能路由 V3
            • V3 兑换路由
            • V2 兑换路由
            • StableSwap 路由
          • 非同质化仓位
          • Pancake V3 池子
        • v2 相关合约
          • Factory v2
          • 路由 V2
        • Stable Swap
          • Stableswap 路由
          • StableSwap 池子
      • 主厨合约
        • 主厨合约 V3
      • 糖浆池
        • 可初始化的 SmartChef
        • 池子部署器
      • CAKE 糖浆池
      • IFO
      • 预测
      • 彩票
        • 彩票合约
      • 糖浆彩票
      • 农场助推器 (bCAKE)
      • IFO 投入上限(iCAKE)
      • 跨链农场
      • CAKE 跨链
      • Market Maker Pool
    • 智能合约 (Aptos)
      • PancakeSwap 交易相关
        • V2
          • 兑换核心 V2
          • V2 路由
      • 主厨合约
      • 糖浆池
      • IFO
      • Utils
    • API
      • Subgraph
    • 私人 RPC 节点
  • 团队
    • 厨房团队
    • 成为一名大厨
      • Solidity Engineer (Contract)
      • Frontend Engineer (Contract)
      • 产品设计师(UX/I)
      • 商务开发经理
      • 前端工程师
      • Solidity 工程师
      • 开发运维工程师
  • 联系我们
    • 客户服务
    • 社交媒体与社区
  • 代币分发 (🚧)
  • 参考资料
    • Old Tokenomics
      • CAKE Tokenomics v1
      • Controlling CAKE supply v1
    • 如何通过BscScan使用农场
Powered by GitBook
On this page
  • Contract info
  • Read functions
  • WETH
  • factory
  • getAmountOut
  • getAmountIn
  • getAmountsOut
  • getAmountsIn
  • quote
  • Write functions
  • addLiquidity
  • addLiquidityETH
  • removeLiquidity
  • removeLiquidityETH
  • removeLiquidityETHSupportingFeeOnTransferTokens
  • removeLiquidityETHWithPermit
  • removeLiquidityETHWithPermitSupportingFeeOnTransferTokens
  • removeLiquidityWithPermit
  • swapETHForExactTokens
  • swapExactETHForTokens
  • swapExactETHForTokensSupportingFeeOnTransferTokens
  • swapExactTokensForETH
  • swapExactTokensForETHSupportingFeeOnTransferTokens
  • swapExactTokensForTokens
  • swapExactTokensForTokensSupportingFeeOnTransferTokens
  • swapTokensForExactETH
  • swapTokensForExactTokens
  • Interface

Was this helpful?

  1. 给开发者们
  2. 智能合约 (EVM)
  3. PancakeSwap 交易相关
  4. v2 相关合约

路由 V2

PreviousFactory v2NextStable Swap

Last updated 1 year ago

Was this helpful?

路由 v2 (Router v2)。

PancakeSwap is based on Uniswap v2. Read the . For more in-depth information on the core contract logic, read the .

Contract info

Contract name: PancakeRouter

View .

Chain
Address

BSC

0x10ED43C718714eb63d5aA57B78B54704E256024E

ETH

0xEfF92A263d31888d860bD50809A8D171709b7b1c

zkEVM

0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb

zkSync

0x5aEaF2883FBf30f3D62471154eDa3C0c1b05942d

Arbitrum

0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb

Linea

0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb

Base

0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb

opBNB

0x8cFe327CEc66d1C090Dd72bd0FF11d690C33a2Eb

Read functions

WETH

function WETH() external pure returns (address);

factory

function factory() external pure returns (address);

getAmountOut

function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut);

getAmountIn

function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn);

getAmountsOut

function getAmountsOut(uint amountIn, address[] memory path) internal view returns (uint[] memory amounts);

getAmountsIn

function getAmountsIn(uint amountOut, address[] memory path) internal view returns (uint[] memory amounts);

quote

function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB);

Write functions

addLiquidity

function addLiquidity(
  address tokenA,
  address tokenB,
  uint amountADesired,
  uint amountBDesired,
  uint amountAMin,
  uint amountBMin,
  address to,
  uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);

Adds liquidity to a BEP20⇄BEP20 pool.

Name
Type
Description

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

amountADesired

uint

The amount of tokenA you'd like to provide as liquidity.

amountBDesired

uint

The amount of tokenA you'd like to provide as liquidity.

amountAMin

uint

The minimum amount of tokenA to provide (slippage impact).

amountBMin

uint

The minimum amount of tokenB to provide (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

addLiquidityETH

function addLiquidityETH(
  address token,
  uint amountTokenDesired,
  uint amountTokenMin,
  uint amountETHMin,
  address to,
  uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);

Adds liquidity to a BEP20⇄WBNB pool.

Name
Type

addLiquidityETH

uint

The payable amount in BNB.

token

address

The contract address of the token to add liquidity.

amountTokenDesired

uint

The amount of the token you'd like to provide as liquidity.

amountTokenMin

uint

The minimum amount of the token to provide (slippage impact).

amountETHMin

uint

The minimum amount of BNB to provide (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

removeLiquidity

function removeLiquidity(
  address tokenA,
  address tokenB,
  uint liquidity,
  uint amountAMin,
  uint amountBMin,
  address to,
  uint deadline
) external returns (uint amountA, uint amountB);

Removes liquidity from a BEP20⇄BEP20 pool.

Name
Type

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

liquidity

uint

The amount of LP Tokens to remove.

amountAMin

uint

The minimum amount of tokenA to remove (slippage impact).

amountBMin

uint

The minimum amount of tokenB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

removeLiquidityETH

function removeLiquidityETH(
  address token,
  uint liquidity,
  uint amountTokenMin,
  uint amountETHMin,
  address to,
  uint deadline
) external returns (uint amountToken, uint amountETH);

Removes liquidity from a BEP20⇄WBNB pool.

Name
Type

token

address

The contract address of the token to remove liquidity.

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of BNB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

removeLiquidityETHSupportingFeeOnTransferTokens

function removeLiquidityETHSupportingFeeOnTransferTokens(
  address token,
  uint liquidity,
  uint amountTokenMin,
  uint amountETHMin,
  address to,
  uint deadline
) external returns (uint amountETH);

Removes liquidity from a BEP20⇄WBNB for tokens that take a fee on transfer.

Name
Type

token

address

The contract address of the token to remove liquidity.

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of BNB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

removeLiquidityETHWithPermit

function removeLiquidityETHWithPermit(
  address token,
  uint liquidity,
  uint amountTokenMin,
  uint amountETHMin,
  address to,
  uint deadline,
  bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);

Removes liquidity from a BEP20⇄WBNB and receives BNB, without pre-approval, via permit.

Name
Type

token

address

The contract address of the token to remove liquidity.

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of BNB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

removeLiquidityETHWithPermitSupportingFeeOnTransferTokens

function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
  address token,
  uint liquidity,
  uint amountTokenMin,
  uint amountETHMin,
  address to,
  uint deadline,
  bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);

Removes liquidity from a BEP20⇄WBNB and receives BNB via permit for tokens that take a fee on transfer.

Name
Type

token

address

The contract address of the token to remove liquidity.

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of BNB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

removeLiquidityWithPermit

function removeLiquidityWithPermit(
  address tokenA,
  address tokenB,
  uint liquidity,
  uint amountAMin,
  uint amountBMin,
  address to,
  uint deadline,
  bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);

Removes liquidity from a BEP20⇄BEP20, without pre-approval, via permit.

Name
Type

tokenA

address

The contract address of one token from your liquidity pair.

tokenB

address

The contract address of the other token from your liquidity pair.

liquidity

uint

The amount of LP Tokens to remove.

amountTokenMin

uint

The minimum amount of the token to remove (slippage impact).

amountETHMin

uint

The minimum amount of BNB to remove (slippage impact).

to

address

Address of LP Token recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

approveMax

bool

Whether or not the approval amount in the signature is for liquidity or uint(-1).

v

uint8

The v component of the permit signature.

r

bytes32

The r component of the permit signature.

s

bytes32

The s component of the permit signature.

swapETHForExactTokens

function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
  external
  payable
  returns (uint[] memory amounts);

Receive an exact amount of output tokens for as little BNB as possible.

Name
Type

swapETHForExactTokens

uint

Payable BNB amount.

amountOut

uint

The amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactETHForTokens

function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
  external
  payable
  returns (uint[] memory amounts);

Receive as many output tokens as possible for an exact amount of BNB.

Name
Type

swapExactETHForTokens

uint

Payable BNB amount.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactETHForTokensSupportingFeeOnTransferTokens

function swapExactETHForTokensSupportingFeeOnTransferTokens(
  uint amountOutMin,
  address[] calldata path,
  address to,
  uint deadline
) external payable;

Receive as many output tokens as possible for an exact amount of BNB. Supports tokens that take a fee on transfer.

Name
Type

swapExactETHForTokensSupportingFeeOnTransferTokens

uint

Payable BNB amount.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactTokensForETH

function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
  external
  returns (uint[] memory amounts);

Receive as much BNB as possible for an exact amount of input tokens.

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactTokensForETHSupportingFeeOnTransferTokens

function swapExactTokensForETHSupportingFeeOnTransferTokens(
  uint amountIn,
  uint amountOutMin,
  address[] calldata path,
  address to,
  uint deadline
) external;

Receive as much BNB as possible for an exact amount of tokens. Supports tokens that take a fee on transfer.

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactTokensForTokens

function swapExactTokensForTokens(
  uint amountIn,
  uint amountOutMin,
  address[] calldata path,
  address to,
  uint deadline
) external returns (uint[] memory amounts);

Receive as many output tokens as possible for an exact amount of input tokens.

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapExactTokensForTokensSupportingFeeOnTransferTokens

function swapExactTokensForTokensSupportingFeeOnTransferTokens(
  uint amountIn,
  uint amountOutMin,
  address[] calldata path,
  address to,
  uint deadline
) external;

Receive as many output tokens as possible for an exact amount of input tokens. Supports tokens that take a fee on transfer.

Name
Type

amountIn

uint

Payable amount of input tokens.

amountOutMin

uint

The minimum amount tokens to receive.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapTokensForExactETH

function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
  external
  returns (uint[] memory amounts);

Receive an exact amount of ETH for as few input tokens as possible.

Name
Type

amountOut

uint

Payable amount of input tokens.

amountInMax

uint

The minimum amount tokens to input.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

swapTokensForExactTokens

function swapTokensForExactTokens(
  uint amountOut,
  uint amountInMax,
  address[] calldata path,
  address to,
  uint deadline
) external returns (uint[] memory amounts);

Receive an exact amount of output tokens for as few input tokens as possible.

Name
Type

amountOut

uint

Payable amount of input tokens.

amountInMax

uint

The maximum amount tokens to input.

path (address[])

address

An array of token addresses. path.length must be >= 2. Pools for each consecutive pair of addresses must exist and have liquidity.

to

address

Address of recipient.

deadline

uint

Unix timestamp deadline by which the transaction must confirm.

Interface

import '@uniswap/v2-core/contracts/interfaces/IPancakeRouter.sol';
pragma solidity >=0.6.2;

interface IPancakeRouter01 {
    function factory() external pure returns (address);
    function WETH() external pure returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

// File: contracts\interfaces\IPancakeRouter02.sol

pragma solidity >=0.6.2;

interface IPancakeRouter02 is IPancakeRouter01 {
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);

    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
}

Returns the canonical address for (WETH being a vestige from Ethereum network origins).

Returns the canonical address for .

For explanations of the following, view the .

Uniswap v2 documentation
Uniswap v2 Core whitepaper
PancakeRouter.sol on GitHub
Binance: WBNB token
PancakeFactory
Uniswap v2 Internal Functions documentation