Fathom Protocol
  • Introduction
  • FXD Stablecoin
    • FXD Smart Contract Architecture
    • Minting and Burning Mechanisms with LTV Ratio
    • Soft-Pegging to the US Dollar
    • Opening and closing position flows
    • BookKeeping mechanism
      • Stablecoin Accounting
      • Collateral Accounting
    • Liquidation
      • Fixed Spread Liquidation Strategy
      • Liquidation process walk through
    • Emergency Shutdown
    • Maths for position safety
    • Fee structure
    • Risk Management
    • Interfaces
      • ProxyWalletRegistry
      • ProxyWallet
        • FathomStablecoinProxyActions
      • CollateralPoolConfig
      • BookKeeper
      • FXD
      • LiquidationEngine
      • FlashMintModule
      • PriceFeed
      • ShowStopper
      • StabilityFeeCollector
      • SystemDebtEngine
      • AdminControls
    • Deployments
      • XDC Network
    • User Guides
      • Open FXD position
      • Top Up FXD Position
      • Repay and close FXD position
    • Fathom Stablecoin Smart Contracts
    • Fathom Stablecoin Subgraph
  • Vaults
    • Key Features
    • Definitions
    • Architecture
    • Fees
    • Workflows
    • Vault Management
    • Strategy Creation
    • Interfaces
      • Factory
      • Vault
      • BaseStrategy
      • TokenizedStrategy
    • Deployments
      • XDC Network
    • User Guides
      • Deposit and Withdraw in Vault
    • Fathom Vaults Smart Contracts
    • Fathom Vaults Subgraph
  • Lending
    • Core Concepts
    • Protocol Mechanics
    • Architecture
    • Interfaces
      • FmToken
      • VariableDebtToken
      • StableDebtToken
      • L2Pool
      • PoolAddressesProvider
    • User Guides
      • Supply, Borrow, Repay and Withdraw Asset
    • Deployments
      • XDC Network
    • Fathom Lending Smart Contracts
    • Fathom Lending Subgraph
  • DEX
    • Core Concepts
    • Architecture
    • Interfaces
      • Factory
      • Pair
      • Router
    • User Guides
      • Providing Liquidity
      • Swapping Assets
    • Deployments
      • XDC Network
    • Fathom DEX Smart Contracts
    • Fathom DEX Subgraph
  • DAO
    • DAO Structure
    • Governance Process
    • Staking Process
    • Treasury Management
    • Risk Management and Security Measures
    • Contributing to Fathom DAO
    • Interfaces
      • FTHM
      • Staking
        • Vault
        • RewardsCalculator
        • vFTHM
      • Governance
        • TimelockController
    • Deployments
      • XDC Network
    • User Guides
      • Staking
      • Proposing
      • Voting
    • Fathom DAO Smart Contracts
    • Fathom DAO Subgraph
  • Whitepaper
    • Version 1.0
  • Resources
  • FXD Deployments
  • FTHM Deployments
  • Privacy Policy
  • Terms of Service
Powered by GitBook

Copyright© Fathom App 2024.

On this page
  • State Variables
  • Set Functions
  • Read Functions
  • Events

Was this helpful?

Export as PDF
  1. DEX
  2. Interfaces

Factory

https://github.com/Into-the-Fathom/fathom-swap-smart-contracts/blob/master/contracts/core/UniswapV2Factory.sol

The UniswapV2Factory contract is a core component of the Fathom DEX. It is responsible for creating and managing pairs (liquidity pools) for token exchanges.

State Variables

feeTo

  • Type: address

  • Description: Address to which protocol fees are sent.

feeToSetter

  • Type: address

  • Description: Address with the permission to update the feeTo address.

getPair

  • Type: mapping(address => mapping(address => address))

  • Description: Mapping from two token addresses to the address of their liquidity pool.

allPairs

  • Type: address[]

  • Description: Array of all created pair addresses.

Set Functions

createPair

  • Parameters:

    • address tokenA: The first token of the pair.

    • address tokenB: The second token of the pair.

  • Returns:

    • address pair: The address of the created pair.

  • Description: Creates a new liquidity pair for tokenA and tokenB. Emits the PairCreated event.

setFeeTo

  • Parameters:

    • address _feeTo: The address to set as the fee recipient.

  • Description: Sets the address to which protocol fees are sent. Can only be called by the feeToSetter.

setFeeToSetter

  • Parameters:

    • address _feeToSetter: The address to set as the new feeToSetter.

  • Description: Sets the address that can update the fee recipient. Can only be called by the current feeToSetter.

Read Functions

allPairsLength

  • Parameters: None

  • Returns:

    • uint: The length of the allPairs array.

  • Description: Returns the number of all pairs created.

getInitHash

  • Parameters: None

  • Returns:

    • bytes32: The keccak256 hash of the UniswapV2Pair creation code.

  • Description: Returns the initialization hash of the UniswapV2Pair contract.

Events

PairCreated

  • Parameters:

    • address indexed token0: The first token of the pair.

    • address indexed token1: The second token of the pair.

    • address pair: The address of the created pair.

    • uint: The total number of pairs.

  • Description: Emitted when a new pair is created.

PreviousInterfacesNextPair

Last updated 11 months ago

Was this helpful?