Contract 63f0bc7bfef41d314e668b1b4dc488e3b3cb3cc4875da18d95b6decc0ef3fb16

← Back to Index 📥 Download WASM

Meta

cliver 25.1.0#
rssdkver 22.0.8#f46e9e0610213bbb72285566f9dd960ff96d03d8
rsver 1.90.0

Instances

  • CAHHREYBOE3UW7ZERXLEEA5YWHZRHDISAU73B3XWWGUI27DQTW2R256C
  • CAWR2V6WGOUCORWVL3B3SQPW36GFWQ4XPKH3SLDRIDTGAINA4QUN6OWS
  • CBOKYILKLX5J4XFJRCRPLZG5YGBU4ESVA5FHVSK4O5AXKBTDA2TTEQEF
  • CBTPRIK3XAGXC2K5G2Q3LM6XPZUT57YZ6XWK2KXAD4ETARGNZCKQ3WBK
  • CCIZ5467KI3Y6TLNKLW7FPEH5QIDUGNJYWUXLKAOG4NJAYSVEFDHHPGZ
  • CDDMH5FOZPAFU23BJVTUBI7K7OVOFZXIRHOHYYODNRXKXSUFZ7CLYZ4Y
  • CDVJV75S7PNIPFRAMXHVL3D4FG3VDNKVP65X2ZSB2EROAQJIE7IHFJWV

Interface

There is a limitation of max 10 params by the soroban contract Initializes the Minah contract.

fn __constructor(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    stablecoin: soroban_sdk::Address,
    receiver: soroban_sdk::Address,
    payer: soroban_sdk::Address,
    price: i128,
    total_supply: u32,
    min_nfts_to_mint: u32,
    max_nfts_per_investor: u32,
    distribution_intervals: soroban_sdk::Vec,
    roi_percentages: soroban_sdk::Vec,
)

Sets a new stablecoin address. Only the contract owner can call this function.

fn set_stablecoin(env: soroban_sdk::Env, stablecoin: soroban_sdk::Address)

Creates a new investor. Function called from the backend when a user creates a profile on the Minah platform

Arguments

  • newInvestor : the fireblocks address generated for the new user. To store in the backend.
fn create_investor(env: soroban_sdk::Env, new_investor: soroban_sdk::Address)

Mints a new NFT to the specified address.

fn mint(env: soroban_sdk::Env, user: soroban_sdk::Address, amount: u32)

Mints NFTs to any investor address on behalf of the owner (admin). Used for Fireblocks investors: USDC payment is handled off-chain, so no stablecoin transfer is performed here. Only the contract owner can call this function.

fn admin_mint(env: soroban_sdk::Env, to: soroban_sdk::Address, amount: u32)

Start the chronometer for ROI distribution

fn start_chronometer(env: soroban_sdk::Env)

Calculate amount to release for a given percentage Function to know how much to approve() on the STABLECOIN smart contract before releasing the amount to all investors. Arguments:

  • percentage: the percentage of ROI to be released for the current stage.(Scaled by 10_000_000 to handle decimal percentages)
fn calculate_amount_to_release(env: soroban_sdk::Env, percent: i128) -> i128

Releases the distribution for the current stage. This function needs to be called by the owner at the end of every distribution period/stage to trigger the current release and next stage.

fn release_distribution(env: soroban_sdk::Env)

Advances the investment state by one period without executing USDC distribution. Use this when ROI distribution was handled off-chain (e.g. via Fireblocks). Pre-conditions: state must be >= BeforeFirstRelease and != Ended.

fn advance_period(env: soroban_sdk::Env)

Repays minting cost (principal) from payer to each investor. Independent of release_distribution. Owner only. Single execution (PrincipalRepaid); second call panics.

fn release_principal(env: soroban_sdk::Env)

Check if an address is an investor

fn is_investor(env: soroban_sdk::Env, investor: soroban_sdk::Address) -> bool

Get investors array length

fn get_investors_array_length(env: soroban_sdk::Env) -> u32

Returns the address of the stablecoin used for investments.

fn get_stablecoin(env: soroban_sdk::Env) -> soroban_sdk::Address

