tx · 3X47SC5puiDbDG9fY1MKzSrqJwhB5pd9h61SfSfxpsPK 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV: -0.05000000 Waves 2024.10.24 19:20 [3341143] smart account 3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV > SELF 0.00000000 Waves
{ "type": 13, "id": "3X47SC5puiDbDG9fY1MKzSrqJwhB5pd9h61SfSfxpsPK", "fee": 5000000, "feeAssetId": null, "timestamp": 1729786826032, "version": 2, "chainId": 84, "sender": "3N9tKixzqTYWnEXQxrDQ5pBTGvQd6sFsvmV", "senderPublicKey": "DS6HkopS9zypvxX6VhkdNvv6v4wcPZuChRvTwKJeacxE", "proofs": [ "49Ss9DoqWHvquLh99ePWDqFJQJByU9BzXYVzvSYzhjYHXdfFeFVuJA7mrEjsgKWxFHHLNLTd6pLN9XMRiLCPfJn5" ], "script": "base64:BgIbCAISBAoCCAgSBQoDCAgIEgQKAggIEgQKAggIDAARQUlfVE9LRU5fQVNTRVRfSUQBIJPhcjhxBJtq6JpjHwQkt2RTlyw+vGYLg3SvaLskjeJCAAtTVEFUVVNfT1BFTgIEb3BlbgASU1RBVFVTX0NIRUNLRURfT1VUAgtjaGVja2VkX291dAALU1RBVFVTX0RPTkUCBGRvbmUADkNIRUNLRURfT1VUX0JZAhBfY2hlY2tlZF9vdXRfYnlfABNTSU1QTEVfQ0hBVEdQVF9UQVNLAhNzaW1wbGVfQ2hhdEdQVF90YXNrABBDSEVDS19PVVRfSEVJR0hUAhJfY2hlY2tfb3V0X2hlaWdodF8AD1JFR0lTVEVSX0hFSUdIVAIRX3JlZ2lzdGVyX2hlaWdodF8ADUNPTU1JVF9IRUlHSFQCD19jb21taXRfaGVpZ2h0XwEPY2FuQmVDaGVja2VkT3V0AgZ0YXNrSWQEdHlwZQQGc3RhdHVzCQCdCAIFBHRoaXMJAKwCAgkArAICBQZ0YXNrSWQCCF9zdGF0dXNfBQR0eXBlCQAAAgUGc3RhdHVzBQtTVEFUV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lIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgkArAICBQZ0YXNrSWQCCF9zdGF0dXNfBQR0eXBlBQtTVEFUVVNfRE9ORQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIJAKwCAgUGdGFza0lkAghfcmVzdWx0XwUEdHlwZQUIcmVzcG9uc2UJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgkArAICBQZ0YXNrSWQFDUNPTU1JVF9IRUlHSFQFBHR5cGUFBmhlaWdodAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICCQCsAgIFBnRhc2tJZAISX2NvbW1pdF90aW1lc3RhbXBfBQR0eXBlBQl0aW1lc3RhbXAJAMwIAgkBC0RlbGV0ZUVudHJ5AQkArAICCQCsAgIJAKwCAgkArAICCQCsAgICD2NoZWNrZWRfb3V0X2J5XwUPY2FsbGVyUHVibGljS2V5AgFfBQR0eXBlAgFfBQZ0YXNrSWQFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkmP4uL", "height": 3341143, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7PBVLoRMtRvSYqkXhfYG1u7KXimWbnLQQ2r8FtkekWjP Next: DwHkFLxNsAVbSrHcoLTHD2XBxAJnuVUaeVi8iiL3kvA1 Diff:
Old | New | Differences | |
---|---|---|---|
79 | 79 | else if ((B == -1)) | |
80 | 80 | then throw("Task type not supported!") | |
81 | 81 | else if ((B > y)) | |
82 | - | then throw((("Payment needs to be at least " + toString(B)) + " | |
82 | + | then throw((("Payment needs to be at least " + toString(B)) + " BAI Token!")) | |
83 | 83 | else [StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), IntegerEntry("dao_sum", E), IntegerEntry(("dao_user_" + v), C)] | |
84 | 84 | } | |
85 | 85 | } | |
106 | 106 | else if ((B == -1)) | |
107 | 107 | then throw("Task type not supported!") | |
108 | 108 | else if ((B > y)) | |
109 | - | then throw((("Payment needs to be at least " + toString(B)) + " | |
110 | - | else [StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_callback_") + l), F), StringEntry(((k + "_caller_") + l), G), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), StringEntry(((("callback_accounting_" + w) + "_") + toString(height)), k)] | |
109 | + | then throw((("Payment needs to be at least " + toString(B)) + " BAI Token!")) | |
110 | + | else $Tuple2([StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_callback_") + l), F), StringEntry(((k + "_caller_") + l), G), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), StringEntry(((("callback_accounting_" + w) + "_") + toString(height)), k)], k) | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | ||
163 | 163 | then throw("Can not identify type of task id") | |
164 | 164 | else if ((F != "no callback")) | |
165 | 165 | then { | |
166 | - | let L = invoke(Address(fromBase58String(G)), F, [I], nil) | |
166 | + | let L = invoke(Address(fromBase58String(G)), F, [k, I], nil) | |
167 | 167 | if ((L == L)) | |
168 | 168 | then [StringEntry(((k + "_status_") + l), d), StringEntry(((k + "_result_") + l), I), IntegerEntry(((k + i) + l), height), IntegerEntry(((k + "_commit_timestamp_") + l), A), DeleteEntry(((((("checked_out_by_" + v) + "_") + l) + "_") + k))] | |
169 | 169 | else throw("Strict value is not equal to itself.") | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | - | ||
176 | - | @Callable(s) | |
177 | - | func buy () = { | |
178 | - | let M = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
179 | - | let N = "%s%s__price__WAVES-USDT" | |
180 | - | let O = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
181 | - | let P = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
182 | - | let Q = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
183 | - | let u = size(s.payments) | |
184 | - | if ((u != 1)) | |
185 | - | then throw("Payment necessary!") | |
186 | - | else { | |
187 | - | let x = s.payments[0] | |
188 | - | let z = x.assetId | |
189 | - | let R = { | |
190 | - | let r = z | |
191 | - | if ($isInstanceOf(r, "ByteVector")) | |
192 | - | then { | |
193 | - | let S = r | |
194 | - | toBase58String(S) | |
195 | - | } | |
196 | - | else "" | |
197 | - | } | |
198 | - | let T = x.amount | |
199 | - | let U = if (!(isDefined(z))) | |
200 | - | then { | |
201 | - | let V = { | |
202 | - | let r = getInteger(M, N) | |
203 | - | if ($isInstanceOf(r, "Int")) | |
204 | - | then { | |
205 | - | let D = r | |
206 | - | D | |
207 | - | } | |
208 | - | else 0 | |
209 | - | } | |
210 | - | (fraction(T, V, 100000000) * 100) | |
211 | - | } | |
212 | - | else if ((R == O)) | |
213 | - | then (T * 100) | |
214 | - | else if ((R == P)) | |
215 | - | then (T * 100) | |
216 | - | else throw("payment necessary in Waves, USDC or USDT!") | |
217 | - | [ScriptTransfer(s.caller, U, fromBase58String(Q))] | |
218 | - | } | |
219 | - | } | |
220 | - | ||
221 | - | ||
222 | - | @Verifier(W) | |
223 | - | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
175 | + | @Verifier(M) | |
176 | + | func N () = sigVerify(M.bodyBytes, M.proofs[0], M.senderPublicKey) | |
224 | 177 |
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,l) = { | |
23 | 23 | let m = getString(this, ((k + "_status_") + l)) | |
24 | 24 | (m == b) | |
25 | 25 | } | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func n (k,o,l) = { | |
29 | 29 | let p = getString(this, ((k + e) + l)) | |
30 | 30 | (p == o) | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func q (l) = { | |
35 | 35 | let r = getInteger(this, ("price_" + l)) | |
36 | 36 | if ($isInstanceOf(r, "Int")) | |
37 | 37 | then { | |
38 | 38 | let s = r | |
39 | 39 | s | |
40 | 40 | } | |
41 | 41 | else -1 | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | @Callable(s) | |
46 | 46 | func registerTask (t,l) = { | |
47 | 47 | let u = size(s.payments) | |
48 | 48 | if ((u != 1)) | |
49 | 49 | then throw("Payment necessary!") | |
50 | 50 | else { | |
51 | 51 | let v = toBase58String(s.callerPublicKey) | |
52 | 52 | let w = toBase58String(s.transactionId) | |
53 | 53 | let x = s.payments[0] | |
54 | 54 | let y = x.amount | |
55 | 55 | let z = x.assetId | |
56 | 56 | let k = ((w + "_") + v) | |
57 | 57 | let A = lastBlock.timestamp | |
58 | 58 | let B = q(l) | |
59 | 59 | let C = { | |
60 | 60 | let r = getInteger(this, ("dao_user_" + v)) | |
61 | 61 | if ($isInstanceOf(r, "Int")) | |
62 | 62 | then { | |
63 | 63 | let D = r | |
64 | 64 | (D + y) | |
65 | 65 | } | |
66 | 66 | else y | |
67 | 67 | } | |
68 | 68 | let E = { | |
69 | 69 | let r = getInteger(this, "dao_sum") | |
70 | 70 | if ($isInstanceOf(r, "Int")) | |
71 | 71 | then { | |
72 | 72 | let D = r | |
73 | 73 | (D + y) | |
74 | 74 | } | |
75 | 75 | else y | |
76 | 76 | } | |
77 | 77 | if ((z != a)) | |
78 | 78 | then throw("Payment only possible in the AI Token!") | |
79 | 79 | else if ((B == -1)) | |
80 | 80 | then throw("Task type not supported!") | |
81 | 81 | else if ((B > y)) | |
82 | - | then throw((("Payment needs to be at least " + toString(B)) + " | |
82 | + | then throw((("Payment needs to be at least " + toString(B)) + " BAI Token!")) | |
83 | 83 | else [StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), IntegerEntry("dao_sum", E), IntegerEntry(("dao_user_" + v), C)] | |
84 | 84 | } | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | ||
89 | 89 | @Callable(s) | |
90 | 90 | func registerTaskCallback (t,l,F) = { | |
91 | 91 | let u = size(s.payments) | |
92 | 92 | if ((u != 1)) | |
93 | 93 | then throw("Payment necessary!") | |
94 | 94 | else { | |
95 | 95 | let v = toBase58String(s.callerPublicKey) | |
96 | 96 | let G = toString(s.caller) | |
97 | 97 | let w = toBase58String(s.transactionId) | |
98 | 98 | let x = s.payments[0] | |
99 | 99 | let y = x.amount | |
100 | 100 | let z = x.assetId | |
101 | 101 | let k = ((w + "_") + v) | |
102 | 102 | let A = lastBlock.timestamp | |
103 | 103 | let B = q(l) | |
104 | 104 | if ((z != a)) | |
105 | 105 | then throw("Payment only possible in the AI Token!") | |
106 | 106 | else if ((B == -1)) | |
107 | 107 | then throw("Task type not supported!") | |
108 | 108 | else if ((B > y)) | |
109 | - | then throw((("Payment needs to be at least " + toString(B)) + " | |
110 | - | else [StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_callback_") + l), F), StringEntry(((k + "_caller_") + l), G), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), StringEntry(((("callback_accounting_" + w) + "_") + toString(height)), k)] | |
109 | + | then throw((("Payment needs to be at least " + toString(B)) + " BAI Token!")) | |
110 | + | else $Tuple2([StringEntry(((k + "_description_") + l), t), StringEntry(((w + "_initializer_") + l), v), StringEntry(((k + "_callback_") + l), F), StringEntry(((k + "_caller_") + l), G), StringEntry(((k + "_status_") + l), b), StringEntry((k + "_type"), l), IntegerEntry(((k + h) + l), height), IntegerEntry(((k + "_register_timestamp_") + l), A), BooleanEntry(((("open_" + l) + "_") + k), true), StringEntry(((("callback_accounting_" + w) + "_") + toString(height)), k)], k) | |
111 | 111 | } | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | ||
116 | 116 | @Callable(s) | |
117 | 117 | func checkoutTask (k,l) = { | |
118 | 118 | let v = toBase58String(s.callerPublicKey) | |
119 | 119 | let H = j(k, l) | |
120 | 120 | let A = lastBlock.timestamp | |
121 | 121 | if (!(H)) | |
122 | 122 | then throw("Task not open for checkout!") | |
123 | 123 | else [StringEntry(((k + e) + l), v), StringEntry(((k + "_status_") + l), c), IntegerEntry(((k + g) + l), height), IntegerEntry(((k + "_check_out_timestamp_") + l), A), BooleanEntry(((((("checked_out_by_" + v) + "_") + l) + "_") + k), true), DeleteEntry(((("open_" + l) + "_") + k))] | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(s) | |
129 | 129 | func commitTask (k,I) = { | |
130 | 130 | let v = toBase58String(s.callerPublicKey) | |
131 | 131 | let l = { | |
132 | 132 | let r = getString((k + "_type")) | |
133 | 133 | if ($isInstanceOf(r, "String")) | |
134 | 134 | then { | |
135 | 135 | let J = r | |
136 | 136 | J | |
137 | 137 | } | |
138 | 138 | else "not set" | |
139 | 139 | } | |
140 | 140 | let K = n(k, v, l) | |
141 | 141 | let A = lastBlock.timestamp | |
142 | 142 | let F = { | |
143 | 143 | let r = getString(((k + "_callback_") + l)) | |
144 | 144 | if ($isInstanceOf(r, "String")) | |
145 | 145 | then { | |
146 | 146 | let J = r | |
147 | 147 | J | |
148 | 148 | } | |
149 | 149 | else "no callback" | |
150 | 150 | } | |
151 | 151 | let G = { | |
152 | 152 | let r = getString(((k + "_caller_") + l)) | |
153 | 153 | if ($isInstanceOf(r, "String")) | |
154 | 154 | then { | |
155 | 155 | let J = r | |
156 | 156 | J | |
157 | 157 | } | |
158 | 158 | else "no callback" | |
159 | 159 | } | |
160 | 160 | if (!(K)) | |
161 | 161 | then throw("Task may only be submitted by the agent who checked the task out!") | |
162 | 162 | else if ((l == "not set")) | |
163 | 163 | then throw("Can not identify type of task id") | |
164 | 164 | else if ((F != "no callback")) | |
165 | 165 | then { | |
166 | - | let L = invoke(Address(fromBase58String(G)), F, [I], nil) | |
166 | + | let L = invoke(Address(fromBase58String(G)), F, [k, I], nil) | |
167 | 167 | if ((L == L)) | |
168 | 168 | then [StringEntry(((k + "_status_") + l), d), StringEntry(((k + "_result_") + l), I), IntegerEntry(((k + i) + l), height), IntegerEntry(((k + "_commit_timestamp_") + l), A), DeleteEntry(((((("checked_out_by_" + v) + "_") + l) + "_") + k))] | |
169 | 169 | else throw("Strict value is not equal to itself.") | |
170 | 170 | } | |
171 | 171 | else [StringEntry(((k + "_status_") + l), d), StringEntry(((k + "_result_") + l), I), IntegerEntry(((k + i) + l), height), IntegerEntry(((k + "_commit_timestamp_") + l), A), DeleteEntry(((((("checked_out_by_" + v) + "_") + l) + "_") + k))] | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | - | ||
176 | - | @Callable(s) | |
177 | - | func buy () = { | |
178 | - | let M = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy") | |
179 | - | let N = "%s%s__price__WAVES-USDT" | |
180 | - | let O = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
181 | - | let P = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum" | |
182 | - | let Q = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1" | |
183 | - | let u = size(s.payments) | |
184 | - | if ((u != 1)) | |
185 | - | then throw("Payment necessary!") | |
186 | - | else { | |
187 | - | let x = s.payments[0] | |
188 | - | let z = x.assetId | |
189 | - | let R = { | |
190 | - | let r = z | |
191 | - | if ($isInstanceOf(r, "ByteVector")) | |
192 | - | then { | |
193 | - | let S = r | |
194 | - | toBase58String(S) | |
195 | - | } | |
196 | - | else "" | |
197 | - | } | |
198 | - | let T = x.amount | |
199 | - | let U = if (!(isDefined(z))) | |
200 | - | then { | |
201 | - | let V = { | |
202 | - | let r = getInteger(M, N) | |
203 | - | if ($isInstanceOf(r, "Int")) | |
204 | - | then { | |
205 | - | let D = r | |
206 | - | D | |
207 | - | } | |
208 | - | else 0 | |
209 | - | } | |
210 | - | (fraction(T, V, 100000000) * 100) | |
211 | - | } | |
212 | - | else if ((R == O)) | |
213 | - | then (T * 100) | |
214 | - | else if ((R == P)) | |
215 | - | then (T * 100) | |
216 | - | else throw("payment necessary in Waves, USDC or USDT!") | |
217 | - | [ScriptTransfer(s.caller, U, fromBase58String(Q))] | |
218 | - | } | |
219 | - | } | |
220 | - | ||
221 | - | ||
222 | - | @Verifier(W) | |
223 | - | func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey) | |
175 | + | @Verifier(M) | |
176 | + | func N () = sigVerify(M.bodyBytes, M.proofs[0], M.senderPublicKey) | |
224 | 177 |
github/deemru/w8io/169f3d6 45.79 ms ◑