B3 백서

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 13쪽 중 3쪽

- Verify your RPC endpoint is working - Check wallet has sufficient Base ETH - Ensure private key format is correct (with 0x prefix) Clear cache and reinstall: --- ## BondKit Introduction Source: https://docs.b3.fun/bondkit/introduction What is BondKit? BondKit is a complete token launch platform for creating ERC20 "bond tokens" on Base mainnet. It provides an end‑to‑end solution that handles everything from initial token creation through bonding curve trading and finally migration to Uniswap v4 for full decentralized trading. Key Components Audited On-Chain Infrastructure - Factory contract for deploying new tokens - ERC20 implementation with bonding curve logic - Automatic Uniswap v4 pool initialization - Gas-optimized minimal proxy pattern Developer-Friendly Tools - Simple API for all contract interactions - Type-safe interfaces with full TypeScript support - Built-in transaction management - Event subscriptions and monitoring Real-Time Data Services - Transaction history tracking - OHLCV chart data generation - Token metadata storage - REST API for frontend integration How BondKit Works The Three-Phase Lifecycle 1. Creation Phase: Deploy your token with custom parameters 2. Bonding Phase: Automated market making via bonding curve 3. DEX Phase: Full decentralized trading on Uniswap v4 Core Features - Gas-Efficient Clones: Uses minimal proxy pattern to reduce deployment costs by ~90% - Standardized Implementation: All tokens share the same battle-tested logic - One-Click Deployment: Simple function call to create a new token - Configurable Aggressiveness: Factor from 0-100 controls price progression - Automatic Price Discovery: Market-driven pricing during bonding phase - Buy & Sell Support: Full two-way trading during bonding - 5% Trading Fee: Applied to both buys and sells, distributed to fee recipient - Customizable Targets: Set your funding goal in ETH or allowed ERC20 - Automatic Threshold Detection: Contract tracks progress to target - One-Click Migration: Simple call to when ready - Price Calculation: computed on-chain for fair initial pricing - Automatic Pool Creation: Pool initialized with bonding curve exit price - Liquidity Provision: Accumulated funds become initial liquidity - Ownership Renouncement: Contract becomes fully decentralized post-migration - Seamless Transition: No manual intervention required - Real-Time Indexing: All transactions recorded and processed - OHLCV Data: Professional trading charts available via API - Transaction History: Complete audit trail for every token - Portfolio Tracking: Monitor multiple tokens and positions Use Cases For Projects & Creators - Fair launch mechanisms - Community-driven price discovery - No upfront liquidity required - Built-in anti-bot protection For GameFi Projects - In-game currency launches - NFT project tokens - Reward token distribution - Player-owned economies For Developers - Programmatic token creation - White-label solutions - Custom frontend integration - API-driven automation Technical Capabilities Smart Contract Features - ✅ ERC20-compliant bond tokens with extended functionality - ✅ Factory pattern for gas-efficient deployments - ✅ Configurable parameters (supply, target, aggressiveness) - ✅ Built-in fee distribution mechanism - ✅ Automatic Uniswap v4 migration SDK Features - ✅ Full TypeScript support with type definitions - ✅ Promise-based async operations - ✅ Event listeners and subscriptions - ✅ Transaction receipt handling - ✅ Error handling and retry logic Analytics Features - ✅ Real-time price tracking - ✅ Volume and liquidity metrics - ✅ Historical transaction data - ✅ OHLCV candlestick data - ✅ User portfolio tracking Get started Launch with BondKit on Base Questions or feedback? Talk to us on Discord Key Terminology | Term | Definition | |------|------------| | Bonding Phase | Initial trading period with algorithmic pricing via bonding curve | | Bond Token | ERC20 token with built-in bonding curve mechanics | | Target Amount | Funding goal that triggers migration eligibility | | Migration | Transition from bonding curve to Uniswap v4 | | Quote Asset | The currency used to buy tokens (ETH or allowed ERC20) | | Term | Definition | |------|------------| | Minimal Proxy | Gas-efficient contract cloning pattern | | Aggressiveness Factor | Parameter (0-100) controlling price curve steepness | | sqrtPriceX96 | Uniswap v4 price format for pool initialization | | Fee Recipient | Address receiving trading fees during bonding | | LP Split Ratio | Liquidity provider fee percentage in basis points | | Term | Definition | |------|------------| | Factory Contract | Main contract for deploying new bond tokens | | Implementation | Template contract cloned for each token | | Public Client | Read-only blockchain connection | | Wallet Client | Write-enabled blockchain connection | | Provider | Web3 connection interface (e.g., MetaMask) | Important Parameters Current Network: Base Mainnet only Supported Trading Tokens: - B3 Token (primary on Base mainnet) - ETH (when configured as zero address) - Additional ERC20 tokens can be whitelisted Fee Structure: - 5% on all bonding phase trades - Customizable LP split ratio for migration Security: - Audited smart contracts - Automatic ownership renouncement post-migration - No admin keys after DEX phase begins Next Steps Set up the BondKit SDK in your project Learn the basics with our step-by-step guide Check out working implementations and demos Get help and share feedback on Discord --- ## Networks & Addresses Source: https://docs.b3.fun/bondkit/networks Base Mainnet | Name | Address | |------|---------| | BondkitTokenFactory | | | BondkitToken Implementation | | | Uniswap V4 Pool Manager | | | BondkitUniswapV4Hook | | | B3 | | | Bonding Phase Splitter | | | Dex Phase Splitter | | BondKit operates on Base mainnet. Testnet/dev environments are currently not available. --- ## Quickstart Source: https://docs.b3.fun/bondkit/quickstart Overview This quickstart guide will walk you through the complete lifecycle of a BondKit token in under 5 minutes. You'll learn how to: 1. Deploy a new bond token 2. Trade during the bonding phase 3. Monitor progress toward the target 4. Migrate to Uniswap v4 Prerequisites: Make sure you've completed the installation and have a funded wallet on Base. Complete Flow Diagram Step 1: Deploy Your Token Basic Deployment Understanding Parameters Total supply of tokens (with 18 decimals). Example: for 1M tokens. Controls bonding curve steepness (0-100): - 0-30: Linear pricing, fair for all buyers - 30-60: Moderate curve, balanced approach - 60-100: Aggressive, rewards early buyers Amount of trading token needed to enable migration. Use for 10 tokens (18 decimals). Address that receives trading fees (5% of all trades). Basis points (1/100th of 1%) for LP fee split. 1000 = 10%. Step 2: Trading During Bonding Phase Initialize Token Instance Understanding Trading Tokens BondKit tokens use a configurable trading token system. Check what token is used for trading: Buying Tokens Selling Tokens Monitoring Progress Event Monitoring Step 3: Migration to Uniswap v4 Check Migration Readiness Execute Migration Important: After migration: - Contract ownership is automatically renounced - Bonding curve trading is permanently disabled - All trading moves to Uniswap v4 - No further admin actions are possible Complete Example Here's a full working example that demonstrates the entire lifecycle: Next Steps Deep dive into bonding curves and pricing Explore all available methods End-to-end token management guide See a complete implementation --- ## SDK Reference Source: https://docs.b3.fun/bondkit/sdk/reference Installation & Setup Core Classes BondkitTokenFactory The factory class handles deploying new bond tokens and querying deployed tokens. Constructor | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | | | Yes | Chain ID (currently only Base: 8453) | | | | No | Private key for write operations | Methods Deploy a new bond token Parameters: Example: Get all deployed tokens Returns: Array of token addresses Example: Get token configuration Example: Get implementation contract Example: Connect wallet provider Example: BondkitToken The token class handles all operations for a specific bond token. Constructor | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | | | Yes | Token contract address | | | | No | Private key for write operations | Read Methods Methods for interacting with the trading token Example: Built-in swap methods for DEX phase trading Example: Write Methods Buy tokens with trading token Parameters: - : Amount of trading token to spend (as string or bigint) - : Minimum tokens to receive (slippage protection) Example: Sell tokens for trading token Parameters: - : Amount of tokens to sell - : Minimum trading token to receive (slippage protection) Example: Migrate to Uniswap v4 Requirements: - Caller must be migration admin - Target must be reached Example: Transfer or renounce token ownership Example: Important: Renouncing ownership is irreversible and removes all admin capabilities. Only do this after migration or if you want to make the token completely decentralized. Event Listeners BondkitSwapService The swap service handles Uniswap V4 trading for tokens after they migrate to the DEX phase. When to use: After migration when tokens are trading on Uniswap V4. During bonding phase, use and instead. Constructor Methods Get swap price quote Parameters: Returns: Example: Execute swap transaction Parameters: - : Same SwapParams as getSwapQuote - : Connected wallet client Example: Complete Example Important Notes: - Only works after token migration to DEX phase - Automatically handles token approvals (ERC20 → Permit2 → Universal Router) - Uses Uniswap V4 with custom hooks and pool configuration - Slippage protection is built into the quotes TradingView Component A React component that renders professional trading charts for Bondkit tokens using TradingView's charting library. Use case: Display price charts, volume data, and trading indicators for your Bondkit tokens in web applications. Installation & Setup Requirements: - React 18+ - TradingView charting library (loaded automatically from CDN) - Tailwind CSS for styling (optional, but recommended) Props Basic Usage Advanced Configuration Features Built-in Support: - Candlestick charts - Volume indicators - Price overlays - Technical analysis tools - Multiple timeframes (1m, 5m, 1h, 1D, etc.) Customization: - Light/dark themes - Responsive design - Mobile-friendly interface - Professional trading UI Automatic Data Feeds: - Real-time price data from B3 API - OHLCV (Open, High, Low, Close, Volume) data - Historical price charts - Transaction-based price updates UDF Compatible: - Standard TradingView datafeed format - Configurable API endpoints - Fallback configurations Optimized Loading: - TradingView library loaded from CDN - Lazy loading with loading states - Error handling and fallbacks - Configurable CDN domains Production Ready: - Automatic CDN switching - Custom domain support - Development/production configurations Complete Integration Example CDN Configuration Setup Requirements: 1. TradingView License: Ensure you have proper licensing for TradingView library usage 2. CDN Setup: Configure CDN URLs in your environment variables 3. API Access: Ensure your app can access the B3 analytics API for chart data 4. CORS: Configure CORS settings if using custom API endpoints Type Definitions Core Types Event Types Transaction Types Configuration Network Support Supported Chains | Chain | Chain ID | Status | |-------|----------|--------| | Base Mainnet | 8453 | ✅ Supported | | Base Sepolia | 84532 | 🚧 Coming Soon | Error Handling Complete Examples Deploy and Trade Portfolio Tracker Best Practices Security Considerations 1. Never expose private keys in client-side code 2. Always use slippage protection in trades 3. Validate addresses before transactions 4. Handle errors gracefully with try-catch 5. Monitor gas prices before large operations Performance Tips 1. Batch read operations with Promise.all() 2. Cache token instances to avoid recreating 3. Use event listeners instead of polling 4. Implement exponential backoff for retries 5. Consider pagination for large datasets Support & Resources Source code and issues Community support Fix common integration issues Example implementation --- ## Collection Management Source: https://docs.b3.fun/createkit/collections Overview Collection management is at the core of CreateKit. This guide covers everything you need to know about creating, configuring, and managing NFT collections using the BaseMint protocol. Collection Metadata Structure Every collection requires specific metadata that defines its characteristics: Required Parameters The name of your NFT collection (e.g., "Bored Ape Yacht Club") The symbol/ticker for your collection (e.g., "BAYC") The Ethereum address of the collection creator The Ethereum address of the game owner (can be same as creator) Optional Parameters Maximum number of tokens that can be minted Price per token in wei (use parseEther() for ETH values) Maximum tokens that can be minted per wallet Whether whitelist-only minting is enabled Unix timestamp when minting starts (0 = immediate) Unix timestamp when minting ends The token standard to use Chain ID (8333 = B3 Mainnet) Creating Collections Basic Collection Advanced Collection Configuration Token Standards CreateKit supports both ERC721 and ERC1155 standards: Metadata Management Collection-Level Metadata Token-Level Metadata CreateKit automatically generates token metadata based on your collection settings: Collection Validation CreateKit provides built-in validation for collection parameters: Address Prediction One of CreateKit's key features is deterministic address prediction: Collection Management Operations Checking Collection Status Updating Collection Settings Most collection parameters cannot be changed after deployment. Plan your collection configuration carefully. Best Practices 1. Collection Planning - Set appropriate max supply based on use case - Consider future demand and scarcity - Leave room for growth or special editions - Research similar collections for pricing reference - Consider gas costs and transaction fees - Plan for different market conditions 2. Metadata Quality 3. Security Considerations - Never hardcode private keys in source code - Use environment variables or secure key management - Consider using multi-signature wallets for valuable collections - Always validate signatures before deployment - Verify collection parameters match intended values - Use a staging deployment before production rollout - Carefully choose creator and gameOwner addresses - Understand reward distribution implications - Plan for long-term collection management Troubleshooting Ensure all collection parameters are identical between signature generation and deployment. Even small changes will result in different addresses. Check that all required fields are provided and that values are within acceptable ranges (e.g., maxSupply > 0, valid addresses). Verify that your wallet client is properly configured and that you have sufficient funds for the signing transaction. Next Steps Now that you understand collection management, explore these related topics: Learn how to implement token minting functionality Set up whitelist-based minting for exclusive access --- ## Error Handling Source: https://docs.b3.fun/createkit/error-handling Overview Robust error handling is crucial for production applications using CreateKit. This guide covers common error scenarios, best practices, and recovery strategies. Common Error Types Signature Errors Storage Errors Contract Interaction Errors Error Recovery Patterns Retry Logic Circuit Breaker User-Friendly Error Messages Error Monitoring Validation Helpers React Error Boundaries Best Practices - Categorize errors by type and severity - Use consistent error codes - Provide actionable error messages - Log errors with sufficient context - Implement appropriate retry logic - Use circuit breakers for external services - Provide fallback mechanisms - Allow manual error recovery Next Steps Now that you have comprehensive CreateKit documentation, you can: Use the quickstart guide to create your first collection Connect with other developers in the B3 Discord --- ## Examples Source: https://docs.b3.fun/createkit/examples Overview This page provides comprehensive, real-world examples of implementing CreateKit in various scenarios. Each example includes complete code, error handling, and best practices. Basic NFT Collection A simple art collection with free minting: Gaming Collection with Whitelist A gaming collection with tiered whitelist access: Multi-Collection Platform A platform managing multiple collections: Marketplace Integration Integrating CreateKit with a marketplace: React Components Frontend components for CreateKit integration: Testing Examples Comprehensive testing patterns: Best Practices Summary - Always validate signatures before deployment - Use environment variables for sensitive data - Implement proper error handling - Test thoroughly before deploying production contracts - Cache frequently accessed data - Use batch operations when possible - Implement proper loading states - Optimize for gas efficiency - Provide clear feedback during operations - Show estimated costs upfront - Handle errors gracefully - Implement proper validation - Write comprehensive tests - Document your code - Use TypeScript for type safety - Follow consistent patterns Next Steps Learn comprehensive error handling patterns and recovery strategies Explore the complete CreateKit API documentation --- ## Installation Source: https://docs.b3.fun/createkit/installation Package Installation Install CreateKit using your preferred package manager: CreateKit is built with TypeScript and provides full type definitions out of the box. Dependencies CreateKit is built on top of modern web3 technologies and requires the following peer dependencies: Environment Setup 1. Configure Chain Networks CreateKit provides pre-configured chain definitions for B3 Mainnet: 2. Initialize Viem Client Set up your viem client for interacting with the blockchain: 3. Environment Variables Create a file in your project root: Never commit private keys to version control. Use environment variables or secure key management solutions. Framework Integration Next.js Setup For Next.js applications, create a configuration file: React/Vite Setup Verify Installation Test your installation with a simple script: Run the test script: TypeScript Configuration Ensure your includes the necessary configurations: Next Steps Now that you have CreateKit installed and configured, you're ready to start building: Create your first NFT collection in minutes Learn about collection creation and management Troubleshooting Ensure all peer dependencies are installed: Make sure your TypeScript configuration includes the necessary lib entries and that is enabled. Verify your RPC endpoints are correct and accessible. Use the default B3 RPC endpoints if custom ones fail. Ensure your private key is in the correct format (0x prefixed) and has sufficient funds for gas fees. --- ## Introduction Source: https://docs.b3.fun/createki
프로젝트로 돌아가기