Response: {
"error": "formula {
// ============================================================
// OBYFIT AA from Whistling Frogs - v 0.1 24 Oct 2019
// ============================================================
// Deposit 1,020,000 bytes and allow connection to Google Fit.
// visit obyfit.whistlingfrogs.com
// ============================================================
// Production settings:
// Duration of the challange: 7 days / periods
// Walk 10,000 steps a day to earn back up to 10,000 bytes a day.
// Walk 70,000 steps in 7 days to earn back 30,000 bytes bonus.
// (change period_goal and total_goal parameters)
// ============================================================
// Test settings:
// Duration of the challange: 7 hours / periods
// Walk 1,000 steps an hour to earn back up to 10,000 bytes.
// Walk 7,000 steps in 7 hous to earn back 30,000 bytes bonus.
// ============================================================
// challenge parameters
$obyfit_wallet = 'WXJIHWMUYHRQRPP2MTRWC6PQHPFBO7HG';
$fees = 5000; // should be enough for AA to pay for 8 transactions
$commission = 20000 - $fees; // 20,000 bytes - $5,000 bytes
$prize = 1000000; // 1,000,000 bytes
$expected_amnt = $prize + $commission + $fees; // amount that user has to sent to start
$period_goal = 1000; // period goal is 1,000 steps an hour in test // 10,000 steps in a day in prod
$duration = 7; // challenge duration is 7 periods (days)
$total_goal = $period_goal * $duration; // total goad is 7,000 steps in test / 70,000 steps in prod
// challenge variables
// prize money from user
if (trigger.initial_address != $obyfit_wallet) {
// checking user input
if ( var[trigger.initial_address] ) bounce('Prize already received');
if ( trigger.output[[asset=base]] < $expected_amnt ) bounce('Prize is too small.');
if ( trigger.output[[asset=base]] > $expected_amnt ) bounce('Prize is too big.');
// setting variables
$user_wallet = trigger.initial_address;
$day_nb = 0;
}
// data message from ObyFit
else {
$user_wallet = trigger.data.user_wallet;
if (trigger.data.user_steps <= $period_goal) {
$user_steps = trigger.data.user_steps;
}
else {
$user_steps = $period_goal;
}
$day_nb = trigger.data.day_nb;
$user_total_steps = trigger.data.user_total_steps;
}
} failed: booleans cannot be compared with other types"
}