Skip to main content

neo_types/
traits.rs

1// Copyright (c) 2025-2026 R3E Network
2// Licensed under the MIT License
3
4use crate::error::NeoResult;
5use crate::value::NeoValue;
6
7/// Neo N3 Contract trait
8pub trait NeoContract {
9    fn name() -> &'static str;
10    fn version() -> &'static str;
11    fn author() -> &'static str;
12    fn description() -> &'static str;
13}
14
15/// Neo N3 Contract Entry Point
16pub trait NeoContractEntry {
17    fn deploy() -> NeoResult<()>;
18    fn update() -> NeoResult<()>;
19    fn destroy() -> NeoResult<()>;
20}
21
22/// Neo N3 Contract Method trait
23pub trait NeoContractMethodTrait {
24    fn name() -> &'static str;
25    fn parameters() -> &'static [&'static str];
26    fn return_type() -> &'static str;
27    fn execute(args: &[NeoValue]) -> NeoResult<NeoValue>;
28}