License
Type-safe SPDX license identifiers for smart contract metadata.Overview
Brandedstring type representing SPDX license identifiers. Used in Solidity source files and smart contract metadata to identify licensing terms. Includes validation for OSI-approved licenses.
Quick Start
- Basic Usage
- Common Licenses
- Solidity Usage
Common Licenses
| License | OSI Approved | Description |
|---|---|---|
| MIT | Yes | Permissive, minimal restrictions |
| Apache-2.0 | Yes | Permissive with patent grant |
| GPL-3.0 | Yes | Strong copyleft |
| GPL-2.0 | Yes | Strong copyleft (earlier version) |
| LGPL-3.0 | Yes | Weak copyleft for libraries |
| BSD-3-Clause | Yes | Permissive with attribution |
| BSD-2-Clause | Yes | Simplified BSD |
| ISC | Yes | Simplified BSD-like |
| MPL-2.0 | Yes | Weak copyleft file-level |
| AGPL-3.0 | Yes | Strong copyleft + network use |
| UNLICENSED | No | Proprietary/no license |
API Reference
Constructors
Methods
Constants
Solidity License Identifier
SPDX license identifiers are required in Solidity files since version 0.6.8:- Identify licensing terms programmatically
- Filter contracts by license type
- Ensure compliance with open source requirements
Use Cases
Contract Metadata Analysis
License Filtering
Related
- SPDX License List - Full list of SPDX identifiers
- OSI Approved Licenses - Open Source Initiative
References
- SPDX Specification - SPDX license format
- Solidity License Identifiers - Solidity documentation

