fn ramp(env: soroban_sdk::Env, id: u32) -> Ramp
fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
Books a loan repayment: the cash, the registry record, and the PLUSD for the interest (to the vault, or to the Pocket for a carved-out loan) and for the fees (staked into the vault for the treasury). Returns the registry's repayment id.
fn repay(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
loan_id: u32,
repayment: RepaymentData,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
sale_id: u32,
) -> u32
Returns true if the contract is paused, and false otherwise.
e - Access to Soroban environment.fn paused(env: soroban_sdk::Env) -> bool
fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
caller: soroban_sdk::Address,
)
fn wire_in(env: soroban_sdk::Env, id: u32) -> WireIn
Wires amount out to a borrower: takes it from bank_cash and records
the disbursement on the loan registry. Returns the cash entry id.
fn disburse(
env: soroban_sdk::Env,
loan_id: u32,
amount: i128,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
) -> u32
Emits the current [PoolState]. Callable by anyone.
fn snapshot(env: soroban_sdk::Env)
fn wire_out(env: soroban_sdk::Env, id: u32) -> WireOut
fn bank_cash(env: soroban_sdk::Env) -> i128
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
fn in_flight(env: soroban_sdk::Env) -> i128
Opens a USDC <-> bank ramp. Returns the ramp id.
fn open_ramp(
env: soroban_sdk::Env,
direction: RampDirection,
amount: i128,
ref_hash: soroban_sdk::BytesN<32>,
) -> u32
fn repayment(env: soroban_sdk::Env, loan_id: u32, repayment_id: u32) -> Repayment
fn cash_entry(env: soroban_sdk::Env, id: u32) -> CashEntry
Closes a ramp with what actually received; the shortfall is a loss
absorbed by the vault and booked as an Expense entry.
fn close_ramp(
env: soroban_sdk::Env,
id: u32,
received: i128,
ref_hash: soroban_sdk::BytesN<32>,
)
fn custodians(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn pool_state(env: soroban_sdk::Env) -> PoolState
fn set_treasury(env: soroban_sdk::Env, new_treasury: soroban_sdk::Address)
Custodian USDC (a failed read counts 0) + bank_cash + in_flight +
the registry's outstanding.
fn total_assets(env: soroban_sdk::Env) -> i128
access_manager - Owner of this contract, and of PLUSD, the vault
and the loan registry.staked_plusd - The sPLUSD vault; its underlying asset is taken as PLUSD.loan_registry - The loan registry this contract is the minter of.treasury - Receives the fee shares.factory - The deal-token factory whose sync_debt is called.pocket - The Pocket for carved-out loans.usdc - The USDC token the custodians hold.rate_limit_config - The mint budget.fn __constructor(
env: soroban_sdk::Env,
access_manager: soroban_sdk::Address,
staked_plusd: soroban_sdk::Address,
loan_registry: soroban_sdk::Address,
treasury: soroban_sdk::Address,
factory: soroban_sdk::Address,
pocket: soroban_sdk::Address,
usdc: soroban_sdk::Address,
rate_limit_config: RateLimitConfig,
)
Bank interest: books delta and mints it into the vault.
fn record_income(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
delta: i128,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
)
fn ref_hash_seen(env: soroban_sdk::Env, ref_hash: soroban_sdk::BytesN<32>) -> bool
Undoes a repay: the cash, the registry record, the treasury's fee
shares, and the interest PLUSD.
fn reverse_repay(
env: soroban_sdk::Env,
loan_id: u32,
repayment_id: u32,
ref_hash: soroban_sdk::BytesN<32>,
)
Stakes an escrowed wire's PLUSD into the vault for receiver.
fn assign_wire_in(env: soroban_sdk::Env, id: u32, receiver: soroban_sdk::Address)
Bank charges: takes delta out of bank_cash and burns it from the vault.
fn record_expense(
env: soroban_sdk::Env,
delta: i128,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
)
Records a bank wire received for receiver: books the cash and mints
PLUSD. An LP receiver is staked straight into the vault (shares to
receiver); the minter itself as receiver holds the PLUSD in escrow
until assign_wire_in / return_wire_in. Returns the wire id.
fn record_wire_in(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
receiver: soroban_sdk::Address,
amount: i128,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
) -> u32
Returns an escrowed wire: burns its PLUSD and takes the cash back out.
fn return_wire_in(env: soroban_sdk::Env, id: u32, ref_hash: soroban_sdk::BytesN<32>)
Sets the USDC custody wallets; each must hold a USDC trustline.
fn set_custodians(
env: soroban_sdk::Env,
new_custodians: soroban_sdk::Vec,
)
Gives the escrowed PLUSD back to the LP (who must not be frozen).
fn cancel_wire_out(env: soroban_sdk::Env, id: u32)
The wire went out: burns the escrowed PLUSD and takes the cash out.
fn settle_wire_out(
env: soroban_sdk::Env,
id: u32,
amount: i128,
value_date: u64,
ref_hash: soroban_sdk::BytesN<32>,
)
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 addresses_config(env: soroban_sdk::Env) -> AddressesConfig
Escrows amount of lp's PLUSD for a bank withdrawal. Returns the id.
fn request_wire_out(
env: soroban_sdk::Env,
lp: soroban_sdk::Address,
amount: i128,
) -> u32
Reverses the whole of disbursement entry original_id (amount must
match it).
fn reverse_disburse(
env: soroban_sdk::Env,
loan_id: u32,
amount: i128,
ref_hash: soroban_sdk::BytesN<32>,
original_id: u32,
)
fn unabsorbed_total(env: soroban_sdk::Env) -> i128
fn decrease_tx_limit(env: soroban_sdk::Env, new_tx_limit: i128)
fn increase_tx_limit(env: soroban_sdk::Env, new_tx_limit: i128)
fn rate_limit_config(env: soroban_sdk::Env) -> RateLimitConfig
Signed bank_cash-only correction of a recorded entry.
fn record_correction(
env: soroban_sdk::Env,
delta: i128,
reason_hash: soroban_sdk::BytesN<32>,
original_id: u32,
)
Pulls amount from the vault and burns it, nothing else.
fn correct_vault_mint(
env: soroban_sdk::Env,
amount: i128,
ref_hash: soroban_sdk::BytesN<32>,
)
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 decrease_window_limit(env: soroban_sdk::Env, new_window_limit: i128)
fn increase_window_limit(env: soroban_sdk::Env, new_window_limit: i128)