formula
if (!!$user_bytes or !!$user_cods)
bounce ($account_name||" for the address "||trigger.address||" already exist, use another address or another 'account_name' !");
if (!trigger.data.lock_time)
bounce("Set lock time");
// Amount received to be blocked to receive free coins
$received_bytes = trigger.output[[asset=base]].amount;
// free coin computation
$remaining_time = parse_date(var["block_until"]) - timestamp;
if ($remaining_time<0)
bounce ("Sorry, The free CODs offering is finished !");
$elapsed_time = $GIVEAWAY_PERIOD - $remaining_time;
$elapsed_periods = round($elapsed_time/$BONUS_REDUCTION_PERIOD);
$remaining_days = round($remaining_time/$DAY);
$bonus = $MAX_BONUS_P100 - ($elapsed_days * $BONUS_REDUCTION_PERCENTAGE);
$unfair_free_cods = $received_bytes * ($bonus / 100);
// robin hood effect, steal the riches and give to the ... pool, 1Gb = 100% 10Gb = 88%, 72, 56,40,24,8%
$uncorrected_robin_percentage = -0.07 * ln($received_bytes) +2.5;
// if more than 100% bring it back to 100%
$robin_percentage = $uncorrected_robin_percentage>1 ? 1 : $uncorrected_robin_percentage;
$free_cods = round($unfair_free_cods * $robin_percentage);
$predicted_interest = $received_cods * (0.7 * ln($user_predicted_lock_time_in_sec) + 1.5); // longer stake => bigger return
failed: not finite in /