Write-down: burns up to amount of the PLUSD the pocket still holds.
Returns what was burned.
fn burn(env: soroban_sdk::Env, loan_id: u32, amount: i128) -> i128
Opens the loan's pocket with the amount of PLUSD sPLUSD just moved
here, owned by the share holders at the end of snapshot_ledger.
sPLUSD passes its total supply at that ledger (the pocket cannot call
back into it mid-carve_out: Soroban forbids re-entry).
fn open(
env: soroban_sdk::Env,
loan_id: u32,
amount: i128,
snapshot_ledger: u32,
supply_at_snapshot: i128,
)
Pays holder their share of everything released so far, by their
sPLUSD balance at the snapshot, less what they already claimed.
Returns what was paid.
fn claim(env: soroban_sdk::Env, holder: soroban_sdk::Address, loan_id: u32) -> i128
fn pause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn plusd(env: soroban_sdk::Env) -> soroban_sdk::Address
Returns true if the contract is paused, and false otherwise.
e - Access to Soroban environment.fn paused(env: soroban_sdk::Env) -> bool
fn pocket(env: soroban_sdk::Env, loan_id: u32) -> PocketData
fn claimed(env: soroban_sdk::Env, holder: soroban_sdk::Address, loan_id: u32) -> i128
Books a recovery: up to principal of the held PLUSD, plus the
interest PLUSD the minter just minted here, become claimable.
Principal beyond what the pocket holds (the part of the loan the vault
could not cover at default) has no PLUSD here to release. Returns the
principal released, which unrelease must be given back.
fn release(
env: soroban_sdk::Env,
loan_id: u32,
principal: i128,
interest: i128,
) -> i128
fn unpause(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn upgrade(
env: soroban_sdk::Env,
new_wasm_hash: soroban_sdk::BytesN<32>,
operator: soroban_sdk::Address,
)
What claim would pay holder now: released_total × balance_at(holder, snapshot) / supply_at_snapshot − claimed.
fn claimable(env: soroban_sdk::Env, holder: soroban_sdk::Address, loan_id: u32) -> 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 reporters(env: soroban_sdk::Env) -> Reporters
Reverses a release: principal (as release returned it) goes back
to held and the interest PLUSD is burned. Refused once any holder
has claimed: entitlements are pro-rata of released_total, so
shrinking it after a claim lets earlier claimers keep the excess and
later claims take it from held.
fn unrelease(env: soroban_sdk::Env, loan_id: u32, principal: i128, interest: i128)
owner - The access-manager.staked_plusd - The sPLUSD vault: opens pockets, and its balance
history decides the claims. Its underlying asset is taken as PLUSD.loan_registry - Burns from pockets on write-down.minter - Releases recoveries.fn __constructor(
env: soroban_sdk::Env,
owner: soroban_sdk::Address,
staked_plusd: soroban_sdk::Address,
loan_registry: soroban_sdk::Address,
minter: soroban_sdk::Address,
)
fn set_reporters(
env: soroban_sdk::Env,
staked_plusd: soroban_sdk::Address,
loan_registry: soroban_sdk::Address,
minter: soroban_sdk::Address,
)
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)
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,
)