⚙️Pot2Pump ABI

Pot2PumpFactory Module


createPair method

Creates a new trading pair in Pot2Pump.

### 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

Field
Type
Description

params

tuple

Parameter struct required for creating the trading pair.

raisedToken

address

Address of the token being raised.

name

string

Name of the new trading pair.

symbol

string

Symbol of the new trading pair.

swapHandler

address

Address of the swap handler contract.

Returns

Name
Type
Description

pair

address

Address of the newly created trading pair.

handler

address

Address of the handler linked to the pair.

  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.

// 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;
```


depositRaisedToken & refundRaisedToken methods

### ABI Format

[{
  "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"
}]
  1. depositRaisedToken

This method is used to deposit fundraising tokens.

Structure

Field
Type
Description

depositor

address

Depositor's address

amount

uint256

Deposit amount

  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

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

This method is used to refund raised tokens.

  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

  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

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


claimLP & claimableLP methods

### 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

This method is used to claim LP tokens.

Structure

Field
Type
Description

claimer

address

Claimer's address

  1. Checks pair status must be Success

  2. Transfers claimable LP tokens to specified address

  3. Includes reentrancy protection (nonReentrant)

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

This method is used to query claimable LP token amount.

Structure

Field
Type
Description

claimer

address

Query address

Returns

Field
Type
Description

""

uint256

Amount of claimable LP tokens

  1. Checks pair status must be Success

  2. Calculates total LP amount for the address

  3. Returns unclaimed LP amount (total minus claimed)

  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

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

Last updated