Expand description
#1
by
warlordsam
- opened
LICENSE
CHANGED
|
@@ -1 +1,21 @@
|
|
| 1 |
-
MIT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2025 credshields/Solidity-CodeGen-v0.1
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
README.md
CHANGED
|
@@ -12,13 +12,56 @@ tags:
|
|
| 12 |
- credshields
|
| 13 |
---
|
| 14 |
# Solidity-CodeGen-v0.1
|
| 15 |
-
|
| 16 |
Solidity-CodeGen-v0.1 is a fine-tuned LLM specialized for generating Solidity smart contracts with modern OpenZeppelin patterns. It works best when paired with the OpenZeppelin Contracts MCP (Model Context Protocol) to produce canonical ERC and Governor implementations.
|
| 17 |
|
| 18 |
- Base: Qwen3 (tuned for Solidity codegen)
|
| 19 |
- Context length: Served via vLLM (up to 32k with server)
|
| 20 |
- Recommended: Use with OpenZeppelin MCP locally for highest-quality results
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
## How to Load
|
| 23 |
Transformers:
|
| 24 |
```
|
|
|
|
| 12 |
- credshields
|
| 13 |
---
|
| 14 |
# Solidity-CodeGen-v0.1
|
|
|
|
| 15 |
Solidity-CodeGen-v0.1 is a fine-tuned LLM specialized for generating Solidity smart contracts with modern OpenZeppelin patterns. It works best when paired with the OpenZeppelin Contracts MCP (Model Context Protocol) to produce canonical ERC and Governor implementations.
|
| 16 |
|
| 17 |
- Base: Qwen3 (tuned for Solidity codegen)
|
| 18 |
- Context length: Served via vLLM (up to 32k with server)
|
| 19 |
- Recommended: Use with OpenZeppelin MCP locally for highest-quality results
|
| 20 |
|
| 21 |
+
## Why Solidity-CodeGen-v0.1?
|
| 22 |
+
|
| 23 |
+
Traditional LLMs often produce generic code that may contain security vulnerabilities or deviate from best practices. Solidity-CodeGen-v0.1 is different—it's a domain-expert model trained specifically for secure smart contract development. Instead of generating random code snippets, it creates structured, audit-grade templates using OpenZeppelin-compliant logic and predictable design patterns.
|
| 24 |
+
|
| 25 |
+
Every generated contract follows OZ v5 conventions, ensuring:
|
| 26 |
+
- **Canonical ERC implementations** (ERC20, ERC721, ERC1155)
|
| 27 |
+
- **Consistent inheritance patterns**
|
| 28 |
+
- **Reproducible function behavior**
|
| 29 |
+
- **Built-in security considerations**
|
| 30 |
+
|
| 31 |
+
## Security-First Architecture
|
| 32 |
+
|
| 33 |
+
The model's training incorporates real-world vulnerability data from CredShields' research, including insights from [SolidityScan's Web3HackHub](https://solidityscan.com/web3hackhub)—a comprehensive database tracking blockchain security incidents since 2011. This vulnerability-aware training means the model has learned from actual exploits and financial losses, including:
|
| 34 |
+
|
| 35 |
+
- **$1.42 billion** lost across 149 documented incidents in 2024 alone
|
| 36 |
+
|
| 37 |
+
- **[OWASP Smart Contract Top 10](https://scs.owasp.org/sctop10/)**: Vulnerability patterns and Common attack vectors like reentrancy, access control flaws, oracle manipulation, and more
|
| 38 |
+
|
| 39 |
+
The OWASP Smart Contract Security Project plays a critical role in shaping secure development practices across the Web3 ecosystem. It serves as a foundational framework that educates developers on the most prevalent and high-impact vulnerabilities affecting smart contracts.
|
| 40 |
+
By aligning with the OWASP Smart Contract Top-10, the Solidity-CodeGen model internalizes these security priorities and reinforces them through code generation. This ensures that every scaffold it produces not only adheres to OpenZeppelin standards but also reflects industry-accepted security hygiene.
|
| 41 |
+
|
| 42 |
+
|
| 43 |
+
By learning from these failures, Solidity-CodeGen-v0.1 proactively avoids anti-patterns that lead to costly vulnerabilities.
|
| 44 |
+
|
| 45 |
+
## Complete Security Workflow
|
| 46 |
+
|
| 47 |
+
While Solidity-CodeGen-v0.1 generates secure code foundations, comprehensive security requires additional validation. **SolidityScan** provides the perfect complement—an AI-powered smart contract scanner that identifies vulnerabilities and security risks in your code.
|
| 48 |
+
|
| 49 |
+
**Together, they create a complete security pipeline:**
|
| 50 |
+
1. **Generate** secure contract templates with Solidity-CodeGen-v0.1
|
| 51 |
+
2. **Scan** for vulnerabilities with SolidityScan's advanced analysis
|
| 52 |
+
3. **Deploy** with confidence, knowing your contracts meet industry standards
|
| 53 |
+
|
| 54 |
+
[Explore SolidityScan](https://solidityscan.com) to discover how AI-powered scanning can enhance your smart contract security workflow.
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
<p align="center">
|
| 58 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/685934bed73d6881647be295/CL6wjrU6gKYv3_Itc4iAO.png" alt="Solidity-CodeGen-v0.1 Banner" width="75%">
|
| 59 |
+
</p>
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
|
| 65 |
## How to Load
|
| 66 |
Transformers:
|
| 67 |
```
|