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
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)
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)
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)