Skip to main content

neo_method

Attribute Macro neo_method 

Source
#[neo_method]
Expand description

Neo N3 Method macro

This macro marks a function as a Neo N3 contract method.

Optional arguments are supported when used inside a #[neo_contract] impl block:

  • safe to emit safe manifest metadata for the generated export
  • name = "..." to override the generated export name.

§Example

#[neo_method]
pub fn my_method(&self, arg: NeoInteger) -> NeoResult<NeoString> {
    // Method implementation
    Ok(NeoString::from_str("Hello, Neo!"))
}