Contract f66d4fe7573273cf05388390e12974f72f40d70f7f977d9942042ab9a0f1b842

← Back to Index 📥 Download WASM

Meta

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

Instances

  • CA5EQ6P5I3GQDC63UXMCZXUKEHGZRODDIFRXGN4MYJ2YDLMJURSSPCDU

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