tx · 3okdC1kQ5pDdK8ktWtAT27ALWyYaTMQgCn33JUiwtKEJ 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV: -0.05000000 Waves 2023.08.13 22:04 [2709186] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves
{ "type": 13, "id": "3okdC1kQ5pDdK8ktWtAT27ALWyYaTMQgCn33JUiwtKEJ", "fee": 5000000, "feeAssetId": null, "timestamp": 1691953433896, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "UJjoNarCerXKBsQLjSa21189ino7c5q1oB5gWPPUEAzDgVZLoiJcpdF8rZvoKprJfQRxKpSbvNTJcXcVGgYYvjd" ], "script": "base64:BgImCAISBAoCCAgSAwoBCBIECgIICBIDCgEIEgQKAggIEgQKAggIEgANABFBSV9UT0tFTl9BU1NFVF9JRAEgk+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAC1NUQVRVU19PUEVOAgRvcGVuABJTVEFUVVNfQ0hFQ0tFRF9PVVQCC2NoZWNrZWRfb3V0AAtTVEFUVVNfRE9ORQIEZG9uZQAOQ0hFQ0tFRF9PVVRfQlkCD19jaGVja2VkX291dF9ieQATU0lNUExFX0NIQVRHUFRfVEFTSwITc2ltcGxlX0NoYXRHUFRfdGFzawAQQ0hFQ0tfT1VUX0hFSUdIVAIRX2NoZWNrX291dF9oZWlnaHQAD1JFR0lTVEVSX0hFSUdIVAIQX3JlZ2lzdGVyX2hlaWdodAANQ09NTUlUX0hFSUdIVAIOX2NvbW1pdF9oZWlnaHQBD2NhbkJlQ2hlY2tlZE91dAEGdGFza0lkBAZzdGF0dXMJAJ0IAgUEdGhpcwkArAICBQZ0YXNrSWQCB19zdGF0dXMJAAACBQZzdGF0dXMFC1NUQVRVU19PUEVOAQ5pc0Nv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XBheW1lbnQgbmVjZXNzYXJ5IGluIFdhdmVzLCBVU0RDIG9yIFVTRFQhCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUGYW1vdW50CQDZBAEFDEJBSV9BU1NFVF9JRAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZNFXlU=", "height": 2709186, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6zuBE5c7nEWMMeSmtAfB2X5i6aveTFntARqmMKwA5qCf Next: FxKDSfbh8ZMbjRDi2uj4sggGSK9gezevV3MkhSBK8Syq Diff:
Old | New | Differences | |
---|---|---|---|
118 | 118 | let C = lastBlock.timestamp | |
119 | 119 | if (!(E)) | |
120 | 120 | 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), DeleteEntry(((("open_" + v) + "_") + k))] | |
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))] | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
140 | 140 | let r = toBase58String(w.callerPublicKey) | |
141 | 141 | let G = m(k, r) | |
142 | 142 | let C = lastBlock.timestamp | |
143 | + | let v = { | |
144 | + | let s = getString((k + "_type")) | |
145 | + | if ($isInstanceOf(s, "String")) | |
146 | + | then { | |
147 | + | let H = s | |
148 | + | H | |
149 | + | } | |
150 | + | else "not set" | |
151 | + | } | |
143 | 152 | if (!(G)) | |
144 | 153 | then throw("Task may only be submitted by the agent who checked the task out!") | |
145 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)] | |
154 | + | else if ((v == "not set")) | |
155 | + | 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_" + v) + "_") + k) + "_by_") + r))] | |
146 | 157 | } | |
147 | 158 | ||
148 | 159 | ||
161 | 172 | ||
162 | 173 | @Callable(w) | |
163 | 174 | func buy () = { | |
164 | - | let H = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
165 | - | let I = "%s%s__price__WAVES-USDT" | |
166 | - | let J = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
175 | + | let I = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
176 | + | let J = "%s%s__price__WAVES-USDT" | |
167 | 177 | let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
168 | - | let L = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
178 | + | let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
179 | + | let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
169 | 180 | let y = size(w.payments) | |
170 | 181 | if ((y != 1)) | |
171 | 182 | then throw("Payment necessary!") | |
172 | 183 | else { | |
173 | 184 | let z = w.payments[0] | |
174 | 185 | let B = z.assetId | |
175 | - | let | |
186 | + | let N = { | |
176 | 187 | let s = B | |
177 | 188 | if ($isInstanceOf(s, "ByteVector")) | |
178 | 189 | then { | |
179 | - | let | |
180 | - | toBase58String( | |
190 | + | let O = s | |
191 | + | toBase58String(O) | |
181 | 192 | } | |
182 | 193 | else "" | |
183 | 194 | } | |
184 | - | let | |
185 | - | let | |
195 | + | let P = z.amount | |
196 | + | let Q = if (!(isDefined(B))) | |
186 | 197 | then { | |
187 | - | let | |
188 | - | let s = getInteger( | |
198 | + | let R = { | |
199 | + | let s = getInteger(I, J) | |
189 | 200 | if ($isInstanceOf(s, "Int")) | |
190 | 201 | then { | |
191 | - | let | |
192 | - | | |
202 | + | let S = s | |
203 | + | S | |
193 | 204 | } | |
194 | 205 | else 0 | |
195 | 206 | } | |
196 | - | (fraction( | |
207 | + | (fraction(P, R, 100000000) * 100) | |
197 | 208 | } | |
198 | - | else if (( | |
199 | - | then ( | |
200 | - | else if (( | |
201 | - | then ( | |
209 | + | else if ((N == K)) | |
210 | + | then (P * 100) | |
211 | + | else if ((N == L)) | |
212 | + | then (P * 100) | |
202 | 213 | else throw("payment necessary in Waves, USDC or USDT!") | |
203 | - | [ScriptTransfer(w.caller, | |
214 | + | [ScriptTransfer(w.caller, Q, fromBase58String(M))] | |
204 | 215 | } | |
205 | 216 | } | |
206 | 217 | ||
207 | 218 | ||
208 | - | @Verifier( | |
209 | - | func | |
219 | + | @Verifier(T) | |
220 | + | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
210 | 221 |
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 = "simple_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 | 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 | 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)] | |
86 | 86 | } | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | @Callable(w) | |
92 | 92 | func registerChatGPTTask (x) = { | |
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 | 98 | let q = toBase58String(w.transactionId) | |
99 | 99 | let z = w.payments[0] | |
100 | 100 | let A = z.amount | |
101 | 101 | let B = z.assetId | |
102 | 102 | let k = ((q + "_") + r) | |
103 | 103 | let C = lastBlock.timestamp | |
104 | 104 | if ((B != a)) | |
105 | 105 | then throw("Payment only possible in the AI Token!") | |
106 | 106 | else if ((10000000 > A)) | |
107 | 107 | then throw("Payment needs to be at least 0.1 AI Token!") | |
108 | 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)] | |
109 | 109 | } | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(w) | |
115 | 115 | func checkoutTask (k,v) = { | |
116 | 116 | let r = toBase58String(w.callerPublicKey) | |
117 | 117 | let E = j(k) | |
118 | 118 | let C = lastBlock.timestamp | |
119 | 119 | if (!(E)) | |
120 | 120 | 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), DeleteEntry(((("open_" + v) + "_") + k))] | |
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))] | |
122 | 122 | } | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | 126 | @Callable(w) | |
127 | 127 | func checkoutChatGPTTask (k) = { | |
128 | 128 | let r = toBase58String(w.callerPublicKey) | |
129 | 129 | let E = j(k) | |
130 | 130 | let C = lastBlock.timestamp | |
131 | 131 | if (!(E)) | |
132 | 132 | then throw("Task not open for checkout!") | |
133 | 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 | 134 | } | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | ||
138 | 138 | @Callable(w) | |
139 | 139 | func commitTask (k,F) = { | |
140 | 140 | let r = toBase58String(w.callerPublicKey) | |
141 | 141 | let G = m(k, r) | |
142 | 142 | let C = lastBlock.timestamp | |
143 | + | let v = { | |
144 | + | let s = getString((k + "_type")) | |
145 | + | if ($isInstanceOf(s, "String")) | |
146 | + | then { | |
147 | + | let H = s | |
148 | + | H | |
149 | + | } | |
150 | + | else "not set" | |
151 | + | } | |
143 | 152 | if (!(G)) | |
144 | 153 | then throw("Task may only be submitted by the agent who checked the task out!") | |
145 | - | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)] | |
154 | + | else if ((v == "not set")) | |
155 | + | 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_" + v) + "_") + k) + "_by_") + r))] | |
146 | 157 | } | |
147 | 158 | ||
148 | 159 | ||
149 | 160 | ||
150 | 161 | @Callable(w) | |
151 | 162 | func commitChatGPTTask (k,F) = { | |
152 | 163 | let r = toBase58String(w.callerPublicKey) | |
153 | 164 | let G = m(k, r) | |
154 | 165 | let C = lastBlock.timestamp | |
155 | 166 | if (!(G)) | |
156 | 167 | then throw("Task may only be submitted by the agent who checked the task out!") | |
157 | 168 | else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)] | |
158 | 169 | } | |
159 | 170 | ||
160 | 171 | ||
161 | 172 | ||
162 | 173 | @Callable(w) | |
163 | 174 | func buy () = { | |
164 | - | let H = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
165 | - | let I = "%s%s__price__WAVES-USDT" | |
166 | - | let J = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
175 | + | let I = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
176 | + | let J = "%s%s__price__WAVES-USDT" | |
167 | 177 | let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
168 | - | let L = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
178 | + | let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
179 | + | let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
169 | 180 | let y = size(w.payments) | |
170 | 181 | if ((y != 1)) | |
171 | 182 | then throw("Payment necessary!") | |
172 | 183 | else { | |
173 | 184 | let z = w.payments[0] | |
174 | 185 | let B = z.assetId | |
175 | - | let | |
186 | + | let N = { | |
176 | 187 | let s = B | |
177 | 188 | if ($isInstanceOf(s, "ByteVector")) | |
178 | 189 | then { | |
179 | - | let | |
180 | - | toBase58String( | |
190 | + | let O = s | |
191 | + | toBase58String(O) | |
181 | 192 | } | |
182 | 193 | else "" | |
183 | 194 | } | |
184 | - | let | |
185 | - | let | |
195 | + | let P = z.amount | |
196 | + | let Q = if (!(isDefined(B))) | |
186 | 197 | then { | |
187 | - | let | |
188 | - | let s = getInteger( | |
198 | + | let R = { | |
199 | + | let s = getInteger(I, J) | |
189 | 200 | if ($isInstanceOf(s, "Int")) | |
190 | 201 | then { | |
191 | - | let | |
192 | - | | |
202 | + | let S = s | |
203 | + | S | |
193 | 204 | } | |
194 | 205 | else 0 | |
195 | 206 | } | |
196 | - | (fraction( | |
207 | + | (fraction(P, R, 100000000) * 100) | |
197 | 208 | } | |
198 | - | else if (( | |
199 | - | then ( | |
200 | - | else if (( | |
201 | - | then ( | |
209 | + | else if ((N == K)) | |
210 | + | then (P * 100) | |
211 | + | else if ((N == L)) | |
212 | + | then (P * 100) | |
202 | 213 | else throw("payment necessary in Waves, USDC or USDT!") | |
203 | - | [ScriptTransfer(w.caller, | |
214 | + | [ScriptTransfer(w.caller, Q, fromBase58String(M))] | |
204 | 215 | } | |
205 | 216 | } | |
206 | 217 | ||
207 | 218 | ||
208 | - | @Verifier( | |
209 | - | func | |
219 | + | @Verifier(T) | |
220 | + | func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
210 | 221 |
github/deemru/w8io/169f3d6 76.73 ms ◑