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+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAC1NUQVRVU19PUEVOAgRvcGVuABJTVEFUVVNfQ0hFQ0tFRF9PVVQCC2NoZWNrZWRfb3V0AAtTVEFUVVNfRE9ORQIEZG9uZQAOQ0hFQ0tFRF9PVVRfQlkCD19jaGVja2VkX291dF9ieQATU0lNUExFX0NIQVRHUFRfVEFTSwITc2ltcGxlX0NoYXRHUFRfdGFzawAQQ0hFQ0tfT1VUX0hFSUdIVAIRX2NoZWNrX291dF9oZWlnaHQAD1JFR0lTVEVSX0hFSUdIVAIQX3JlZ2lzdGVyX2hlaWdodAANQ09NTUlUX0hFSUdIVAIOX2NvbW1pdF9oZWlnaHQBD2NhbkJlQ2hlY2tlZE91dAEGdGFza0lkBAZzdGF0dXMJAJ0IAgUEdGhpcwkArAICBQZ0YXNrSWQCB19zdGF0dXMJAAACBQZzdGF0dXMFC1NUQVRVU19PUEVOAQ5pc0N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KXBheW1lbnQgbmVjZXNzYXJ5IGluIFdhdmVzLCBVU0RDIG9yIFVTRFQhCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUGYW1vdW50CQDZBAEFDEJBSV9BU1NFVF9JRAUDbmlsAQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleZNFXlU=", "height": 2709186, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6zuBE5c7nEWMMeSmtAfB2X5i6aveTFntARqmMKwA5qCf Next: FxKDSfbh8ZMbjRDi2uj4sggGSK9gezevV3MkhSBK8Syq Diff:
OldNewDifferences
118118 let C = lastBlock.timestamp
119119 if (!(E))
120120 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))]
122122 }
123123
124124
140140 let r = toBase58String(w.callerPublicKey)
141141 let G = m(k, r)
142142 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+ }
143152 if (!(G))
144153 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))]
146157 }
147158
148159
161172
162173 @Callable(w)
163174 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"
167177 let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
168- let L = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
178+ let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
179+ let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
169180 let y = size(w.payments)
170181 if ((y != 1))
171182 then throw("Payment necessary!")
172183 else {
173184 let z = w.payments[0]
174185 let B = z.assetId
175- let M = {
186+ let N = {
176187 let s = B
177188 if ($isInstanceOf(s, "ByteVector"))
178189 then {
179- let N = s
180- toBase58String(N)
190+ let O = s
191+ toBase58String(O)
181192 }
182193 else ""
183194 }
184- let O = z.amount
185- let P = if (!(isDefined(B)))
195+ let P = z.amount
196+ let Q = if (!(isDefined(B)))
186197 then {
187- let Q = {
188- let s = getInteger(H, I)
198+ let R = {
199+ let s = getInteger(I, J)
189200 if ($isInstanceOf(s, "Int"))
190201 then {
191- let R = s
192- R
202+ let S = s
203+ S
193204 }
194205 else 0
195206 }
196- (fraction(O, Q, 100000000) * 100)
207+ (fraction(P, R, 100000000) * 100)
197208 }
198- else if ((M == J))
199- then (O * 100)
200- else if ((M == K))
201- then (O * 100)
209+ else if ((N == K))
210+ then (P * 100)
211+ else if ((N == L))
212+ then (P * 100)
202213 else throw("payment necessary in Waves, USDC or USDT!")
203-[ScriptTransfer(w.caller, P, fromBase58String(L))]
214+[ScriptTransfer(w.caller, Q, fromBase58String(M))]
204215 }
205216 }
206217
207218
208-@Verifier(S)
209-func T () = sigVerify(S.bodyBytes, S.proofs[0], S.senderPublicKey)
219+@Verifier(T)
220+func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
210221
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1'
55
66 let b = "open"
77
88 let c = "checked_out"
99
1010 let d = "done"
1111
1212 let e = "_checked_out_by"
1313
1414 let f = "simple_ChatGPT_task"
1515
1616 let g = "_check_out_height"
1717
1818 let h = "_register_height"
1919
2020 let i = "_commit_height"
2121
2222 func j (k) = {
2323 let l = getString(this, (k + "_status"))
2424 (l == b)
2525 }
2626
2727
2828 func m (k,n) = {
2929 let o = getString(this, (k + e))
3030 (o == n)
3131 }
3232
3333
3434 func p (q) = {
3535 let r = {
3636 let s = getString(this, (q + "_initializer"))
3737 if ($isInstanceOf(s, "String"))
3838 then {
3939 let t = s
4040 t
4141 }
4242 else ""
4343 }
4444 let s = getString(this, ((q + "_") + r))
4545 if ($isInstanceOf(s, "String"))
4646 then {
4747 let t = s
4848 t
4949 }
5050 else ""
5151 }
5252
5353
5454 func u (v) = {
5555 let s = getInteger(this, ("price_" + v))
5656 if ($isInstanceOf(s, "Int"))
5757 then {
5858 let w = s
5959 w
6060 }
6161 else -1
6262 }
6363
6464
6565 @Callable(w)
6666 func registerTask (x,v) = {
6767 let y = size(w.payments)
6868 if ((y != 1))
6969 then throw("Payment necessary!")
7070 else {
7171 let r = toBase58String(w.callerPublicKey)
7272 let q = toBase58String(w.transactionId)
7373 let z = w.payments[0]
7474 let A = z.amount
7575 let B = z.assetId
7676 let k = ((q + "_") + r)
7777 let C = lastBlock.timestamp
7878 let D = u(v)
7979 if ((B != a))
8080 then throw("Payment only possible in the AI Token!")
8181 else if ((D == -1))
8282 then throw("Task type not supported!")
8383 else if ((D > A))
8484 then throw((("Payment needs to be at least " + toString(D)) + " AI Token!"))
8585 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)]
8686 }
8787 }
8888
8989
9090
9191 @Callable(w)
9292 func registerChatGPTTask (x) = {
9393 let y = size(w.payments)
9494 if ((y != 1))
9595 then throw("Payment necessary!")
9696 else {
9797 let r = toBase58String(w.callerPublicKey)
9898 let q = toBase58String(w.transactionId)
9999 let z = w.payments[0]
100100 let A = z.amount
101101 let B = z.assetId
102102 let k = ((q + "_") + r)
103103 let C = lastBlock.timestamp
104104 if ((B != a))
105105 then throw("Payment only possible in the AI Token!")
106106 else if ((10000000 > A))
107107 then throw("Payment needs to be at least 0.1 AI Token!")
108108 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)]
109109 }
110110 }
111111
112112
113113
114114 @Callable(w)
115115 func checkoutTask (k,v) = {
116116 let r = toBase58String(w.callerPublicKey)
117117 let E = j(k)
118118 let C = lastBlock.timestamp
119119 if (!(E))
120120 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))]
122122 }
123123
124124
125125
126126 @Callable(w)
127127 func checkoutChatGPTTask (k) = {
128128 let r = toBase58String(w.callerPublicKey)
129129 let E = j(k)
130130 let C = lastBlock.timestamp
131131 if (!(E))
132132 then throw("Task not open for checkout!")
133133 else [StringEntry((k + e), r), StringEntry((k + "_status"), c), IntegerEntry((k + g), height), IntegerEntry((k + "_check_out_timestamp"), C), DeleteEntry(("open_chatgpt_" + k))]
134134 }
135135
136136
137137
138138 @Callable(w)
139139 func commitTask (k,F) = {
140140 let r = toBase58String(w.callerPublicKey)
141141 let G = m(k, r)
142142 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+ }
143152 if (!(G))
144153 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))]
146157 }
147158
148159
149160
150161 @Callable(w)
151162 func commitChatGPTTask (k,F) = {
152163 let r = toBase58String(w.callerPublicKey)
153164 let G = m(k, r)
154165 let C = lastBlock.timestamp
155166 if (!(G))
156167 then throw("Task may only be submitted by the agent who checked the task out!")
157168 else [StringEntry((k + "_status"), d), StringEntry((k + "_result"), F), IntegerEntry((k + i), height), IntegerEntry((k + "_commit_timestamp"), C)]
158169 }
159170
160171
161172
162173 @Callable(w)
163174 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"
167177 let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
168- let L = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
178+ let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
179+ let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
169180 let y = size(w.payments)
170181 if ((y != 1))
171182 then throw("Payment necessary!")
172183 else {
173184 let z = w.payments[0]
174185 let B = z.assetId
175- let M = {
186+ let N = {
176187 let s = B
177188 if ($isInstanceOf(s, "ByteVector"))
178189 then {
179- let N = s
180- toBase58String(N)
190+ let O = s
191+ toBase58String(O)
181192 }
182193 else ""
183194 }
184- let O = z.amount
185- let P = if (!(isDefined(B)))
195+ let P = z.amount
196+ let Q = if (!(isDefined(B)))
186197 then {
187- let Q = {
188- let s = getInteger(H, I)
198+ let R = {
199+ let s = getInteger(I, J)
189200 if ($isInstanceOf(s, "Int"))
190201 then {
191- let R = s
192- R
202+ let S = s
203+ S
193204 }
194205 else 0
195206 }
196- (fraction(O, Q, 100000000) * 100)
207+ (fraction(P, R, 100000000) * 100)
197208 }
198- else if ((M == J))
199- then (O * 100)
200- else if ((M == K))
201- then (O * 100)
209+ else if ((N == K))
210+ then (P * 100)
211+ else if ((N == L))
212+ then (P * 100)
202213 else throw("payment necessary in Waves, USDC or USDT!")
203-[ScriptTransfer(w.caller, P, fromBase58String(L))]
214+[ScriptTransfer(w.caller, Q, fromBase58String(M))]
204215 }
205216 }
206217
207218
208-@Verifier(S)
209-func T () = sigVerify(S.bodyBytes, S.proofs[0], S.senderPublicKey)
219+@Verifier(T)
220+func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
210221

github/deemru/w8io/169f3d6 
76.73 ms