### Premine Amount Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example for setting 20% of the total supply as a premine amount for the creator. This value must be less than or equal to `initialTokenFairLaunch`. ```plaintext 20e27 ``` -------------------------------- ### Basic Metadata Upload Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/api.md Example of how to use curl to upload basic token metadata, including optional website and Twitter URLs. ```bash curl -X POST http://web2-api.flaunch.gg/api/v1/upload-metadata -H "Content-Type: application/json" -d '{ "name": "My Token", "symbol": "MTK", "description": "A sample token for demonstration", "imageIpfs": "QmSampleImageHash123", "websiteUrl": "https://mytoken.com", "twitterUrl": "https://twitter.com/mytoken" }' ``` -------------------------------- ### Initial Price Params Encoding Examples Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Examples of encoding parameters for InitialPrice logic, defining the initial market cap. The value must be >= 1000e6. ```solidity abi.encode(5000e6) ``` ```solidity abi.encode(75000e6) ``` -------------------------------- ### Example Response for Token Full Details Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Example JSON response structure for the Get Token Full Details endpoint, showing various metrics and social links. ```json { "tokenAddress": "0x1c93d155bd388241f9ab5df500d69eb529ce9583", "price": { "marketCapETH": "1234.567890123456789", "priceChange24h": "12.45", "startingMarketCapETH": "100.0" }, "volume": { "volume24h": "456.789" }, "trading": { "bidWallBalance": "1000.0", "bidWallLifetime": "3600", "bidWallRemaining": "800.0", "bidWallRemainingPercentage": 80.0, "buybackBalance": "1000.0", "buybackProgress": 20.0 }, "status": { "fairLaunchActive": true, "createdAt": 1703980800, "owner": "0xowner123..." }, "socials": { "website": "https://floki.com", "twitter": "https://twitter.com/floki", "telegram": "https://t.me/floki", "discord": "https://discord.gg/floki", "farcaster": "https://warpcast.com/floki" }, "meta": { "network": "mainnet", "timestamp": 1703980800 } } ``` -------------------------------- ### Example Prompts for Flaunch Skills Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/artificial-intelligence/vibe-guide.md These example prompts demonstrate various use cases for the Flaunch AI skills, including launching tokens, building launchpads, and creating managers. ```shell Use flaunch: Launch a memecoin on Base with the fastest possible path. ``` ```shell Use flaunch: Help me choose whether this launchpad should use the API, SDK, or a custom manager. ``` ```shell Use flaunch: Build a TypeScript launch flow with @flaunch/sdk on Base Sepolia. ``` ```shell Use flaunch: Create a revenue manager through the Web2 API. ``` -------------------------------- ### Initial Token Fair Launch Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example for setting 50% of the total supply as single-sided fair launch liquidity. Value must be between 1% (1e27) and 69% (69e27). ```plaintext 50e27 ``` -------------------------------- ### Token URI Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example of an IPFS URI for token metadata. Ensure this is valid to avoid missing information or token hiding. ```plaintext ipfs://QmScdsMTXWm3GUvzUwvQvYJLBQjtXwFjWvLgGvPBgipHmg ``` -------------------------------- ### Creator Fee Allocation Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example for setting a 60.25% dev revenue share. This value is accurate to 2 decimal places and cannot exceed 10000. ```plaintext 6025 ``` -------------------------------- ### Install Flaunch Skill Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/README.md Install the top-level `flaunch` skill for a single install target. This command is used to add the Flaunch skills repository. ```bash npx skills add https://github.com/flayerlabs/flaunch-skills --skill flaunch ``` -------------------------------- ### Example Response for Token Price Data Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Example JSON response structure for the Get Token Price Data endpoint, including current price, historical data, and trading metrics. ```json { "tokenAddress": "0x1c93d155bd388241f9ab5df500d69eb529ce9583", "price": { "current": "1234.567890123456789", "marketCapETH": "1234.567890123456789", "priceETH": "0.001234567", "priceChange24h": "12.45", "priceChange24hPercentage": 12.45, "allTimeHigh": "2000.0", "allTimeLow": "50.0", "startingMarketCapETH": "100.0" }, "volume": { "volume24h": "456.789", "volume7d": "3200.123" }, "trading": { "bidWallBalance": "1000.0", "bidWallLifetime": "3600", "bidWallRemaining": "800.0", "bidWallRemainingPercentage": 80.0, "buybackBalance": "1000.0", "buybackProgress": 20.0 }, "priceHistory": { "daily": [ { "timestamp": 1703980800, "date": 19722, "open": "1200.0", "high": "1300.0", "low": "1100.0", "close": "1234.5", "volume": "100.5", "marketCap": "1234.5", "price": "0.001234" } ], "hourly": [ { "timestamp": 1703980800, "open": "1230.0", "high": "1240.0", "low": "1220.0", "close": "1234.5", "volume": "10.5", "marketCap": "1234.5", "price": "0.001234" } ], "minutely": [ { "timestamp": 1703980800, "open": "1233.0", "high": "1235.0", "low": "1232.0", "close": "1234.5", "volume": "1.5", "marketCap": "1234.5", "price": "0.001234" } ], "secondly": [ { "timestamp": 1703980800, "open": "1234.0", "high": "1235.0", "low": "1233.0", "close": "1234.5", "volume": "0.1", "marketCap": "1234.5", "price": "0.001234" } ] }, "status": { "isActive": true, "createdAt": 1703980800, "owner": "0xowner123..." }, "meta": { "network": "mainnet", "timestamp": 1703980800, "timeRanges": { "dailyStart": 1703376000, "hourlyStart": 1703894400, "minutelyStart": 1703970000, "secondlyStart": 1703980500 } } } ``` -------------------------------- ### Get Token Basic Details Response (JSON) Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Example JSON response for the 'Get Token Basic Details' endpoint, providing comprehensive information about a single token. ```json { "tokenAddress": "0x1c93d155bd388241f9ab5df500d69eb529ce9583", "symbol": "FLOKI", "name": "Floki Inu", "marketCapETH": "1234.567890123456789", "createdAt": 1703980800, "image": "https://example.com/floki.png", "description": "Community-driven meme token with strong fundamentals", "socials": { "website": "https://floki.com", "twitter": "https://twitter.com/floki", "telegram": "https://t.me/floki", "discord": "https://discord.gg/floki", "farcaster": "https://warpcast.com/floki" }, "meta": { "network": "mainnet", "timestamp": 1703980800 } } ``` -------------------------------- ### Get New Tokens Response (JSON) Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Example JSON response for the 'Get New Tokens' endpoint, showcasing recently launched tokens and their details. ```json { "data": [ { "tokenAddress": "0x9876543210abcdef9876543210abcdef98765432", "symbol": "NEWMEME", "name": "New Meme Token", "marketCapETH": "0.123456789", "createdAt": 1703980800, "isActive": true, "image": "https://example.com/newmeme.png", "description": "Brand new meme token just launched" } ], "pagination": { "limit": 5, "offset": 0 }, "meta": { "network": "mainnet", "timestamp": 1703980800 } } ``` -------------------------------- ### Flaunch At Timestamp Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example of a Unix timestamp for scheduling a token launch. Tokens cannot be swapped until this time is reached. Cannot be greater than +30 days from current block.timestamp. ```plaintext 1739534400 ``` -------------------------------- ### Get All Tokens (Default Limit) Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/readme/for-aggregators.md Retrieves all tokens with the default limit of 1000. No setup is required beyond making the request. ```bash curl https://data.flayerlabs.xyz/tokens ``` -------------------------------- ### Token Name Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example of a token name for ERC20. ```plaintext Flaunchy ``` -------------------------------- ### Token Symbol Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example of a token symbol for ERC20. Recommended to be 3-6 characters. ```plaintext FLNCHY ``` -------------------------------- ### All Holdings for a User Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/subgraph/subgraph-query-examples.md This example demonstrates how to query for all collection token holdings associated with a specific user. ```APIDOC ## All Holdings for a User ### Description Retrieves all collection token holdings for a given user, including token details and balance. ### Method POST ### Endpoint https://gateway.thegraph.com/api/subgraphs/id/bbWLZuPrmoskDaU64xycxZFE6EvSkMQALKkDpsz5ifF ### Parameters #### Query Parameters - **query** (string) - Required - The GraphQL query string. - **operationName** (string) - Required - The name of the operation to execute. - **variables** (object) - Optional - Variables to be used in the query. ### Request Example ```json { "query": "{ collectionTokenHoldings( orderDirection:desc where: { user: \"0x4eAc46c2472b32dc7158110825A7443D35a90168\" }) { collectionToken { id symbol } balance user { id } } }", "operationName": "Subgraphs", "variables": {} } ``` ### Response #### Success Response (200) - **data** (object) - The query results. - **collectionTokenHoldings** (array) - A list of token holdings. - **collectionToken** (object) - Details of the collection token. - **id** (string) - The token's unique identifier. - **symbol** (string) - The token's symbol. - **balance** (string) - The user's balance of the token. - **user** (object) - Details of the user. - **id** (string) - The user's unique identifier. ### Response Example ```json { "data": { "collectionTokenHoldings": [ { "balance": "1897457691606421342801808", "collectionToken": { "id": "0xb2cfb7c1082b570372f6caf5cdf47af4590c8faa", "symbol": "FWNCY" }, "user": { "id": "0x4eac46c2472b32dc7158110825a7443d35a90168" } }, { "balance": "19760756900253676525474001", "collectionToken": { "id": "0xb5652652d95498227b040b2c518681bcc546092b", "symbol": "MCJBL" }, "user": { "id": "0x4eac46c2472b32dc7158110825a7443d35a90168" } } // ... more holdings ] } } ``` ``` -------------------------------- ### Get All Tokens Response (JSON) Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Example JSON response for the 'Get All Tokens' endpoint, including token data and pagination information. ```json { "data": [ { "tokenAddress": "0x1c93d155bd388241f9ab5df500d69eb529ce9583", "symbol": "FLOKI", "name": "Floki Inu", "marketCapETH": "1234.567890123456789", "createdAt": 1703980800, "fairLaunchActive": true, "image": "https://example.com/floki.png", "description": "Community-driven meme token" } ], "pagination": { "limit": 10, "offset": 0 }, "meta": { "network": "mainnet", "timestamp": 1703980800 } } ``` -------------------------------- ### Deploy and Initialize Treasury Manager Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/treasury-managers/README.md This snippet shows the three-step process of flaunching a token, deploying a Treasury Manager, and then initializing it to take ownership of the token on behalf of the creator. Ensure the TreasuryManagerFactory address and managerImplementation are correctly set. ```solidity // 1. Flaunch the token, keeping the creator as this contract address memecoin = PositionManager.flaunch( PositionManager.FlaunchParams({ creator: address(this), ... }) ); // Get the tokenId of the memecoin that was just flaunched uint tokenId = flaunch.tokenId(memecoin); // 2. Deploy the treasury manager via the TreasuryManagerFactory. This will // use an approved implementation to create a unique version of the manager. TreasuryManagerFactory factory = TreasuryManagerFactory(0x123); address payable _manager = factory.deployManager(managerImplementation); // Approve the ERC721 to be transferred by the new manager flaunch.approve(_manager, tokenId); // 3. Initialize our manager. This will transfer the token from this address // to the deployed treasury manager contract. Each treasury manager will // expect different data to be passed inside the `_data` parameter and will // usually be defined by their own internal InitializeParams struct. ITreasuryManager(_manager).initialize({ _tokenId: tokenId, // The Flaunch tokenId that will be transferred _owner: address(this), // Make this contract the owner of the manager _data: abi.encode (...) // Passes variables to configure the manager }); ``` -------------------------------- ### Blank Treasury Action Contract Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/creating-treasury-actions.md This is a basic example of a treasury action contract that performs no operation. It is useful for testing and as a starting point for new actions. Ensure the contract inherits from ITreasuryAction and implements the execute function. ```solidity // SPDX-License-Identifier: MIT pragma solidity ^0.8.26; import {PoolKey} from '@uniswap/v4-core/src/types/PoolKey.sol'; import {ITreasuryAction} from '@flaunch-interfaces/ITreasuryAction.sol'; /** * Does nothing. * * @dev This is just used for testing purposes. */ contract BlankAction is ITreasuryAction { function execute(PoolKey memory _poolKey, bytes memory) external override { emit ActionExecuted(_poolKey, 0, 0); } } ``` -------------------------------- ### Prompt Agent for Launchpad Path Choice Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/artificial-intelligence/vibe-guide.md Use this prompt to have the AI agent help decide between API, SDK, or a custom manager for a launchpad. This is part of the quick start process. ```shell Use flaunch: Help me choose whether this launchpad should use the API, SDK, or a custom manager. ``` -------------------------------- ### Launch Token - Minimal Launch Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Queues a memecoin for on-chain deployment without any treasury management. Supports basic token details and sniper protection. Rate-limited to 2 launches per minute per IP. ```bash # Option 1: Minimal launch (no treasury management) curl -X POST https://web2-api.flaunch.gg/api/v1/base/launch-memecoin \ -H "Content-Type: application/json" \ -d '{ \ "name": "Simple Token", \ "symbol": "SMPL", \ "description": "A straightforward launch.", \ "imageIpfs": "QmX7UbPKJ7Drci3y6p6E8oi5TpUiG7NH3qSzcohPX9Xkvo", \ "creatorAddress": "0x498E93Bc04955fCBAC04BCF1a3BA792f01Dbaa96", \ "sniperProtection": true \ }' ``` -------------------------------- ### Launch Token - With Revenue Manager Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Queues a memecoin launch using a pre-deployed Revenue Manager contract for fee capture. Requires the `revenueManagerAddress`. Rate-limited to 2 launches per minute per IP. ```bash # Option 2: Revenue manager (pre-deployed launchpad contract) curl -X POST https://web2-api.flaunch.gg/api/v1/base/launch-memecoin \ -H "Content-Type: application/json" \ -d '{ \ "name": "Revenue Token", "symbol": "REV", \ "description": "Launches with a revenue manager.", \ "imageIpfs": "QmX7UbPKJ7Drci3y6p6E8oi5TpUiG7NH3qSzcohPX9Xkvo", \ "creatorAddress": "0x498E93Bc04955fCBAC04BCF1a3BA792f01Dbaa96", \ "revenueManagerAddress": "0x57ac78c4a704233e274bbcdeb057ba640b65de23" \ }' ``` -------------------------------- ### Combine Query Parameters Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/readme/for-aggregators.md Demonstrates combining limit, creator address, and orderId for precise token retrieval. All parameters are optional. ```bash curl https://data.flayerlabs.xyz/tokens?limit=500&creator=0x1234567890123456789012345678901234567890&orderId=1234567890 ``` -------------------------------- ### Initialize RevenueManager with Treasury Manager Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/treasury-managers/revenuemanager.md Initialize the RevenueManager by calling the `initialize` function on the Treasury Manager contract. This sets up the creator, protocol recipient, and protocol fee for fee distribution. Ensure the `_owner` is the contract handling middleware management. ```solidity /** * Parameters passed during manager initialization: * * @member creator The end-owner creator of the ERC721 * @member protocolRecipient The recipient of protocol fees * @member protocolFee The fee that the external protocol will take (2dp) */ struct InitializeParams { address payable creator; address payable protocolRecipient; uint protocolFee; } /** * Initialize our manager. This will transfer the token from this address * to the deployed treasury manager contract. The owner should be the contract * that will handle the middleware management. This will likely be the same * contract that is making the flaunch call. */ ITreasuryManager(_manager).initialize({ _tokenId: tokenId, _owner: address(this), _data: abi.encode( InitializeParams({ creator: msg.sender, protocolRecipient: address(0x123), protocolFee: 1000 // Taking 10% }) ) }); ``` -------------------------------- ### Launch ERC-20 Token with Fair Launch and Premine (Solidity) Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Use this contract to deploy a new ERC-20 token with a fair-launch allocation and an optional creator premine. Ensure the `flaunchingFee` and `premineFee` are calculated correctly before calling the `flaunch` function. The `msg.value` can overpay, with excess ETH being refunded. ```Solidity // SPDX-License-Identifier: MIT\npragma solidity ^0.8.26;\n\n// Step 1: Calculate fees\nuint flaunchingFee = positionManager.getFlaunchingFee(\n abi.encode(75_000e6) // initialPriceParams = $75,000 starting market cap\n);\nuint premineFee = premineZap.calculateFee(\n 5e27, // premineAmount: 5% of total supply\n 0, // slippage bps (0 = no slippage, overpayment refunded)\n abi.encode(75_000e6)\n);\n\n// Step 2: Launch (msg.value can overpay; excess is refunded)\n(address memecoin, uint ethSpent) = premineZap.flaunch{\n value: flaunchingFee + premineFee\n}(\n PositionManager.FlaunchParams({\n name: "Example Memecoin",\n symbol: "EXMPL",\n tokenUri: "ipfs://QmScdsMTXWm3GUvzUwvQvYJLBQjtXwFjWvLgGvPBgipHmg",\n initialTokenFairLaunch: 50e27, // 50% of supply in fair launch (range: 1%–69%)\n premineAmount: 5e27, // creator pre-buys 5% (must be <= fairLaunch amount)\n creator: msg.sender,\n creatorFeeAllocation: 80_00, // 80.00% dev rev (2dp, max 100_00)\n flaunchAt: block.timestamp + 24 hours, // scheduled launch (max +30d)\n initialPriceParams: abi.encode(75_000e6), // $75k USDC market cap (min $1k)\n feeCalculatorParams: abi.encode("") // unused; pass empty bytes\n })\n);\n// memecoin => deployed ERC-20 address\n// ethSpent => ETH consumed by the premine buy\n ``` -------------------------------- ### All Holdings for a User Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/subgraph/subgraph-query-examples.md This example demonstrates how to retrieve all token holdings for a specific user. It includes the token's ID, symbol, and the user's balance. ```json { "balance": "1897457691606421342801808", "collectionToken": { "id": "0xb2cfb7c1082b570372f6caf5cdf47af4590c8faa", "symbol": "FWNCY" }, "user": { "id": "0x4eac46c2472b32dc7158110825a7443d35a90168" } } ``` -------------------------------- ### Creator Address Example Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Example of a creator address that will receive ERC721 ownership and premined ERC20 tokens. A zero address will cause the call to revert. ```plaintext 0xYourCreatorAddress ``` -------------------------------- ### Initialize RevenueManager Parameters Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/manager-types/revenuemanager.md Defines the parameters required for initializing the RevenueManager contract. Specify the recipient for protocol fees and the percentage of the protocol fee. ```solidity /** * Parameters passed during manager initialization. * * @member protocolRecipient The recipient of protocol fees * @member protocolFee The fee that the external protocol will take (2dp) */ struct InitializeParams { address payable protocolRecipient; uint protocolFee; } ``` -------------------------------- ### Example Token Holders Response Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md An example JSON response structure for the token holders endpoint, showing token address, total holders, and a list of individual holders with their balances. ```json { "tokenAddress": "0x1c93d155bd388241f9ab5df500d69eb529ce9583", "totalHolders": "3162", "holders": [ { "id": "0x498581ff718922c3f8e6a244956af099b2652b2b", "balance": "16544363767544050103679622889" }, { "id": "0x742d35cc6354c7deae7a5d3f2f4c2f8b8a8b9e6c", "balance": "8272181883772025051839811444" }, { "id": "0x1a2b3c4d5e6f7890abcdef1234567890abcdef12", "balance": "4136090941886012525919905722" } ] } ``` -------------------------------- ### Launch Token - Custom Inline Fee Split Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Queues a memecoin launch with a custom, inline fee split configuration. The creator can receive a specified share, and other recipients can be defined with custom weights. Rate-limited to 2 launches per minute per IP. ```bash # Option 3: Custom inline fee split, creator gets 20% curl -X POST https://web2-api.flaunch.gg/api/v1/base/launch-memecoin \ -H "Content-Type: application/json" \ -d '{ \ "name": "Weighted Token", "symbol": "WCOMM", \ "description": "Custom weighted revenue split.", \ "imageIpfs": "QmX7UbPKJ7Drci3y6p6E8oi5TpUiG7NH3qSzcohPX9Xkvo", \ "creatorAddress": "0x498E93Bc04955fCBAC04BCF1a3BA792f01Dbaa96", \ "creatorShare": 2000, \ "feeSplitRecipients": [ \ { "type": "email", "id": "founder@example.com", "split": "5000000" }, \ { "type": "twitter", "id": "justinavery", "split": "3000000" }, \ { "type": "wallet", "id": "0x123...", "split": "2000000" } \ ], \ "marketCap": "10000000000", \ "creatorFeeSplit": "8000" \ }' ``` ```json # Success 200: # { "success": true, "message": "Memecoin launch request queued", "jobId": "40", # "queueStatus": { "position": 0, "waitingJobs": 0, "activeJobs": 1, "estimatedWaitSeconds": 0 } ``` -------------------------------- ### AI Skills: Install Flaunch Skill for AI Coding Agents Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Install the 'flaunch-skills' repository to enable AI coding agents to interact with Flaunch integrations. This routes agents to the correct API, SDK, or custom manager based on the goal. ```bash # Install the umbrella skill (routes to sub-skills automatically) npx skills add https://github.com/flayerlabs/flaunch-skills --skill flaunch ``` -------------------------------- ### Initialize RevenueManager Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/implementation.md Deploy and initialize a RevenueManager contract. Ensure the `_managerImplementation` address points to an approved RevenueManager implementation and `_owner` is set to the address authorized for authenticated calls. The `_data` field configures the protocol recipient and fee. ```solidity // Contract addresses are valid for Base Sepolia TreasuryManagerFactory factory = TreasuryManagerFactory(0xd2f3c6185e06925dcbe794c6574315b2202e9ccd); address manager = factory.deployAndInitializeManager({ _managerImplementation: 0x1216c723853dac0449c01d01d6e529d751d9c0c8, // RevenueManager _owner: address(this), _data: abi.encode( RevenueManager.InitializeParams({ protocolRecipient: payable(address(this)), protocolFee: 1000 // 10% }) ) }); ``` -------------------------------- ### AI Skills – Install Flaunch Skill for AI Coding Agents Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Install the `flaunch-skills` repository to enable AI coding agents to interact with Flaunch integrations. This provides a structured way for agents to route requests to the correct API, SDK, or custom manager. ```APIDOC ## AI Skills – Install Flaunch Skill for AI Coding Agents The `flaunch-skills` repository provides structured skill files that route AI coding agents (e.g. Cursor, Claude Code) to the correct integration path—API, SDK, or custom manager—based on the described goal. ```bash # Install the umbrella skill (routes to sub-skills automatically) npx skills add https://github.com/flayerlabs/flaunch-skills --skill flaunch # Example agent prompts after installation: # "Use flaunch: Launch a memecoin on Base with the fastest possible path." # "Use flaunch: Build a TypeScript launch flow with @flaunch/sdk on Base Sepolia." # "Use flaunch: Create a revenue manager through the Web2 API." # "Use flaunch: Help me choose whether to use the API, SDK, or a custom manager." # Core skill files: # skills/basic/token-creation/SKILL.md – fastest token launch # skills/basic/token-launchpad/SKILL.md – launchpad with API/SDK/manager choice # skills/core/manager/SKILL.md – custom treasury manager development ``` ``` -------------------------------- ### Launch Token Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Queues a memecoin for on-chain deployment with various treasury management options. ```APIDOC ## POST /api/v1/base/launch-memecoin ### Description Queues a memecoin for on-chain deployment. Returns a `jobId` to poll via `launch-status`. Supports four mutually exclusive treasury options: no management, revenue manager, fee split manager, or inline custom fee split. Rate-limited to 2 launches per minute per IP. ### Method POST ### Endpoint https://web2-api.flaunch.gg/api/v1/base/launch-memecoin ### Parameters #### Request Body - **name** (string) - Required - The name of the memecoin. - **symbol** (string) - Required - The symbol of the memecoin. - **description** (string) - Required - A description of the memecoin. - **imageIpfs** (string) - Required - The IPFS hash of the memecoin's image. - **creatorAddress** (string) - Required - The creator's wallet address. - **sniperProtection** (boolean) - Optional - Enables sniper protection. - **revenueManagerAddress** (string) - Optional - The address of a pre-deployed revenue manager. - **creatorShare** (integer) - Optional - The creator's share percentage for custom fee splits. - **feeSplitRecipients** (array) - Optional - An array of recipient objects for custom fee splits. - **type** (string) - Required - The type of recipient (email, twitter, wallet). - **id** (string) - Required - The identifier for the recipient. - **split** (string) - Required - The split weight for the recipient. - **marketCap** (string) - Optional - The initial market cap of the token. - **creatorFeeSplit** (string) - Optional - The creator's fee split percentage. ### Request Example ```json { "name": "Simple Token", "symbol": "SMPL", "description": "A straightforward launch.", "imageIpfs": "QmX7UbPKJ7Drci3y6p6E8oi5TpUiG7NH3qSzcohPX9Xkvo", "creatorAddress": "0x498E93Bc04955fCBAC04BCF1a3BA792f01Dbaa96", "sniperProtection": true } ``` ### Response #### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **message** (string) - A message confirming the launch request. - **jobId** (string) - The ID of the launch job. - **queueStatus** (object) - Information about the job's position in the queue. - **position** (integer) - The job's position in the queue. - **waitingJobs** (integer) - The number of jobs waiting. - **activeJobs** (integer) - The number of active jobs. - **estimatedWaitSeconds** (integer) - Estimated wait time in seconds. #### Response Example ```json { "success": true, "message": "Memecoin launch request queued", "jobId": "40", "queueStatus": { "position": 0, "waitingJobs": 0, "activeJobs": 1, "estimatedWaitSeconds": 0 } } ``` ``` -------------------------------- ### Get Flaunch Tokens Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/readme/for-aggregators.md Returns a list of Flaunch tokens in JSON format. ```APIDOC ## GET /tokens ### Description Returns a list of Flaunch tokens in JSON format. ### Method GET ### Endpoint https://data.flayerlabs.xyz/tokens ### Parameters None ### Request Example None ### Response #### Success Response (200) - **tokens** (array) - A list of Flaunch token objects. - **address** (string) - The contract address of the token. - **name** (string) - The name of the token. - **symbol** (string) - The symbol of the token. - **decimals** (integer) - The number of decimals for the token. #### Response Example ```json { "tokens": [ { "address": "0xabc123...", "name": "Example Token", "symbol": "EXM", "decimals": 18 } ] } ``` ``` -------------------------------- ### Get Fair Launch Fee Calculator Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/hooks/fee-distributor.md Retrieves the IFeeCalculator contract used for calculating swap fees during the Fair Launch period. ```Solidity function fairLaunchFeeCalculator() public view returns (IFeeCalculator) { // .. } ``` -------------------------------- ### Get Post-Fair Launch Fee Calculator Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/hooks/fee-distributor.md Retrieves the IFeeCalculator contract used for calculating swap fees after the Fair Launch period. ```Solidity function feeCalculator() public view returns (IFeeCalculator) { // .. } ``` -------------------------------- ### Calculating Total Swap Amounts and Fees Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/subgraph/indexing-swaps.md To get a complete picture of a swap, sum the amounts and fees from the Fair Launch, Internal Swap, and Uniswap stages for each token. ```solidity amount = flAmount + ispAmount + uniAmount; fees = flFee + ispFee + uniFee; ``` -------------------------------- ### Get Video Status Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/api.md Retrieve the processing status of an uploaded video using its unique identifier. ```http GET /api/v1/video-status?uid={videoUID} ``` -------------------------------- ### Get Total Protocol Claimed Amount Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/manager-types/revenuemanager.md Returns the total amount of ETH that the protocol has claimed. ```solidity protocolTotalClaimed() returns (uint) ``` -------------------------------- ### Launch with Sniper Protection Enabled Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/api.md Example of enabling sniper protection during a token launch. Sniper protection enforces a wallet cap to prevent bots and snipers from accumulating large positions early in the launch. ```APIDOC ## Launch with Sniper Protection Enabled ### Description This example demonstrates how to enable sniper protection for a token launch. When `sniperProtection` is set to `true`, a maximum wallet cap of 0.25% of the total supply is enforced during the fair launch period to prevent bot accumulation and ensure fairer distribution. ### Request Body Example ```json { "name": "Snipe Protection", "symbol": "ANTISNIPE", "description": "A basic token with no fee management", "imageIpfs": "QmX7UbPKJ7Drci3y6p6E8oi5TpUiG7NH3qSzcohPX9Xkvo", "creatorAddress": "0x498E93Bc04955fCBAC04BCF1a3BA792f01Dbaa96", "sniperProtection": true } ``` ### Notes - The `sniperProtection` field is a boolean, defaulting to `false`. - The 0.25% wallet cap is automatically removed after the fair launch period ends. - This feature helps ensure fairer token distribution among genuine participants. ``` -------------------------------- ### Get claimed amount for a recipient Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/manager-types/addressfeesplitmanager.md Retrieves the total amount of fees that have been claimed by a specific recipient. ```solidity /** * The amount claimed for the recipient */ amountClaimed(address _recipient) returns (uint) ``` -------------------------------- ### Get Token Full Details Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/references/restful-data-api.md Retrieve comprehensive token information including trading data, bid wall information, and detailed metrics. Requires chain and tokenAddress as path parameters. ```bash curl "https://dev-api.flayerlabs.xyz/v1/base/tokens/0x1c93d155bd388241f9ab5df500d69eb529ce9583/details" ``` -------------------------------- ### Get Flaunching Fee Source: https://github.com/flayerlabs/flaunch-gitbook/blob/main/developer-resources/guides/flaunching-a-coin.md Retrieve the 0.1% market cap fee by passing the `initialPriceParams` to `PositionManager.getFlaunchingFee`. ```solidity uint flaunchingFee = PositionManager.getFlaunchingFee( FlaunchParams.initialPriceParams ) ``` -------------------------------- ### Subgraph: Query All Memecoins with Fair Launch and Pool Data Source: https://context7.com/flayerlabs/flaunch-gitbook/llms.txt Paginate through all launched tokens to retrieve details like creator, owner, fair-launch window, and fee allocation. Use 'first' and 'skip' parameters for pagination. Replace '{api-key}' with your actual API key. ```bash curl -X POST \ -H "Content-Type: application/json" \ -d '{ "query": "query getAllCollectionTokens { collectionTokens(first:1000, skip:0, orderBy:createdAt, orderDirection:asc) { id name symbol baseURI createdAt creator { id } owner { id } marketCapETH volumeETH totalHolders fairLaunch { initialSupply active starts_at ends_at } pool { id startingMarketCap startingMarketCapETH flipped feeAllocation { creator community } } } }", "operationName": "Subgraphs", "variables": {} }' \ "https://gateway.thegraph.com/api/{api-key}/subgraphs/id/bbWLZuPrmoskDaU64xycxZFE6EvSkMQALKkDpsz5ifF" ```