PancakeSwap
Launch App
Español
Español
  • PancakeSwap Intro
    • Empezando en PancakeSwap
      • Creando una Wallet
      • Tokens Bep20
      • Cómo Conectarse a PancakeSwap
    • Empezando en PancakeSwap (Aptos)
      • Crea una Wallet
      • Cómo conseguir Aptos Coins
      • Guía del Puente de CAKE
      • Conecta tu Wallet a PancakeSwap
      • Aptos FAQ (preguntas más frecuentes)
    • Migraciones V3/V2
      • ¿Como migrar?
      • Preguntas más frecuentes (FAQ)
      • Migración V2
        • Migra tus Stakings
        • MasterChef v2
        • CAKE Syrup Pool
      • Cómo se calcula el APR de V3
    • Auditorías
    • Roadmap
    • Ayuda
      • Errores Frecuentes
      • Preguntas Frecuentes
      • Arreglar Transacciones Pendientes Trabadas
      • Guía de Binance Academy
  • Productos.
    • 🔄Exchange
      • Swap de Tokens
      • Cómo hacer un Trade
      • Fees y Rutas
      • Liquidez
      • Añadir/Remover Liquidez
      • FAQ()
      • Integración del Market Maker
      • Smart Router (V2)
        • Cómo comerciar usando Smart Router
      • Zap (V2)
      • StableSwap
      • Limit Orders (V2)
        • Limit Orders FAQ
    • 🚜 Yield Farming
      • Cómo usar Farms
      • APR/ROI/Calculadora IL
      • FAQ
      • Farming en Aptos
        • Preguntas más frecuentes (FAQ)
      • Crosschain Farming
        • FAQ Crosschain farming
      • bCAKE
        • Cómo usar bCAKE
        • FAQ
      • Cómo usar Farms (BscScan)
    • 🔷veCAKE
      • Qué es veCAKE?
      • Cómo obtener veCAKE?
      • Migración del pool de CAKE
      • FAQ
    • 🍯Syrup Pools
      • Nuevo Cake Pool
        • Cómo usar el Staking Flexible
        • Cómo usar Staking Bloqueado
        • CAKE Syrup Pool FAQ
      • Syrup Pool FAQ & Errores Frecuentes
    • 🍯Syrup Pools - Stake CAKE(*)
    • 💹Revenue Sharing
      • Cómo participar?
      • FAQ
    • 🛍️IFO (Oferta Inicial de Farm)
      • Cómo Participar en una IFO
      • iCAKE
      • Detalles de Contrato
    • 🤝Staking Simple
      • Cómo comenzar con Staking Simple
      • FAQ
      • Términos y Condiciones
    • 💧Integración de Staking Líquido
      • Cómo hacer Staking Líquido
      • WBETH
        • WBETH FAQ
      • SnBNB
        • SnBNB FAQ
    • Trading Perpetuo
      • Qué es Trading Perpetuo?
      • Trading Perpetuo V2
        • Cómo se usa?
        • Glosario V2
        • Forex
        • Trading Perpetuo V2 FAQ
          • Arbitrum
            • ALP Syrup Pool (Arbitrum)
              • ALP Comisiones por compras y ventas
      • Trading Perpetuo V1
        • Glosario V1
        • ¿Como puedo usarlo?
        • Trading Perpetuo V1 FAQ (Preguntas más frecuentes)
    • 🎮Gaming
      • 🎓Pancake Mayor
    • 🧈Recompensas de Trading
      • Cómo participar
      • FAQ
    • 🔮Predicción
      • Cómo Usar Predicción?
      • Errores y Preguntas Frecuentas
    • 🎟️Lotería v2
      • Cómo Jugar a la Lotería V2
      • Lotería: FAQ
    • 🍯Pottery
      • Cómo usar Pottery?
      • Pottery: FAQ
      • Actualización de Pottery
    • 🖼️Perfil NFT en PancakeSwap
      • Equipos
      • Cómo Crear un Perfil
    • 💳Compra cripto
    • 🌐PancakeSwap Mini-Programa
      • ¿Cómo usar el Mini-Programa de PancakeSwap?
      • Mini-Programa - Preguntas más Frecuentes (FAQ)
      • ⛓️PancakeSwap CEDEFI Integration translated
    • 📈Info (Analíticas)
    • 🔔Notificaciones
    • PancakeSwap V4
      • v4 FAQ
  • Gobernanza y Tokenomics
    • CAKE
      • Tokenomics de CAKE
      • Controlando el Circulante de CAKE
    • Votación (Viejo)
      • Qué se vota?
      • ¿Cómo votar?
        • ¿Cómo votar con la billetera de SafePal?
      • vCAKE
    • Gobernanza (Nuevo)
  • Multichain
    • Implementación en Aptos
  • Ecosistema & Alianzas
    • Marca y logos
    • Alianzas Comerciales
      • ⛽Gauges
  • Desarrolladores
    • Contribuciones
      • Descripción de Base de Código
    • Recompensa por Bugs
    • Smart Contracts
      • Lottery v2
      • Exchange
        • Factory v2
        • Router v2
      • Main Staking/Syrup Pool/MasterChef Contract
      • Prediction V2
      • Auto CAKE Syrup Pool (CakeVault)
  • Equipo
    • El Equipo de La Cocina
    • Quieres ser un Chef?
      • Senior Backend Engineer - JavaScript / TypeScript
      • Solidity Engineer
      • Blockchain QA Engineer
  • Contacto
    • Partnerships de Negocios
    • NFT Marketplace
    • Soporte
    • Redes Sociales & Comunidades
  • Archivo
