tx · 5EJBhiRcVDXxuJecUFqwuhcEDqS45XYyq3XGCddhE3Kt 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV: -0.01000000 Waves 2023.09.07 10:17 [2744652] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves
{ "type": 13, "id": "5EJBhiRcVDXxuJecUFqwuhcEDqS45XYyq3XGCddhE3Kt", "fee": 1000000, "feeAssetId": null, "timestamp": 1694071129582, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "5cabMsynqu4qiiy96iuFDVGytxCb9cfQEE1zSMacUraor8aWvmqGtECjUHks8LT9zJrJW5E2hQ2K9iBDeW4dGxY8" ], "script": "base64:BgIdCAISBAoCCAgSBQoDCAgIEgQKAggIEgQKAggIEgANABFBSV9UT0tFTl9BU1NFVF9JRAEgk+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAC1NUQVRVU19PUEVOAgRvcGVuABJTVEFUVVNfQ0hFQ0tFRF9PVVQCC2NoZWNrZWRfb3V0AAtTVEFUVVNfRE9ORQIEZG9uZQAOQ0hFQ0tFRF9PVVRfQlkCEF9jaGVja2VkX291dF9ieV8AE1NJTVBMRV9DSEFUR1BUX1RBU0sCE3NpbXBsZV9DaGF0R1BUX3Rhc2sAEENIRUNLX09VVF9IRUlHSFQCEl9jaGVja19vdXRfaGVpZ2h0XwAPUkVHSVNURVJfSEVJR0hUAhFfcmVnaXN0ZXJfaGVpZ2h0XwANQ09NTUlUX0hFSUdIVAIPX2NvbW1pdF9oZWlnaHRfAQ9jYW5CZUNoZWNrZWRPdXQBBnRhc2tJZAQGc3RhdHVzCQCdCAIFBHRoaXMJAKwCAgUGdGFza0lkAgdfc3RhdHVzCQAAAgUGc3RhdHVzBQtTVEFUVVNfT1BFTgEOaXND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AW4AAAkAaAIJAGsDBQ1wYXltZW50QW1vdW50BQ53YXZlc1VzZHRQcmljZQCAwtcvAGQDCQAAAgUQZmVlQXNzZXRJZFN0cmluZwUNVVNEVF9BU1NFVF9JRAkAaAIFDXBheW1lbnRBbW91bnQAZAMJAAACBRBmZWVBc3NldElkU3RyaW5nBQ1VU0RDX0FTU0VUX0lECQBoAgUNcGF5bWVudEFtb3VudABkCQACAQIpcGF5bWVudCBuZWNlc3NhcnkgaW4gV2F2ZXMsIFVTREMgb3IgVVNEVCEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQZhbW91bnQJANkEAQUMQkFJX0FTU0VUX0lEBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V56RViuw==", "height": 2744652, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FxKDSfbh8ZMbjRDi2uj4sggGSK9gezevV3MkhSBK8Syq Next: ChGeWu4zwoRH9YgcF3C8QqCqokWcUAHYELf7j2GEmzQv Diff:
Old | New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let d = "done" | |
11 | 11 | ||
12 | - | let e = "_checked_out_by" | |
12 | + | let e = "_checked_out_by_" | |
13 | 13 | ||
14 | 14 | let f = "simple_ChatGPT_task" | |
15 | 15 | ||
16 | - | let g = "_check_out_height" | |
16 | + | let g = "_check_out_height_" | |
17 | 17 | ||
18 | - | let h = "_register_height" | |
18 | + | let h = "_register_height_" | |
19 | 19 | ||
20 | - | let i = "_commit_height" | |
20 | + | let i = "_commit_height_" | |
21 | 21 | ||
22 | 22 | func j (k) = { | |
23 | 23 | let l = getString(this, (k + "_status")) | |
82 | 82 | then throw("Task type not supported!") | |
83 | 83 | else if ((D > A)) | |
84 | 84 | then throw((("Payment needs to be at least " + toString(D)) + " AI Token!")) | |
85 | - | else [StringEntry((k + "_description"), x), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), v), IntegerEntry((k + h), height), IntegerEntry((k + "_register_timestamp"), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
85 | + | else [StringEntry(((k + "_description_") + v), x), StringEntry(((q + "_initializer_") + v), r), StringEntry(((k + "_status_") + v), b), StringEntry((k + "_type"), v), IntegerEntry(((k + h) + v), height), IntegerEntry(((k + "_register_timestamp_") + v), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(w) | |
92 | - | func | |
92 | + | func registerTaskCallback (x,v,E) = { | |
93 | 93 | let y = size(w.payments) | |
94 | 94 | if ((y != 1)) | |
95 | 95 | then throw("Payment necessary!") | |
96 | 96 | else { | |
97 | 97 | let r = toBase58String(w.callerPublicKey) | |
98 | + | let F = toString(w.caller) | |
98 | 99 | let q = toBase58String(w.transactionId) | |
99 | 100 | let z = w.payments[0] | |
100 | 101 | let A = z.amount | |
101 | 102 | let B = z.assetId | |
102 | 103 | let k = ((q + "_") + r) | |
103 | 104 | let C = lastBlock.timestamp | |
105 | + | let D = u(v) | |
104 | 106 | if ((B != a)) | |
105 | 107 | then throw("Payment only possible in the AI Token!") | |
106 | - | else if ((10000000 > A)) | |
107 | - | then throw("Payment needs to be at least 0.1 AI Token!") | |
108 | - | else [StringEntry((k + "_description"), x), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "_register_timestamp"), C), BooleanEntry(("open_chatgpt_" + k), true)] | |
108 | + | else if ((D == -1)) | |
109 | + | then throw("Task type not supported!") | |
110 | + | else if ((D > A)) | |
111 | + | then throw((("Payment needs to be at least " + toString(D)) + " AI Token!")) | |
112 | + | else [StringEntry(((k + "_description_") + v), x), StringEntry(((q + "_initializer_") + v), r), StringEntry(((q + "_callback_") + v), E), StringEntry(((q + "_caller_") + v), F), StringEntry(((k + "_status_") + v), b), StringEntry((k + "_type"), v), IntegerEntry(((k + h) + v), height), IntegerEntry(((k + "_register_timestamp_") + v), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
109 | 113 | } | |
110 | 114 | } | |
111 | 115 | ||
114 | 118 | @Callable(w) | |
115 | 119 | func checkoutTask (k,v) = { | |
116 | 120 | let r = toBase58String(w.callerPublicKey) | |
117 | - | let | |
121 | + | let G = j(k) | |
118 | 122 | let C = lastBlock.timestamp | |
119 | - | if (!( | |
123 | + | if (!(G)) | |
120 | 124 | then throw("Task not open for checkout!") | |
121 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), C), BooleanEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k), true), DeleteEntry(((("open_" + v) + "_") + k))] | |
125 | + | else [StringEntry(((k + e) + v), r), StringEntry(((k + "_status_") + v), c), IntegerEntry(((k + g) + v), height), IntegerEntry(((k + "_check_out_timestamp_") + v), C), BooleanEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k), true), DeleteEntry(((("open_" + v) + "_") + k))] | |
122 | 126 | } | |
123 | 127 | ||
124 | 128 | ||
125 | 129 | ||
126 | 130 | @Callable(w) | |
127 | - | func | |
131 | + | func commitTask (k,H) = { | |
128 | 132 | let r = toBase58String(w.callerPublicKey) | |
129 | - | let E = j(k) | |
130 | - | let C = lastBlock.timestamp | |
131 | - | if (!(E)) | |
132 | - | then throw("Task not open for checkout!") | |
133 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), C), DeleteEntry(("open_chatgpt_" + k))] | |
134 | - | } | |
135 | - | ||
136 | - | ||
137 | - | ||
138 | - | @Callable(w) | |
139 | - | func commitTask (k,F) = { | |
140 | - | let r = toBase58String(w.callerPublicKey) | |
141 | - | let G = m(k, r) | |
133 | + | let I = m(k, r) | |
142 | 134 | let C = lastBlock.timestamp | |
143 | 135 | let v = { | |
144 | 136 | let s = getString((k + "_type")) | |
145 | 137 | if ($isInstanceOf(s, "String")) | |
146 | 138 | then { | |
147 | - | let | |
148 | - | | |
139 | + | let J = s | |
140 | + | J | |
149 | 141 | } | |
150 | 142 | else "not set" | |
151 | 143 | } | |
152 | - | if (!(G)) | |
144 | + | let E = { | |
145 | + | let s = getString((k + "_callback")) | |
146 | + | if ($isInstanceOf(s, "String")) | |
147 | + | then { | |
148 | + | let J = s | |
149 | + | J | |
150 | + | } | |
151 | + | else "no callback" | |
152 | + | } | |
153 | + | let F = { | |
154 | + | let s = getString((k + "_caller")) | |
155 | + | if ($isInstanceOf(s, "String")) | |
156 | + | then { | |
157 | + | let J = s | |
158 | + | J | |
159 | + | } | |
160 | + | else "no callback" | |
161 | + | } | |
162 | + | if (!(I)) | |
153 | 163 | then throw("Task may only be submitted by the agent who checked the task out!") | |
154 | 164 | else if ((v == "not set")) | |
155 | 165 | then throw("Can not identify type of task id") | |
156 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
157 | - | } | |
158 | - | ||
159 | - | ||
160 | - | ||
161 | - | @Callable(w) | |
162 | - | func commitChatGPTTask (k,F) = { | |
163 | - | let r = toBase58String(w.callerPublicKey) | |
164 | - | let G = m(k, r) | |
165 | - | let C = lastBlock.timestamp | |
166 | - | if (!(G)) | |
167 | - | then throw("Task may only be submitted by the agent who checked the task out!") | |
168 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)] | |
166 | + | else if ((E != "no callback")) | |
167 | + | then { | |
168 | + | let K = invoke(Address(fromBase58String(F)), E, [H], nil) | |
169 | + | [StringEntry(((k + "_status_") + v), d), StringEntry(((k + "_result_") + v), H), IntegerEntry(((k + i) + v), height), IntegerEntry(((k + "_commit_timestamp_") + v), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
170 | + | } | |
171 | + | else [StringEntry(((k + "_status_") + v), d), StringEntry(((k + "_result_") + v), H), IntegerEntry(((k + i) + v), height), IntegerEntry(((k + "_commit_timestamp_") + v), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
169 | 172 | } | |
170 | 173 | ||
171 | 174 | ||
172 | 175 | ||
173 | 176 | @Callable(w) | |
174 | 177 | func buy () = { | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | let | |
179 | - | let | |
178 | + | let L = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
179 | + | let M = "%s%s__price__WAVES-USDT" | |
180 | + | let N = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
181 | + | let O = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
182 | + | let P = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
180 | 183 | let y = size(w.payments) | |
181 | 184 | if ((y != 1)) | |
182 | 185 | then throw("Payment necessary!") | |
183 | 186 | else { | |
184 | 187 | let z = w.payments[0] | |
185 | 188 | let B = z.assetId | |
186 | - | let | |
189 | + | let Q = { | |
187 | 190 | let s = B | |
188 | 191 | if ($isInstanceOf(s, "ByteVector")) | |
189 | 192 | then { | |
190 | - | let | |
191 | - | toBase58String( | |
193 | + | let R = s | |
194 | + | toBase58String(R) | |
192 | 195 | } | |
193 | 196 | else "" | |
194 | 197 | } | |
195 | - | let | |
196 | - | let | |
198 | + | let S = z.amount | |
199 | + | let T = if (!(isDefined(B))) | |
197 | 200 | then { | |
198 | - | let | |
199 | - | let s = getInteger( | |
201 | + | let U = { | |
202 | + | let s = getInteger(L, M) | |
200 | 203 | if ($isInstanceOf(s, "Int")) | |
201 | 204 | then { | |
202 | - | let | |
203 | - | | |
205 | + | let V = s | |
206 | + | V | |
204 | 207 | } | |
205 | 208 | else 0 | |
206 | 209 | } | |
207 | - | (fraction( | |
210 | + | (fraction(S, U, 100000000) * 100) | |
208 | 211 | } | |
209 | - | else if (( | |
210 | - | then ( | |
211 | - | else if (( | |
212 | - | then ( | |
212 | + | else if ((Q == N)) | |
213 | + | then (S * 100) | |
214 | + | else if ((Q == O)) | |
215 | + | then (S * 100) | |
213 | 216 | else throw("payment necessary in Waves, USDC or USDT!") | |
214 | - | [ScriptTransfer(w.caller, | |
217 | + | [ScriptTransfer(w.caller, T, fromBase58String(P))] | |
215 | 218 | } | |
216 | 219 | } | |
217 | 220 | ||
218 | 221 | ||
219 | - | @Verifier( | |
220 | - | func | |
222 | + | @Verifier(W) | |
223 | + | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
221 | 224 |
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 | - | let e = "_checked_out_by" | |
12 | + | let e = "_checked_out_by_" | |
13 | 13 | ||
14 | 14 | let f = "simple_ChatGPT_task" | |
15 | 15 | ||
16 | - | let g = "_check_out_height" | |
16 | + | let g = "_check_out_height_" | |
17 | 17 | ||
18 | - | let h = "_register_height" | |
18 | + | let h = "_register_height_" | |
19 | 19 | ||
20 | - | let i = "_commit_height" | |
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 | func u (v) = { | |
55 | 55 | let s = getInteger(this, ("price_" + v)) | |
56 | 56 | if ($isInstanceOf(s, "Int")) | |
57 | 57 | then { | |
58 | 58 | let w = s | |
59 | 59 | w | |
60 | 60 | } | |
61 | 61 | else -1 | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Callable(w) | |
66 | 66 | func registerTask (x,v) = { | |
67 | 67 | let y = size(w.payments) | |
68 | 68 | if ((y != 1)) | |
69 | 69 | then throw("Payment necessary!") | |
70 | 70 | else { | |
71 | 71 | let r = toBase58String(w.callerPublicKey) | |
72 | 72 | let q = toBase58String(w.transactionId) | |
73 | 73 | let z = w.payments[0] | |
74 | 74 | let A = z.amount | |
75 | 75 | let B = z.assetId | |
76 | 76 | let k = ((q + "_") + r) | |
77 | 77 | let C = lastBlock.timestamp | |
78 | 78 | let D = u(v) | |
79 | 79 | if ((B != a)) | |
80 | 80 | then throw("Payment only possible in the AI Token!") | |
81 | 81 | else if ((D == -1)) | |
82 | 82 | then throw("Task type not supported!") | |
83 | 83 | else if ((D > A)) | |
84 | 84 | then throw((("Payment needs to be at least " + toString(D)) + " AI Token!")) | |
85 | - | else [StringEntry((k + "_description"), x), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), v), IntegerEntry((k + h), height), IntegerEntry((k + "_register_timestamp"), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
85 | + | else [StringEntry(((k + "_description_") + v), x), StringEntry(((q + "_initializer_") + v), r), StringEntry(((k + "_status_") + v), b), StringEntry((k + "_type"), v), IntegerEntry(((k + h) + v), height), IntegerEntry(((k + "_register_timestamp_") + v), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(w) | |
92 | - | func | |
92 | + | func registerTaskCallback (x,v,E) = { | |
93 | 93 | let y = size(w.payments) | |
94 | 94 | if ((y != 1)) | |
95 | 95 | then throw("Payment necessary!") | |
96 | 96 | else { | |
97 | 97 | let r = toBase58String(w.callerPublicKey) | |
98 | + | let F = toString(w.caller) | |
98 | 99 | let q = toBase58String(w.transactionId) | |
99 | 100 | let z = w.payments[0] | |
100 | 101 | let A = z.amount | |
101 | 102 | let B = z.assetId | |
102 | 103 | let k = ((q + "_") + r) | |
103 | 104 | let C = lastBlock.timestamp | |
105 | + | let D = u(v) | |
104 | 106 | if ((B != a)) | |
105 | 107 | then throw("Payment only possible in the AI Token!") | |
106 | - | else if ((10000000 > A)) | |
107 | - | then throw("Payment needs to be at least 0.1 AI Token!") | |
108 | - | else [StringEntry((k + "_description"), x), StringEntry((q + "_initializer"), r), StringEntry((k + "_status"), b), StringEntry((k + "_type"), f), IntegerEntry((k + h), height), IntegerEntry((k + "_register_timestamp"), C), BooleanEntry(("open_chatgpt_" + k), true)] | |
108 | + | else if ((D == -1)) | |
109 | + | then throw("Task type not supported!") | |
110 | + | else if ((D > A)) | |
111 | + | then throw((("Payment needs to be at least " + toString(D)) + " AI Token!")) | |
112 | + | else [StringEntry(((k + "_description_") + v), x), StringEntry(((q + "_initializer_") + v), r), StringEntry(((q + "_callback_") + v), E), StringEntry(((q + "_caller_") + v), F), StringEntry(((k + "_status_") + v), b), StringEntry((k + "_type"), v), IntegerEntry(((k + h) + v), height), IntegerEntry(((k + "_register_timestamp_") + v), C), BooleanEntry(((("open_" + v) + "_") + k), true)] | |
109 | 113 | } | |
110 | 114 | } | |
111 | 115 | ||
112 | 116 | ||
113 | 117 | ||
114 | 118 | @Callable(w) | |
115 | 119 | func checkoutTask (k,v) = { | |
116 | 120 | let r = toBase58String(w.callerPublicKey) | |
117 | - | let | |
121 | + | let G = j(k) | |
118 | 122 | let C = lastBlock.timestamp | |
119 | - | if (!( | |
123 | + | if (!(G)) | |
120 | 124 | then throw("Task not open for checkout!") | |
121 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), C), BooleanEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k), true), DeleteEntry(((("open_" + v) + "_") + k))] | |
125 | + | else [StringEntry(((k + e) + v), r), StringEntry(((k + "_status_") + v), c), IntegerEntry(((k + g) + v), height), IntegerEntry(((k + "_check_out_timestamp_") + v), C), BooleanEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k), true), DeleteEntry(((("open_" + v) + "_") + k))] | |
122 | 126 | } | |
123 | 127 | ||
124 | 128 | ||
125 | 129 | ||
126 | 130 | @Callable(w) | |
127 | - | func | |
131 | + | func commitTask (k,H) = { | |
128 | 132 | let r = toBase58String(w.callerPublicKey) | |
129 | - | let E = j(k) | |
130 | - | let C = lastBlock.timestamp | |
131 | - | if (!(E)) | |
132 | - | then throw("Task not open for checkout!") | |
133 | - | else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), C), DeleteEntry(("open_chatgpt_" + k))] | |
134 | - | } | |
135 | - | ||
136 | - | ||
137 | - | ||
138 | - | @Callable(w) | |
139 | - | func commitTask (k,F) = { | |
140 | - | let r = toBase58String(w.callerPublicKey) | |
141 | - | let G = m(k, r) | |
133 | + | let I = m(k, r) | |
142 | 134 | let C = lastBlock.timestamp | |
143 | 135 | let v = { | |
144 | 136 | let s = getString((k + "_type")) | |
145 | 137 | if ($isInstanceOf(s, "String")) | |
146 | 138 | then { | |
147 | - | let | |
148 | - | | |
139 | + | let J = s | |
140 | + | J | |
149 | 141 | } | |
150 | 142 | else "not set" | |
151 | 143 | } | |
152 | - | if (!(G)) | |
144 | + | let E = { | |
145 | + | let s = getString((k + "_callback")) | |
146 | + | if ($isInstanceOf(s, "String")) | |
147 | + | then { | |
148 | + | let J = s | |
149 | + | J | |
150 | + | } | |
151 | + | else "no callback" | |
152 | + | } | |
153 | + | let F = { | |
154 | + | let s = getString((k + "_caller")) | |
155 | + | if ($isInstanceOf(s, "String")) | |
156 | + | then { | |
157 | + | let J = s | |
158 | + | J | |
159 | + | } | |
160 | + | else "no callback" | |
161 | + | } | |
162 | + | if (!(I)) | |
153 | 163 | then throw("Task may only be submitted by the agent who checked the task out!") | |
154 | 164 | else if ((v == "not set")) | |
155 | 165 | then throw("Can not identify type of task id") | |
156 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
157 | - | } | |
158 | - | ||
159 | - | ||
160 | - | ||
161 | - | @Callable(w) | |
162 | - | func commitChatGPTTask (k,F) = { | |
163 | - | let r = toBase58String(w.callerPublicKey) | |
164 | - | let G = m(k, r) | |
165 | - | let C = lastBlock.timestamp | |
166 | - | if (!(G)) | |
167 | - | then throw("Task may only be submitted by the agent who checked the task out!") | |
168 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)] | |
166 | + | else if ((E != "no callback")) | |
167 | + | then { | |
168 | + | let K = invoke(Address(fromBase58String(F)), E, [H], nil) | |
169 | + | [StringEntry(((k + "_status_") + v), d), StringEntry(((k + "_result_") + v), H), IntegerEntry(((k + i) + v), height), IntegerEntry(((k + "_commit_timestamp_") + v), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
170 | + | } | |
171 | + | else [StringEntry(((k + "_status_") + v), d), StringEntry(((k + "_result_") + v), H), IntegerEntry(((k + i) + v), height), IntegerEntry(((k + "_commit_timestamp_") + v), C), DeleteEntry(((((("checked_out_by_" + r) + "_") + v) + "_") + k))] | |
169 | 172 | } | |
170 | 173 | ||
171 | 174 | ||
172 | 175 | ||
173 | 176 | @Callable(w) | |
174 | 177 | func buy () = { | |
175 | - | let | |
176 | - | let | |
177 | - | let | |
178 | - | let | |
179 | - | let | |
178 | + | let L = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
179 | + | let M = "%s%s__price__WAVES-USDT" | |
180 | + | let N = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
181 | + | let O = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
182 | + | let P = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
180 | 183 | let y = size(w.payments) | |
181 | 184 | if ((y != 1)) | |
182 | 185 | then throw("Payment necessary!") | |
183 | 186 | else { | |
184 | 187 | let z = w.payments[0] | |
185 | 188 | let B = z.assetId | |
186 | - | let | |
189 | + | let Q = { | |
187 | 190 | let s = B | |
188 | 191 | if ($isInstanceOf(s, "ByteVector")) | |
189 | 192 | then { | |
190 | - | let | |
191 | - | toBase58String( | |
193 | + | let R = s | |
194 | + | toBase58String(R) | |
192 | 195 | } | |
193 | 196 | else "" | |
194 | 197 | } | |
195 | - | let | |
196 | - | let | |
198 | + | let S = z.amount | |
199 | + | let T = if (!(isDefined(B))) | |
197 | 200 | then { | |
198 | - | let | |
199 | - | let s = getInteger( | |
201 | + | let U = { | |
202 | + | let s = getInteger(L, M) | |
200 | 203 | if ($isInstanceOf(s, "Int")) | |
201 | 204 | then { | |
202 | - | let | |
203 | - | | |
205 | + | let V = s | |
206 | + | V | |
204 | 207 | } | |
205 | 208 | else 0 | |
206 | 209 | } | |
207 | - | (fraction( | |
210 | + | (fraction(S, U, 100000000) * 100) | |
208 | 211 | } | |
209 | - | else if (( | |
210 | - | then ( | |
211 | - | else if (( | |
212 | - | then ( | |
212 | + | else if ((Q == N)) | |
213 | + | then (S * 100) | |
214 | + | else if ((Q == O)) | |
215 | + | then (S * 100) | |
213 | 216 | else throw("payment necessary in Waves, USDC or USDT!") | |
214 | - | [ScriptTransfer(w.caller, | |
217 | + | [ScriptTransfer(w.caller, T, fromBase58String(P))] | |
215 | 218 | } | |
216 | 219 | } | |
217 | 220 | ||
218 | 221 | ||
219 | - | @Verifier( | |
220 | - | func | |
222 | + | @Verifier(W) | |
223 | + | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
221 | 224 |
github/deemru/w8io/026f985 51.23 ms ◑