Initialise the campaign.
price_per_share: payment_token units for 1 share out of 10 000.soft_cap_shares: minimum shares sold to mark campaign Succeeded [1, 10 000].hard_cap_shares: maximum shares available [soft_cap, 10 000].
Pass 10 000 for no effective hard cap.deadline: unix timestamp after which finalize() can be called.fn init(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
payment_token: soroban_sdk::Address,
price_per_share: i128,
soft_cap_shares: i128,
hard_cap_shares: i128,
deadline: u64,
) -> Result<(), soroban_sdk::Error>
Claim a refund after a Failed campaign. Returns payment_token to the investor proportional to their contribution.
fn refund(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
) -> Result
Transfer all raised funds to the splitter contract after a successful campaign. Admin must deploy the V1 splitter externally first, then call this. The splitter should be initialised with shares proportional to contributions.
fn activate(
env: soroban_sdk::Env,
splitter_address: soroban_sdk::Address,
) -> Result
Evaluate success/failure after deadline (callable by anyone). Sets status to Succeeded if total_shares_sold >= soft_cap_shares, else Failed.
fn finalize(env: soroban_sdk::Env) -> Result
Buy shares_amount shares during the fundraising period.
Transfers shares_amount × price_per_share payment_token from investor to contract.
Returns the total payment amount transferred.
fn contribute(
env: soroban_sdk::Env,
investor: soroban_sdk::Address,
shares_amount: i128,
) -> Result
fn get_config(env: soroban_sdk::Env) -> Result
fn get_status(env: soroban_sdk::Env) -> Result
fn get_splitter(env: soroban_sdk::Env) -> Option
fn get_contribution(env: soroban_sdk::Env, investor: soroban_sdk::Address) -> i128
fn get_total_raised(env: soroban_sdk::Env) -> i128