Unit ID
cAD2ydH0kAcKJNsVwRyIHH78JfE+55CZPQfQUD80yXo=
Received
06.02.2022 15:12:47
Confirmation delay (full node)
7 minutes 52 seconds
Confirmation delay (light node)
10 minutes 40 seconds
Messages
Definition
Definition: [ "autonomous agent", { "getters": "{ $peek = ($i)=>var[json_stringify((var["tail"] OTHERWISE 0) - ($i OTHERWISE 0))]; $msg_push = ($val)=>[ { app: "data", payload: { push: $val } }, { app: "payment", payload: { outputs: [ {address: this_address, amount: length($val)+100} ] } } ]; $msg_pop = ()=>[ { app: "data", payload: { pop: 1 } }, { app: "payment", payload: { outputs: [{address: this_address, amount: 100}] } } ]; $size = ()=>var["head"]; $can_push = ($address)=>{ if (params.can_push_controller AND is_aa(params.can_push_controller)) //Is an AA, execute getter return params.can_push_controller#4.$can_push($address); return $address == params.can_push_controller; //Is a normal address }; $can_pop = ($address)=>{ log($address); log(params.can_pop_controller); log(is_aa(params.can_pop_controller)); if (params.can_pop_controller AND is_aa(params.can_pop_controller)) //Is an AA, execute getter return params.can_pop_controller#4.$can_push($address); return $address == params.can_pop_controller; //Is a normal address }; }", "init": "{ $MIN_PAYOUT = 10000; $COLLECTION_ADDRESS = "ZIT3YPDTLGAO7MVO2ONNDMSEYS2VELX6"; $head_ptr = var["head"] OTHERWISE 0; }", "messages": [ { "if": "{(trigger.data.pop OR trigger.data.clear) AND balance["base"] > $MIN_PAYOUT}", "app": "payment", "payload": { "outputs": [ { "address": "{$COLLECTION_ADDRESS}" } ] } }, { "app": "state", "init": "{ $is_allowed_to_pop = $can_pop(trigger.address); if (trigger.data.pop){ require($is_allowed_to_pop, "You cannot pop data from this stack"); $new_head_ptr = max(0, $head_ptr - 1); } else if (trigger.data.clear){ require($is_allowed_to_pop, "You cannot clear this stack"); $new_head_ptr = 0; } else if (exists(trigger.data.push)){ require($can_push(trigger.address), "You cannot push data to this stack"); $new_head_ptr = $head_ptr + 1; } }", "state": "{ if (trigger.data.pop) var[json_stringify($new_head_ptr)] = false; else if (exists(trigger.data.push)) var[json_stringify($head_ptr)] = trigger.data.push; var["head"] = $new_head_ptr; }" } ] } ]
Technical information
Fees:
3,764 bytes
(452 headers, 3312 payload)
Level:2567198
Witnessed level:2567190
Main chain index:2545209
Latest included mc index:2545208
Status:stable/confirmed/final