Exchange

This is a smart contract to expand KIP7 that is created with every liquidity pair. The Factory deploys this as new pool creation is requested. Although the Factory actually stores the two tokens of a pair and swapping takes place through it, the Exchange Contract must be called for liquidity to be provided or taken.

Code

Github Link: (Will be updated after official launch)

Address

Contract address after production is deployed (scope link)

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

Events

Transfer

event Transfer(address indexed from, address indexed to, uint amount);
  • KIP7 Standard

  • Event log of Transfer/Mint/Burn

Approval

event Approval(address indexed holder, address indexed spender, uint amount);
  • KIP7 Standard

  • Event log of Approvals

ChangeMiningRate

event ChangeMiningRate(uint _mining);
  • Event log of mining rate change

ChangeFee

event ChangeFee(uint _fee);
  • Event log of trading fee rate changes

UpdateMiningIndex

event UpdateMiningIndex(uint lastMined, uint miningIndex);
  • Event log of pairs’ mining index changes

  • lastMined : Factory.mined() value at the time index is updated

  • miningIndex : pairs’ miningIndex value at the time

GiveReward

event GiveReward(address user, uint amount, uint lastIndex, uint rewardSum);
  • Event log of when mined KSP is claimed and distributed

  • user : address of the user who claimed

  • amount : the amount of KSP claimed

  • lastIndex : index result of the pair of the wallet after claiming

  • rewardSum : The amount of KSP that has been accrued so far

ExchangePos

event ExchangePos(address tokenA, uint amountA, address tokenB, uint amountB);
  • Event log of POS transactions

  • tokenA : Token address delivered by the user

  • amountA : the amount of tokens delivered by the user

  • tokenB : token address received by user

  • amountB : the amount of tokens received by the user

ExchangeNeg

event ExchangeNeg(address tokenA, uint amountA, address tokenB, uint amountB);
  • Event log of NEG transactions

  • tokenA : token address delivered by the user

  • amountA : the amount of tokens delivered by the user

  • tokenB : token address received by the user

  • amountB : the amount of tokens received by the user

AddLiquidity

event AddLiquidity(address user, address tokenA, uint amountA, address tokenB, uint amountB, uint liquidity);
  • Event log of liquidity additions

  • liquidity : the amount of LP tokens minted due to additional liquidity

RemoveLiquidity

event RemoveLiquidity(address user, address tokenA, uint amountA, address tokenB, uint amountB, uint liquidity);
  • Event log of liquidity removals

  • liquidity : the amount of LP tokens burned due to liquidity removal

Last updated