Skip to main content

neo_types/
traits.rs

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