Initialize the contract with the address of the OrganizationRegistry.
env: The contract environment.contract_org: The address of the OrganizationRegistry contract.Result<(), Error>: Ok if successful, Err if already initialized.fn initialize(
env: soroban_sdk::Env,
contract_org: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
fn ping(env: soroban_sdk::Env) -> u32
fn get_part_root(
env: soroban_sdk::Env,
part_uuid: soroban_sdk::BytesN<16>,
) -> Result, soroban_sdk::Error>
fn event_leaf_hash_view(
env: soroban_sdk::Env,
leaf: EventLeaf,
) -> soroban_sdk::BytesN<32>
fn recompute_root_from_leaf_view(
env: soroban_sdk::Env,
leaf_hash: soroban_sdk::Bytes,
proof: soroban_sdk::Vec<(soroban_sdk::Bytes, bool)>,
) -> soroban_sdk::BytesN<32>
Create a new aeronautic part.
env: The contract environment.caller: The address of the caller (must be an OEM).uuid: The unique identifier for the part.manufacturer: The address of the manufacturer.owner: The address of the initial owner.user: The address of the initial user.merkle_root: The initial Merkle root of the part's manifest.isAircraft: Boolean indicating if the part is an aircraft.Result<(), Error>: Ok if successful, Err if part already exists or caller is not authorized.fn create_part(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
uuid: soroban_sdk::BytesN<16>,
manufacturer: soroban_sdk::Address,
owner: soroban_sdk::Address,
user: soroban_sdk::Address,
merkle_root: soroban_sdk::BytesN<32>,
is_aircraft: bool,
) -> Result<(), soroban_sdk::Error>
Get part details if caller is authorized via Merkle proof.
env: The contract environment.caller: The address of the caller.uuid: The unique identifier for the part.proof: The Merkle proof to verify caller's authorization.Result<AeronauticPart, Error>: The part details if authorized, Err otherwise.fn get_part(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
uuid: soroban_sdk::BytesN<16>,
proof: soroban_sdk::Vec<(soroban_sdk::Bytes, bool)>,
) -> Result
Change the Merkle root of the part's manifest.
env: The contract environment.caller: The address of the caller (must be the part owner).uuid: The unique identifier for the part.merkle_root: The new Merkle root to set.Result<(), Error>: Ok if successful, Err if part not found or caller is not authorized.fn change_merkle_root(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
uuid: soroban_sdk::BytesN<16>,
merkle_root: soroban_sdk::BytesN<32>,
) -> Result<(), soroban_sdk::Error>
Update a single event leaf with authorization controlled by the event owner (or delegated writers).
This endpoint allows the event owner (or a writer proven to belong to writers_root) to update exactly
one event leaf. The contract verifies:
writers_root,env: The contract environment.caller: The address of the caller (must be the event owner or a delegated writer).part_uuid: The unique identifier for the part.prev_root: The previous Merkle root of the part's manifest.branch: The Merkle proof branch as a vector of (sibling hash, is_left) tuples for the event leaf.old_leaf: The previous compact event leaf (owner, data_hash, writers_root).new_leaf: The new compact event leaf (same event_id; owner unchanged).writer_branch: Optional Merkle proof branch for `cfn update_event_leaf(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
part_uuid: soroban_sdk::BytesN<16>,
prev_root: soroban_sdk::BytesN<32>,
branch: soroban_sdk::Vec<(soroban_sdk::BytesN<32>, bool)>,
old_leaf: EventLeaf,
new_leaf: EventLeaf,
_writer_branch: Option>,
) -> Result<(), soroban_sdk::Error>
Add a new event leaf to the part's manifest. This function allows the part owner (or a delegated writer) to append a new event. It verifies:
env: The Soroban environment.caller: Address of the caller (must be owner or writer).part_uuid: UUID of the part.prev_root: Previous Merkle root on-chain.new_root: New Merkle root after adding the event.new_leaf: The new EventLeaf being added.writer_branch: Optional proof that caller ∈ writers_root (if not owner).Ok(()) on success, Error otherwise.
fn add_event_leaf(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
part_uuid: soroban_sdk::BytesN<16>,
prev_root: soroban_sdk::BytesN<32>,
new_root: soroban_sdk::BytesN<32>,
new_leaf: EventLeaf,
_writer_branch: Option>,
) -> Result<(), soroban_sdk::Error>
Transfer ownership of the part to a new owner.
env: The contract environment.caller: The address of the caller (must be the part owner).uuid: The unique identifier for the part.new_owner: The address of the new owner.Result<(), Error>: Ok if successful, Err if part not found or caller is not authorized.fn transfer_part(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
uuid: soroban_sdk::BytesN<16>,
new_owner: soroban_sdk::Address,
) -> Result<(), soroban_sdk::Error>
Change the status of the part.
env: The contract environment.caller: The address of the caller (must be the part owner).uuid: The unique identifier for the part.new_status: The new status to set for the part.Result<(), Error>: Ok if successful, Err if part not found or caller is not authorized.fn change_status(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
uuid: soroban_sdk::BytesN<16>,
new_status: PartStatus,
) -> Result<(), soroban_sdk::Error>