Contract 78f163cb9484bb4be0674173d6cf03fc910c977856f8eedbf8a3d0b52bc354d5

← 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

  • CCRD2XCQHOREZAVGJWL3EDOS547VKWGUUPEKBFY5SW2POZFRN4UW64FS

Interface

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.

Arguments

  • 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.

Arguments

  • 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.

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)

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,
)

Imports

WebAssembly Text (WAT) ▶