Attribute Macro system

Source
#[system]
Expand description

This macro attribute is used to define a BOLT system.

Bolt components are themselves programs. The macro adds parsing and serialization

§Example

#[system]
pub mod system_fly {
    pub fn execute(ctx: Context<Component>, _args: Vec<u8>) -> Result<Position> {
        let pos = Position {
            x: ctx.accounts.position.x,
            y: ctx.accounts.position.y,
            z: ctx.accounts.position.z + 1,
        };
        Ok(pos)
    }
}