Response: {
"error": "formula {
$aa_name = "CODAAA"; // Safe Autonomous Agent Forwarding Estate;
$aa_asset_creation_and_issuing = "O7NYCFUL5XIJTYE3O4MKGMGMTN6ATQAJ"; // could withdraw the dust is calculable;
$DAY = 60 * 60 * 24;
$WEEK = 7 * $DAY;
$YEAR = 364.25 * $DAY;
$TOTAL_CODS_AMOUNT=1e15;
// BONUS RELATED STUFF
$DEBUG = true;
// There is a give away period for people ready to stake their bytes:
$GIVEAWAY_PERIOD = $DEBUG ? 15*60 : 0.5 * $YEAR;
// at the beginning of the give away period the bonus is max:
$MAX_BONUS_P100 = 200;
// then during every day the bonus is reducing:
$DAILY_BONUS_REDUCTION_P100 = 1;
// We need better interest for longer stake: return = 0.7 * ln(period) + 1.5
// Viva robin the hood!, we need to steal the riches to feed the pool: reduction_p100 = 0.04 * ln(balance) - 0.31
// ACCOUNTING RELATED STUFF
// Every given time interest should be computed and paied by each user
$ACCOUNTING_PERIOD = 1 * $YEAR;
// from the pool of unclaim coins, we can allow a percentage per week
$YEARLY_INTEREST_P100_FROM_POOL = 4 / 52; // 4% per year
// input
$key = trigger.address||"_"||$account_name;
// load state concerning the CODAA
$temp_next_accounting_time = var["next_accounting_time"];
$temp_interest_next_accounting = var["interest_next_accounting"] otherwise 0;
$temp_pool_balance = var["pool_balance"] otherwise $TOTAL_CODS_AMOUNT;
// load state concerning the user
$user_bytes = var[$key||"_bytes"] otherwise 0;
$user_cods = var[$key||"_cods"] otherwise 0;
$user_stake_start = var[$key||"_stake_start"] otherwise timestamp;
$user_predicted_lock_time = var[$key||"_predicted_lock_time"] otherwise trigger.data.lock_time;
// make weekly accounting? (removing the needed coin reserved to pay interets from the pool)
if ( timestamp > $temp_next_accounting_time )
{
$cods_available_from_pool = round($pool_balance * $YEARLY_INTEREST_P100_FROM_POOL / 100);
$pool_balance = $temp_pool_balance - $cods_available_from_pool;
$next_accounting_time = $temp_next_accounting_time + $ACCOUNTING_PERIOD;
$interest_next_accounting = 0;
}
else
{
$pool_balance = $temp_pool_balance;
$next_accounting_time = $temp_next_accounting_time;
$interest_next_accounting = $temp_interest_next_accounting;
}
} failed: booleans cannot be compared with other types"
}