Integration Guide

This guide details how developers, trading bots, and dashboards can integrate with Slops on Robinhood Chain (Chain ID 4663). All trades, launches, and creator metadata links are recorded directly on-chain.


1. On-Chain Swap ABI Reference

To execute buys and sells programmatically, interact with the specific token's active BondingCurve contract using the following Solidity signatures:

[
  {
    "inputs": [
      { "internalType": "uint256", "name": "minTokensOut", "type": "uint256" },
      { "internalType": "address", "name": "referrer", "type": "address" }
    ],
    "name": "buy",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      { "internalType": "uint256", "name": "tokenAmount", "type": "uint256" },
      { "internalType": "uint256", "name": "minEthOut", "type": "uint256" },
      { "internalType": "address", "name": "referrer", "type": "address" }
    ],
    "name": "sell",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]

Executing a Buy Order

Send ETH directly with the transaction payload. Supply a slippage protection parameter (minTokensOut) and a referrer address (use address(0) if there is no referrer).

// Viem / Ethers Example
const curve = new ethers.Contract(curveAddress, BondingCurveAbi, signer);
const tx = await curve.buy(
  minTokensOut, // Min tokens to receive (slippage check)
  referrerAddress, // Referral mapping address or zero address
  { value: buyAmountInEth }
);

Executing a Sell Order

Before invoking the sell function, approve the target token contract to allow the BondingCurve contract address to spend your balance.

// 1. Approve Bonding Curve spending limit
const token = new ethers.Contract(tokenAddress, ERC20Abi, signer);
await token.approve(curveAddress, tokenAmountToSell);

// 2. Submit Sell transaction
const curve = new ethers.Contract(curveAddress, BondingCurveAbi, signer);
const tx = await curve.sell(
  tokenAmountToSell, 
  minEthOut, // Min ETH to receive (slippage check)
  referrerAddress
);

2. Dynamic Price & Reserve Calculations

Pricing calculations are calculated using the virtual constant product reserves:

$$(V_{\text{ETH}} + R_{\text{ETH}}) \cdot (V_{\text{Token}} - S_{\text{Token}}) = k$$

  • $V_{\text{ETH}}$ (Virtual ETH Reserve): 1.5 ETH
  • $V_{\text{Token}}$ (Virtual Token Reserve): 840,000,000 Tokens
  • $R_{\text{ETH}}$: Current real ETH balance of the curve.
  • $S_{\text{Token}}$: Current cumulative tokens purchased.
  • $k$: Fixed at $1,260,000,000$

Tokens Received for $E_{\text{in}}$ ETH Buy:

$$\Delta\text{Tokens} = y - \frac{k}{x + E_{\text{in}} \cdot 0.99}$$

(Where $y$ is the current token reserve, $x$ is the current ETH reserve, and $E_{\text{in}}$ is the ETH sent. A 1% fee is deducted from the input ETH before it acts on the curve).


3. Reading Token & Creator Metadata

Every token's creator profile details, website link, avatar, banner, description, and linked Twitter/X account handles are stored on-chain inside the token contract's metadataURI.

To fetch this:

  1. Call metadataURI() directly on the LaunchToken contract address.
  2. This returns a URL (IPFS or server address) pointing to a JSON schema:
{
  "name": "Token Name",
  "symbol": "TKN",
  "image": "https://example.com/logo.png",
  "description": "Token description details",
  "banner": "https://example.com/banner.png",
  "socials": {
    "x": "https://twitter.com/optional_manual_x",
    "website": "https://example.com",
    "telegram": "https://t.me/group",
    "discord": "https://discord.gg/invite"
  },
  "creatorUsername": "@linked_x_username",
  "creatorName": "linked_x_name",
  "creatorAvatar": "linked_x_avatar_url",
  "isXLinked": true,
  "signature": "0x51c9ae77..."
}

Cryptographic Twitter Linking Verification

To prevent spoofing of X linking status, the metadata JSON includes a signature field.

Integrators can verify that the Twitter username is linked to the token creator by executing off-chain EIP-191 message recovery:

  1. Construct Message: creatorAddress.toLowerCase() + ":" + creatorUsername (e.g., 0x1234...:@DegenKing).
  2. Recover Address: Recover the message signer using the signature value.
  3. Validate Signer: Assert that the recovered signer matches the official Slops validation address:
    • Protocol Signer Address: 0x749Ecd533f47d3DeA8b24F7CA5f009B84A562093

By verifying this signature, integrations can confirm that the Twitter handle was authenticated through the official protocol interface.