Powered by GitBook
On this page
  • Contract info
  • Read functions
  • getPair
  • allPairs
  • allPairsLength
  • feeTo
  • feeToSetter
  • Write functions
  • createPair
  • setFeeTo
  • setFeeToSetter
  • Events
  • PairCreated
  • Interface

Was this helpful?

  1. Desarrolladores
  2. Smart Contracts
  3. Exchange

Factory v2

PreviousExchangeNextRouter v2

Last updated 3 years ago

Was this helpful?

PancakeSwap está basado en Uniswap v2. Lea la . Para más info lea .

Contract info

Contract name: PancakeFactory Contract address: 0xcA143Ce32Fe78f1f7019d7d551a6402fC5350c73

View .

View the .

Read functions

getPair

function getPair(address tokenA, address tokenB) external view returns (address pair);

Address for tokenA and address for tokenB return address of pair contract (where one exists).

tokenA and tokenB order is interchangeable.

Returns 0x0000000000000000000000000000000000000000 as address where no pair exists.

allPairs

function allPairs(uint) external view returns (address pair);

Returns the address of the nth pair (0-indexed) created through the Factory contract.

Returns 0x0000000000000000000000000000000000000000 where pair has not yet been created.

Begins at 0 for first created pair.

allPairsLength

function allPairsLength() external view returns (uint);

Displays the current number of pairs created through the Factory contract as an integer.

feeTo

function feeTo() external view returns (address);

The address to where non-LP-holder fees are sent.

feeToSetter

function feeToSetter() external view returns (address);

The address with permission to set the feeTo address.

Write functions

createPair

function createPair(address tokenA, address tokenB) external returns (address pair);

Creates a pair for tokenA and tokenB where a pair doesn't already exist.

tokenA and tokenB order is interchangeable.

Emits PairCreated (see Events).

setFeeTo

Sets address for feeTo.

setFeeToSetter

Sets address for permission to adjust feeTo.

Events

PairCreated

event PairCreated(address indexed token0, address indexed token1, address pair, uint);

Emitted whenever a createPair creates a new pair.

token0 will appear before token1 in sort order.

The final uint log value will be 1 for the first pair created, 2 for the second, etc.

Interface

import '@uniswap/v2-core/contracts/interfaces/IPancakeFactory.sol';
pragma solidity =0.5.16;


interface IPancakeFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
}
Uniswap v2: documentación
Uniswap v2: whitepaper
PancakeFactory.sol on GitHub
PancakeSwap: Factory v2 contract on BscScan