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
  • Contract info
  • Read functions
  • getPair
  • allPairs
  • allPairsLength
  • feeTo
  • feeToSetter
  • Write functions
  • createPair
  • setFeeTo
  • setFeeToSetter
  • Events
  • PairCreated
  • Interface
  1. DEVELOPERS
  2. Smart Contracts (BSC)
  3. SMBSwap Exchange

Factory v2

PreviousSMBSwap ExchangeNextRouter v2

Last updated 2 years ago

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

Contract info

Contract name: SMBFactory Contract address: 0x2Af5c23798FEc8E433E11cce4A8822d95cD90565

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/ISMBFactory.sol';
pragma solidity =0.5.16;


interface ISMBFactory {
    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 documentation
Uniswap v2 Core whitepaper
SMBSwap: Factory v2 contract on BscScan