Contract 6f146b87e2a13a25db5900968359f93231136d4dbf481fa56e5f6500ca0ea677

← Back to Index 📥 Download WASM

Meta

cliver 27.0.0#5a7c5fe76530bf4248477ac812fc757146b98cc4
rssdk_spec_shaking 2
rssdkver 25.3.1#e50d95af029c83196dd122f0154bac3f1302394b
rsver 1.98.1

Instances

  • CBAZFRNDEFOYERDMNLKH3VXVGJHYHBHQSL55WAIUPFVTLZRIVXKMV3UH

Interface

fn deal(env: soroban_sdk::Env, loan_id: u32) -> Deal
fn upgrade(
    env: soroban_sdk::Env,
    new_wasm_hash: soroban_sdk::BytesN<32>,
    operator: soroban_sdk::Address,
)

Returns Some(Address) if ownership is set, or None if ownership has been renounced.

Arguments

  • e - Access to the Soroban environment.
fn get_owner(env: soroban_sdk::Env) -> Option

Brings the loan NFT owner's DEBT balance to the loan's outstanding: unfreezes it, mints or claws back the difference, freezes it again. Callable by anyone.

fn sync_debt(env: soroban_sdk::Env, loan_id: u32)

Brings this contract's CARGO balance to the loan's pledged cargo quantity. Callable by anyone.

fn sync_cargo(env: soroban_sdk::Env, loan_id: u32)
fn debt_issuer(env: soroban_sdk::Env) -> soroban_sdk::Address

Applies to deals registered from now on; registered deals keep their tokens.

fn set_issuers(
    env: soroban_sdk::Env,
    debt_issuer: soroban_sdk::Address,
    cargo_issuer: soroban_sdk::Address,
)
fn cargo_issuer(env: soroban_sdk::Env) -> soroban_sdk::Address

The DEBT<nnnn> SAC address for loan_id under the current issuer, computable before it is deployed.

fn debt_address(env: soroban_sdk::Env, loan_id: u32) -> soroban_sdk::Address
  • owner - The access-manager.
  • loan_registry - Source of DEBT: outstanding and the NFT owner.
  • collateral_registry - Source of CARGO: cargo_quantity.
  • debt_issuer / cargo_issuer - Classic accounts issuing every DEBT<nnnn> / CARGO<nnnn>.
fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    loan_registry: soroban_sdk::Address,
    collateral_registry: soroban_sdk::Address,
    debt_issuer: soroban_sdk::Address,
    cargo_issuer: soroban_sdk::Address,
)

The CARGO<nnnn> SAC address for loan_id under the current issuer.

fn cargo_address(env: soroban_sdk::Env, loan_id: u32) -> soroban_sdk::Address
fn loan_registry(env: soroban_sdk::Env) -> soroban_sdk::Address

Registers the deal for loan_id: its DEBT<nnnn> / CARGO<nnnn> SACs must already be deployed with this contract as admin. Lets this contract hold its own CARGO. The loan must exist. The capital wallet's DEBT trustline is not needed yet (sync_debt fails until it exists).

fn register_deal(env: soroban_sdk::Env, loan_id: u32) -> Deal

Accepts a pending ownership transfer.

Arguments

  • e - Access to the Soroban environment.

Errors

  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If there is no pending transfer to accept.

Events

  • topics - ["ownership_transfer_completed"]
  • data - [new_owner: Address]
fn accept_ownership(env: soroban_sdk::Env)
fn set_loan_registry(env: soroban_sdk::Env, loan_registry: soroban_sdk::Address)

Renounces ownership of the contract.

Permanently removes the owner, disabling all functions gated by #[only_owner].

Arguments

  • e - Access to the Soroban environment.

Errors

  • [OwnableError::TransferInProgress] - If there is a pending ownership transfer.
  • [OwnableError::OwnerNotSet] - If the owner is not set.

Notes

  • Authorization for the current owner is required.
fn renounce_ownership(env: soroban_sdk::Env)

Initiates a 2-step ownership transfer to a new address.

Requires authorization from the current owner. The new owner must later call accept_ownership() to complete the transfer.

Arguments

  • e - Access to the Soroban environment.
  • new_owner - The proposed new owner.
  • live_until_ledger - Ledger number until which the new owner can accept. A value of 0 cancels any pending transfer.

Errors

  • [OwnableError::OwnerNotSet] - If the owner is not set.
  • [crate::role_transfer::RoleTransferError::NoPendingTransfer] - If trying to cancel a transfer that doesn't exist.
  • [crate::role_transfer::RoleTransferError::InvalidLiveUntilLedger] - If the specified ledger is in the past.
  • [crate::role_transfer::RoleTransferError::InvalidPendingAccount] - If the specified pending account is not the same as the provided new address.

Notes

  • Authorization for the current owner is required.
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)
fn collateral_registry(env: soroban_sdk::Env) -> soroban_sdk::Address
fn set_collateral_registry(
    env: soroban_sdk::Env,
    collateral_registry: soroban_sdk::Address,
)

Imports

WebAssembly Text (WAT) ▶