Pair

This documentation covers Dragonswap-specific functionality. For ERC-20 functionality, see Pair (ERC-20).

Code

DragonswapPair.solarrow-up-right

Events

event Mint(address indexed sender, uint amount0, uint amount1);

Emitted each time liquidity tokens are created via mint.

event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);

Emitted each time liquidity tokens are destroyed via burn.

event Swap(
  address indexed sender,
  uint amount0In,
  uint amount1In,
  uint amount0Out,
  uint amount1Out,
  address indexed to
);

Emitted each time a swap occurs via swap.

Emitted each time reserves are updated via mint, burn, swap, or sync.

Read-Only Functions

MINIMUM_LIQUIDITY​arrow-up-right

Returns 1000 for all pairs. See Minimum Liquidity.

Returns the factory address.

Returns the address of the pair token with the lower sort order.

Returns the address of the pair token with the higher sort order.

Returns the reserves of token0 and token1 used to price trades and distribute liquidity. Also returns the block.timestamp (mod 2**32) of the last block during which an interaction occured for the pair.

price0CumulativeLast​arrow-up-right

price1CumulativeLast​arrow-up-right

Returns the product of the reserves as of the most recent liquidity event.

State-Changing Functions

Creates pool tokens.

Destroys pool tokens.

Swaps tokens. For regular swaps, data.length must be 0.

Interface

ABI

https://github.com/dragonswap-app/dragonswap-core/blob/7daf58214605f2bcbb2b06d295acc1d891437fc7/deployments/abis.json#L1195arrow-up-right

Last updated