Pair
This documentation covers DoveSwap-specific functionality. For ERC-20 functionality, see Pair (ERC-20).
Events
Mintβ
event Mint(address indexed sender, uint amount0, uint amount1);Emitted each time liquidity tokens are created via mint.
Burnβ
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);Emitted each time liquidity tokens are destroyed via burn.
Swapβ
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);Emitted each time a swap occurs via swap.
Syncβ
Emitted each time reserves are updated via mint, burn, swap, or sync.
Read-Only Functions
MINIMUM_LIQUIDITYβ
Returns 1000 for all pairs. See Minimum Liquidity.
factoryβ
Returns the factory address.
token0β
Returns the address of the pair token with the lower sort order.
token1β
Returns the address of the pair token with the higher sort order.
getReservesβ
Returns the reserves of token0 and token1 used to price trades and distribute liquidity. See Pricing. Also returns the block.timestamp (mod 2**32) of the last block during which an interaction occured for the pair.
price0CumulativeLastβ
See Oracles.
price1CumulativeLastβ
See Oracles.
kLastβ
Returns the product of the reserves as of the most recent liquidity event. See Protocol Charge Calculation.
State-Changing Functions
mintβ
Creates pool tokens.
burnβ
Destroys pool tokens.
swapβ
Swaps tokens. For regular swaps, data.length must be 0. Also see Flash Swaps.
skimβ
Functions as a recovery mechanism in case enough tokens are sent to an pair to overflow the two uint112 storage slots for reserves, which could otherwise cause trades to fail. skim() allows a user to withdraw the difference between the current balance of the pair and 2**112β1 to the caller, if that difference is greater than 0
syncβ
Functions as a recovery mechanism in the case that a token asynchronously deflates the balance of a pair. In this case, trades will receive sub-optimal rates, and if no liquidity provider is willing to rectify the situation, the pair is stuck. sync() exists to set the reserves of the contract to the current balances, providing a somewhat graceful recoveryfrom this situation
Emits Sync.
Last updated