Meshswap
  • Introduction
  • What is MESH?
    • MESH Allocation
    • MESH Tokenomics
    • MESH Redistribution Policy
  • Get started
    • Create a Wallet
    • Add Polygon Network & Tokens
    • How to move your assets to wallet
      • Transferring MATIC
        • [Binance, Kucoin, Gate.io] How to move MATIC from CEX to Wallet 1
        • [Coinbase, OKX, Upbit, Bithumb, Coinone] How to move MATIC to Wallet 2
        • [Polygon Bridge] How to move MATIC to Wallet 3
      • How to get WETH, MATIC, USDC, USDT, DAI
      • How to get oETH, oMATIC, oUSDC, oUSDT, oDAI
      • XRP: The Quickest and easiest way to transfer your asset
      • How to get oXRP in your KuCoin wallet and deposit in Meshswap
      • How to transfer BUSD from Binance to the Polygon network
      • Transferring TON
        • Create Wallets supporting TON network
        • How to transfer TON from wallet to Meshswap
        • How to transfer TON from Huobi to the Polygon network
  • More
    • Risk & Security
    • Privacy Policy
    • Contract & Audit
    • Contact & Team
    • Events
      • Early-bird MESH Airdrop Events(End)
      • Meshswap x Kucoin Partnership Giveaway Event(End)
  • PRODUCTS
    • Swaps
    • Lend
      • How to deposit your assets on Lending pools
      • The Detailed Policy of Lending Pool Deposit
    • Yield Farm
      • How to deposit your assets on Yield Farming pools
    • Leveraged Yield Farm
      • How to deposit your assets on Leveraged Yield Farming pools
      • Detailed Policy of Leverage Farm
    • Long/Short Margin Trading
      • Open and Close Long/Short Positions
        • Open Long Positions
        • Open Short Positions
        • Close Long Positions
        • Close Short Positions
      • Long/Short Margin Trading Details Policy
    • Interest rate
    • Stake
      • How to stake MESH
      • Staking Policy
    • Pool Voting
      • How to participate in Pool Voting with vMESH
    • Ecopot
    • Drops
    • Pool Airdrop
    • Governance
      • Governance Voting Policy
  • DEVELOPERS
    • Contract
      • MESH
      • MESHswapRouter
      • MESHSwapView
      • Factory
      • Exchange
      • PoolVoting
      • VotingMESH
      • Treasury
      • Distribution
      • Governor
      • SinglePool
      • SinglePool Factory
      • PlusPool
      • PlusPool Factory
      • EcoPotVoting
      • EcoPot
    • Airdrop
      • Set Airdrop Operator
      • Start Airdop
    • EcoPot
      • Set EcoPot
      • Start EcoPot
  • Meshswap Protocol
  • Orbit Bridge
Powered by GitBook
On this page
  • Code
  • Address
  • Events, Read-Only Functions, and State-Changing Functions
  1. DEVELOPERS
  2. Contract

SinglePool

This contract is a single pool contract, where liquidity providers deposit/withdraw assets, and Plus Pool users bring or return utilized assets from a single pool.

Code

Github Link: (Will be updated after official launch)

Address

Contract address after production is deployed

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

Events

GiveReward

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

Deposit

event Deposit(address user, uint depositAmount, uint depositTokens, uint totalAmount, uint totalSupply);
  • Event log of single pool liquidity additions

  • Parameters

    • user : user address

    • depositAmount : amount of tokens deposited by the user

    • depositTokens : amount of single pool tokens deposited

    • totalAmount : total amount of tokens deposited

    • totalSupply : total amount of single pool tokens deposited

Withdraw

event Withdraw(address user, uint withdrawAmount, uint withdrawTokens, uint totalAmount, uint totalSupply);
  • Event log of single pool liquidity removals

  • Parameters

    • user : User address

    • withdrawAmount : The amount of tokens removed by the user

    • withdrawTokens : The amount of single pool tokens removed by the user

    • totalAmount : Total amount of tokens deposited

    • totalSupply : Total amount of single pool tokens deposited

