This example demonstrates the simplest possible smart contract on the Neo N3 blockchain. It provides a basic starting point for developers new to Neo smart contract development and showcases the minimal structure required for a functional contract.
- Minimal contract implementation
- Basic method declaration
- Safe method attribute usage
- Contract metadata annotation
The HelloWorld contract demonstrates several fundamental Neo N3 features:
- Contract attribute decorations for metadata
- Safe method annotation for read-only operations
- Basic method implementation
- String return type handling
The example showcases essential contract attributes:
DisplayName: Human-readable name for the contractContractDescription: Brief description of the contract's purposeContractEmail: Contact information for the contract authorContractVersion: Version information for the contractContractSourceCode: Link to the source code repositoryContractPermission: Permission settings for contract interactions
The example includes a method marked with the [Safe] attribute, indicating that:
- The method does not modify blockchain state
- It can be called without incurring GAS fees
- It performs read-only operations
This contract can be used as:
- A starting template for new Neo N3 developers
- A verification that the Neo development environment is set up correctly
- A baseline for more complex contract development
The contract can be compiled and deployed using the Neo SDK tools. Once deployed, the SayHello method can be invoked to retrieve the "Hello, World!" message.
The contract functionality can be tested by invoking the SayHello method and verifying that it returns the expected string.
This example teaches:
- Basic Neo N3 contract structure
- Proper use of contract attributes
- Implementation of read-only methods
- String handling in Neo smart contracts