tx · xFHmzfUQPcoZ5B6hFrU74ZvzYtn1Qhh7Fd6jebNwY3j 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV: -0.05000000 Waves 2023.06.09 11:39 [2614907] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves
{ "type": 13, "id": "xFHmzfUQPcoZ5B6hFrU74ZvzYtn1Qhh7Fd6jebNwY3j", "fee": 5000000, "feeAssetId": null, "timestamp": 1686299993040, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "3at4sjAeM1vCq8A7MSY8mWKbAgBWcMfqecycdZfhcoLAejrEaLPLgj2w11nXn9udyLUjv8mkm9Sn1UQW6VGahc4y" ], "script": "base64:BgISCAISAwoBCBIDCgEIEgQKAggIDAARQUlfVE9LRU5fQVNTRVRfSUQBIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAtTVEFUVVNfT1BFTgIEb3BlbgASU1RBVFVTX0NIRUNLRURfT1VUAgtjaGVja2VkX291dAALU1RBVFVTX0RPTkUCBGRvbmUADkNIRUNLRURfT1VUX0JZAg9fY2hlY2tlZF9vdXRfYnkAE1NJTVBMRV9DSEFUR1BUX1RBU0sCFHNpbWlwbGVfQ2hhdEdQVF90YXNrABBDSEVDS19PVVRfSEVJR0hUAhFfY2hlY2tfb3V0X2hlaWdodAAPUkVHSVNURVJfSEVJR0hUAhBfcmVnaXN0ZXJfaGVpZ2h0AA1DT01NSVRfSEVJR0hUAg5fY29tbWl0X2hlaWdodAEPY2FuQmVDaGVja2VkT3V0AQZ0YXNrSWQEBnN0YXR1cwkAnQgCBQR0aGlzCQCsAgIFBnRhc2tJZAIHX3N0YXR1cwkAAAIFBnN0YXR1cwULU1RBVFVTX09QRU4BDmlzQ29ycmVjdEFnZW50AgZ0YX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ted Prev: 5QieAPFibJjRStRtjoFYnsznM3J9AMo288W2GjskhD3q Next: F15DaJuwt6pvsydjQ8nFzmDu6xKXdemFADBNLtbUwLR4 Diff:
Old | New | Differences | |
---|---|---|---|
68 | 68 | then throw("Payment only possible in the AI Token!") | |
69 | 69 | else if ((10000000 > y)) | |
70 | 70 | then throw("Payment needs to be at least 0.1 AI Token!") | |
71 | - | else [StringEntry((k + "_description"), v), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "register_timestamp"), A)] | |
71 | + | else [StringEntry((k + "_description"), v), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "register_timestamp"), A), BooleanEntry(("open_" + k), true)] | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
82 | 82 | let A = lastBlock.timestamp | |
83 | 83 | if (!(B)) | |
84 | 84 | then throw("Task not open for checkout!") | |
85 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), A)] | |
85 | + | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), A), DeleteEntry(("open_" + k))] | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1' | |
5 | 5 | ||
6 | 6 | let b = "open" | |
7 | 7 | ||
8 | 8 | let c = "checked_out" | |
9 | 9 | ||
10 | 10 | let d = "done" | |
11 | 11 | ||
12 | 12 | let e = "_checked_out_by" | |
13 | 13 | ||
14 | 14 | let f = "simiple_ChatGPT_task" | |
15 | 15 | ||
16 | 16 | let g = "_check_out_height" | |
17 | 17 | ||
18 | 18 | let h = "_register_height" | |
19 | 19 | ||
20 | 20 | let i = "_commit_height" | |
21 | 21 | ||
22 | 22 | func j (k) = { | |
23 | 23 | let l = getString(this, (k + "_status")) | |
24 | 24 | (l == b) | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func m (k,n) = { | |
29 | 29 | let o = getString(this, (k + e)) | |
30 | 30 | (o == n) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func p (q) = { | |
35 | 35 | let r = { | |
36 | 36 | let s = getString(this, (q + "_initializer")) | |
37 | 37 | if ($isInstanceOf(s, "String")) | |
38 | 38 | then { | |
39 | 39 | let t = s | |
40 | 40 | t | |
41 | 41 | } | |
42 | 42 | else "" | |
43 | 43 | } | |
44 | 44 | let s = getString(this, ((q + "_") + r)) | |
45 | 45 | if ($isInstanceOf(s, "String")) | |
46 | 46 | then { | |
47 | 47 | let t = s | |
48 | 48 | t | |
49 | 49 | } | |
50 | 50 | else "" | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(u) | |
55 | 55 | func registerChatGPTTask (v) = { | |
56 | 56 | let w = size(u.payments) | |
57 | 57 | if ((w != 1)) | |
58 | 58 | then throw("Payment necessary!") | |
59 | 59 | else { | |
60 | 60 | let r = toUtf8String(u.callerPublicKey) | |
61 | 61 | let q = toUtf8String(u.transactionId) | |
62 | 62 | let x = u.payments[0] | |
63 | 63 | let y = x.amount | |
64 | 64 | let z = x.assetId | |
65 | 65 | let k = ((q + "_") + r) | |
66 | 66 | let A = lastBlock.timestamp | |
67 | 67 | if ((z != a)) | |
68 | 68 | then throw("Payment only possible in the AI Token!") | |
69 | 69 | else if ((10000000 > y)) | |
70 | 70 | then throw("Payment needs to be at least 0.1 AI Token!") | |
71 | - | else [StringEntry((k + "_description"), v), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "register_timestamp"), A)] | |
71 | + | else [StringEntry((k + "_description"), v), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "register_timestamp"), A), BooleanEntry(("open_" + k), true)] | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(u) | |
78 | 78 | func checkoutChatGPTTask (q) = { | |
79 | 79 | let k = p(q) | |
80 | 80 | let r = toUtf8String(u.callerPublicKey) | |
81 | 81 | let B = j(k) | |
82 | 82 | let A = lastBlock.timestamp | |
83 | 83 | if (!(B)) | |
84 | 84 | then throw("Task not open for checkout!") | |
85 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), A)] | |
85 | + | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), A), DeleteEntry(("open_" + k))] | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(u) | |
91 | 91 | func commitChatGPTTask (q,C) = { | |
92 | 92 | let k = p(q) | |
93 | 93 | let r = toUtf8String(u.callerPublicKey) | |
94 | 94 | let D = m(k, r) | |
95 | 95 | let A = lastBlock.timestamp | |
96 | 96 | if (!(D)) | |
97 | 97 | then throw("Task may only be submitted by the agent who checked the task out!") | |
98 | 98 | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), C), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), A)] | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | @Verifier(E) | |
103 | 103 | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
104 | 104 |
github/deemru/w8io/169f3d6 37.73 ms ◑