defi-protocol-templates

仓库创建 2025年7月25日最近提交 4 天前SkillHot 收录 20 天前
▸ 精选理由

加速构建常见 DeFi 产品原型与标准实现。

▸ 风险提示

包含可操作智能合约代码,需审计并谨慎部署,可能造成资金风险。

这个 Skill 做什么

提供生产级 DeFi 协议模板,覆盖质押、AMM、治理与闪电贷等。

提供一套可直接用在主网的 DeFi 合约模板,包含质押、AMM、治理代币和闪电贷等常见模块。通常在要快速搭建 staking 平台、AMM 市场或治理系统时用,省掉从零实现的脆弱环节。特别之处是模板偏向 production-ready,含奖励分发、流动性逻辑和安全接口,方便直接复用或二次开发。

▸ 展开 SKILL.md 英文原文

Implement DeFi protocols with production-ready templates for staking, AMMs, governance, and flash loans. Use when building decentralized finance applications or smart contract protocols.

垂直行业DeFi模板AMM智能合约通用
3.8w
Stars
4.1k
Forks
40
仓库内 Skill
+683
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/wshobson/agents/main/plugins/blockchain-web3/skills/defi-protocol-templates/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/wshobson/agents/main/plugins/blockchain-web3/skills/defi-protocol-templates/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# DeFi Protocol Templates

Production-ready templates for common DeFi protocols including staking, AMMs, governance, and flash loans.

## When to Use This Skill

- Building staking platforms with reward distribution
- Implementing AMM (Automated Market Maker) protocols
- Creating governance token systems
- Integrating flash loan functionality

## Staking Contract

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract StakingRewards is ReentrancyGuard, Ownable {
    IERC20 public stakingToken;
    
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有