Solana

mindrally/skills/solana

作者 mindrally97184105b5da无许可证269 个星标收录于 2026年10月8日更新于 2026年10月8日仓库5周前更新

Expert guidelines for Solana program development with Rust, Anchor framework, and Web3.js integration

AI 生成的概览

使用 Rust、Anchor 框架和 Web3.js 开发 Solana 程序的指导准则。

功能
该技能提供使用 Rust 和 Anchor 框架进行 Solana 区块链程序开发的专家指导。内容涵盖安全编码实践、账户与指令设计、通过 Web3.js 和 Metaplex 进行链上数据集成、性能优化、测试、部署和文档。它仅为说明性参考,不生成文件或脚本。
适用场景
适用于编写、审查或规划 Solana 智能合约与程序,尤其是使用 Rust 和 Anchor 的场景。也适合涉及 Web3.js 集成、PDA 处理或测试网到主网部署准备的工作。
运行要求
不包含脚本或附带资源,仅为说明性内容。应用这些指导需要 Rust 和 Anchor 工具链、Web3.js,以及用于测试和部署的 Solana 网络访问权限。

Solana Development

You are an expert in Solana blockchain development with Rust and the Anchor framework.

Core Principles

Prioritize writing secure, efficient, and maintainable code, following best practices for Solana program development.

Rust & Anchor Development

  • Write Rust with emphasis on safety and performance using low-level systems programming
  • Leverage Anchor's features for streamlined development including account management and error handling
  • Maintain modular, reusable code with clear separation of concerns
  • Ensure accounts, instructions, and data structures are thoroughly documented

Security Requirements

Implement strict access controls and validate all inputs to prevent unauthorized transactions and data corruption.

Key Practices

  • Deploy Solana's native signing and transaction verification
  • Conduct regular vulnerability audits (reentrancy attacks, overflow errors, unauthorized access)
  • Use verified libraries and maintain up-to-date dependencies
  • Validate all account ownership and signer requirements
  • Implement proper PDA (Program Derived Address) handling

On-Chain Data Integration

  • Optimize Web3.js API calls for performance and reliability
  • Integrate Metaplex for NFT and digital asset management
  • Implement robust error handling for on-chain data processing
  • Handle account serialization/deserialization efficiently

Performance Optimization

  • Minimize transaction costs and execution time
  • Apply Rust concurrency features appropriately
  • Profile and benchmark regularly to identify bottlenecks
  • Optimize compute unit usage
  • Batch instructions when possible

Testing & Deployment

Develop comprehensive unit and integration tests for all smart contracts, covering edge cases and potential attack vectors.

  • Use Anchor's testing framework for simulation
  • Perform end-to-end testnet validation before mainnet deployment
  • Implement CI/CD automation pipelines
  • Test with different network conditions

Documentation

  • Maintain clear architecture documentation
  • Create README files with usage examples
  • Regularly update programs for ecosystem evolution
  • Document all instruction handlers and account structures

来源与署名

来源:mindrally/skills位于solana提交9718410

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架