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.
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.
e - Access to the Soroban environment.crate::role_transfer::RoleTransferError::NoPendingTransfer] - If
there is no pending transfer to accept.["ownership_transfer_completed"][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].
e - Access to the Soroban environment.OwnableError::TransferInProgress] - If there is a pending ownership
transfer.OwnableError::OwnerNotSet] - If the owner is not set.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.
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.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.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,
)