Fizzswap
English
English
  • Introduction
  • Protocol Overview
  • Core Concept
  • Risk & Security
  • Privacy Policy
  • Audit
  • Fizz Token
    • Fizzswap Protocol
  • PRODUCT
    • SWAP
    • V2 Pool
    • V3 Pool
      • Supply Liquidity to V3 pool
        • V3 Supply Guide
        • V3 Supply Policy
      • V3 to V3 Migration
        • V3 to V3 Migration Guide
        • V3 to V3 Migration Policy
      • Remove Liquidity from V3 Pool
        • V3 Remove Guide
        • V3 Remove Policy
  • GET STARTED
    • Create a Wallet
    • How to Transfer ETH to the Silicon Network
  • DEVELOPERS
    • Contract
      • V2Factory
      • Exchange
      • VotingRewardToken
      • V2Treasury
      • Distribution
      • Governor
      • V2Router
      • V2Helper
      • V3Factory
      • V3Pool
      • NonfungiblePositionManager
      • NonfungibleTokenPositionDescriptor
      • V3SwapRouter
      • V3Migrator
      • V3Estimator
      • PositionMigrator
      • V3Treasury
      • UniversalRouter
      • V3AirdropOperator
  • Fizzswap
  • Silicon Bridge
  • Github (fork)
  • Audit report (fork)
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions
Export as PDF
  1. DEVELOPERS
  2. Contract

V2Factory

PreviousContractNextExchange

Last updated 8 months ago

The Factory smart contract oversees the full functionality of V2 token pair registration and transactions in Fizzswap.

Code

Github Link: (Will be updated after official launch)

Address

  • Silicon Mainnet :

Events, Read-Only Functions, and State-Changing Functions

Events

ChangeNextOwner

event ChangeNextOwner(address nextOwner);
  • Event to pre-register new owner

  • owner will be governance smart contract (In Intial period before KSP distributed, DEV team have owner permission)

ChangeOwner

event ChangeOwner(address owner);
  • Event that completes changing the owner

Read-Only Functions

owner

  • Governance Contract Address

nextOwner

  • The next Governance Contract Address set in advance.

pools

  • List of liquidity pool pairings

  • Each item saves the smart contract address of the liquidity pool

poolExist

  • Returns if the contract for the given liquidity pool pair exists

tokenToPool

  • The contract address corresponding to the tokenA, tokenB pair

  • When the addresses of tokenA and tokenB are inputted, this returns the contract address of the corresponding pairing

  • Returns the same contract address regardless of the order of the liquidity pool pairing tokens:

    tokenToPool[tokenA][tokenB] == tokenToPool[tokenB][tokenA]

getPoolCount

function getPoolCount() public view returns (uint256)
  • Returns the current number of registered liquidity pools.

getPoolAddress

function getPoolAddress(uint256 idx) public view returns (address)
  • Returns the liquidity pair contract address of the pair's index.

State-Changing Functions

changeNextOwner

function changeNextOwner(address _nextOwner) public
  • Method to set the next Owner in advance before changing Owner

  • only owner

changeOwner

function changeOwner() public
  • Method for the next Owner to change the actual Owner

  • only nextOwner

createETHPool

function createETHPool(address token, uint256 amount, uint256 fee) public payable
  • A method called to add a liquidity pair with one side as ETH

  • Token for when the ETH-ERC20 pair to be registered has never been registered before

  • Parameters

    • token : ERC20 token address to add liquidity

    • amount : the amount of tokens (ERC20) to be provided for the initial liquidity

    • fee : Sets the initial fee value for liquidity pairs

      • A value between 0 and 100

      • Meaning: 0 -> 0%, 100 -> 1%

    • msg.value : ETH quantity to initially supply liquidity

      • Delivers the transaction value without specifying otherwise

createTokenPool

function createTokenPool(address token0, uint256 amount0, address token1, uint256 amount1, uint256 fee) public
  • Method called to add liquidity pair in case of ERC20 token pair

  • parameter

    • token0 : The address of the first token

    • amount0 : The quantity of the first token that supplies the initial liquidity

    • token1 : The address of the second token

    • amount1 : The quantity of the second token that supplies the initial liquidity

    • fee : Sets the initial fee value for liquidity pairs

0xCB72354080A1d3B8A48425B889025d0799c52095