Unit ID
5ouamyHkYfgRV+KwEYkTgoDQIGxYLvvyyEP/qt/z30o=
Received
12.11.2020 10:49:27
Confirmation delay (full node)
2 minutes 16 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{\r $nom_AA = 'Compensacions';\r $versio = '3';\r \r $AA_PF = trigger.data.AA_PF;\r $adr__ = trigger.initial_address;\r $qt = trigger.output[[asset=base]] - 10000;\r $receptora = trigger.data.receptora;\r \r $unitat = var[ $AA_PF ][ 'unitat' ];\r $AA_Transfers = var[ $AA_PF ][ '_AA_Transfers' ];\r $AA_Subscripcions = var[ $AA_PF ][ '_AA_Subscripcions' ];\r $AA_Renovacions = var[ $AA_PF ][ '_AA_Renovacions' ];\r $adr_FOP = var[ $AA_PF ][ '_FOP' ];\r \r // Comprova existeix Subscripcio receptora\r $subscripcio = var[ $AA_Subscripcions ][ 'subscripcio_' || $receptora ];\r if ( ! $subscripcio )\r { bounce ( $nom_AA || ": L'adreça receptora no està subscrita per rebre compensacions." ); }\r \r // Comprova q cicle renovat per receptora no és inferior a l'actual\r $cicle_subscripcio = $subscripcio.cicle;\r \r $cicle_actual = var[ $AA_Transfers ][ 'cicle_actual'];\r $cicle_renovat = var[ $AA_Renovacions ][ 'cicle_' || $receptora ];\r \r if ( $cicle_actual > $cicle_subscripcio ){\r $resp = $nom_AA || ": L'adreça receptora no ha renovat la subscripció per rebre compensacions.";\r if ( ! $cicle_renovat ) { bounce ( $resp ); }\r if ( $cicle_actual > $cicle_renovat ) { bounce ( $resp ); }\r }\r \r $derivacio = $qt * $subscripcio.aFOP / 100;\r }", "messages": [ { "app": "payment", "payload": { "asset": "{ $unitat }", "outputs": [ { "address": "{ $receptora }", "amount": "{ $qt - $derivacio }" }, { "address": "{ $adr_FOP }", "amount": "{ $derivacio }" } ] } }, { "app": "state", "state": "{\r var[ 'total_Compensacions' ] += $qt;\r var[ 'total_Compensacions_de_' || $adr__ ] += $qt;\r var[ 'total_Compensacions_a_' || $receptora ] += $qt;\r var[ 'total_Compensacions_de_' || $adr__ || '_a_' || $receptora ] += $qt;\r \r response[ 'Total Compensacions ' ] = var[ 'total_Compensacions' ];\r response[ 'Total Compensacions ' || ' de ' || $adr__ ] = var[ 'total_Compensacions_de_' || $adr__ ];\r response[ 'Total Compensacions ' || ' a ' || $receptora ] = var[ 'total_Compensacions_a_' || $receptora ];\r response[ 'Total Compensacions ' || ' de ' || $adr__ || ' a ' || $receptora ] = var[ 'total_Compensacions_de_' || $adr__ || '_a_' || $receptora ];\r \r var[ 'total_Derivacions' ] += $qt;\r var[ 'total_Derivacions_de_' || $receptora ] += $qt;\r \r response[ 'Total Derivacions ' ] = var[ 'total_Derivacions' ];\r response[ 'Total Derivacions ' || ' de ' || $receptora ] = var[ 'total_Derivacions_de_' || $receptora ];\r }" } ] } ]
Technical information
Fees:
3,290 bytes
(452 headers, 2838 payload)
Level:1750449
Witnessed level:1750440
Main chain index:1742760
Latest included mc index:1742759
Status:stable/confirmed/final