Note: Given two token addresses (token0, token1), return the swap pair address corresponding to the given tokens.
通过 ITWAMM(twammAdd) 合约获取创建 APEX/DAI 交易对地址。
代码块
addInitialLiquidity(
address token0,
address token1,
uint256 amount0,
uint256 amount1,
uint256 deadline
) external returns (uint256 lpTokenAmount);
代码块
event InitialLiquidityProvided(
address indexed addr,
uint256 lpTokenAmount,
uint256 amountA,
uint256 amountB
);
Note: Given two token addresses (token0, token1) and their corresponding amounts (amount0, amount1), with which the liquidity is initialized. Deadline is a number > current block.number and is used to prevent a dead operation.
通过 ITWAMM(twammAdd) 合约添加 APEX/DAI Pool 的初始流动性,定义 APEX/DAI 初始价格。
代码块
obtainReserves(address token0, address token1)
external
view
returns (uint256 reserve0, uint256 reserve1);
Note: Given two token addresses (token0, token1), return the reserve values for token0 (e.g. reserve0) and token 1 (e.g. reserve1) that are in the token0/token1 pair.
通过 ITWAMM(twammAdd) 合约的 View 函数获取 APEX/DAI Pool 的储备。
代码块
obtainTotalSupply(address pair)
external
view
returns (uint256);
Note: Given a pair address, return the total LP token supply.