Initializes the contract by setting the administrator address if it has not been set previously.
admin: The address to be set as the administrator of the contract.Ok(()) if the contract is successfully initialized with the specified administrator.Err(ContractError) if an error occurs during initialization.AlreadyInitialized: Thrown if the administrator has already been set, indicating the contract is already initialized.fn initialize(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
) -> Result<(), ContractError>
Performs multiple token transfers from the sender to specified addresses, with optional messages for each transfer and an optional transfer fee.
sender: The address initiating the transfers.addresses: A vector of recipient addresses for each transfer.amounts: A vector of token amounts to transfer to each corresponding recipient.messages: A vector of optional messages for each transfer.token_address: The address of the token being transferred.fee_token_address: The address of the token used for the transfer fee.fee_recipient: The address that will receive the transfer fee.fee_amount: The amount of fee tokens to be transferred to the fee recipient.Ok(()) if all transfers are completed successfully.Err(ContractError) if an error occurs during the multi-transfer process.Emits a message event for each recipient with topics ["message", recipient: Address], and data [message: String].
AddressNotWhitelisted: Throwfn multi_transfer(
env: soroban_sdk::Env,
sender: soroban_sdk::Address,
addresses: soroban_sdk::Vec,
amounts: soroban_sdk::Vec,
messages: soroban_sdk::Vec,
token_address: soroban_sdk::Address,
fee_token_address: soroban_sdk::Address,
fee_recipient: soroban_sdk::Address,
fee_amount: i128,
) -> Result<(), ContractError>
Checks if a specific address is on the whitelist.
address: The address to check for whitelisting status.bool: true if the address is whitelisted, false otherwise.fn is_whitelisted(env: soroban_sdk::Env, address: soroban_sdk::Address) -> bool
Checks if the whitelist feature is enabled in the contract.
bool: true if whitelisting is enabled, false otherwise.fn is_whitelist_enabled(env: soroban_sdk::Env) -> bool
Enables the whitelist feature in the contract, allowing addresses to be whitelisted for special permissions.
Ok(()) if the whitelist is successfully enabled.Err(ContractError) if an error occurs during the enabling process.Emits a whitelist_enabled event with topics ["whitelist_enabled"].
WhitelistAlreadyEnabled: Thrown if the whitelist is already enabled.fn enable_whitelist(env: soroban_sdk::Env) -> Result<(), ContractError>
Disables the whitelist feature in the contract, revoking special permissions for whitelisted addresses.
Ok(()) if the whitelist is successfully disabled.Err(ContractError) if an error occurs during the disabling process.Emits a whitelist_disabled event with topics ["whitelist_disabled"].
WhitelistAlreadyDisabled: Thrown if the whitelist is already disabled.fn disable_whitelist(env: soroban_sdk::Env) -> Result<(), ContractError>
Adds an address to the whitelist.
address: The address to be added to the whitelist.Ok(()) if the address is successfully whitelisted.Err(ContractError) if an error occurs during the whitelisting process.Emits a user_whitelisted event with topics ["user_whitelisted"], data = address: Address.
WhitelistNotEnabled: Thrown if the whitelist feature is not enabled in the contract.AddrAlreadyWhitelisted: Thrown if the address is already on the whitelist.fn whitelist(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
) -> Result<(), ContractError>
Removes an address from the whitelist, revoking any special permissions associated with whitelisted addresses.
address: The address to be removed from the whitelist.Ok(()) if the address is successfully removed from the whitelist.Err(ContractError) if an error occurs during the removal process.Emits a user_unwhitelisted event with topics ["user_unwhitelisted"], data = address: Address.
WhitelistNotEnabled: Thrown if the whitelist feature is not enabled in the contract.AddrAlreadyUnwhitelisted: Thrown if the address is not currently on the whitelist.fn remove_from_whitelist(
env: soroban_sdk::Env,
address: soroban_sdk::Address,
) -> Result<(), ContractError>