Neo.SmartContract.Template 3.10.0

Prefix Reserved
dotnet new install Neo.SmartContract.Template@3.10.0
                    
This package contains a .NET Template Package you can call from the shell/command line.

Neo.SmartContract.Template

.NET project templates for creating Neo smart contracts. Quickly scaffold new contract projects with the correct structure and dependencies.

Features

  • Solution Template: Contract project plus a wired unit-test project
  • NEP-17 Token Template: Fungible token contract template
  • NEP-11 Token Template: Non-fungible token contract template
  • Oracle Template: Contract with oracle functionality
  • Ownable Template: Contract with ownership pattern
  • Pre-configured: Includes proper framework references and build settings

Installation

Install Templates

dotnet new install Neo.SmartContract.Template

Update Templates

dotnet new update Neo.SmartContract.Template

Uninstall Templates

dotnet new uninstall Neo.SmartContract.Template

Available Templates

Smart Contract Solution

dotnet new neocontract -n MyContract -o ./MyContract/

Creates a solution with:

  • a smart contract project
  • an MSTest project wired to Neo.SmartContract.Testing
  • generated contract artifacts consumed automatically by the test project
  • a local nccs tool manifest used during the contract build

NEP-17 Token Contract

dotnet new neocontractnep17 -n MyToken -o ./MyToken/

Creates a NEP-17 compliant fungible token contract.

NEP-11 Token Contract

dotnet new neocontractnep11 -n MyNFT -o ./MyNFT/

Creates a NEP-11 compliant non-fungible token contract.

Oracle Contract

dotnet new neocontractoracle -n MyOracle -o ./MyOracle/

Creates a contract with oracle request functionality.

Ownable Contract

dotnet new neocontractowner -n MyContract -o ./MyContract/

Creates a contract with ownership transfer capabilities.

Template Structure

Project templates generate:

MyContract/
├── MyContract.cs          # Main contract file
├── MyContract.csproj      # Project file with proper references
└── README.md              # Template-specific documentation

The solution template generates:

MyContract/
├── .config/dotnet-tools.json
├── MyContract.sln
├── MyContract/
│   ├── MyContract.csproj
│   └── SmartContract.cs
└── MyContract.UnitTests/
    ├── MyContract.UnitTests.csproj
    └── SmartContractTests.cs

Building Generated Contracts

cd MyContract
dotnet restore
dotnet build

The compiled .nef and .manifest.json files will be in the output directory.

For the solution template, run the generated tests with:

cd MyContract
dotnet test

The contract build restores the local nccs tool, generates .nef, .manifest.json, and .artifacts.cs, and the unit-test project compiles the generated artifacts automatically.

Customizing Templates

After generating, modify the contract file to add your custom logic while keeping the standard structure.

License

MIT - See LICENSE for details.

  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.10.0 110 6/12/2026
3.9.1 929 1/28/2026
3.8.1 728 5/12/2025
3.7.4.1 626 11/6/2024
3.7.4 1,005 5/20/2024
3.6.2 3,610 11/22/2023
3.6.0 738 9/13/2023
3.5.0 1,205 12/8/2022
3.4.0 865 8/5/2022
3.3.0 970 6/6/2022
3.1.0 823 11/14/2021
3.0.3 839 10/8/2021
3.0.2 1,586 8/6/2021
3.0.0 992 8/1/2021