Returns the address of the receiver.

fn get_receiver(env: soroban_sdk::Env) -> soroban_sdk::Address

Returns the start time of the chronometer.

fn get_begin_date(env: soroban_sdk::Env) -> u64

Returns whether the chronometer has started.

fn is_chronometer_started(env: soroban_sdk::Env) -> bool

Returns the address of the payer.

fn get_payer(env: soroban_sdk::Env) -> soroban_sdk::Address

Get claimed amount for an investor

fn see_claimed_amount(env: soroban_sdk::Env, investor: soroban_sdk::Address) -> i128

Get current supply

fn get_current_supply(env: soroban_sdk::Env) -> u32

Get current state

fn get_current_state(env: soroban_sdk::Env) -> InvestmentStatus

Get NFT PRICE

fn get_nft_price(env: soroban_sdk::Env) -> i128

Get total supply

fn get_total_supply(env: soroban_sdk::Env) -> u32

Get minimum nfts to mint

fn get_min_nfts_to_mint(env: soroban_sdk::Env) -> u32

Get maximum nfts per investor

fn get_max_nfts_per_investor(env: soroban_sdk::Env) -> u32

Get nft buying phase supply

fn get_nft_buying_phase_supply(env: soroban_sdk::Env) -> u32

Get distribution intervals array

fn get_distribution_intervals(env: soroban_sdk::Env) -> soroban_sdk::Vec

Whether principal (minting cost) has already been repaid to investors.

fn is_principal_repaid(env: soroban_sdk::Env) -> bool

Get ROI percentages array

fn get_roi_percentages(env: soroban_sdk::Env) -> soroban_sdk::Vec

Get buying phase nft supply

fn get_buying_phase_nft_supply(env: soroban_sdk::Env) -> u32
fn buy_tokens(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_ids: soroban_sdk::Vec,
)
fn sell_tokens(
    env: soroban_sdk::Env,
    from: soroban_sdk::Address,
    to: soroban_sdk::Address,
    token_ids: soroban_sdk::Vec,
)

Sets a new receiver address. Only the contract owner can call this function.

fn set_receiver(env: soroban_sdk::Env, receiver: soroban_sdk::Address)

Sets a new payer address. Only the contract owner can call this function.

fn set_payer(env: soroban_sdk::Env, payer: soroban_sdk::Address)
fn hello(
    env: soroban_sdk::Env,
    to: soroban_sdk::String,
) -> soroban_sdk::Vec
fn transfer(
    env: soroban_sdk::Env,
    _from: soroban_sdk::Address,
    _to: soroban_sdk::Address,
    _token_id: u32,
)
fn transfer_from(
    env: soroban_sdk::Env,
    _spender: soroban_sdk::Address,
    _from: soroban_sdk::Address,
    _to: soroban_sdk::Address,
    _token_id: u32,
)
fn balance(env: soroban_sdk::Env, account: soroban_sdk::Address) -> u32
fn owner_of(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::Address
fn approve(
    env: soroban_sdk::Env,
    approver: soroban_sdk::Address,
    approved: soroban_sdk::Address,
    token_id: u32,
    live_until_ledger: u32,
)
fn approve_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
    live_until_ledger: u32,
)
fn get_approved(env: soroban_sdk::Env, token_id: u32) -> Option
fn is_approved_for_all(
    env: soroban_sdk::Env,
    owner: soroban_sdk::Address,
    operator: soroban_sdk::Address,
) -> bool
fn token_uri(env: soroban_sdk::Env, token_id: u32) -> soroban_sdk::String
fn name(env: soroban_sdk::Env) -> soroban_sdk::String
fn symbol(env: soroban_sdk::Env) -> soroban_sdk::String
fn get_owner(env: soroban_sdk::Env) -> Option
fn transfer_ownership(
    env: soroban_sdk::Env,
    new_owner: soroban_sdk::Address,
    live_until_ledger: u32,
)
fn accept_ownership(env: soroban_sdk::Env)
fn renounce_ownership(env: soroban_sdk::Env)

Imports

WebAssembly Text (WAT) ▶