Comment on page
MESHSwapView
This contract can check asset details and exchange estimates of meshswap service
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 valuerateDecimals
: MESH distribution ratio denominator- 예) Daily MESH distribution ratio
- miningRate - 130323276365080043, rateDecimals - 10000000000000000
- 130323276365080043 / 10000000000000000 = 13.03...%
token0
: LP token0reserveA
: Amount of token0 held by LPtoken1
: LP token1reserveB
: Amount of token1 held by LPairdropCount
: Number of airdrop plans in progress at LPairdropTokens
: Airdrop token address arrayairdropSettings
: 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 MESHairdropCount
: Number of airdrop plans the LP hasairdropTokens
: Airdrop token address arrayairdropRewards
: 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 exchangedpath
: exchange token path
- example
- WMATIC -> MESH
- amountIn = 1000000000000000000 ( =1 WMATIC )
- path =
["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]
- WMATIC -> USDC -> MESH
- path =
["0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174", "0x82362Ec182Db3Cf7829014Bc61E9BE8a2E82868a"]
Last modified 10mo ago