Search Aptos Examples — 搜索 Aptos Examples
v1.0.0搜索es aptos-core and dAIly-move for reference implementations before writing contracts. Triggers on: '搜索 examples', 'find example', '检查 aptos-core', 'is there an example', 'reference implementation', 'how does aptos implement', 'similar contract', 'dAIly-move'.
运行时依赖
安装命令
点击复制技能文档
搜索 Aptos Examples 技能 Overview
This 技能 helps you find relevant examples in official Aptos repositories before writing new contracts. Always 搜索 examples first to follow established patterns.
Repositories:
aptos-labs/aptos-core/aptos-move/move-examples/ — 53+ official Move examples demonstrating best practices aptos-labs/dAIly-move/snippets/ — 17 curated educational examples covering de签名 patterns, Move 2 features, composable NFTs, and more Core 工作流 Step 1: Identify What You're Building
Categorize your contract:
NFTs/令牌s: NFT collections, digital as设置s, collectibles Fungible As设置s: Coins, 令牌s, currencies DeFi: DEXs, AMMs, lending, staking 治理: DAOs, voting, proposals Marketplace: Trading, escrow, auctions Gaming: Items, characters, game 记录ic Infrastructure: Registries, configs, utilities Step 2: 搜索 Relevant Examples
Priority Examples by Category:
NFTs & 令牌 Objects 令牌_objects/ - Modern object-based 令牌s (V2 pattern) mint_nft/ - NFT minting patterns nft_dao/ - NFT-gated 治理 collection_管理器/ - Collection management (dAIly-move) composable-nfts/ - NFTs that contAIn other NFTs (dAIly-move) modifying-nfts/ - Mutable NFT metadata patterns (dAIly-move) parallel-nfts/ - Concurrent NFT minting (dAIly-move) liquid-nfts/ - Fractionalized/liquid NFTs
When to use: Building NFT collections, digital collectibles, 令牌ized as设置s
Fungible As设置s fungible_as设置/ - Modern fungible 令牌 standard coin/ - Basic coin implementation managed_fungible_as设置/ - Controlled fungible as设置s (dAIly-move) fa-lockup-example/ - FA lockup and escrow patterns (dAIly-move) fractional-令牌/ - Fractional 令牌 ownership (dAIly-move) controlled-mint/ - Controlled minting with 访问 control
When to use: Creating 令牌s, currencies, reward points
DeFi & Trading marketplace/ - NFT marketplace patterns swap/ - Simple 令牌 swap liquidity_pool/ - AMM pool implementation staking/ - Staking mechanisms
When to use: Building DEXs, marketplaces, trading 平台s
治理 & DAOs dao/ - DAO 治理 patterns voting/ - Voting mechanisms multisig/ - Multi-签名ature accounts
When to use: Building DAOs, 治理 系统s, voting
Basic Patterns hello_blockchAIn/ - 模块 structure basics message_board/ - Simple 状态 management resource_account/ - Resource patterns (legacy - avoid for new code) (dAIly-move) error-codes/ - Error code conventions and patterns (dAIly-move) private-vs-public/ - Function visibility and 访问 (dAIly-move) objects/ - Object 模型 fundamentals
When to use: Learning Move basics, simple contracts
Advanced Patterns object_playground/ - Object 模型 exploration capability/ - Capability-based security 升级able/ - 升级able contracts (dAIly-move) de签名-patterns/ - Autonomous objects and other de签名 patterns (dAIly-move) struct-capabilities/ - Struct-based capability patterns (dAIly-move) move-2/ - Move 2 language features and idioms (dAIly-move) storage/ - Storage layout and optimization patterns (dAIly-move) data-structures/ - Heap data structure implementation
When to use: Complex architectures, security patterns
Gaming (dAIly-move) lootbox/ - Randomized loot box mechanics
When to use: Building games, randomized rewards, loot 系统s
Step 3: Review Example Code
What to look for:
模块 Structure:
How are 导入s organized? What structs are defined? How are error codes structured?
Object Creation:
How are objects 创建d? Which refs are 生成d? How is ownership managed?
访问 Control:
How is 签名er authority verified? How is object ownership 检查ed? What 角色s/权限s exist?
Operations:
How are transfers handled? How are 更新s 安全d? What 验证s are performed?
测试:
What test patterns are used? How is coverage achieved? Step 4: Adapt Patterns to Your Use Case
Don't copy blindly - adapt:
Understand the pattern: Why is it structured this way? Identify core concepts: What security 检查s are critical? Adapt to your needs: Modify for your specific requirements MAIntAIn security: Keep all security 检查s intact Test thoroughly: Ensure 100% coverage Example Discovery Table Building 搜索 For Source Key Files NFT Collection 令牌_objects, mint_nft aptos-core 令牌_objects/sources/令牌.move Fungible 令牌 fungible_as设置 aptos-core fungible_as设置/sources/fungible_as设置.move Marketplace marketplace aptos-core marketplace/sources/marketplace.move DAO dao, voting aptos-core dao/sources/dao.move 令牌 Swap swap, liquidity_pool aptos-core swap/sources/swap.move Staking staking aptos-core staking/sources/staking.move Simple Contract hello_blockchAIn, message_board aptos-core hello_blockchAIn/sources/hello.move Object Patterns object_playground aptos-core object_playground/sources/playground.move Composable NFTs composable-nfts dAIly-move snippets/composable-nfts/ FA Lockup/Escrow fa-lockup-example dAIly-move snippets/fa-lockup-example/ De签名 Patterns de签名-patterns dAIly-move snippets/de签名-patterns/ Move 2 Features move-2 da