Liquidity ZAP Contract

Address

Init Function

1
function initUniswapZAP(
2
address token,
3
address WETH,
4
address tokenWethPair
5
)
6
public
Copied!
Parameter
Description
token
Address of the token from LP pair.
WETH
Address of WETH.
tokenWethPair
Address of the LP pair.
Initializes LP addresses.

ZAP and unZAP Functions

1
function zapETH() external payable returns (uint256 liquidity)
Copied!
Adds liquidity taking only ETH tokens.
1
function zapTokens(uint amount) external returns (uint256 liquidity)
Copied!
Adds liquidity taking only Tokens.
1
function unzap() external returns (uint amountToken, uint amountETH)
Copied!
Unzaps LP to respective Token and ETH amounts.
1
function unzapToETH() external returns (uint amount)
Copied!
Unzaps LP to ETH only.
1
function unzapToTokens() external returns (uint amount)
Copied!
Unzaps LP to Token only.

Read-Only Functions

1
function getLPTokenPerEthUnit(uint ethAmt) public view returns (uint liquidity)
Copied!
Returns how many LP tokens is user able to get with given ETH amount.
Last modified 6mo ago