Initialize the contract with farm address
fn __constructor(env: soroban_sdk::Env, farm: soroban_sdk::Address)
Batch plant operation - plants for multiple farmers at once
farmers - Vector of farmer addresses (max 10)amounts - Vector of stake amounts in stroops (1 KALE = 10_000_000 stroops)Vector of boolean success status for each farmer
let farmers = vec![&env, farmer1, farmer2, farmer3];
let amounts = vec![&env, 10_000_000, 20_000_000, 15_000_000];
let results = batch_plant(env, farmers, amounts);
// results = [true, true, true] if all succeeded
fn batch_plant(
env: soroban_sdk::Env,
farmers: soroban_sdk::Vec,
amounts: soroban_sdk::Vec,
) -> soroban_sdk::Vec
Batch work submission - submits mining results for multiple farmers
farmers - Vector of farmer addresses (max 10)hashes - Vector of mining result hashes (32 bytes each)nonces - Vector of mining noncesVector of gap values (i128) for each farmer Returns 0 if work failed for a farmer
let farmers = vec![&env, farmer1, farmer2];
let hashes = vec![&env, hash1, hash2];
let nonces = vec![&env, 12345, 67890];
let gaps = batch_work(env, farmers, hashes, nonces);
// gaps = [150, 200] - gap values returned from contract
fn batch_work(
env: soroban_sdk::Env,
farmers: soroban_sdk::Vec,
hashes: soroban_sdk::Vec>,
nonces: soroban_sdk::Vec,
) -> soroban_sdk::Vec
Batch harvest - harvests rewards for multiple farmers
farmers - Vector of farmer addresses (max 10)blocks - Vector of block numbers to harvestVector of reward amounts (i128) for each farmer in stroops Returns 0 if harvest failed for a farmer
let farmers = vec![&env, farmer1, farmer2, farmer3];
let blocks = vec![&env, 12340, 12340, 12340]; // same block
let rewards = batch_harvest(env, farmers, blocks);
// rewards = [5_000_000, 3_000_000, 4_000_000] in stroops
fn batch_harvest(
env: soroban_sdk::Env,
farmers: soroban_sdk::Vec,
blocks: soroban_sdk::Vec,
) -> soroban_sdk::Vec
Get the configured farm contract address
fn get_farm(env: soroban_sdk::Env) -> soroban_sdk::Address
Utility function to check maximum supported batch size
fn max_batch_size(env: soroban_sdk::Env) -> u32