Contract 42549904d3f537404746b43460a560820f80acfdabb433e33cc63bdf8238ed4b

← Back to Index 📥 Download WASM

Meta

cliver 23.4.0#fc6745f3d4e90d1ef68d14d0ae947404768fa5c0
rssdkver 23.0.2#a97daf8b07cdf24e9bd45e344db51a21b9ea77d3
rsver 1.89.0

Instances

  • CBZPNQJUPE5E4BOHA7PYVH44B4RWEQQW4QU4BL6LHQOWZYAU5ZRNWJYL
  • CDHCUQAWJMKHOFKTUGG5V42EUVL34YHI3JO4ZPN5VRZM5U5O3CKAW2CG

Interface

Constructor for the Collective contract

Arguments

  • admin - The admin address
  • join_fee - Fee to join the collective (in stroops)
  • mint_fee - Fee to publish a file (in stroops)
  • token - The payment token address (e.g., XLM)
  • reward - Opus reward per file (in Opus tokens)
  • split - Percentage of Opus reward to collective treasury (0-30, default 10)
fn __constructor(
    env: soroban_sdk::Env,
    admin: soroban_sdk::Address,
    join_fee: u32,
    mint_fee: u32,
    token: soroban_sdk::Address,
    reward: u32,
    split: u32,
)
fn fund_contract(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    fund_amount: u32,
) -> i128
fn join(env: soroban_sdk::Env, caller: soroban_sdk::Address)
fn withdraw(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    recipient: soroban_sdk::Address,
) -> Result
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::Symbol
fn join_fee(env: soroban_sdk::Env) -> i128
fn mint_fee(env: soroban_sdk::Env) -> i128
fn opus_reward(env: soroban_sdk::Env) -> i128

Returns the current Opus split percentage (0-30) This is the percentage of Opus rewards that go to the collective treasury

fn opus_split(env: soroban_sdk::Env) -> u32
fn member_paid(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> u32
fn opus_address(env: soroban_sdk::Env) -> soroban_sdk::Address
fn is_member(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> bool
fn remove(
    env: soroban_sdk::Env,
    admin_caller: soroban_sdk::Address,
    member_to_remove: soroban_sdk::Address,
) -> bool
fn deploy_node_token(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    name: soroban_sdk::String,
    descriptor: soroban_sdk::String,
) -> soroban_sdk::Address
fn deploy_ipfs_token(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    name: soroban_sdk::String,
    ipfs_hash: soroban_sdk::String,
    file_type: soroban_sdk::String,
    gateways: soroban_sdk::String,
    ipns_hash: Option,
) -> soroban_sdk::Address
fn publish_file(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    publisher: soroban_sdk::String,
    ipfs_hash: soroban_sdk::String,
)
fn publish_encrypted_share(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    publisher: soroban_sdk::String,
    recipient: soroban_sdk::String,
    ipfs_hash: soroban_sdk::String,
)

Sets the OPUS token contract address and mints initial allocation to the caller.

Important

The collective contract must be set as the admin of the OPUS token contract before calling this function. This can be done by calling set_admin on the OPUS token contract with the collective contract's address.

fn set_opus_token(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    opus_contract_id: soroban_sdk::Address,
    initial_alloc: u32,
) -> bool
fn is_launched(env: soroban_sdk::Env) -> bool
fn update_join_fee(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_fee: u32,
) -> i128
fn update_mint_fee(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_fee: u32,
) -> i128
fn update_opus_reward(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_reward: u32,
) -> i128

Updates the Opus split percentage (admin only)

Arguments

  • new_split - New split percentage (0-30)
  • 0 = 100% to publisher, 0% to collective
  • 10 = 90% to publisher, 10% to collective (default)
  • 30 = 70% to publisher, 30% to collective (max)
fn update_opus_split(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_split: u32,
) -> u32
fn add_admin(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    new_admin: soroban_sdk::Address,
) -> bool
fn is_admin(env: soroban_sdk::Env, caller: soroban_sdk::Address) -> bool
fn get_admin_list(env: soroban_sdk::Env) -> soroban_sdk::Vec
fn remove_admin(
    env: soroban_sdk::Env,
    caller: soroban_sdk::Address,
    admin_to_remove: soroban_sdk::Address,
) -> bool

Imports

WebAssembly Text (WAT) ▶