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+FyOHEEm2rommMfBCS3ZFOXLD68ZguDdK9ouySN4kIAC1NUQVRVU19PUEVOAgRvcGVuABJTVEFUVVNfQ0hFQ0tFRF9PVVQCC2NoZWNrZWRfb3V0AAtTVEFUVVNfRE9ORQIEZG9uZQAOQ0hFQ0tFRF9PVVRfQlkCEF9jaGVja2VkX291dF9ieV8AE1NJTVBMRV9DSEFUR1BUX1RBU0sCE3NpbXBsZV9DaGF0R1BUX3Rhc2sAEENIRUNLX09VVF9IRUlHSFQCEl9jaGVja19vdXRfaGVpZ2h0XwAPUkVHSVNURVJfSEVJR0hUAhFfcmVnaXN0ZXJfaGVpZ2h0XwANQ09NTUlUX0hFSUdIVAIPX2NvbW1pdF9oZWlnaHRfAQ9jYW5CZUNoZWNrZWRPdXQBBnRhc2tJZAQGc3RhdHVzCQCdCAIFBHRoaXMJAKwCAgUGdGFza0lkAgdfc3RhdHVzCQAAAgUGc3RhdHVzBQtTVEFUVVNfT1BFTgEOaXN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FAW4AAAkAaAIJAGsDBQ1wYXltZW50QW1vdW50BQ53YXZlc1VzZHRQcmljZQCAwtcvAGQDCQAAAgUQZmVlQXNzZXRJZFN0cmluZwUNVVNEVF9BU1NFVF9JRAkAaAIFDXBheW1lbnRBbW91bnQAZAMJAAACBRBmZWVBc3NldElkU3RyaW5nBQ1VU0RDX0FTU0VUX0lECQBoAgUNcGF5bWVudEFtb3VudABkCQACAQIpcGF5bWVudCBuZWNlc3NhcnkgaW4gV2F2ZXMsIFVTREMgb3IgVVNEVCEJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQZhbW91bnQJANkEAQUMQkFJX0FTU0VUX0lEBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V56RViuw==", "height": 2744652, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FxKDSfbh8ZMbjRDi2uj4sggGSK9gezevV3MkhSBK8Syq Next: ChGeWu4zwoRH9YgcF3C8QqCqokWcUAHYELf7j2GEmzQv Diff:
OldNewDifferences
99
1010 let d = "done"
1111
12-let e = "_checked_out_by"
12+let e = "_checked_out_by_"
1313
1414 let f = "simple_ChatGPT_task"
1515
16-let g = "_check_out_height"
16+let g = "_check_out_height_"
1717
18-let h = "_register_height"
18+let h = "_register_height_"
1919
20-let i = "_commit_height"
20+let i = "_commit_height_"
2121
2222 func j (k) = {
2323 let l = getString(this, (k + "_status"))
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!"))
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)]
8686 }
8787 }
8888
8989
9090
9191 @Callable(w)
92-func registerChatGPTTask (x) = {
92+func registerTaskCallback (x,v,E) = {
9393 let y = size(w.payments)
9494 if ((y != 1))
9595 then throw("Payment necessary!")
9696 else {
9797 let r = toBase58String(w.callerPublicKey)
98+ let F = toString(w.caller)
9899 let q = toBase58String(w.transactionId)
99100 let z = w.payments[0]
100101 let A = z.amount
101102 let B = z.assetId
102103 let k = ((q + "_") + r)
103104 let C = lastBlock.timestamp
105+ let D = u(v)
104106 if ((B != a))
105107 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)]
109113 }
110114 }
111115
114118 @Callable(w)
115119 func checkoutTask (k,v) = {
116120 let r = toBase58String(w.callerPublicKey)
117- let E = j(k)
121+ let G = j(k)
118122 let C = lastBlock.timestamp
119- if (!(E))
123+ if (!(G))
120124 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))]
122126 }
123127
124128
125129
126130 @Callable(w)
127-func checkoutChatGPTTask (k) = {
131+func commitTask (k,H) = {
128132 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)
142134 let C = lastBlock.timestamp
143135 let v = {
144136 let s = getString((k + "_type"))
145137 if ($isInstanceOf(s, "String"))
146138 then {
147- let H = s
148- H
139+ let J = s
140+ J
149141 }
150142 else "not set"
151143 }
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))
153163 then throw("Task may only be submitted by the agent who checked the task out!")
154164 else if ((v == "not set"))
155165 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))]
169172 }
170173
171174
172175
173176 @Callable(w)
174177 func buy () = {
175- let I = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy")
176- let J = "%s%s__price__WAVES-USDT"
177- let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
178- let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
179- let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
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"
180183 let y = size(w.payments)
181184 if ((y != 1))
182185 then throw("Payment necessary!")
183186 else {
184187 let z = w.payments[0]
185188 let B = z.assetId
186- let N = {
189+ let Q = {
187190 let s = B
188191 if ($isInstanceOf(s, "ByteVector"))
189192 then {
190- let O = s
191- toBase58String(O)
193+ let R = s
194+ toBase58String(R)
192195 }
193196 else ""
194197 }
195- let P = z.amount
196- let Q = if (!(isDefined(B)))
198+ let S = z.amount
199+ let T = if (!(isDefined(B)))
197200 then {
198- let R = {
199- let s = getInteger(I, J)
201+ let U = {
202+ let s = getInteger(L, M)
200203 if ($isInstanceOf(s, "Int"))
201204 then {
202- let S = s
203- S
205+ let V = s
206+ V
204207 }
205208 else 0
206209 }
207- (fraction(P, R, 100000000) * 100)
210+ (fraction(S, U, 100000000) * 100)
208211 }
209- else if ((N == K))
210- then (P * 100)
211- else if ((N == L))
212- then (P * 100)
212+ else if ((Q == N))
213+ then (S * 100)
214+ else if ((Q == O))
215+ then (S * 100)
213216 else throw("payment necessary in Waves, USDC or USDT!")
214-[ScriptTransfer(w.caller, Q, fromBase58String(M))]
217+[ScriptTransfer(w.caller, T, fromBase58String(P))]
215218 }
216219 }
217220
218221
219-@Verifier(T)
220-func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
222+@Verifier(W)
223+func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)
221224
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
12-let e = "_checked_out_by"
12+let e = "_checked_out_by_"
1313
1414 let f = "simple_ChatGPT_task"
1515
16-let g = "_check_out_height"
16+let g = "_check_out_height_"
1717
18-let h = "_register_height"
18+let h = "_register_height_"
1919
20-let i = "_commit_height"
20+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!"))
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)]
8686 }
8787 }
8888
8989
9090
9191 @Callable(w)
92-func registerChatGPTTask (x) = {
92+func registerTaskCallback (x,v,E) = {
9393 let y = size(w.payments)
9494 if ((y != 1))
9595 then throw("Payment necessary!")
9696 else {
9797 let r = toBase58String(w.callerPublicKey)
98+ let F = toString(w.caller)
9899 let q = toBase58String(w.transactionId)
99100 let z = w.payments[0]
100101 let A = z.amount
101102 let B = z.assetId
102103 let k = ((q + "_") + r)
103104 let C = lastBlock.timestamp
105+ let D = u(v)
104106 if ((B != a))
105107 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)]
109113 }
110114 }
111115
112116
113117
114118 @Callable(w)
115119 func checkoutTask (k,v) = {
116120 let r = toBase58String(w.callerPublicKey)
117- let E = j(k)
121+ let G = j(k)
118122 let C = lastBlock.timestamp
119- if (!(E))
123+ if (!(G))
120124 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))]
122126 }
123127
124128
125129
126130 @Callable(w)
127-func checkoutChatGPTTask (k) = {
131+func commitTask (k,H) = {
128132 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)
142134 let C = lastBlock.timestamp
143135 let v = {
144136 let s = getString((k + "_type"))
145137 if ($isInstanceOf(s, "String"))
146138 then {
147- let H = s
148- H
139+ let J = s
140+ J
149141 }
150142 else "not set"
151143 }
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))
153163 then throw("Task may only be submitted by the agent who checked the task out!")
154164 else if ((v == "not set"))
155165 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))]
169172 }
170173
171174
172175
173176 @Callable(w)
174177 func buy () = {
175- let I = addressFromStringValue("3N1WjhmF3EyutvrvtsfsSLbhmiLU8Bc1Toy")
176- let J = "%s%s__price__WAVES-USDT"
177- let K = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
178- let L = "98D3pkKvfrXEnXmQqKGWgtoGvVh1aTf4CPDttqG9csum"
179- let M = "AxGKQRxKo4F2EbhrRq6N2tdLsxtMnpzQsS4QemV6V1W1"
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"
180183 let y = size(w.payments)
181184 if ((y != 1))
182185 then throw("Payment necessary!")
183186 else {
184187 let z = w.payments[0]
185188 let B = z.assetId
186- let N = {
189+ let Q = {
187190 let s = B
188191 if ($isInstanceOf(s, "ByteVector"))
189192 then {
190- let O = s
191- toBase58String(O)
193+ let R = s
194+ toBase58String(R)
192195 }
193196 else ""
194197 }
195- let P = z.amount
196- let Q = if (!(isDefined(B)))
198+ let S = z.amount
199+ let T = if (!(isDefined(B)))
197200 then {
198- let R = {
199- let s = getInteger(I, J)
201+ let U = {
202+ let s = getInteger(L, M)
200203 if ($isInstanceOf(s, "Int"))
201204 then {
202- let S = s
203- S
205+ let V = s
206+ V
204207 }
205208 else 0
206209 }
207- (fraction(P, R, 100000000) * 100)
210+ (fraction(S, U, 100000000) * 100)
208211 }
209- else if ((N == K))
210- then (P * 100)
211- else if ((N == L))
212- then (P * 100)
212+ else if ((Q == N))
213+ then (S * 100)
214+ else if ((Q == O))
215+ then (S * 100)
213216 else throw("payment necessary in Waves, USDC or USDT!")
214-[ScriptTransfer(w.caller, Q, fromBase58String(M))]
217+[ScriptTransfer(w.caller, T, fromBase58String(P))]
215218 }
216219 }
217220
218221
219-@Verifier(T)
220-func U () = sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey)
222+@Verifier(W)
223+func X () = sigVerify(W.bodyBytes, W.proofs[0], W.senderPublicKey)
221224

github/deemru/w8io/026f985 
51.23 ms