Unit ID
r7fctSCS7efYfFXitAkmiEquCL7tUP1+GzGT5e2ERPw=
Received
21.10.2019 16:37:07
Confirmation delay (full node)
3 minutes 39 seconds
Confirmation delay (light node)
5 minutes 19 seconds
Messages
Definition
Definition: [ "autonomous agent", { "init": "{ // Attest $return_fee = 1000; $attestor = 'BK54UAWZ6KTI3K7PWH7PRPHVYWTIZZXH'; $attested_user_id = attestation[[attestors=$attestor, address=trigger.address]].user_id; if (!$attested_user_id) bounce('Your address is not attested by attestor ' || $attestor); $balance = 'user_id_'||$attested_user_id||'_balance'; }", "messages": { "cases": [ { "if": "{!trigger.data.withdraw}", "init": "{ if (!attestation[[attestors=$attestor, address=trigger.address]].profile_hash AND trigger.data.public!='allow') bounce("This address attestation is not private. Anybody can see account associated with your balance. If you still want to continue please add 'public' data field with value 'allow'"); }", "messages": [ { "app": "state", "state": "{ var[$balance] = var[$balance] + trigger.output[[asset=base]]; response['message'] = "Total balance for your account will be " || var[$balance] || " bytes."; }" } ] }, { "init": "{ if (!var[$balance]) bounce("Your address is attested but the balance for your account is not found"); if (typeof(trigger.data.withdraw)!='number') bounce("Please enter numbers of bytes you want to withdraw from your account"); if (var[$balance] + trigger.output[[asset=base]] < trigger.data.withdraw + $return_fee) bounce('Not enough funds. The maximum amount you can withdraw for this user_id is ' || var[$balance] - $return_fee || 'bytes'); }", "messages": [ { "app": "payment", "payload": { "asset": "base", "outputs": [ { "address": "{trigger.address}", "amount": "{trigger.data.withdraw - $return_fee + trigger.output[[asset=base]]}" } ] } }, { "app": "state", "state": "{ response['message'] = 'You will receive ' || (trigger.data.withdraw - $return_fee + trigger.output[[asset=base]]) || ' bytes to your account (' || trigger.data.withdraw || ' bytes will be released - '|| $return_fee || ' bytes transaction fee + ' || trigger.output[[asset=base]] || ' bytes bounced back)'; var[$balance] = var[$balance] - trigger.data.withdraw - $return_fee; }" } ] } ] } } ]
Technical information
Fees:
2,692 bytes
(353 headers, 2339 payload)
Level:1113439
Witnessed level:1113430
Main chain index:1112198
Latest included mc index:1112197
Status:stable/confirmed/final