LogoLogo
  • 소개
  • 프로토콜 개요
  • 핵심 개념
  • 클레이스왑의 장점
  • 위험 & 보안
  • 개인정보처리방침
  • 보안 감사
  • Tokenomics
    • KSP
      • KSP Tokenomics
      • KSP 분배율 자동화
        • KSP 분배율 반영 정책
      • KSP Allocation
  • Product
    • Swap
    • Supply & Borrow
      • 자동 반환
      • 파라미터
      • Supply & Borrow 상세정책
    • V2 Pool
    • V3 Pool (Concentrated Liquidity Pool)
      • V2 to V3 마이그레이션
        • V2 to V3 마이그레이션 가이드
        • V2 to V3 마이그레이션 상세 정책
      • V3 풀 유동성 공급
        • V3 풀 유동성 공급 가이드
        • V3 풀 유동성 공급 상세 정책
      • V3 to V3 마이그레이션
        • V3 to V3 마이그레이션 가이드
        • V3 to V3 마이그레이션 상세 정책
      • V3 풀 유동성 회수
        • V3 풀 회수 가이드
        • V3 풀 유동성 회수 상세 정책
    • KSP Staking
      • Staking 정책
    • Governance
      • Governance 투표 정책
    • Pool Airdrop
    • APR & APY
      • TVL
      • Pool
      • Staking
  • Developers
    • Contract
      • V2Factory
      • V2Exchange
      • VotingKSP
      • V2Treasury
      • Distribution
      • Governor
      • Helper
      • V3Factory
      • V3Pool
      • NonfungiblePositionManager
      • NonfungibleTokenPositionDescriptor
      • V3SwapRouter
      • V3Migrator
      • V3Estimator
      • PositionMigrator
      • V3Treasury
      • V3AirdropOperator
      • UniversalRouter
    • Airdrop
      • Airdrop Operator 권한 획득
      • Airdrop 계획 진행
  • HOW-TO GUIDES
    • 클레이스왑 가이드
    • 서비스에 연결하기
      • [클립] PC에서 연결하기
      • [클립] 모바일에서 연결하기
      • [카이카스] PC에서 연결하기
    • 활용할 자산 입금하기
      • 클레이튼 자산 입금하기
      • 이더리움/BSC 자산 입금하기
      • 리플 자산 입금하기
    • 풀에 예치하기
      • [클립] PC에서 단일 예치하기
      • [부리또월렛] 모바일에서 단일 예치하기
      • [클립] PC에서 일반 페어 예치 하기
      • [클립] 모바일에서 일반 페어 예치 하기
      • [카이카스] PC에서 일반 페어 예치하기
      • [클립] PC에서 플러스 페어 예치하기
      • [공통] 활용할 자산 선택하기
    • 풀에서 출금하기
      • [클립] PC에서 단일 예치출금하기
      • [클립] PC에서 플러스 예치 출금하기
    • KSP 스테이킹 & 풀 투표하기
      • [클립] PC에서 KSP 스테이킹 하기
      • [클립] 모바일에서 KSP 스테이킹 하기
      • [카이카스] PC에서 KSP 스테이킹 하기
      • [클립] PC에서 풀 투표 하기
      • [클립] 모바일에서 풀 투표 하기
      • [카이카스] PC에서 풀 투표 하기
    • 보상 수령하기
    • FAQ
      • 클레이스왑은 어떤 서비스인가요?
      • 클레이(KLAY) & 클레이스왑(KSP)은 무엇인가요?
      • 유동성 풀(Liquidity pool)이 무엇인가요?
      • 유동성 풀의 예치방법, 특징이 무엇인가요?
      • 왜 클레이스왑에서 예치해야 하나요?
      • 획득한 보상은 어떻게 활용하나요?
  • KLAYswap
  • Orbit Bridge
  • KLAYswap git
  • Orbit Bridge git
  • KLAYswap audit report
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions
  1. Developers
  2. Contract

V2Factory

PreviousContractNextV2Exchange

Last updated 11 months ago

The Factory smart contract oversees the full functionality of token pair registration and transactions in KLAYswap. It is also a token contract for KLAYswap's KSP governance token that complies with the KIP7 standard, and a smart contract that implements all functions related to KSP mining.

Code

Github Link: (Will be updated after official launch)

Address

  • Cypress :

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

Events

CreatePool

event CreatePool(
    address token0,
    uint256 amount0,
    address token1,
    uint256 amount1,
    uint256 fee,
    address exchange,
    uint256 exid
);
  • Event to create new liquidity pool

  • parameters

    • token0 : token0 address in pair

    • amount0 : token0 amount in pool

    • token1 : token1 address in pair

    • amount1 : token1 amount in pool

    • fee : pool fee rate exchange :

    • exchange : contract address of this pool

    • exid : exchange id

Read-Only Functions

owner

  • Governance Contract Address

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 liquidiy pool pair exists

tokenToPool

  • 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]

createFee

  • The amount of KSP that must be paired to create a new liquidity pool pair

  • deprecated

getPoolCount

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

getPoolAddress

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

State-Changing Functions

createKlayPool

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

  • Token for when the KLAY-KIP7 pair to be registered has never been registered before

  • Parameters

    • token : KIP7 token address to add liquidity

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

    • fee : Sets the initial fee value for liquidity pairs

      • A value between 30 and 100

      • Meaning: 30 -> 0.3%, 100 -> 1%

    • msg.value : KLAY 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
  • A method called to add a liquidity pair with both ERC20

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

  • 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

0xb2ad0f20d54177916721c6b6466bce1eb1a56eef