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.
caller must authorise this invocation AND the nested sub-invocations:
caller to the vault (pulled internally by the vault)vault_df_token.transfer(caller → userN, amountN) for every recipientThe 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)>