Unit ID
DSStHInMlfRSyaP7tAgbve6MVn9z8llzRmRLDEJ4j1E=
Received
11.09.2019 16:13:43
Confirmation delay (full node)
3 minutes 6 seconds
Confirmation delay (light node)
6 minutes 24 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ $release_fee = 1000; $balance_key = 'balance_'||trigger.address; $timestamp_key = 'timestamp_'||trigger.address; }", "messages": { "cases": [ { "if": "{trigger.data.keep}", "init": "{ if(!trigger.data.seconds AND !var[$balance_key]) bounce("Please add 'seconds' data field with number of seconds to lock the bytes."); if(trigger.data.seconds AND typeof(trigger.data.seconds) != "number") bounce("Only numbers are allowed in the 'seconds' field."); }", "messages": [ { "app": "state", "state": "{ var[$balance_key] = (var[$balance_key]? var[$balance_key]:0) + trigger.output[[asset=base]]; if(trigger.data.seconds AND !var[$balance_key]) $release_timestamp = timestamp + trigger.data.seconds; response['message'] = "Total number of keeped bytes will be "|| var[$balance_key] || " bytes. The bytes will be locked for "|| trigger.data.seconds || " seconds. The release date is "|| timestamp_to_string($release_timestamp, 'datetime') || ". You can withdraw your bytes only from the address you made this deposit: " || trigger.address || ". Please make a wallet backup and store it in a safe place."; var[$timestamp_key] = $release_timestamp; }" } ] }, { "if": "{trigger.data.release}", "init": "{ if(!var[$balance_key]) bounce('No bytes to release for this address.'); if(var[$timestamp_key] > timestamp) bounce('The release date has not come yet. Bytes are locked till '||timestamp_to_string(var[$timestamp_key], 'datetime')); if(var[$balance_key] <= $release_fee) bounce('Bytes amount is less than ' || $release_fee || ' bytes fee.'); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{ var[$balance_key] - $release_fee}" } ] } }, { "app": "state", "state": "{ response['message'] = var[$balance_key] || ' bytes will be released. Transaction fee is ' || $release_fee || ' bytes. You will receive ' || var[$balance_key] - $release_fee || ' bytes to your account.'; var[$balance_key] = false; var[$timestamp_key] = false; }" } ] }, { "messages": [ { "app": "state", "state": "{ bounce("Welcome user! If you want to store your bytes please add 'keep' data field with any value and 'seconds' data field with number of seconds the bytes will be locked. If you want to withdraw previously deposited bytes add 'release' data field. Otherwise the transaction will be bounced."); }" } ] } ] } } ]
Technical information
Fees:
2,795 bytes
(353 headers, 2442 payload)
Level:1055738
Witnessed level:1055731
Main chain index:1054511
Latest included mc index:1054510
Status:stable/confirmed/final