# Helper

The Helper smart contract is a contract that helps deposit LP with single token, even if you do not bring two tokens.

## Code

Github Link: (Will be updated after official launch)

## Address

* Cypress : [0x0363053524610888Fb883A5C0b16Fb55aA4701Cf](https://scope.klaytn.com/account/0x0363053524610888Fb883A5C0b16Fb55aA4701Cf?tabId=contractCode)

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Read-Only Functions" %}

## State-Changing Functions

**estimateLP**

```solidity
function estimateLP(address lp, address token, uint amount, uint swap, bool validPool) public view returns (uint estLP, uint realInput, uint estTarget)
```

* Method to estimate the expected amounts, depositing with single token.
* Parameters
  * `lp` : Address of LP token
  * `token` : Token address to be deposited
  * `amount` : Amount of token not to be swapped
  * `swap` : Amount of token to swap
  * `validPool` : Whether it is a pool with KSP rewards
* Returns
  * `estLP` : Expected number of LP token to be minted
  * `realInput` : Actual number of input amount
  * `estTarget` :  Amount of tokens to be receivedthrough swap

**estimateSwapAmount**

```solidity
function estimateSwapAmount(address lp, address token, uint amount) public view returns (uint maxLP, uint maxSwap, uint targetAmount)
```

* Method to change the mining weight per liquidity pair
* Parameters
  * `lp` : Address of LP
  * `token` : Token address to be deposited
  * `amount` : Amount of token to be deposited
* Returns
  * `maxLP` :  Expected number of LP token to be minted
  * `maxSwap` : Expected amount of token to swap
  * `targetAmount` :  Amount of tokens to be received through swap
    {% endtab %}

{% tab title="State-Changing Functions" %}

## State-Changing Functions

####

**addLiquidityWithKlay**

```solidity
function addLiquidityWithKlay(address lp, uint limit, uint inputForLiquidity, uint targetForLiquidity) public payable
```

* Method to add liquidity only providing KLAY.
* Parameters
  * `lp` : address of LP token
  * `limit` : Minimum amounts of LP tokens to be minted.
  * `inputForLiquidity` : Expected amount of KLAY to provide LP
    * 1% slippage allowed
  * `targetForLiquidity` : Expected amount of target token to provide LP
    * 1% slippage allowed
  * `msg.value` : KLAY amount of token to be provided.

**addLiquidityWithKCT**

```solidity
function addLiquidityWithKCT(address lp, address token, uint amount, uint limit, uint inputForLiquidity, uint targetForLiquidity) public
```

* Method to add liquidity only providing single token.
* Parameters
  * `lp` : address of LP token
  * `token` : Token address to be deposited
  * `amount` : Amount of token to be deposited
  * `limit` : Minimum amounts of LP tokens to be minted.
  * `inputForLiquidity` : Expected amount of input token to provide LP
    * 1% slippage allowed
  * `targetForLiquidity` : Expected amount of target token to provide LP
    * 1% slippage allowed
      {% endtab %}
      {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.klayswap.com/developers/contract/helper.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
