Unit ID
oDnZWKMfdkKrbv9xDzWl1qgbcBJCc6Ni6Xo+fAoBIqE=
Received
22.08.2020 22:18:10
Confirmation delay (full node)
3 minutes 4 seconds
Confirmation delay (light node)
4 minutes 11 seconds
Messages
Definition
Definition: [ "autonomous agent", { "bounce_fees": { "base": 10000 }, "init": "{ $developper = "B2UMBICLZSBVDHRC7BYM6BBU4AQEXL2F"; //errors are donations^^ $howto = "Give me a 'destination' address, a 'duration' in hours and the 'hash' of the secret allowing to release the funds and I will keep the funds safe during that time."; }", "messages": { "cases": [ { "if": "{ !!params.destination and !!params.duration_in_hours and !!params.hash_secret}", "messages": [ { "app": "state", "state": "{ var["origin"] = trigger.address; var["destination"] = params.destination; $amount = trigger.output[[asset=base]].amount; var["amount"] = $amount; $deadline = timestamp + json_parse(params.duration_in_hours); var["deadline"] = $deadline; var["hash_of_secret"] = params.hash_of_secret; response['message'] = 'Lock, holding '||$amount||' bytes until '||timestamp_to_string($deadline, 'datetime')||' hours, created by '||trigger.address||' for '||params.destination||'.'; }" } ] }, { "if": "{ !!var["deadline"] and timestamp>var["deadline"] }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{var["sender"]}", "amount": "{balance[base]}" } ] } }, { "app": "state", "state": "{ var["deadline"] = false; response['message'] = 'Cancelled, bytes sent back to origin address'; }" } ] }, { "if": "{!!var["deadline"] and var["gb_receiver"] == trigger.address }", "init": "{ $message = "You have been recognized but "; if (!params.secret) bounce ($message||"you have to provide the 'secret' revealed on the other chain"); if (sha256(params.secret) != var["hash_of_secret"]) bounce ($message||"the secret is not good one."); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{var["destination"]}", "amount": "{var["amount"]}" } ] } }, { "app": "state", "state": "{ var["deadline"] = false; response['message'] = 'Transfer successfull!'; }" } ] }, { "if": "{!var["deadline"] and !!var["hash_of_secret"] }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{$developper}", "amount": "{balance[base]}" } ] } }, { "app": "state", "state": "{ response['message'] = 'Thank you for this donation!'; }" } ] }, { "messages": [ { "app": "state", "state": "{ bounce($howto) ; }" } ] } ] } } ]
Technical information
Fees:
3,254 bytes
(452 headers, 2802 payload)
Level:1566265
Witnessed level:1566258
Main chain index:1559115
Latest included mc index:1559114
Status:stable/confirmed/final