Read the configured admin (the account that funded the contract).
fn admin(env: soroban_sdk::Env) -> Option
Submit a guess. Returns Ok(true) if the guess matches and the
caller has been rewarded, Ok(false) on a wrong guess.
Returns:
Err(InvalidGuess) if the guess is outside 1..=5.Err(InsufficientRewardFunds) if the contract cannot pay the
full 10 XLM reward (no transfer, no reset).Err(FailedToTransferReward) if the token transfer itself fails.On a correct guess the contract pays 10 XLM to the guesser and
immediately rolls a new random number for the next round.
fn guess(
env: soroban_sdk::Env,
user_number: u64,
guesser: soroban_sdk::Address,
) -> Result
Constructor.
admin funds the contract with INITIAL_FUNDING_XLM XLM out of its
own balance (the deployer should friendbot the admin first).
xlm is the address of the XLM Stellar Asset Contract on the target
network — the deployer supplies it explicitly so the contract stays
network-agnostic.
fn __constructor(
env: soroban_sdk::Env,
admin: soroban_sdk::Address,
xlm: soroban_sdk::Address,
)