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.
kLast
function kLast() external view returns (uint256);
Returns the product of the reserves as of the most recent liquidity event.
State-Changing Functions
mint
function mint(address to) external returns (uint256 liquidity);
Creates pool tokens, which are sent to the to address.
Emits Mint, Sync, Transfer.
burn
function burn(address to) external returns (uint amount0, uint amount1);
Destroys pool tokens.
Emits Burn, Sync, Transfer.
swap
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata callbackData) external;
Swaps tokens.
Emits Swap, Sync.
skim
function skim(address to) external;
Gets actual token balances to match the reserve accounted balances reserve0 and reserve1.
sync
function sync() external;
Syncs virtual and actual reserve accounted balances with actual token balances.
Emits Sync.
Interface
pragma solidity 0.6.12;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IBuniCornFactory.sol";
interface IBuniCornPool {
function mint(address to) external returns (uint256 liquidity);
function burn(address to) external returns (uint256 amount0, uint256 amount1);
function swap(
uint256 amount0Out,
uint256 amount1Out,
address to,
bytes calldata data
) external;
function sync() external;
function getReserves() external view returns (uint112 reserve0, uint112 reserve1);
function getTradeInfo()
external
view
returns (
uint112 _vReserve0,
uint112 _vReserve1,
uint112 reserve0,
uint112 reserve1,
uint256 feeInPrecision
);
function token0() external view returns (IERC20);
function token1() external view returns (IERC20);
function ampBps() external view returns (uint32);
function factory() external view returns (IBuniCornFactory);
function kLast() external view returns (uint256);
}