# Pot2Pump ABI

## `Pot2PumpFactory` Module

***

#### <mark style="color:red;">`createPair`</mark> <mark style="color:red;"></mark><mark style="color:red;">method</mark>

Creates a new trading pair in Pot2Pump.

```json
### ABI Format
{
  "inputs": [{
    "components": [{
      "internalType": "address",
      "name": "raisedToken",
      "type": "address"
    }, {
      "internalType": "string",
      "name": "name",
      "type": "string"
    }, {
      "internalType": "string", 
      "name": "symbol",
      "type": "string"
    }, {
      "internalType": "address",
      "name": "swapHandler",
      "type": "address"
    }],
    "internalType": "struct Pot2PumpFactory.CreatePairParams",
    "name": "params",
    "type": "tuple"
  }],
  "name": "createPair",
  "outputs": [{
    "internalType": "address",
    "name": "pair",
    "type": "address"
  }, {
    "internalType": "address",
    "name": "launchedToken",
    "type": "address"
  }],
  "stateMutability": "nonpayable",
  "type": "function"
}
```

**Structure**

<table><thead><tr><th width="152">Field</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>params</td><td>tuple</td><td>Parameter struct required for creating the trading pair.</td></tr><tr><td>raisedToken</td><td>address</td><td>Address of the token being raised.</td></tr><tr><td>name</td><td>string</td><td>Name of the new trading pair.</td></tr><tr><td>symbol</td><td>string</td><td>Symbol of the new trading pair.</td></tr><tr><td>swapHandler</td><td>address</td><td>Address of the swap handler contract.</td></tr></tbody></table>

**Returns**

<table><thead><tr><th width="150">Name</th><th width="141">Type</th><th>Description</th></tr></thead><tbody><tr><td>pair</td><td>address</td><td>Address of the newly created trading pair.</td></tr><tr><td>handler</td><td>address</td><td>Address of the handler linked to the pair.</td></tr></tbody></table>

{% hint style="warning" %}

1. The caller must verify that the `raisedToken` is properly registered in the factory contract.
2. The `swapHandler` address must point to a valid and functional swap handler contract.
3. This method will deploy new token and pair contracts.
4. The newly created pair will be initialized with the appropriate parameters upon deployment.
   {% endhint %}

{% tabs %}
{% tab title="Usage Example" %}

````javascript
// Web3.js example
const createPairParams = {
  raisedToken: "0x...", // Fundraising token address
  name: "MyToken",      // New token name
  symbol: "MTK",        // New token symbol
  swapHandler: "0x..."  // Swap handler address
};

const result = await pot2PumpFactory.methods.createPair(createPairParams).send({
  from: userAddress
});

