Unit ID
9tSMgHxL8l53O+pC5Tks7dokiiL0FxzHIMaJlmQubNM=
Received
16.12.2020 11:44:04
Confirmation delay (full node)
4 minutes 20 seconds
Confirmation delay (light node)
11 minutes 48 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $nom_AA = 'Portal'; $versio = '0.1.2'; $_AUT_000 = 'C4KIJSUWVM7BGWTLXKX3K4PNRXV7OY4W'; $adr__ = trigger.address; $args = trigger.data; $generics = var[ 'Generics' ]; $__bota = $txt => bounce ( $nom_AA || ' >>> ' || $txt ); if ( $args.admin ) { $propostes = var[ 'Propostes' ]; $validacions = var[ 'Validacions' ]; $ordinals = var[ 'Ordinals' ]; // Funció: Si no s'ha lliurat l'argument especificat, s'atura $__arg = $arg => $args[ $arg ] ? $args[ $arg ] : $__bota( "Cal proporcionar el valor de: " || $arg ); // Funció: Retorna si|no adr consta com a autoritzada $__autoritzada = ( $x ) => { $aut = $generics[ '_AUT_' || $x ]; $aut AND $aut == $adr__ }; // Comprova si la adr__ actuant consta com a autoritzada if ( $adr__ != $_AUT_000 AND ! $__autoritzada( '0' ) AND ! $__autoritzada( 'A' ) AND ! $__autoritzada( 'B' ) AND ! $__autoritzada( 'C' ) ) { $__bota( 'No autoritzada' ); } // _AUT_000 pot saltar-se procés validació mentre no existeixi _AUT_0 $es_AUT_000 = $adr__ == $_AUT_000; if ( ! $es_AUT_000 OR ( $es_AUT_000 AND $__autoritzada( '0' ) ) ) { if ( $args.tasca == 'confirmacio' ) { $proposta = $propostes[ $args.idprop ]; // La proposta ha d'existir if ( ! $proposta ) { $__bota( "No hi ha cap proposta de nou getó amb aquesta ref" ); } // La confirmació l'ha de fer una AUT diferent a la proposant if ( $proposta.proposant == $adr__ ) { $__bota( "El procés de confirmació l'ha d'endegar una altra AUT" ); } // La confirmació només es pot fer quan ha transcorregut el lapse especificat if ( $generics.Lapse > timestamp - $proposta.temps ) { $__bota( "Encara no es pot confirmar la proposta" ); } // La proposta ha de constar com a validada if ( ! $validacions[ $args.idprop ] ) { $__bota( "La proposta encara no ha estat validada" ); } $tasca = 'confirmacio'; } else { $ref = $__arg( 'ref' ); $val = $__arg( 'val' ); // Quan no es tracta de getons, // el valor actual i el proporcionat no han de coincidir if ( $ref != 'nou_geto' AND $generics[ $ref ] AND $generics[ $ref ] == $val ) { $__bota( "El valor proposat coincideix amb l'actual" ); } // El valor proporcionat no ha de coincidir amb el de la darrera proposta $darrera_prop = $propostes[ $ref || '_' || $ordinals[ $ref ] ]; if ( $darrera_prop AND $darrera_prop.val == $val ) { $__bota( "El valor proposat coincideix amb el de la darrera proposta" ); } $nou_ordinal = $ordinals[ $ref ] ? $ordinals[ $ref ] + 1 : 1; $tasca = 'proposta'; } } else { $ref = $__arg( 'ref' ); $val = $__arg( 'val' ); $tasca = 'drecera'; } } }", "messages": { "cases": [ { "if": "{ $args.proces == 'acces' }", "init": "{ $args._Portal = this_address; $args._FOP = $generics._FOP; $args._Estels = $generics._Estels; $args.geto = trigger.output[[ asset != base ]].asset; $args.qt = trigger.output[[ asset = $args.geto ]]; }", "messages": [ { "app": "data", "payload": "{ $args }" }, { "app": "payment", "payload": { "asset": "{ $args.geto }", "outputs": [ { "address": "{ $generics._Acces }", "amount": "{ $args.qt }" } ] } } ] }, { "if": "{ $args.proces == 'esmena_generics' }", "messages": [ { "app": "state", "state": "{ if ( $tasca == 'drecera' ) { if ( $ref == 'multiple' ) { $__valvar = $refvar => $args[ $refvar ] ? $args[ $refvar ] : $generics[ $refvar ]; var[ 'Generics' ] = { _Acces: $__valvar( '_Acces' ), _Getons: $__valvar( '_Getons' ), _FRO: $__valvar( '_FRO' ), _FOP: $__valvar( '_FOP' ), _FDIP: $__valvar( '_FDIP' ), _Estels: $__valvar( '_Estels' ), Interval: $__valvar( 'Interval' ), Lapse: $__valvar( 'Lapse' ), _Transfer: $__valvar( '_Transfer' ), _Capacitacio: $__valvar( '_Capacitacio' ), _Avis: $__valvar( '_Avis' ), Import_Activacio: $__valvar( 'Import_Activacio' ), Import_Subscripcio: $__valvar( 'Import_Subscripcio' ), Import_Renovacio: $__valvar( 'Import_Renovacio' ), Taxa_Conversio: $__valvar( 'Taxa_Conversio' ), Factor_Conversio: $__valvar( 'Factor_Conversio' ), Cicles_Latencia: $__valvar( 'Cicles_Latencia' ), _AUT_0: $__valvar( '_AUT_0' ), _AUT_A: $__valvar( '_AUT_A' ), _AUT_B: $__valvar( '_AUT_B' ), _AUT_C: $__valvar( '_AUT_C' ), }; response[ '_Acces' ] = $__valvar( '_Acces' ); response[ '_Getons' ] = $__valvar( '_Getons' ); response[ '_Validacions' ] = $__valvar( '_Validacions' ); response[ '_FRO' ] = $__valvar( '_FRO' ); response[ '_FOP' ] = $__valvar( '_FOP' ); response[ '_FDIP' ] = $__valvar( '_FDIP' ); response[ '_Estels' ] = $__valvar( 'id_Estels' ); response[ 'Interval' ] = $__valvar( 'Interval' ); response[ 'Lapse' ] = $__valvar( 'Lapse' ); response[ '_Transfer' ] = $__valvar( '_Transfer' ); response[ '_Capacitacio' ] = $__valvar( '_Capacitacio' ); response[ '_Avis' ] = $__valvar( '_Avis' ); response[ 'Import_Activacio' ] = $__valvar( 'Import_Activacio' ); response[ 'Import_Subscripcio' ] = $__valvar( 'Import_Subscripcio' ); response[ 'Import_Renovacio' ] = $__valvar( 'Import_Activacio' ); response[ 'Taxa_Conversio' ] = $__valvar( 'Taxa_Conversio' ); response[ 'Factor_Conversio' ] = $__valvar( 'Factor_Conversio' ); response[ 'Cicles_Latencia' ] = $__valvar( 'Cicles_Latencia' ); response[ '_AUT_0' ] = $__valvar( '_AUT_0' ); response[ '_AUT_A' ] = $__valvar( '_AUT_A' ); response[ '_AUT_B' ] = $__valvar( '_AUT_B' ); response[ '_AUT_C' ] = $__valvar( '_AUT_C' ); $__valvar2 = $refvar => var[ $refvar ] ? var[ $refvar ] : {}; var[ 'Getons' ] = $__valvar2( 'Getons' ); var[ 'Propostes' ] = $__valvar2( 'Propostes' ); var[ 'Validacions' ] = $__valvar2( 'Validacions' ); var[ 'Ordinals' ] = $__valvar2( 'Ordinals' ); } else { $generics[ $ref ] = $val; var[ 'Generics' ] = $generics; response[ 'nova ref' ] = $ref; response[ 'nou val' ] = $val; } } else if ( $tasca == 'confirmacio' ) { $generics[ $proposta.ref ] = $proposta.val; response[ 'proposta' ] = $args.idprop; response[ 'nova ref' ] = $proposta.ref; response[ 'nou val' ] = $proposta.val; } else { $ordinals[ $ref ] = $nou_ordinal; var[ 'Ordinals' ] = $ordinals; $id_proposta = $ref || '_' || $nou_ordinal; $propostes[ $id_proposta ] = { ref: $ref, val: $val, proposant: $adr__, temps: timestamp, }; var[ 'Propostes' ] = $propostes; response[ 'proposta' ] = $id_proposta; response[ 'nova ref' ] = $ref; response[ 'nou val' ] = $val; response[ 'data proposta' ] = timestamp_to_string( timestamp ); response[ 'data inici confirmació'] = timestamp_to_string( timestamp + $generics.Lapse ); } }" } ] }, { "if": "{ $args.proces == 'definicio_geto' }", "messages": [ { "if": "{ $tasca != 'proposta' }", "app": "asset", "payload": { "cap": "{ $args.cap otherwise 1e9 }", "is_private": false, "is_transferrable": true, "auto_destroy": "{ !! $args.auto_destroy }", "fixed_denominations": false, "issued_by_definer_only": true, "cosigned_by_definer": false, "spender_attested": false } }, { "app": "state", "state": "{ if ( $tasca != 'confirmacio' ) { $perfil = { id : response_unit, _FOG : $__arg( '_FOG' ), _AUT_A : $__arg( '_AUT_A' ), factor_conversio : $__arg( 'factor_conversio' ), import_activacio : $__arg( 'import_activacio' ), import_subscripcio : $__arg( 'import_subscripcio' ), import_renovacio : $__arg( 'import_renovacio' ), taxa_conversio : $__arg( 'taxa_conversio' ), derivacio_aFOG : $__arg( 'derivacio_aFOG' ), activacions_restringides : $__arg( 'activacions_restringides' ), subscripcions_restringides : $__arg( 'subscripcions_restringides' ), recepcions_restringides : $__arg( 'recepcions_restringides' ), conversions_restringides : $__arg( 'conversions_restringides' ), valors_esmenables : $__arg( 'valors_esmenables' ), llistats_editables : $__arg( 'llistats_editables' ), bloqueig_possible : $__arg( 'bloqueig_possible' ), }; } if ( $tasca == 'drecera' ) { $getons = var[ 'Getons' ]; $getons[ response_unit ] = { proposant: $adr__, confirmant: $adr__, temps: timestamp, perfil: $perfil }; var[ 'Getons' ] = $getons; response[ 'Getó operatiu' ] = response_unit; } if ( $tasca == 'confirmacio' ) { $prop = $propostes[ $args.idprop ]; $getons = var[ 'Getons' ]; $getons[ response_unit ] = { proposant: $prop.proposant, confirmant: $adr__, temps: timestamp, perfil: $prop.perfil }; var[ 'Getons' ] = $getons; response[ 'Getó operatiu' ] = $args.idprop; } if ( $tasca == 'proposta' ) { $id_proposta = 'nou_geto_' || $nou_ordinal; $propostes[ $id_proposta ] = { proposant: $adr__, temps: timestamp, perfil: $perfil }; var[ 'Propostes' ] = $propostes; response[ 'proposta' ] = $id_proposta; response[ 'data inici confirmació'] = timestamp_to_string( timestamp + $args.lapse ); } response[ 'tasca' ] = $tasca; }" } ] }, { "if": "{ $args.proces == 'validacio' }", "init": "{ $id_geto = trigger.output[[ asset != base ]].asset; $getons = var[ 'Getons' ]; if( $id_geto != $generics._Estels ) { $geto_ini = $getons[ $id_geto ]; $perfil_geto = $generics._Getons[ $id_geto ]; if( $adr__ != $geto_ini.perfil._AUT_A AND $adr__ != $perfil_geto._AUT_B AND $adr__ != $perfil_geto._AUT_C ) { $__bota( "No autoritzada per a aquest getó" ); } } // La confirmació només es pot fer si compte amb el suport d'un nombre // mínim d'ids isox avaluadores d'entre les escollides aleatòriament // La confirmació només es pot fer si compte amb el suport d'un nombre // mínim d'entitats suportants d'entre les escollides aleatòriament //... altres requeriments }", "messages": [ { "app": "data", "payload": "{ $args.idprop }" }, { "if": "{ $id_geto != $generics._Estels }", "app": "payment", "payload": { "asset": "{ $id_geto }", "outputs": [ { "address": "{ $generics._Getons }", "amount": "{ 10 }" } ] } }, { "app": "state", "state": "{ $validacions[ $args.idprop ] = timestamp; var[ 'Validacions' ] = $validacions; response[ 'Ref proposta validada' ] = $args.idprop; }" } ] } ] } } ]
Technical information
Fees:
15,319 bytes
(452 headers, 14867 payload)
Level:1805023
Witnessed level:1805016
Main chain index:1797156
Latest included mc index:1797155
Status:stable/confirmed/final