Contract 7bbf4f8fc227467136bfde2ddc63dd0de9527ca79d55a219a3558ce414a7b30c

← Back to Index 📥 Download WASM

Meta

rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.90.0

Instances

  • CDLZWSAAYHSJLLJTDFD6LCPKBFUMNCNQSPHYOKZRLNMGZLBFFBYEFCLV

Interface

Register an organization.

Parameters

  • env: The contract environment.
  • caller: The address of the organization registering itself.
  • org_type: The type of the organization (e.g., OEM, MRO, etc.).

Returns

  • Ok(()) if the registration is successful.
  • Err(Error::AlreadyRegistered) if the organization is already registered.
fn register_org(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    org_type: OrgType,
) -> Result<(), soroban_sdk::Error>

Activate or deactivate the organization.

Parameters

  • env: The contract environment.
  • caller: The address of the organization changing its status.
  • active: A boolean indicating whether to activate (true) or deactivate (false) the organization.

Returns

  • Ok(()) if the status change is successful.
  • Err(Error::NotRegistered) if the organization is not registered.
fn set_active(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    active: bool,
) -> Result<(), soroban_sdk::Error>

Check if an organization is active.

Parameters

  • env: The contract environment.
  • addr: The address of the organization to check.

Returns

  • bool: true if the organization is active, false otherwise.
  • Option<OrgType>: The type of the organization if registered, None otherwise.
fn is_active(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> bool

Get the type of an organization.

Parameters

  • env: The contract environment.
  • addr: The address of the organization to check.

Returns

  • Option<OrgType>: The type of the organization if registered, None otherwise.
fn get_org_type(env: soroban_sdk::Env, addr: soroban_sdk::Address) -> Option

Imports

WebAssembly Text (WAT) ▶