Meshswap
Search…
MESHSwapView
This contract can check asset details and exchange estimates of meshswap service

Address

  • Polygon Mainnet : 0xF61e4ede9128A9FA9a128cB7D161F4e73bd464Da
Read-Only Functions

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(
address tokenIn,
address tokenOut,
uint amountIn,
address[] memory path
) public view returns (uint amountOut)
  • MESHswap swap estimate lookup function
  • Input Parameters
    • tokenIn : Token address to be exchanged
    • tokenOut : Token address to receive
    • amountIn : Token amount to be exchanged
    • path : exchange route
  • example
    • WMATIC -> MESH
      • tokenIn = WMATIC token address
      • tokenOut = MESH token address
      • amountIn = 1000000000000000000 ( =1 WMATIC )
      • path = []
    • WMATIC -> ORC -> MESH
      • tokenIn = WMATIC token address
      • tokenOut = MESH token address
      • amountIn = 1000000000000000000 ( =1 WMATIC )
      • path = ["{ORC token Address}"]
Copy link