Contract e83494e004ce74979e9375e16b191a60c5cee47fe7c7c69cb116b466dca0bd87

← Back to Index 📥 Download WASM

Meta

rssdkver 25.1.1#94c2a3b3a5ded6b9cf9cef0c207bf8804f3eb294
rsver 1.93.1
source_repo github:paltalabs/defindex-distributor

Instances

  • CD3R2ZWUCBETVDHGHTFH2PWHMWC2JBW6XF6SH2K5HP5I7KAWQUJTCGGU
  • CDQ7KXPQHSGEBWQ5HQEOTMEZ45ODZPU3UTY3GC4GOMHOCQ7J35ZIVVIN

Interface

Deposits the sum of all recipient amounts into a defindex vault on behalf of caller, then distributes the minted df tokens back to each recipient pro-rata (floor). The last recipient absorbs any remainder from rounding.

Returns [(user, df_tokens_received)] in the same order as recipients.

Auth

caller must authorise this invocation AND the nested sub-invocations:

  • underlying token transfer from caller to the vault (pulled internally by the vault)
  • vault_df_token.transfer(caller → userN, amountN) for every recipient

Pro-rata note

The vault may have a share price != 1:1 (e.g. 1 df token = 1.05 USDC if the vault has accrued yield). As a result, the number of df tokens each user receives will differ from their input amount, but proportionality is preserved: a user who contributed X% of the total receives X% of the minted df tokens, which redeems for exactly X% of the deposited underlying.

fn distribute(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    asset: soroban_sdk::Address,
    vault: soroban_sdk::Address,
    recipients: soroban_sdk::Vec,
) -> soroban_sdk::Vec<(soroban_sdk::Address, i128)>

Imports

WebAssembly Text (WAT) ▶