MESHSwapView

This contract can check asset details and exchange estimates of meshswap service

Address

Read-Only Functions

getPoolData

function getPoolData(address lp) public view returns (
        uint miningRate,
        uint rateDecimals,
        address token0,
        uint reserveA,
        address token1,
        uint reserveB,
        uint airdropCount,
        address[] memory airdropTokens,
        uint[] memory airdropSettings 
    )
  • Details of the pool

  • Airdrop only between startBlock and endBlock of blocks in the network

  • Parameters

    • miningRate : MESH distribution ratio numerator value

    • rateDecimals : MESH distribution ratio denominator

      • 예) Daily MESH distribution ratio

        • miningRate - 130323276365080043, rateDecimals - 10000000000000000

        • 130323276365080043 / 10000000000000000 = 13.03...%

    • token0 : LP token0

    • reserveA : Amount of token0 held by LP

    • token1 : LP token1

    • reserveB : Amount of token1 held by LP

    • airdropCount : Number of airdrop plans in progress at LP

    • airdropTokens : Airdrop token address array

    • airdropSettings : Airdrop info array

      • [0]: blockAmount, [1]: startBlock, [2]: endBlock

  • airdropSettings Data format

    • 예) Token0, Token1 Airdrop

      • airdropTokens = [ Token0 address, Token1 address]

      • airdropSettings = [ Token0 blockAmount, Token0 startBlock, Token0 endBlock, Token1 blockAmount, Token1 startBlock, Token1 endBlock ]

getPendingReward

function getPendingReward(address lp, address user) public view returns ( 
    uint meshReward, 
    uint airdropCount, 
    address[] memory airdropTokens, 
    uint[] memory airdropRewards )
  • User's claimable reward information

  • Parameters

    • meshReward : Claimable MESH

    • airdropCount : Number of airdrop plans the LP has

    • airdropTokens : Airdrop token address array

    • airdropRewards : Arrangement of Airdrop token amount Information claimable

  • airdrop data format

    • 예) Token0, Token1 Airdrop

      • airdropTokens = [ Token0 address, Token1 address]

      • airdropSettings = [ Token0 reward, Token1 reward ]

estimateSwap

function estimateSwap(
    uint amountIn, 
    address[] memory path
) public view returns (uint amountOut)
  • MESHswap swap estimate lookup function

  • Input Parameters

    • amountIn : Token amount to be exchanged

    • path : exchange token path

  • example

    • WMATIC -> MESH

      • amountIn = 1000000000000000000 ( =1 WMATIC )

      • path = ["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]

    • WMATIC -> USDC -> MESH

      • path = ["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]

Last updated