Response: {
"error": "formula {
if (!$FOREVER_CONSTANT){ // FOREVER CONSTANTS (the if(!) is trick to be able to create blocks)
$owner = 'MYESSCFGDERS3YIEGNZDOG2BI5HKQHLU';
$domain_creation_fee = 500000; // 500,000.0 bytes
$requesting_reputation_fee = 10000; // 10,000.0 bytes
$reward_pourcentage = 1; // 1% of the balance for an evalution of an attested address
$symbolic_reward= 10; // for evaluation of not attested address
$evaluation_delay = 2*24*60*60; // 1 days
$default_domain = 'base';
$default_attestor = '35IT3ZYKEPQSCXG2F7A7KWNRAD3SZXN4'; //'UOYYSPEE7UUW3KJAB5F4Y4AWMYMDDB4Y'; // official attestor
}
if (!$TRIGGER_INFO){ // info coming from the triggering transaction
$user_address = trigger.address; // Attested user (if evaluator)
$evaluated_address = trigger.data.adress otherwise trigger.data.ad;
$domain = trigger.data.domain otherwise trigger.data.do otherwise $default_domain; // Evaluation domain
$evaluation = trigger.data.evaluation otherwise trigger.data.ev; // Evaluation: 0-5 or ?
$attestor = trigger.data.attestor otherwise trigger.data.at otherwise $default_attestor;
$input_is_test_mode = trigger.data.testmode otherwise trigger.data.tm otherwise false;
$TRIGGER_INFO = 'At the begining there was a user ('||$user_address_hash||') interested in a seller('|| $evaluated_address ||') in a given domain ('|| $domain ||') in the scope of an attestor ('|| $attestor ||') the user could try to initial the test mode ('|| $input_is_test_mode ||'). ';
}
if (!$HASHES){ // hashing to avoid to store the reputation openely in the dag (euh why?)
$user_address_hash = sha256($user_address);
$evaluated_address_hash = sha256($evaluated_address);
$domain_hash = sha256($domain);
$attestor_hash = sha256($attestor);
$attested_domain = sha256($domain_hash and $attestor_hash);
$evaluation_hash = sha256($attested_domain and $evaluated_address_hash and $user_address_hash);
$reputation_hash = sha256(($attested_domain and $evaluated_address_hash) || 'reputation');
$evaluation_count_hash = sha256(($attested_domain and $evaluated_address_hash) || 'count');
// confuse attested address in the dag to avoid to gather information for free
// is it even possible ? $evaluated_address_confused = $evaluated_address(2);
$HASHES= 'user hash is ('|| $user_address_hash ||') seller ('|| $evaluated_address_hash ||') domain ('|| $domain_hash ||') attestor ('|| $attestor_hash ||') attested_domain ('|| $attested_domain ||'). The evaluation hash for the AD and this pair of user is ('|| $evaluation_hash ||') seller reputation hash is ('|| $reputation_hash ||') number of evaluation for this seller hash is ('|| $evaluation_count_hash ||'). ';
}
if (!$INITIAL_DAG_STATE){ // aka state variables
$state_var_is_test_mode = var['is_test_mode'];
$attested_domain_exist = var['coad('||$attested_domain] otherwise false;
$balance_in_attestor_scope = var['bo('||$attestor_hash] otherwise 0;
$reputation = var['ro('||$reputation_hash] otherwise -1;
$eval_count = var['eco('||$evaluation_count_hash] otherwise 0;
$previous_evaluation = var['le(=)'||$evaluation_hash] otherwise -1;
$is_re_evaluation = var['leo('||$evaluation_hash] otherwise false; // this return false if the var doesn't exist
$INITIAL_DAG_STATE = 'Is test mode activated to allow unattested user to vote? ('|| $state_var_is_test_mode || '). It is ('|| $attested_domain_exist || '/' || var['coad('||$attested_domain] ||') that the attested domain exist. The balance for this attestor scope is ('|| $balance_in_attestor_scope || '/' || var['bo('||$attestor_hash] || '). The reputation of the seller is ('|| $reputation || '/' || var['ro('||$reputation_hash] || ') with ('|| $eval_count|| '/' || var['eco('||$evaluation_count_hash] ||') votes. The previous evalutaion of the seller from this user is ('|| $previous_evaluation|| '/' || var['le(=)'||$evaluation_hash] ||') so it is ('|| $is_re_evaluation || ') to says that it is a re-evaluation. ';
}
if (!$PRELIMINARY_CHECKS){ // Preliminary checks and deductions
// test mode?
if ($user_address==$owner)
$is_test_mode = $input_is_test_mode otherwise $state_var_is_test_mode otherwise false;
else
$is_test_mode = var['is_test_mode'] otherwise false;
// function?
$is_requesting = $evaluation == '?';
$is_contributing = (!$is_requesting)? $evaluation >= 0 and $evaluation <= 5 : false;
// attested domain?
$attested_default_domain = ($domain == $default_domain) and ($attestor == $default_attestor);
// Preliminary checks
if(!$is_requesting and !$is_contributing)
bounce('Sorry, You have to specify a \'evaluation\' field in the data section. Use \'0\' to \'5\' to evaluate an address or use \'?\' to request the reputation of an address.'); // (money - bounce fee) is return automatically
if(!$evaluated_address)
bounce('Sorry, You have to specify which address you want to find reputation for. Please add an \'address\' field in the data section.');
// Fee checks
$fee_received = trigger.output[[asset=base]].amount;
$is_creation_fee_received = $fee_received > $domain_creation_fee;
$is_requesting_fee_received = $fee_received > $requesting_reputation_fee;
$PRELIMINARY_CHECKS= 'The test mode is set to ('|| $is_test_mode ||') requesting mode to ('|| $is_requesting ||') contributing mode to ('|| $is_contributing ||') this is ('|| $attested_default_domain ||') to say that we will work with the default attested domain. The fee received is ('|| $fee_received ||') ok for creation ('|| $is_creation_fee_received ||') ok for requesting a reputation ('|| $is_requesting_fee_received ||'). ';
}
if (!$ATTESTATIONS){ // Attestation checks
$evaluated_is_attested = attestation[[attestors=$attestor, address=$evaluated_address, ifnone=0]];
$user_is_attested = attestation[[attestors=$attestor, address=$user_address, ifnone=0]];
$ATTESTATIONS = 'User attestation is ('|| $user_is_attested ||') and seller attestation is ('|| $evaluated_is_attested ||'). ';
}
} failed: booleans cannot be compared with other types"
}