diff --git a/docs/cookbook/ai-prompting.mdx b/docs/cookbook/ai-prompting.mdx deleted file mode 100644 index 6c5725ec..00000000 --- a/docs/cookbook/ai-prompting.mdx +++ /dev/null @@ -1,9 +0,0 @@ ---- -sidebarTitle: AI-powered IDEs -title: Use AI-powered IDEs -description: How to use AI-powered IDEs to generate code for OnchainKit. ---- - -import AiPowered from "/snippets/ai-powered.mdx"; - - diff --git a/docs/cookbook/launch-tokens.mdx b/docs/cookbook/launch-tokens.mdx deleted file mode 100644 index 103ee0fa..00000000 --- a/docs/cookbook/launch-tokens.mdx +++ /dev/null @@ -1,438 +0,0 @@ ---- -title: 'Launch a Token' ---- - - -Launching a token on Base can be accomplished through multiple approaches, from no-code platforms to custom smart contract development. This guide helps you choose the right method and provides implementation details for both approaches. - - - - Use existing platforms like Zora, Clanker, or Flaunch for quick deployment - - - Build custom ERC-20 tokens with Foundry for maximum control - - - Decision framework to help you pick the right method - - - Security, community building, and post-launch guidance - - - - -**For most users:** Use existing token launch platforms like Zora, Clanker, or Flaunch. These tools handle the technical complexity while providing unique features for different use cases. - -**For developers:** Build custom ERC-20 tokens using Foundry and OpenZeppelin's battle-tested contracts for maximum control and customization. - - -## Choosing Your Launch Approach - -### Platform-Based Launch (Recommended for Most Users) - -Choose a platform when you want: -- Quick deployment without coding -- Built-in community features -- Automated liquidity management -- Social integration capabilities - -### Custom Development (For Developers) - -Build your own smart contract when you need: -- Custom tokenomics or functionality -- Full control over contract behavior -- Integration with existing systems -- Advanced security requirements - -## Token Launch Platforms on Base - -### Zora -**Best for:** Content creators and social tokens - -Zora transforms every post into a tradeable ERC-20 token with automatic Uniswap integration. Each post becomes a "coin" with 1 billion supply, creators receive 10 million tokens, and earn 1% of all trading fees. - -**Key Features:** -- Social-first token creation -- Automatic liquidity pools -- Revenue sharing for creators -- Built-in trading interface - -[Get started with Zora →](https://zora.co) - -### Clanker -**Best for:** Quick memecoin launches via social media - -Clanker is an AI-driven token deployment tool that operates through Farcaster. Users can create ERC-20 tokens on Base by simply tagging @clanker with their token concept. - -**Key Features:** -- AI-powered automation -- Social media integration via Farcaster -- Instant deployment -- Community-driven discovery - -[Get started with Clanker →](https://farcaster.xyz) or visit [clanker.world](https://clanker.world) - -### Flaunch -**Best for:** Advanced memecoin projects with sophisticated tokenomics - -Flaunch leverages Uniswap V4 to enable programmable revenue splits, automated buybacks, and Progressive Bid Walls for price support. Creators can customize fee distributions and treasury management. - -**Key Features:** -- Programmable revenue sharing -- Automated buyback mechanisms -- Progressive Bid Wall technology -- Treasury management tools - -[Get started with Flaunch →](https://flaunch.gg) - -### Mint Club -**Best for:** Token families and community-driven assets - -Mint Club enables anyone to launch new tokens or NFTs backed by existing ERC-20 tokens. Each trade locks the parent token in a bonding curve pool, creating onchain, auto-managed liquidity that strengthens the parent token while supporting new community assets. - -**Key Features:** -- Launch tokens or NFTs from any ERC-20 token -- Automated liquidity with customizable bonding curves -- Integrated trading interface with cross-chain swap -- Built-in airdrop and lock-up tools -- Simple trading for tokens and NFTs -- Creator revenue sharing - -[Get started with Mint Club →](https://mint.club) - -## Technical Implementation with Foundry - -For developers who want full control over their token implementation, here's how to create and deploy a custom ERC-20 token on Base using Foundry. - - -Before launching a custom developed token to production, always conduct security reviews by expert smart contract developers. - - -### Prerequisites - - - - Install Foundry on your system: - ```bash Terminal - curl -L https://foundry.paradigm.xyz | bash - foundryup - ``` - For detailed installation instructions, see the [Foundry documentation](https://book.getfoundry.sh/getting-started/installation). - - - Obtain Base Sepolia ETH for testing from the [Base Faucet](https://docs.base.org/docs/tools/network-faucets) - - - Configure your wallet and development tools for Base testnet deployment - - - -### Project Setup - -Initialize a new Foundry project and clean up template files: - -```bash Terminal -# Create new project -forge init my-token-project -cd my-token-project - -# Remove template files we don't need -rm src/Counter.sol script/Counter.s.sol test/Counter.t.sol -``` - -Install OpenZeppelin contracts for secure, audited ERC-20 implementation: - -```bash Terminal -# Install OpenZeppelin contracts library -forge install OpenZeppelin/openzeppelin-contracts -``` - -### Smart Contract Development - -Create your token contract using OpenZeppelin's ERC-20 implementation: - -```solidity src/MyToken.sol -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; -import "@openzeppelin/contracts/access/Ownable.sol"; - -/** - * @title MyToken - * @dev ERC-20 token with minting capabilities and supply cap - */ -contract MyToken is ERC20, Ownable { - // Maximum number of tokens that can ever exist - uint256 public constant MAX_SUPPLY = 1_000_000_000 * 10**18; // 1 billion tokens - - constructor( - string memory name, - string memory symbol, - uint256 initialSupply, - address initialOwner - ) ERC20(name, symbol) Ownable(initialOwner) { - require(initialSupply <= MAX_SUPPLY, "Initial supply exceeds max supply"); - // Mint initial supply to the contract deployer - _mint(initialOwner, initialSupply); - } - - /** - * @dev Mint new tokens (only contract owner can call this) - * @param to Address to mint tokens to - * @param amount Amount of tokens to mint - */ - function mint(address to, uint256 amount) public onlyOwner { - require(totalSupply() + amount <= MAX_SUPPLY, "Minting would exceed max supply"); - _mint(to, amount); - } - - /** - * @dev Burn tokens from caller's balance - * @param amount Amount of tokens to burn - */ - function burn(uint256 amount) public { - _burn(msg.sender, amount); - } -} -``` - -### Deployment Script - -Create a deployment script following Foundry best practices: - -```solidity script/DeployToken.s.sol -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import {Script, console} from "forge-std/Script.sol"; -import {MyToken} from "../src/MyToken.sol"; - -contract DeployToken is Script { - function run() external { - // Load deployer's private key from environment variables - uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); - address deployerAddress = vm.addr(deployerPrivateKey); - - // Token configuration parameters - string memory name = "My Token"; - string memory symbol = "MTK"; - uint256 initialSupply = 100_000_000 * 10**18; // 100 million tokens - - // Start broadcasting transactions - vm.startBroadcast(deployerPrivateKey); - - // Deploy the token contract - MyToken token = new MyToken( - name, - symbol, - initialSupply, - deployerAddress - ); - - // Stop broadcasting transactions - vm.stopBroadcast(); - - // Log deployment information - console.log("Token deployed to:", address(token)); - console.log("Token name:", token.name()); - console.log("Token symbol:", token.symbol()); - console.log("Initial supply:", token.totalSupply()); - console.log("Deployer balance:", token.balanceOf(deployerAddress)); - } -} -``` - -### Environment Configuration - -Create a `.env` file with your configuration: - -```bash .env -PRIVATE_KEY=your_private_key_here -BASE_SEPOLIA_RPC_URL=https://sepolia.base.org -BASE_MAINNET_RPC_URL=https://mainnet.base.org -BASESCAN_API_KEY=your_basescan_api_key_here -``` - -Update `foundry.toml` for Base network configuration: - -```toml foundry.toml -[profile.default] -src = "src" -out = "out" -libs = ["lib"] -remappings = ["@openzeppelin/=lib/openzeppelin-contracts/"] - -[rpc_endpoints] -base_sepolia = "${BASE_SEPOLIA_RPC_URL}" -base_mainnet = "${BASE_MAINNET_RPC_URL}" - -[etherscan] -base_sepolia = { key = "${BASESCAN_API_KEY}", url = "https://api-sepolia.basescan.org/api" } -base = { key = "${BASESCAN_API_KEY}", url = "https://api.basescan.org/api" } -``` - -### Testing - -Create comprehensive tests for your token: - -```solidity test/MyToken.t.sol -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.19; - -import {Test, console} from "forge-std/Test.sol"; -import {MyToken} from "../src/MyToken.sol"; - -contract MyTokenTest is Test { - MyToken public token; - address public owner = address(0x1); - address public user = address(0x2); - - uint256 constant INITIAL_SUPPLY = 100_000_000 * 10**18; - - function setUp() public { - // Deploy token contract before each test - vm.prank(owner); - token = new MyToken("Test Token", "TEST", INITIAL_SUPPLY, owner); - } - - function testInitialState() public { - // Verify token was deployed with correct parameters - assertEq(token.name(), "Test Token"); - assertEq(token.symbol(), "TEST"); - assertEq(token.totalSupply(), INITIAL_SUPPLY); - assertEq(token.balanceOf(owner), INITIAL_SUPPLY); - } - - function testMinting() public { - uint256 mintAmount = 1000 * 10**18; - - // Only owner should be able to mint - vm.prank(owner); - token.mint(user, mintAmount); - - assertEq(token.balanceOf(user), mintAmount); - assertEq(token.totalSupply(), INITIAL_SUPPLY + mintAmount); - } - - function testBurning() public { - uint256 burnAmount = 1000 * 10**18; - - // Owner burns their own tokens - vm.prank(owner); - token.burn(burnAmount); - - assertEq(token.balanceOf(owner), INITIAL_SUPPLY - burnAmount); - assertEq(token.totalSupply(), INITIAL_SUPPLY - burnAmount); - } - - function testFailMintExceedsMaxSupply() public { - // This test should fail when trying to mint more than max supply - uint256 excessiveAmount = token.MAX_SUPPLY() + 1; - - vm.prank(owner); - token.mint(user, excessiveAmount); - } - - function testFailUnauthorizedMinting() public { - // This test should fail when non-owner tries to mint - vm.prank(user); - token.mint(user, 1000 * 10**18); - } -} -``` - -Run your tests: - -```bash Terminal -# Run all tests with verbose output -forge test -vv -``` - -### Deployment and Verification - -Deploy to Base Sepolia testnet: - -```bash Terminal -# Load environment variables -source .env - -# Deploy to Base Sepolia with automatic verification -forge script script/DeployToken.s.sol:DeployToken \ - --rpc-url base_sepolia \ - --broadcast \ - --verify -``` - - -The `--verify` flag automatically verifies your contract on BaseScan, making it easier for users to interact with your token. - - - -To deploy to Base Mainnet, simply change `base_sepolia` to `base_mainnet` in your deployment command. Ensure you have sufficient ETH on Base Mainnet for deployment and gas fees. - - -## Post-Launch Considerations - -Once your token is deployed, here are the key next steps to consider: - -### Token Distribution and Economics - -Carefully consider your token's supply and distribution settings. Think through how tokens will be distributed to your community, team, and ecosystem participants. Consider factors like vesting schedules, allocation percentages, and long-term incentive alignment. - -### Community and Social Presence - -Establish a community and social presence around your token and project. This includes creating documentation, setting up social media accounts, engaging with the Base ecosystem, and building relationships with other projects and developers. - -### Liquidity and Trading - -Add liquidity to decentralized exchanges like Uniswap to enable trading. Note that token launchers will typically handle this for you automatically, but for custom deployments, you'll need to create trading pairs and provide initial liquidity. - -### Continued Development - -For comprehensive guidance on growing your project on Base, including marketing strategies, ecosystem integration, and growth tactics, visit the [Base Launch Playbook](https://www.launchonbase.xyz/). - - -Remember to always prioritize security, transparency, and community value when developing and launching tokens. Consider conducting security audits and following best practices for token distribution. - - -## Resources - - - - Complete guide to getting started on Base - - - Technical specifications and network information - - - Comprehensive guide to using Foundry - - - Security-focused smart contract library - - - Explore transactions and contracts on Base - - - Get testnet ETH for development - - - -### Community - - - - Join the Base community - - - Follow Base updates - - - Contribute to Base development - - - ---- - -Whether you choose a platform-based approach for speed and convenience, or custom development for maximum control, Base provides a robust foundation for token launches. Start with the approach that best fits your technical expertise and project requirements, and leverage Base's growing ecosystem to build successful token projects. diff --git a/docs/docs.json b/docs/docs.json index dccc0994..cd794ac5 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -9,14 +9,20 @@ }, "favicon": "/logo/favicon.png", "contextual": { - "options": ["copy", "chatgpt", "claude"] + "options": [ + "copy", + "chatgpt", + "claude" + ] }, "api": { "playground": { "display": "simple" }, "examples": { - "languages": ["javascript"] + "languages": [ + "javascript" + ] } }, "navigation": { @@ -26,7 +32,9 @@ "groups": [ { "group": "Introduction", - "pages": ["get-started/base"] + "pages": [ + "get-started/base" + ] }, { "group": "Quickstart", @@ -47,7 +55,10 @@ }, { "group": "Build with AI", - "pages": ["get-started/ai-prompting", "get-started/prompt-library"] + "pages": [ + "get-started/ai-prompting", + "get-started/prompt-library" + ] } ], "global": { @@ -185,7 +196,9 @@ "groups": [ { "group": "Introduction", - "pages": ["base-account/overview/what-is-base-account"] + "pages": [ + "base-account/overview/what-is-base-account" + ] }, { "group": "Quickstart", @@ -387,7 +400,8 @@ "pages": [ "base-account/basenames/basenames-faq", "base-account/basenames/basename-transfer", - "base-account/basenames/basenames-onchainkit-tutorial" ] + "base-account/basenames/basenames-onchainkit-tutorial" + ] }, { "group": "Contribute", @@ -417,7 +431,9 @@ "groups": [ { "group": "Introduction", - "pages": ["base-app/introduction/beta-faq"] + "pages": [ + "base-app/introduction/beta-faq" + ] }, { "group": "Chat Agents", @@ -534,19 +550,28 @@ "pages": [ { "group": "Buy", - "pages": ["onchainkit/latest/components/buy/buy"] + "pages": [ + "onchainkit/latest/components/buy/buy" + ] }, { "group": "Checkout", - "pages": ["onchainkit/latest/components/checkout/checkout"] + "pages": [ + "onchainkit/latest/components/checkout/checkout" + ] }, { "group": "Earn", - "pages": ["onchainkit/latest/components/earn/earn"] + "pages": [ + "onchainkit/latest/components/earn/earn" + ] }, { "group": "Fund", - "pages": ["onchainkit/latest/components/fund/fund-button", "onchainkit/latest/components/fund/fund-card"] + "pages": [ + "onchainkit/latest/components/fund/fund-button", + "onchainkit/latest/components/fund/fund-card" + ] }, { "group": "Identity", @@ -562,7 +587,10 @@ }, { "group": "Mint", - "pages": ["onchainkit/latest/components/mint/nft-card", "onchainkit/latest/components/mint/nft-mint-card"] + "pages": [ + "onchainkit/latest/components/mint/nft-card", + "onchainkit/latest/components/mint/nft-mint-card" + ] }, { "group": "MiniKit", @@ -588,11 +616,16 @@ }, { "group": "Signature", - "pages": ["onchainkit/latest/components/signature/signature"] + "pages": [ + "onchainkit/latest/components/signature/signature" + ] }, { "group": "Swap", - "pages": ["onchainkit/latest/components/swap/swap", "onchainkit/latest/components/swap/swap-settings"] + "pages": [ + "onchainkit/latest/components/swap/swap", + "onchainkit/latest/components/swap/swap-settings" + ] }, { "group": "Token", @@ -606,7 +639,9 @@ }, { "group": "Transaction", - "pages": ["onchainkit/latest/components/transaction/transaction"] + "pages": [ + "onchainkit/latest/components/transaction/transaction" + ] }, { "group": "Wallet", @@ -622,7 +657,9 @@ }, { "group": "Connected", - "pages": ["onchainkit/latest/components/connected/connected"] + "pages": [ + "onchainkit/latest/components/connected/connected" + ] } ] }, @@ -660,7 +697,9 @@ }, { "group": "Token", - "pages": ["onchainkit/latest/utilities/token/format-amount"] + "pages": [ + "onchainkit/latest/utilities/token/format-amount" + ] }, { "group": "Wallet", @@ -762,15 +801,21 @@ "pages": [ { "group": "Buy", - "pages": ["onchainkit/buy/buy"] + "pages": [ + "onchainkit/buy/buy" + ] }, { "group": "Checkout", - "pages": ["onchainkit/checkout/checkout"] + "pages": [ + "onchainkit/checkout/checkout" + ] }, { "group": "Earn", - "pages": ["onchainkit/earn/earn"] + "pages": [ + "onchainkit/earn/earn" + ] }, { "group": "Fund", @@ -851,11 +896,15 @@ }, { "group": "Token", - "pages": ["onchainkit/api/get-tokens"] + "pages": [ + "onchainkit/api/get-tokens" + ] }, { "group": "Wallet", - "pages": ["onchainkit/api/get-portfolios"] + "pages": [ + "onchainkit/api/get-portfolios" + ] } ] }, @@ -915,7 +964,9 @@ }, { "group": "Token", - "pages": ["onchainkit/token/format-amount"] + "pages": [ + "onchainkit/token/format-amount" + ] }, { "group": "Wallet", @@ -983,7 +1034,7 @@ "cookbook/accept-crypto-payments", "cookbook/spend-permissions-ai-agent", "cookbook/launch-ai-agents", - "cookbook/launch-tokens", + "get-started/launch-token", "cookbook/onchain-social", "cookbook/defi-your-app", "cookbook/go-gasless", @@ -993,7 +1044,10 @@ }, { "group": "Build with AI", - "pages": ["cookbook/ai-prompting", "cookbook/base-builder-mcp"] + "pages": [ + "get-started/ai-prompting", + "cookbook/base-builder-mcp" + ] }, { "group": "Vibe Code a Mini App", @@ -1040,14 +1094,18 @@ }, { "tab": "Showcase", - "pages": ["showcase"] + "pages": [ + "showcase" + ] }, { "tab": "Learn", "groups": [ { "group": "Building Onchain", - "pages": ["learn/welcome"] + "pages": [ + "learn/welcome" + ] }, { "group": "Onchain Concepts", @@ -1136,7 +1194,9 @@ }, { "group": "Deploy with Fleek", - "pages": ["learn/onchain-app-development/deploy-with-fleek"] + "pages": [ + "learn/onchain-app-development/deploy-with-fleek" + ] } ] }, @@ -1286,11 +1346,15 @@ }, { "group": "Events", - "pages": ["learn/events/hardhat-events-sbs"] + "pages": [ + "learn/events/hardhat-events-sbs" + ] }, { "group": "Address and Payable", - "pages": ["learn/address-and-payable/address-and-payable"] + "pages": [ + "learn/address-and-payable/address-and-payable" + ] } ] }, @@ -1426,7 +1490,9 @@ }, { "group": "Exercise Contracts", - "pages": ["learn/exercise-contracts"] + "pages": [ + "learn/exercise-contracts" + ] } ] } @@ -1449,12 +1515,11 @@ "icon": "discord" } ], - "primary": - { - "type": "button", - "label": "Base Build", - "href": "https://base.dev" - } + "primary": { + "type": "button", + "label": "Base Build", + "href": "https://base.dev" + } }, "footer": { "socials": { @@ -1492,6 +1557,14 @@ ] }, "redirects": [ + { + "source": "/cookbook/launch-tokens", + "destination": "/get-started/launch-token" + }, + { + "source": "/cookbook/ai-prompting", + "destination": "/get-started/ai-prompting" + }, { "source": "base-app/agents/getting-featured", "destination": "base-app/agents/building-quality-agents" @@ -2826,4 +2899,4 @@ "measurementId": "G-TKCM02YFWN" } } -} +} \ No newline at end of file