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