Initialize the pool contract
fn initialize(
env: soroban_sdk::Env,
config: PoolInitConfig,
roles: PoolRoles,
) -> soroban_sdk::Symbol
Simple hello function for testing
fn hello(
env: soroban_sdk::Env,
to: soroban_sdk::Symbol,
) -> soroban_sdk::Vec
Check if pool is initialized
fn is_initialized(env: soroban_sdk::Env) -> bool
Set minimum investment (operator only)
fn set_min_investment(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_min: i128,
) -> soroban_sdk::Symbol
Set administration fee (operator only)
fn set_admin_fee(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_fee: i128,
) -> soroban_sdk::Symbol
Set fee receiver address (admin only)
fn set_fee_receiver(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_receiver: soroban_sdk::Address,
) -> soroban_sdk::Symbol
Set funds receiver address (admin only)
fn set_funds_receiver(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_receiver: soroban_sdk::Address,
) -> soroban_sdk::Symbol
Set SBRL token address (admin only) - for updating to SAC address
fn set_sbrl_token(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
new_token_address: soroban_sdk::Address,
) -> soroban_sdk::Symbol
fn get_pool_id(env: soroban_sdk::Env) -> soroban_sdk::String
fn get_pool_name(env: soroban_sdk::Env) -> soroban_sdk::String
fn get_pool_symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn get_total_invested(env: soroban_sdk::Env) -> i128
fn get_total_paid(env: soroban_sdk::Env) -> i128
fn get_total_repaid(env: soroban_sdk::Env) -> i128
fn get_min_investment(env: soroban_sdk::Env) -> i128
Get administration fee (public for backward compatibility)
fn get_admin_fee(env: soroban_sdk::Env) -> i128
Get administration fee (operator only - matching Solidity pattern) Equivalente ao getAdministrationFee do Solidity com onlyRole(OPERATOR_ROLE)
fn get_admin_fee_protected(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> i128
fn get_total_value(env: soroban_sdk::Env) -> i128
fn get_last_payment_date(env: soroban_sdk::Env) -> i64
fn get_fee_receiver(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_funds_receiver(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_originator_wallet(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_sbrl_token(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_admin(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_operator(env: soroban_sdk::Env) -> soroban_sdk::Address
fn get_credit_demand_fee(env: soroban_sdk::Env) -> i128
fn get_credit_demand_amortization(env: soroban_sdk::Env) -> i128
fn get_credit_demands(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn get_credit_demands_count(env: soroban_sdk::Env) -> i128
fn get_investors(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn get_investors_count(env: soroban_sdk::Env) -> i128
fn is_investor(env: soroban_sdk::Env, address: soroban_sdk::Address) -> bool
fn get_investor_balance(env: soroban_sdk::Env, investor: soroban_sdk::Address) -> i128
fn get_pool_info(env: soroban_sdk::Env) -> PoolInfo
Adds a credit demand to the pool (only operator)
fn add_credit_demand(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
credit_demand_address: soroban_sdk::Address,
) -> soroban_sdk::Symbol
Removes a credit demand from the pool (only operator)
fn remove_credit_demand(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
credit_demand_address: soroban_sdk::Address,
) -> soroban_sdk::Symbol
Processes a payment from a credit demand (only registered credit demands)
fn process_credit_demand_payment(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
amount: i128,
fee: i128,
amortization: i128,
) -> soroban_sdk::Symbol
Checks if an address is a registered credit demand
fn is_registered_credit_demand(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
) -> bool
Main SBRL investment function (without permit) Based on investSBRLWithoutPermit from Solidity contract
fn invest_sbrl(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
amount: i128,
) -> soroban_sdk::Symbol
SBRL investment with permit signature Based on investSBRLPermit from Solidity contract
fn invest_with_permit(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
amount: i128,
deadline: u64,
v: u32,
_r: soroban_sdk::Bytes,
_s: soroban_sdk::Bytes,
) -> soroban_sdk::Symbol
Get user investment history Based on getUserInvestments from Solidity contract
fn get_user_investments(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
) -> soroban_sdk::Vec
Get specific user investment by index
fn get_user_investment_by_index(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
index: u32,
) -> Option
Get number of investments for a user
fn get_user_investments_count(
env: soroban_sdk::Env,
user: soroban_sdk::Address,
) -> i128
Get investment information for a specific investor Returns basic investment info like balance, total invested, etc.
fn get_investment_info(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
) -> InvestorInfo
Get list of investment IDs for a user Equivalente a getUserInvestmentIds do Solidity
fn get_user_investment_ids(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
) -> soroban_sdk::Vec
Get investment by ID
fn get_investment_by_id(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
investment_id: soroban_sdk::String,
) -> Option
Cancel investment by ID (cooling-off period: 5 days)
fn cancel_investment_by_id(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
investor: soroban_sdk::Address,
investment_id: soroban_sdk::String,
) -> soroban_sdk::Symbol
Distribute payments to investors from credit demands (called by credit demands) Based on creditDemandPayInvestorsSBRL from Solidity RivoolPool
fn credit_demand_pay_investors_sbrl(
env: soroban_sdk::Env,
caller: soroban_sdk::Address,
amount: i128,
fee: i128,
amortization: i128,
) -> soroban_sdk::Symbol
Get payment history for investor
fn get_investor_payment_history(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
) -> soroban_sdk::Vec
Get all payments from the pool (for all investors)
fn get_all_pool_payments(env: soroban_sdk::Env) -> soroban_sdk::Vec