unc-sdk 2.3.2

Rust library for writing Utility smart contracts.
Documentation
//! Smart contract that implements trait.

use unc_sdk::unc;

#[unc(contract_state)]
#[derive(Default)]
struct Incrementer {
    value: u32,
}

pub trait Zeroable {
    fn set_to_zero(&mut self);
}

#[unc]
impl Incrementer {
    pub fn inc(&mut self, by: u32) {
        self.value += by;
    }
}

#[unc]
impl Zeroable for Incrementer {
    fn set_to_zero(&mut self) {
        self.value = 0;
    }
}

fn main() {}