const { pair, launchedToken } = result.events.PairCreated.returnValues;
```
````

{% endtab %}
{% endtabs %}

***

<mark style="color:red;">**`depositRaisedToken`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**&**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**`refundRaisedToken`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**methods**</mark>

<pre class="language-json"><code class="lang-json"><strong>### ABI Format
</strong>
[{
  "inputs": [{
    "internalType": "address",
    "name": "depositor",
    "type": "address"
  }, {
    "internalType": "uint256",
    "name": "amount",
    "type": "uint256"
  }],
  "name": "depositRaisedToken",
  "outputs": [],
  "stateMutability": "nonpayable",
  "type": "function"
}, {
  "inputs": [],
  "name": "refundRaisedToken",
  "outputs": [],
  "stateMutability": "nonpayable",
  "type": "function"
}]
</code></pre>

1. **`depositRaisedToken`**&#x20;

This method is used to deposit fundraising tokens.

**Structure**

<table><thead><tr><th width="152">Field</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>depositor</td><td>address</td><td>Depositor's address</td></tr><tr><td>amount</td><td>uint256</td><td>Deposit amount</td></tr></tbody></table>

{% hint style="info" %}

1. Checks that the pair status is not paused
2. Verifies current time hasn't exceeded end time
3. Deposits made in the first half of the launch cycle are considered early deposits
4. Automatically executes `_perform()` if total deposits reach minimum cap
   {% endhint %}

{% tabs %}
{% tab title="Usage Example" %}

```javascript
// Web3.js example
await pot2PumpPair.methods.depositRaisedToken(
  userAddress,  // Depositor address
  "1000000000000000000"  // Amount (in wei)
).send({
  from: userAddress
});
```

{% endtab %}
{% endtabs %}

2. **`refundRaisedToken`**&#x20;

This method is used to refund raised tokens.

{% hint style="info" %}

1. Refunds are only possible when:
   * Fundraising period has ended and minimum cap wasn't reached
   * Or pair status is paused
2. Returns user's deposited tokens
3. Updates early deposit records
   {% endhint %}

{% hint style="warning" %}

1. Ensure contract approval before `depositRaisedToken`
2. Early depositors (first half of launch cycle) receive additional rewards
3. `refundRaisedToken` has strict triggering conditions
4. Both methods are non-reentrant to prevent attacks
   {% endhint %}

{% tabs %}
{% tab title="Usage Example" %}

```javascript
// Web3.js example
await pot2PumpPair.methods.refundRaisedToken().send({
  from: userAddress
});
```

{% endtab %}

{% tab title="Approval Example" %}

```javascript
// Approve before deposit
await raisedToken.methods.approve(
  pot2PumpPairAddress,
  amount
).send({
  from: userAddress
});
```

{% endtab %}
{% endtabs %}

***

<mark style="color:red;">**`claimLP`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**&**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**`claimableLP`**</mark><mark style="color:red;">**&#x20;**</mark><mark style="color:red;">**methods**</mark>

```json
### ABI Format
[{
  "inputs": [{
    "internalType": "address",
    "name": "claimer",
    "type": "address"
  }],
  "name": "claimLP",
  "outputs": [],
  "stateMutability": "nonpayable",
  "type": "function"
}, {
  "inputs": [{
    "internalType": "address",
    "name": "claimer",
    "type": "address"
  }],
  "name": "claimableLP",
  "outputs": [{
    "internalType": "uint256",
    "name": "",
    "type": "uint256"
  }],
  "stateMutability": "view",
  "type": "function"
}]
```

1. **`claimLP`**&#x20;

This method is used to claim LP tokens.

**Structure**

<table><thead><tr><th width="152">Field</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>claimer</td><td>address</td><td>Claimer's address</td></tr></tbody></table>

{% hint style="info" %}

1. Checks pair status must be Success
2. Transfers claimable LP tokens to specified address
3. Includes reentrancy protection (nonReentrant)
   {% endhint %}

{% tabs %}
{% tab title="Usage Example" %}

```javascript
// Web3.js example
await pot2PumpPair.methods.claimLP(
  userAddress  // Claimer address
).send({
  from: userAddress
});
```

{% endtab %}
{% endtabs %}

2. **`claimableLP`**&#x20;

This method is used to query claimable LP token amount.

**Structure**

<table><thead><tr><th width="152">Field</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>claimer</td><td>address</td><td>Query address</td></tr></tbody></table>

**Returns**

<table><thead><tr><th width="152">Field</th><th width="138">Type</th><th>Description</th></tr></thead><tbody><tr><td>""</td><td>uint256</td><td>Amount of claimable LP tokens</td></tr></tbody></table>

{% hint style="info" %}

1. Checks pair status must be Success
2. Calculates total LP amount for the address
3. Returns unclaimed LP amount (total minus claimed)
   {% endhint %}

{% hint style="warning" %}

1. Only available when pair status is Success
2. LP token calculation based on user participation
3. Each address can claim only once
4. Check claimable amount before claiming
   {% endhint %}

{% tabs %}
{% tab title="Usage Example" %}

```javascript
Web3.js example
const claimableAmount = await pot2PumpPair.methods.claimableLP(
  userAddress  // Query address
).call();
console.log(`Claimable LP amount: ${claimableAmount}`);

```

{% endtab %}

{% tab title="Complete Usage Example" %}

```javascript
// 1. First query claimable amount
const claimableAmount = await pot2PumpPair.methods.claimableLP(userAddress).call();

// 2. Claim if amount available
if (claimableAmount > 0) {
  await pot2PumpPair.methods.claimLP(userAddress).send({
    from: userAddress
  });
  console.log(`Successfully claimed ${claimableAmount} LP tokens`);
} else {
  console.log('No LP tokens available to claim');
}
```

{% 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.honeypotfinance.xyz/products/pot2pump/pot2pump-abi.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.
