defi-protocol-templates
ステーキング、AMM、ガバナンス、レンディングシステムのプロダクション対応テンプレートでDeFiプロトコルを実装します。分散型金融アプリケーションまたはスマートコントラクトプロトコルを構築する時に使用してください。
Security Assessment
Detected risks:
About defi-protocol-templates
The 'defi-protocol-templates' skill provides ready-to-use, production-grade templates for building decentralized finance (DeFi) protocols. It simplifies the development of complex DeFi systems by offering foundational smart contract structures for staking, automated market makers (AMMs), governance, lending/borrowing, and flash loans. By using these templates, developers can avoid the repetitive boilerplate work involved in creating secure and efficient DeFi applications, enabling faster deployment and reduced risk of critical errors.
This skill includes key features such as a staking contract that manages user deposits, calculates rewards based on staking duration, and allows users to claim rewards or exit their positions. The AMM template supports token swaps between two ERC20 tokens with reserve tracking and liquidity management. Additionally, the skill provides guidance for implementing governance tokens and integrating lending protocols. Each template follows standard practices and leverages OpenZeppelin contracts to ensure security and maintainability.
Target users for this skill include blockchain developers, DeFi project teams, and smart contract engineers looking to accelerate protocol development. It is particularly useful for those who want to implement reward distribution systems, liquidity pools, governance mechanisms, and yield farming platforms. This skill helps reduce development time while providing robust, tested contract patterns suitable for production environments, making it ideal for teams launching DeFi applications or experimenting with financial primitives on Ethereum-compatible networks.
FAQ
How do I deploy the staking contract included in this skill?
You can deploy the staking contract by providing the addresses of the staking token and rewards token when initializing the contract. Make sure to use a supported Ethereum network and have sufficient gas for deployment.
Can these templates be integrated with existing DeFi protocols?
Yes, the templates are designed to be modular and can be integrated into existing projects, but you should review compatibility with your token standards and ensure proper testing before production use.
What versions of Solidity are supported by these templates?
The provided contracts use Solidity version 0.8.0 or higher, which includes built-in overflow checks and is compatible with recent OpenZeppelin contracts.
Are there any limitations when using these templates?
These templates provide foundational structures but do not cover all edge cases for complex DeFi strategies. Developers should audit the contracts and adapt them to their specific requirements.
Do I need OpenZeppelin contracts to use these templates?
Yes, the templates rely on OpenZeppelin libraries for ERC20 token handling, access control, and security patterns such as reentrancy guards.
Install defi-protocol-templates
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
amurata/cc-tools