Borrow

event Borrow(address user, address plusPoolAddress, uint borrowAmount, uint accountBorrows, uint totalBorrows);
  • Event log of using assets utilized during plus deposit

  • Parameters

    • user : user address

    • plusPoolAddress : Plus Pool address

    • borrowAmount : The amount of tokens utilized

    • accountBorrows : Total amount of assets utilized by users

    • totalBorrows : Total amount of single pool utilized

Repay

event Repay(address user, address plusPoolAddress, uint repayAmount, uint accountBorrows, uint totalBorrows);
  • Event log of used assets are returned

  • Parameters

    • user : User address

    • plusPoolAddress : PlusPool address

    • repayAmount : The amount of returned asset tokens

    • accountBorrows : Total amount of assets utilized by users

    • totalBorrows : Total amount of single pool utilized

Read-Only Functions

name

  • "I" + token name

symbol

  • "i" + token symbol

decimals

  • 18

token

  • ERC-20 token address

totalSupply

  • mint/burn depending on liquidity addition/removal

balanceOf

  • Number of LP tokens held by each address

allowance

  • Status of approval to spender for each address

getCash

  • Number of tokens held by contract

reserveFactor

  • MESH buyback & burn allocation ratio among utilization fees

  • It is a value between 0 and 10^18, in units of 0.000000000000000001%

  • Default - 200000000000000000

totalBorrow

  • Total Assets Utilized

mining

  • The ratio of MESHs distributed to a single pool mined by that pool

  • It is a value between 0 and 10000, in units of 0.0001%

lastMined

  • SinglePoolFactory.mined() value at the last time the pair updated the index

withdrawActive

function withdrawActive() public view returns (bool)
  • Whether single pool withdrawal is possible

depositActive

function depositActive() public view returns (bool)
  • Whether single pool deposit is possible

State-Changing Functions

transfer

function transfer(address _to, uint _value) public returns (bool)
  • ERC-20 Standard

  • Method to transfer tokens

transferFrom

function transferFrom(address _from, address _to, uint _value) public returns (bool)
  • ERC-20 Standard

  • Method to transfer tokens on behalf of the approved wallet

approve

function approve(address _spender, uint _value) public returns (bool)
  • ERC-20 Standard

  • Method to approve a transfer as much as value to spender

depositETH

function depositETH() public payable
  • Method used to provide liquidity when token is MATIC

  • Liquidity of the MATIC msg.value

depositToken

function depositToken(uint depositAmount) public
  • Method used to provide liquidity when token is ERC-20 standard token

  • Liquidity of the number of deposit amount is provided

withdrawETH

function withdraw(uint withdrawAmount)
  • Method to withdraw MATIC to msg.sender wallet.

  • withdrawAmount : Number of token amount to withdraw

withdrawETHByAmount

function withdrawETHByAmount(uint withdrawTokens)
  • Method to withdraw MATIC to msg.sender wallet.

  • withdrawTokens : Number of SinglePool liquidity token amount to withdraw

withdrawToken

function withdrawToken(uint withdrawAmount)
  • Method to withdraw tokens to msg.sender wallet.

  • withdrawAmount : Number of token amount to withdraw

withdrawTokenByAmount

function withdrawTokenByAmount(uint withdrawTokens)
  • Method to withdraw tokens to msg.sender wallet.

  • withdrawTokens : Number of SinglePool liquidity token amount to withdraw

addReserves

function addReserves(uint addAmount) external payable
  • Method to transfer tokens to using buyback MESH

  • addAmount : Number of token

claimReward

function claimReward() public
  • Method that a user calls to claim the claimable MESH and airdrop that has accumulated for the pair

  • When called, MESH is claimed from the Factory and paid to msg.sende

  • Even if the method is not called directly, it is automatically called when the SinglePool token balance of the user’s wallet changes.

    • When liquidity is added

    • When liquidity is removed

PreviousGovernorNextSinglePool Factory

Last updated 2 years ago