tx · BPbGKRJCsMb33aWkhW6arytEBw6MyfygwetTKwCJ2ccu 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4: -0.01500000 Waves 2023.11.07 15:26 [2832926] smart account 3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4 > SELF 0.00000000 Waves
{ "type": 13, "id": "BPbGKRJCsMb33aWkhW6arytEBw6MyfygwetTKwCJ2ccu", "fee": 1500000, "feeAssetId": null, "timestamp": 1699360054626, "version": 2, "chainId": 84, "sender": "3N2PjXqef29HexCE7PeGZa9eRjS2jVeaFe4", "senderPublicKey": "DU1U4j8FqHUMRr9WgfF3yo67ULEFkjp7dtMWMpjBK1ar", "proofs": [ "DSCFsBnb8vQySRDUwVyPggKZbzb9kVu2kWFzcXVoGa6bUuMmiL7cdG4d9GJgjskifuz3ZDxAB2eLF7z21cXH1fs", "48UtMFCPH3HBVfMFYBY8xrf1AXkJLiW3P5D5cZFNyopD8QKV92doPJfFW4yjPqhsHttf5oJhCo6PArWF6mgWA6HZ" ], "script": "base64:BgIuCAISABIDCgEIEgYKBAgICAgSABIDCgEBEgASABIDCgEIEgUKAwgICBIAEgASACAABlNDQUxFOACAwtcvAA1QRVJDRU5UX1NDQUxFAJBOAAlTRVBBUkFUT1ICAl9fAAlrSW50ZXJlc3QCCGludGVyZXN0AA1rVXNlckludGVyZXN0Ag1fdXNlckludGVyZXN0AA5rVXNlckF2YWlsYWJsZQITX3VzZXJBdmFpbGFibGVDbGFpbQAQa1VzZXJUb2tlblN0YWtlZAIQX3VzZXJUb2tlblN0YWtlZAARa1RvdGFsVG9rZW5TdGFrZWQCEHRvdGFsVG9rZW5TdGFrZWQADGtORlRJbnRlcmVzdAILTkZUSW50ZXJlc3QAEGtORlRVc2VySW50ZXJlc3QCEF9ORlRVc2VySW50ZXJlc3QAFmtORlRVc2VyQXZhaWxhYmxlQ2xhaW0CFl9ORlRVc2VyQXZhaWxhYmxlQ2xhaW0AD2tORlRUb3RhbFN0YWtlZAIOTkZUV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GVhbkVudHJ5AgUHa0FjdGl2ZQcFA25pbAECdHgBBnZlcmlmeQAEE211bHRpU2lnbmVkQnlBZG1pbnMEEmFkbWluUHViS2V5MVNpZ25lZAMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAFCGFkbWluMVBLAAEAAAQSYWRtaW5QdWJLZXkyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAQUIYWRtaW4yUEsAAQAABBJhZG1pblB1YktleTNTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQhhZG1pbjNQSwABAAAJAGcCCQBkAgkAZAIFEmFkbWluUHViS2V5MVNpZ25lZAUSYWRtaW5QdWJLZXkyU2lnbmVkBRJhZG1pblB1YktleTNTaWduZWQAAgQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EA2ludgUHJG1hdGNoMAQGaXNTZWxmCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BAppc1JpZ2h0RmVlAwkAAAIIBQNpbnYDZmVlAKD3NgkAAAIIBQNpbnYKZmVlQXNzZXRJZAUEdW5pdAcECmlzSW5pdENhbGwJAAACCAUDaW52CGZ1bmN0aW9uAgRpbml0BAxpc25vUGF5bWVudHMJAAACCQCQAwEIBQNpbnYIcGF5bWVudHMAAAMDAwMFCmlzUmlnaHRGZWUFCmlzSW5pdENhbGwHBQZpc1NlbGYHBQxpc25vUGF5bWVudHMHBgUTbXVsdGlTaWduZWRCeUFkbWlucwUTbXVsdGlTaWduZWRCeUFkbWluc3PXXsY=", "height": 2832926, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HEQiLGTf1dhgxCqdktd982YwvXjNLQWVu114VGtQ7pxD Next: none Diff:
Old | New | Differences | |
---|---|---|---|
35 | 35 | ||
36 | 36 | let q = "tokenId" | |
37 | 37 | ||
38 | - | let r = " | |
38 | + | let r = "active" | |
39 | 39 | ||
40 | - | let s = " | |
40 | + | let s = "admin_pub_1" | |
41 | 41 | ||
42 | - | let t = " | |
42 | + | let t = "admin_pub_2" | |
43 | 43 | ||
44 | - | let u = "admin_pub_ | |
44 | + | let u = "admin_pub_3" | |
45 | 45 | ||
46 | - | let v = " | |
46 | + | let v = fromBase58String(valueOrErrorMessage(getString(this, s), "Can't get admin1PK")) | |
47 | 47 | ||
48 | - | let w = " | |
48 | + | let w = fromBase58String(valueOrErrorMessage(getString(this, t), "Can't get admin2PK")) | |
49 | 49 | ||
50 | - | let x = fromBase58String(valueOrErrorMessage(getString(this, u), "Can't get | |
50 | + | let x = fromBase58String(valueOrErrorMessage(getString(this, u), "Can't get operatorPK")) | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = valueOrErrorMessage(getString(this, q), "Can't get staking token") | |
53 | 53 | ||
54 | - | let z = fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get operatorPK")) | |
55 | - | ||
56 | - | let A = valueOrErrorMessage(getString(this, q), "Can't get staking token") | |
57 | - | ||
58 | - | func B (C) = if (containsElement([x, y, z], C.callerPublicKey)) | |
54 | + | func z (A) = if (containsElement([v, w, x], A.callerPublicKey)) | |
59 | 55 | then unit | |
60 | 56 | else throw("Only admin can call this function") | |
61 | 57 | ||
62 | 58 | ||
63 | - | func | |
59 | + | func B (A) = if ((A.caller == this)) | |
64 | 60 | then unit | |
65 | 61 | else throw("Only contract itself can call this function") | |
66 | 62 | ||
67 | 63 | ||
68 | - | func | |
64 | + | func C () = if (valueOrElse(getBoolean(this, r), true)) | |
69 | 65 | then unit | |
70 | 66 | else throw("DApp is inactive at this moment") | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
74 | - | let | |
75 | - | if ($isInstanceOf( | |
69 | + | func D (E) = { | |
70 | + | let F = E | |
71 | + | if ($isInstanceOf(F, "ByteVector")) | |
76 | 72 | then { | |
77 | - | let | |
78 | - | toBase58String( | |
73 | + | let G = F | |
74 | + | toBase58String(G) | |
79 | 75 | } | |
80 | - | else if ($isInstanceOf( | |
76 | + | else if ($isInstanceOf(F, "Unit")) | |
81 | 77 | then { | |
82 | - | let | |
78 | + | let H = F | |
83 | 79 | "WAVES" | |
84 | 80 | } | |
85 | 81 | else throw("Not Asset id") | |
86 | 82 | } | |
87 | 83 | ||
88 | 84 | ||
89 | - | func | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | $Tuple4( | |
85 | + | func I (J) = { | |
86 | + | let K = valueOrElse(getInteger(this, h), 0) | |
87 | + | let L = valueOrElse(getInteger(this, d), 0) | |
88 | + | let M = valueOrElse(getInteger(this, (J + f)), 0) | |
89 | + | let N = valueOrElse(getInteger(this, (J + e)), L) | |
90 | + | let O = valueOrElse(getInteger(this, (J + g)), 0) | |
91 | + | let P = fraction(O, (L - N), a) | |
92 | + | $Tuple4(L, (P + M), O, K) | |
97 | 93 | } | |
98 | 94 | ||
99 | 95 | ||
100 | - | func | |
101 | - | let | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | $Tuple4( | |
96 | + | func Q (J) = { | |
97 | + | let R = valueOrElse(getInteger(this, l), 0) | |
98 | + | let L = valueOrElse(getInteger(this, i), 0) | |
99 | + | let M = valueOrElse(getInteger(this, (J + k)), 0) | |
100 | + | let N = valueOrElse(getInteger(this, (J + j)), L) | |
101 | + | let S = valueOrElse(getInteger(this, (J + m)), 0) | |
102 | + | let P = (S * (L - N)) | |
103 | + | $Tuple4(L, (P + M), S, R) | |
108 | 104 | } | |
109 | 105 | ||
110 | 106 | ||
111 | - | func V () = { | |
112 | - | let W = valueOrElse(getInteger(this, p), 0) | |
113 | - | let M = valueOrElse(getInteger(this, h), 0) | |
114 | - | let X = valueOrElse(getInteger(this, l), 0) | |
115 | - | let Y = getIntegerValue(this, r) | |
116 | - | let Z = if ((X == 0)) | |
117 | - | then W | |
118 | - | else fraction(W, (100 - min([Y, (X * 10)])), 100) | |
119 | - | (fraction(Z, b, M) * 52) | |
107 | + | func T () = { | |
108 | + | let U = valueOrElse(getInteger(this, p), 0) | |
109 | + | let K = valueOrElse(getInteger(this, h), 0) | |
110 | + | let V = valueOrElse(getInteger(this, l), 0) | |
111 | + | let W = if ((V == 0)) | |
112 | + | then U | |
113 | + | else fraction(U, (100 - V), 100) | |
114 | + | (fraction(W, b, K) * 52) | |
120 | 115 | } | |
121 | 116 | ||
122 | 117 | ||
123 | - | func aa (L) = { | |
124 | - | func ab (ac,ad) = if (isDefined(getBoolean(this, (((L + "_") + ad) + n)))) | |
125 | - | then (ac :+ ad) | |
126 | - | else ac | |
127 | - | ||
128 | - | let ae = valueOrElse(getString(this, s), "") | |
129 | - | let af = if ((ae == "")) | |
130 | - | then nil | |
131 | - | else split(ae, c) | |
132 | - | let ag = { | |
133 | - | let ah = af | |
134 | - | let ai = size(ah) | |
135 | - | let aj = nil | |
136 | - | func ak (al,am) = if ((am >= ai)) | |
137 | - | then al | |
138 | - | else ab(al, ah[am]) | |
139 | - | ||
140 | - | func an (al,am) = if ((am >= ai)) | |
141 | - | then al | |
142 | - | else throw("List size exceeds 5") | |
143 | - | ||
144 | - | an(ak(ak(ak(ak(ak(aj, 0), 1), 2), 3), 4), 5) | |
145 | - | } | |
146 | - | makeString(ag, ",") | |
147 | - | } | |
148 | - | ||
149 | - | ||
150 | - | @Callable(C) | |
118 | + | @Callable(A) | |
151 | 119 | func getStatsREADONLY () = { | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | $Tuple2(nil, makeString(["%d%d%d", toString( | |
120 | + | let X = T() | |
121 | + | let K = valueOrElse(getInteger(this, h), 0) | |
122 | + | let R = valueOrElse(getInteger(this, l), 0) | |
123 | + | $Tuple2(nil, makeString(["%d%d%d", toString(X), toString(K), toString(R)], c)) | |
156 | 124 | } | |
157 | 125 | ||
158 | 126 | ||
159 | 127 | ||
160 | - | @Callable(C) | |
161 | - | func getStatsByUserREADONLY (L) = { | |
162 | - | let ap = valueOrErrorMessage(addressFromString(L), "Wrong user address") | |
163 | - | let aq = K(L) | |
164 | - | let ar = aq._1 | |
165 | - | let as = aq._2 | |
166 | - | let Q = aq._3 | |
167 | - | let M = aq._4 | |
168 | - | let at = S(L) | |
169 | - | let au = at._1 | |
170 | - | let av = at._2 | |
171 | - | let aw = at._3 | |
172 | - | let X = at._4 | |
173 | - | let ax = assetBalance(ap, fromBase58String(A)) | |
174 | - | let ag = aa(L) | |
175 | - | $Tuple2(nil, makeString(["%d%d%d%d%s", toString(ax), toString(Q), toString(as), toString(av), ag], c)) | |
128 | + | @Callable(A) | |
129 | + | func getStatsByUserREADONLY (J) = { | |
130 | + | let Y = valueOrErrorMessage(addressFromString(J), "Wrong user address") | |
131 | + | let Z = I(J) | |
132 | + | let aa = Z._1 | |
133 | + | let ab = Z._2 | |
134 | + | let O = Z._3 | |
135 | + | let K = Z._4 | |
136 | + | let ac = Q(J) | |
137 | + | let ad = ac._1 | |
138 | + | let ae = ac._2 | |
139 | + | let af = ac._3 | |
140 | + | let V = ac._4 | |
141 | + | let ag = assetBalance(Y, fromBase58String(y)) | |
142 | + | $Tuple2(nil, makeString(["%d%d%d%d%s", toString(ag), toString(O), toString(ab), toString(ae)], c)) | |
176 | 143 | } | |
177 | 144 | ||
178 | 145 | ||
179 | 146 | ||
180 | - | @Callable(C) | |
181 | - | func getUserStatsREADONLY (L) = { | |
182 | - | let ao = V() | |
183 | - | let ay = if ((L == "")) | |
184 | - | then $Tuple4(0, 0, 0, 0) | |
185 | - | else { | |
186 | - | let ap = valueOrErrorMessage(addressFromString(L), "Wrong user address") | |
187 | - | let az = K(L) | |
188 | - | let ar = az._1 | |
189 | - | let as = az._2 | |
190 | - | let Q = az._3 | |
191 | - | let M = az._4 | |
192 | - | let aA = S(L) | |
193 | - | let au = aA._1 | |
194 | - | let av = aA._2 | |
195 | - | let aw = aA._3 | |
196 | - | let X = aA._4 | |
197 | - | let aB = assetBalance(ap, fromBase58String(A)) | |
198 | - | $Tuple4(aB, Q, as, av) | |
199 | - | } | |
200 | - | let ax = ay._1 | |
201 | - | let Q = ay._2 | |
202 | - | let as = ay._3 | |
203 | - | let av = ay._4 | |
204 | - | $Tuple2(nil, makeString(["%d%d%d%d%d", toString(ao), toString(ax), toString(Q), toString(as), toString(av)], c)) | |
205 | - | } | |
147 | + | @Callable(A) | |
148 | + | func init (y,ah,ai,aj) = valueOrElse(B(A), if (isDefined(getString(this, q))) | |
149 | + | then throw("DApp already inited") | |
150 | + | else if (!(isDefined(assetInfo(fromBase58String(y))))) | |
151 | + | then throw("asset id is not correct asset id") | |
152 | + | else if ((size(fromBase58String(ah)) != 32)) | |
153 | + | then throw("group1Admin1PubKey is not correct") | |
154 | + | else if ((size(fromBase58String(ai)) != 32)) | |
155 | + | then throw("group1Admin1PubKey is not correct") | |
156 | + | else if ((size(fromBase58String(aj)) != 32)) | |
157 | + | then throw("group1Admin1PubKey is not correct") | |
158 | + | else [StringEntry(q, y), StringEntry(s, ah), StringEntry(t, ai), StringEntry(u, aj)]) | |
206 | 159 | ||
207 | 160 | ||
208 | 161 | ||
209 | - | @Callable(C) | |
210 | - | func init (A,aC,aD,aE,aF) = valueOrElse(D(C), if (isDefined(getString(this, q))) | |
211 | - | then throw("DApp already inited") | |
212 | - | else if (!(isDefined(assetInfo(fromBase58String(A))))) | |
213 | - | then throw("asset id is not correct asset id") | |
214 | - | else if ((size(fromBase58String(aC)) != 32)) | |
215 | - | then throw("group1Admin1PubKey is not correct") | |
216 | - | else if ((size(fromBase58String(aD)) != 32)) | |
217 | - | then throw("group1Admin1PubKey is not correct") | |
218 | - | else if ((size(fromBase58String(aE)) != 32)) | |
219 | - | then throw("group1Admin1PubKey is not correct") | |
220 | - | else [StringEntry(q, A), StringEntry(u, aC), StringEntry(v, aD), StringEntry(w, aE), IntegerEntry(r, aF)]) | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(C) | |
225 | - | func stake () = valueOrElse(E(), if ((size(C.payments) != 1)) | |
162 | + | @Callable(A) | |
163 | + | func stake () = valueOrElse(C(), if ((size(A.payments) != 1)) | |
226 | 164 | then throw("One payment expected") | |
227 | 165 | else { | |
228 | - | let | |
229 | - | let | |
230 | - | let | |
231 | - | if (( | |
166 | + | let ak = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
167 | + | let al = ak._1 | |
168 | + | let am = ak._2 | |
169 | + | if ((am != fromBase58String(y))) | |
232 | 170 | then throw("Wrong payment asset") | |
233 | 171 | else { | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | let | |
239 | - | let | |
240 | - | [IntegerEntry(( | |
172 | + | let J = toString(A.caller) | |
173 | + | let an = I(J) | |
174 | + | let aa = an._1 | |
175 | + | let ab = an._2 | |
176 | + | let O = an._3 | |
177 | + | let K = an._4 | |
178 | + | [IntegerEntry((J + e), aa), IntegerEntry((J + f), ab), IntegerEntry((J + g), (O + al)), IntegerEntry(h, (K + al))] | |
241 | 179 | } | |
242 | 180 | }) | |
243 | 181 | ||
244 | 182 | ||
245 | 183 | ||
246 | - | @Callable( | |
247 | - | func unstake ( | |
248 | - | let | |
249 | - | if ((0 >= | |
184 | + | @Callable(A) | |
185 | + | func unstake (ao) = valueOrElse(C(), { | |
186 | + | let J = toString(A.caller) | |
187 | + | if ((0 >= ao)) | |
250 | 188 | then throw("Amount must be greater than 0") | |
251 | 189 | else { | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | if (( | |
190 | + | let ap = I(J) | |
191 | + | let aa = ap._1 | |
192 | + | let ab = ap._2 | |
193 | + | let O = ap._3 | |
194 | + | let K = ap._4 | |
195 | + | if ((ao > O)) | |
258 | 196 | then throw("You can't unstake more than staked") | |
259 | - | else [IntegerEntry(( | |
197 | + | else [IntegerEntry((J + e), aa), IntegerEntry((J + f), ab), IntegerEntry((J + g), (O - ao)), IntegerEntry(h, (K - ao)), ScriptTransfer(A.caller, ao, fromBase58String(y))] | |
260 | 198 | } | |
261 | 199 | }) | |
262 | 200 | ||
263 | 201 | ||
264 | 202 | ||
265 | - | @Callable( | |
266 | - | func claim () = valueOrElse( | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | let | |
277 | - | let | |
278 | - | if ((( | |
203 | + | @Callable(A) | |
204 | + | func claim () = valueOrElse(C(), { | |
205 | + | let J = toString(A.caller) | |
206 | + | let aq = I(J) | |
207 | + | let aa = aq._1 | |
208 | + | let ab = aq._2 | |
209 | + | let O = aq._3 | |
210 | + | let K = aq._4 | |
211 | + | let ar = Q(J) | |
212 | + | let ad = ar._1 | |
213 | + | let ae = ar._2 | |
214 | + | let af = ar._3 | |
215 | + | let V = ar._4 | |
216 | + | if (((ab + ae) == 0)) | |
279 | 217 | then throw("Nothing to claim") | |
280 | - | else [IntegerEntry(( | |
218 | + | else [IntegerEntry((J + e), aa), IntegerEntry((J + f), 0), IntegerEntry((J + j), ad), IntegerEntry((J + k), 0), ScriptTransfer(A.caller, (ab + ae), fromBase58String(y))] | |
281 | 219 | }) | |
282 | 220 | ||
283 | 221 | ||
284 | 222 | ||
285 | - | @Callable( | |
286 | - | func stakeNFT () = valueOrElse( | |
223 | + | @Callable(A) | |
224 | + | func stakeNFT () = valueOrElse(C(), if ((size(A.payments) != 1)) | |
287 | 225 | then throw("One payment expected") | |
288 | 226 | else { | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | if (!(isDefined(getString(this, ( | |
227 | + | let as = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
228 | + | let al = as._1 | |
229 | + | let am = as._2 | |
230 | + | let at = D(am) | |
231 | + | if (!(isDefined(getString(this, (at + o))))) | |
294 | 232 | then throw("Wrong nft asset") | |
295 | 233 | else { | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | [IntegerEntry(( | |
234 | + | let J = toString(A.caller) | |
235 | + | let au = Q(J) | |
236 | + | let aa = au._1 | |
237 | + | let ab = au._2 | |
238 | + | let af = au._3 | |
239 | + | let V = au._4 | |
240 | + | [IntegerEntry((J + j), aa), IntegerEntry((J + k), ab), IntegerEntry((J + m), (af + 1)), IntegerEntry(l, (V + 1)), BooleanEntry((((J + "_") + at) + n), true)] | |
303 | 241 | } | |
304 | 242 | }) | |
305 | 243 | ||
306 | 244 | ||
307 | 245 | ||
308 | - | @Callable( | |
309 | - | func unstakeNFT ( | |
310 | - | let | |
311 | - | if (!(isDefined(getBoolean(this, ((( | |
246 | + | @Callable(A) | |
247 | + | func unstakeNFT (G) = valueOrElse(C(), { | |
248 | + | let J = toString(A.caller) | |
249 | + | if (!(isDefined(getBoolean(this, (((J + "_") + G) + n))))) | |
312 | 250 | then throw("You didn't staked") | |
313 | 251 | else { | |
314 | - | let | |
315 | - | let | |
316 | - | let | |
317 | - | let | |
318 | - | let | |
319 | - | [IntegerEntry(( | |
252 | + | let av = Q(J) | |
253 | + | let aa = av._1 | |
254 | + | let ab = av._2 | |
255 | + | let af = av._3 | |
256 | + | let V = av._4 | |
257 | + | [IntegerEntry((J + j), aa), IntegerEntry((J + k), ab), IntegerEntry((J + m), (af - 1)), IntegerEntry(l, (V - 1)), DeleteEntry((((J + "_") + G) + n)), ScriptTransfer(A.caller, 1, fromBase58String(G))] | |
320 | 258 | } | |
321 | 259 | }) | |
322 | 260 | ||
323 | 261 | ||
324 | 262 | ||
325 | - | @Callable(C) | |
326 | - | func issueNFT (ap,aS,aT) = valueOrElse(E(), valueOrElse(B(C), { | |
327 | - | let aU = valueOrErrorMessage(addressFromString(ap), "Wrong user address") | |
328 | - | let aV = Issue(aS, aT, 1, 0, false) | |
329 | - | let ad = calculateAssetId(aV) | |
330 | - | let af = valueOrElse(getString(this, s), "") | |
331 | - | let aW = (af + (if ((af != "")) | |
332 | - | then (c + toBase58String(ad)) | |
333 | - | else ("" + toBase58String(ad)))) | |
334 | - | [aV, StringEntry((toBase58String(ad) + o), ap), StringEntry(s, aW), ScriptTransfer(aU, 1, ad)] | |
263 | + | @Callable(A) | |
264 | + | func issueNFT (Y,aw,ax) = valueOrElse(C(), valueOrElse(z(A), { | |
265 | + | let ay = valueOrErrorMessage(addressFromString(Y), "Wrong user address") | |
266 | + | let az = Issue(aw, ax, 1, 0, false) | |
267 | + | let aA = calculateAssetId(az) | |
268 | + | [az, StringEntry((toBase58String(aA) + o), Y), ScriptTransfer(ay, 1, aA)] | |
335 | 269 | })) | |
336 | 270 | ||
337 | 271 | ||
338 | 272 | ||
339 | - | @Callable( | |
340 | - | func airdrop () = valueOrElse( | |
273 | + | @Callable(A) | |
274 | + | func airdrop () = valueOrElse(C(), valueOrElse(z(A), if ((size(A.payments) != 1)) | |
341 | 275 | then throw("One payment expected") | |
342 | 276 | else { | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | if (( | |
277 | + | let aB = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
278 | + | let al = aB._1 | |
279 | + | let am = aB._2 | |
280 | + | if ((am != fromBase58String(y))) | |
347 | 281 | then throw("Wrong payment asset") | |
348 | 282 | else { | |
349 | - | let Y = getIntegerValue(this, r) | |
350 | - | let M = valueOrElse(getInteger(this, h), 0) | |
351 | - | let X = valueOrElse(getInteger(this, l), 0) | |
352 | - | let N = valueOrElse(getInteger(this, d), 0) | |
353 | - | let aY = valueOrElse(getInteger(this, i), 0) | |
354 | - | let aZ = if ((X == 0)) | |
355 | - | then $Tuple2(0, aH) | |
283 | + | let K = valueOrElse(getInteger(this, h), 0) | |
284 | + | let V = valueOrElse(getInteger(this, l), 0) | |
285 | + | let L = valueOrElse(getInteger(this, d), 0) | |
286 | + | let aC = valueOrElse(getInteger(this, i), 0) | |
287 | + | let aD = if ((V == 0)) | |
288 | + | then $Tuple2(0, al) | |
356 | 289 | else { | |
357 | - | let | |
358 | - | $Tuple2( | |
290 | + | let aE = fraction(al, V, 100) | |
291 | + | $Tuple2(aE, (al - aE)) | |
359 | 292 | } | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | then ( | |
364 | - | else | |
365 | - | let | |
366 | - | then ( | |
367 | - | else | |
368 | - | [IntegerEntry(d, | |
293 | + | let aF = aD._1 | |
294 | + | let aG = aD._2 | |
295 | + | let aH = if ((K > 0)) | |
296 | + | then (L + fraction(aG, a, K)) | |
297 | + | else L | |
298 | + | let aI = if ((V > 0)) | |
299 | + | then (aC + (aF / V)) | |
300 | + | else aC | |
301 | + | [IntegerEntry(d, aH), IntegerEntry(i, aI), IntegerEntry(p, al)] | |
369 | 302 | } | |
370 | 303 | })) | |
371 | 304 | ||
372 | 305 | ||
373 | 306 | ||
374 | - | @Callable( | |
375 | - | func activate () = valueOrElse( | |
307 | + | @Callable(A) | |
308 | + | func activate () = valueOrElse(z(A), if (valueOrElse(getBoolean(this, r), true)) | |
376 | 309 | then throw("dApp already active") | |
377 | - | else [BooleanEntry( | |
310 | + | else [BooleanEntry(r, true)]) | |
378 | 311 | ||
379 | 312 | ||
380 | 313 | ||
381 | - | @Callable( | |
382 | - | func shutdown () = valueOrElse( | |
314 | + | @Callable(A) | |
315 | + | func shutdown () = valueOrElse(z(A), if (!(valueOrElse(getBoolean(this, r), true))) | |
383 | 316 | then throw("dApp already shutdown") | |
384 | - | else [BooleanEntry( | |
317 | + | else [BooleanEntry(r, false)]) | |
385 | 318 | ||
386 | 319 | ||
387 | - | @Verifier( | |
388 | - | func | |
389 | - | let | |
390 | - | let | |
320 | + | @Verifier(aJ) | |
321 | + | func aK () = { | |
322 | + | let aL = { | |
323 | + | let aM = if (sigVerify(aJ.bodyBytes, aJ.proofs[0], v)) | |
391 | 324 | then 1 | |
392 | 325 | else 0 | |
393 | - | let | |
326 | + | let aN = if (sigVerify(aJ.bodyBytes, aJ.proofs[1], w)) | |
394 | 327 | then 1 | |
395 | 328 | else 0 | |
396 | - | let | |
329 | + | let aO = if (sigVerify(aJ.bodyBytes, aJ.proofs[2], x)) | |
397 | 330 | then 1 | |
398 | 331 | else 0 | |
399 | - | ((( | |
332 | + | (((aM + aN) + aO) >= 2) | |
400 | 333 | } | |
401 | - | let | |
402 | - | if ($isInstanceOf( | |
334 | + | let F = aJ | |
335 | + | if ($isInstanceOf(F, "InvokeScriptTransaction")) | |
403 | 336 | then { | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | then ( | |
337 | + | let aP = F | |
338 | + | let aQ = sigVerify(aJ.bodyBytes, aJ.proofs[0], aJ.senderPublicKey) | |
339 | + | let aR = if ((aP.fee == 900000)) | |
340 | + | then (aP.feeAssetId == unit) | |
408 | 341 | else false | |
409 | - | let | |
410 | - | let | |
411 | - | if (if (if (if ( | |
412 | - | then | |
342 | + | let aS = (aP.function == "init") | |
343 | + | let aT = (size(aP.payments) == 0) | |
344 | + | if (if (if (if (aR) | |
345 | + | then aS | |
413 | 346 | else false) | |
414 | - | then | |
347 | + | then aQ | |
415 | 348 | else false) | |
416 | - | then | |
349 | + | then aT | |
417 | 350 | else false) | |
418 | 351 | then true | |
419 | - | else | |
352 | + | else aL | |
420 | 353 | } | |
421 | - | else | |
354 | + | else aL | |
422 | 355 | } | |
423 | 356 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 100000000 | |
5 | 5 | ||
6 | 6 | let b = 10000 | |
7 | 7 | ||
8 | 8 | let c = "__" | |
9 | 9 | ||
10 | 10 | let d = "interest" | |
11 | 11 | ||
12 | 12 | let e = "_userInterest" | |
13 | 13 | ||
14 | 14 | let f = "_userAvailableClaim" | |
15 | 15 | ||
16 | 16 | let g = "_userTokenStaked" | |
17 | 17 | ||
18 | 18 | let h = "totalTokenStaked" | |
19 | 19 | ||
20 | 20 | let i = "NFTInterest" | |
21 | 21 | ||
22 | 22 | let j = "_NFTUserInterest" | |
23 | 23 | ||
24 | 24 | let k = "_NFTUserAvailableClaim" | |
25 | 25 | ||
26 | 26 | let l = "NFTTotalStaked" | |
27 | 27 | ||
28 | 28 | let m = "_userNFTStaked" | |
29 | 29 | ||
30 | 30 | let n = "_userNFTStakedId" | |
31 | 31 | ||
32 | 32 | let o = "_NFTCreated" | |
33 | 33 | ||
34 | 34 | let p = "_lastAirdrop" | |
35 | 35 | ||
36 | 36 | let q = "tokenId" | |
37 | 37 | ||
38 | - | let r = " | |
38 | + | let r = "active" | |
39 | 39 | ||
40 | - | let s = " | |
40 | + | let s = "admin_pub_1" | |
41 | 41 | ||
42 | - | let t = " | |
42 | + | let t = "admin_pub_2" | |
43 | 43 | ||
44 | - | let u = "admin_pub_ | |
44 | + | let u = "admin_pub_3" | |
45 | 45 | ||
46 | - | let v = " | |
46 | + | let v = fromBase58String(valueOrErrorMessage(getString(this, s), "Can't get admin1PK")) | |
47 | 47 | ||
48 | - | let w = " | |
48 | + | let w = fromBase58String(valueOrErrorMessage(getString(this, t), "Can't get admin2PK")) | |
49 | 49 | ||
50 | - | let x = fromBase58String(valueOrErrorMessage(getString(this, u), "Can't get | |
50 | + | let x = fromBase58String(valueOrErrorMessage(getString(this, u), "Can't get operatorPK")) | |
51 | 51 | ||
52 | - | let y = | |
52 | + | let y = valueOrErrorMessage(getString(this, q), "Can't get staking token") | |
53 | 53 | ||
54 | - | let z = fromBase58String(valueOrErrorMessage(getString(this, w), "Can't get operatorPK")) | |
55 | - | ||
56 | - | let A = valueOrErrorMessage(getString(this, q), "Can't get staking token") | |
57 | - | ||
58 | - | func B (C) = if (containsElement([x, y, z], C.callerPublicKey)) | |
54 | + | func z (A) = if (containsElement([v, w, x], A.callerPublicKey)) | |
59 | 55 | then unit | |
60 | 56 | else throw("Only admin can call this function") | |
61 | 57 | ||
62 | 58 | ||
63 | - | func | |
59 | + | func B (A) = if ((A.caller == this)) | |
64 | 60 | then unit | |
65 | 61 | else throw("Only contract itself can call this function") | |
66 | 62 | ||
67 | 63 | ||
68 | - | func | |
64 | + | func C () = if (valueOrElse(getBoolean(this, r), true)) | |
69 | 65 | then unit | |
70 | 66 | else throw("DApp is inactive at this moment") | |
71 | 67 | ||
72 | 68 | ||
73 | - | func | |
74 | - | let | |
75 | - | if ($isInstanceOf( | |
69 | + | func D (E) = { | |
70 | + | let F = E | |
71 | + | if ($isInstanceOf(F, "ByteVector")) | |
76 | 72 | then { | |
77 | - | let | |
78 | - | toBase58String( | |
73 | + | let G = F | |
74 | + | toBase58String(G) | |
79 | 75 | } | |
80 | - | else if ($isInstanceOf( | |
76 | + | else if ($isInstanceOf(F, "Unit")) | |
81 | 77 | then { | |
82 | - | let | |
78 | + | let H = F | |
83 | 79 | "WAVES" | |
84 | 80 | } | |
85 | 81 | else throw("Not Asset id") | |
86 | 82 | } | |
87 | 83 | ||
88 | 84 | ||
89 | - | func | |
90 | - | let | |
91 | - | let | |
92 | - | let | |
93 | - | let | |
94 | - | let | |
95 | - | let | |
96 | - | $Tuple4( | |
85 | + | func I (J) = { | |
86 | + | let K = valueOrElse(getInteger(this, h), 0) | |
87 | + | let L = valueOrElse(getInteger(this, d), 0) | |
88 | + | let M = valueOrElse(getInteger(this, (J + f)), 0) | |
89 | + | let N = valueOrElse(getInteger(this, (J + e)), L) | |
90 | + | let O = valueOrElse(getInteger(this, (J + g)), 0) | |
91 | + | let P = fraction(O, (L - N), a) | |
92 | + | $Tuple4(L, (P + M), O, K) | |
97 | 93 | } | |
98 | 94 | ||
99 | 95 | ||
100 | - | func | |
101 | - | let | |
102 | - | let | |
103 | - | let | |
104 | - | let | |
105 | - | let | |
106 | - | let | |
107 | - | $Tuple4( | |
96 | + | func Q (J) = { | |
97 | + | let R = valueOrElse(getInteger(this, l), 0) | |
98 | + | let L = valueOrElse(getInteger(this, i), 0) | |
99 | + | let M = valueOrElse(getInteger(this, (J + k)), 0) | |
100 | + | let N = valueOrElse(getInteger(this, (J + j)), L) | |
101 | + | let S = valueOrElse(getInteger(this, (J + m)), 0) | |
102 | + | let P = (S * (L - N)) | |
103 | + | $Tuple4(L, (P + M), S, R) | |
108 | 104 | } | |
109 | 105 | ||
110 | 106 | ||
111 | - | func V () = { | |
112 | - | let W = valueOrElse(getInteger(this, p), 0) | |
113 | - | let M = valueOrElse(getInteger(this, h), 0) | |
114 | - | let X = valueOrElse(getInteger(this, l), 0) | |
115 | - | let Y = getIntegerValue(this, r) | |
116 | - | let Z = if ((X == 0)) | |
117 | - | then W | |
118 | - | else fraction(W, (100 - min([Y, (X * 10)])), 100) | |
119 | - | (fraction(Z, b, M) * 52) | |
107 | + | func T () = { | |
108 | + | let U = valueOrElse(getInteger(this, p), 0) | |
109 | + | let K = valueOrElse(getInteger(this, h), 0) | |
110 | + | let V = valueOrElse(getInteger(this, l), 0) | |
111 | + | let W = if ((V == 0)) | |
112 | + | then U | |
113 | + | else fraction(U, (100 - V), 100) | |
114 | + | (fraction(W, b, K) * 52) | |
120 | 115 | } | |
121 | 116 | ||
122 | 117 | ||
123 | - | func aa (L) = { | |
124 | - | func ab (ac,ad) = if (isDefined(getBoolean(this, (((L + "_") + ad) + n)))) | |
125 | - | then (ac :+ ad) | |
126 | - | else ac | |
127 | - | ||
128 | - | let ae = valueOrElse(getString(this, s), "") | |
129 | - | let af = if ((ae == "")) | |
130 | - | then nil | |
131 | - | else split(ae, c) | |
132 | - | let ag = { | |
133 | - | let ah = af | |
134 | - | let ai = size(ah) | |
135 | - | let aj = nil | |
136 | - | func ak (al,am) = if ((am >= ai)) | |
137 | - | then al | |
138 | - | else ab(al, ah[am]) | |
139 | - | ||
140 | - | func an (al,am) = if ((am >= ai)) | |
141 | - | then al | |
142 | - | else throw("List size exceeds 5") | |
143 | - | ||
144 | - | an(ak(ak(ak(ak(ak(aj, 0), 1), 2), 3), 4), 5) | |
145 | - | } | |
146 | - | makeString(ag, ",") | |
147 | - | } | |
148 | - | ||
149 | - | ||
150 | - | @Callable(C) | |
118 | + | @Callable(A) | |
151 | 119 | func getStatsREADONLY () = { | |
152 | - | let | |
153 | - | let | |
154 | - | let | |
155 | - | $Tuple2(nil, makeString(["%d%d%d", toString( | |
120 | + | let X = T() | |
121 | + | let K = valueOrElse(getInteger(this, h), 0) | |
122 | + | let R = valueOrElse(getInteger(this, l), 0) | |
123 | + | $Tuple2(nil, makeString(["%d%d%d", toString(X), toString(K), toString(R)], c)) | |
156 | 124 | } | |
157 | 125 | ||
158 | 126 | ||
159 | 127 | ||
160 | - | @Callable(C) | |
161 | - | func getStatsByUserREADONLY (L) = { | |
162 | - | let ap = valueOrErrorMessage(addressFromString(L), "Wrong user address") | |
163 | - | let aq = K(L) | |
164 | - | let ar = aq._1 | |
165 | - | let as = aq._2 | |
166 | - | let Q = aq._3 | |
167 | - | let M = aq._4 | |
168 | - | let at = S(L) | |
169 | - | let au = at._1 | |
170 | - | let av = at._2 | |
171 | - | let aw = at._3 | |
172 | - | let X = at._4 | |
173 | - | let ax = assetBalance(ap, fromBase58String(A)) | |
174 | - | let ag = aa(L) | |
175 | - | $Tuple2(nil, makeString(["%d%d%d%d%s", toString(ax), toString(Q), toString(as), toString(av), ag], c)) | |
128 | + | @Callable(A) | |
129 | + | func getStatsByUserREADONLY (J) = { | |
130 | + | let Y = valueOrErrorMessage(addressFromString(J), "Wrong user address") | |
131 | + | let Z = I(J) | |
132 | + | let aa = Z._1 | |
133 | + | let ab = Z._2 | |
134 | + | let O = Z._3 | |
135 | + | let K = Z._4 | |
136 | + | let ac = Q(J) | |
137 | + | let ad = ac._1 | |
138 | + | let ae = ac._2 | |
139 | + | let af = ac._3 | |
140 | + | let V = ac._4 | |
141 | + | let ag = assetBalance(Y, fromBase58String(y)) | |
142 | + | $Tuple2(nil, makeString(["%d%d%d%d%s", toString(ag), toString(O), toString(ab), toString(ae)], c)) | |
176 | 143 | } | |
177 | 144 | ||
178 | 145 | ||
179 | 146 | ||
180 | - | @Callable(C) | |
181 | - | func getUserStatsREADONLY (L) = { | |
182 | - | let ao = V() | |
183 | - | let ay = if ((L == "")) | |
184 | - | then $Tuple4(0, 0, 0, 0) | |
185 | - | else { | |
186 | - | let ap = valueOrErrorMessage(addressFromString(L), "Wrong user address") | |
187 | - | let az = K(L) | |
188 | - | let ar = az._1 | |
189 | - | let as = az._2 | |
190 | - | let Q = az._3 | |
191 | - | let M = az._4 | |
192 | - | let aA = S(L) | |
193 | - | let au = aA._1 | |
194 | - | let av = aA._2 | |
195 | - | let aw = aA._3 | |
196 | - | let X = aA._4 | |
197 | - | let aB = assetBalance(ap, fromBase58String(A)) | |
198 | - | $Tuple4(aB, Q, as, av) | |
199 | - | } | |
200 | - | let ax = ay._1 | |
201 | - | let Q = ay._2 | |
202 | - | let as = ay._3 | |
203 | - | let av = ay._4 | |
204 | - | $Tuple2(nil, makeString(["%d%d%d%d%d", toString(ao), toString(ax), toString(Q), toString(as), toString(av)], c)) | |
205 | - | } | |
147 | + | @Callable(A) | |
148 | + | func init (y,ah,ai,aj) = valueOrElse(B(A), if (isDefined(getString(this, q))) | |
149 | + | then throw("DApp already inited") | |
150 | + | else if (!(isDefined(assetInfo(fromBase58String(y))))) | |
151 | + | then throw("asset id is not correct asset id") | |
152 | + | else if ((size(fromBase58String(ah)) != 32)) | |
153 | + | then throw("group1Admin1PubKey is not correct") | |
154 | + | else if ((size(fromBase58String(ai)) != 32)) | |
155 | + | then throw("group1Admin1PubKey is not correct") | |
156 | + | else if ((size(fromBase58String(aj)) != 32)) | |
157 | + | then throw("group1Admin1PubKey is not correct") | |
158 | + | else [StringEntry(q, y), StringEntry(s, ah), StringEntry(t, ai), StringEntry(u, aj)]) | |
206 | 159 | ||
207 | 160 | ||
208 | 161 | ||
209 | - | @Callable(C) | |
210 | - | func init (A,aC,aD,aE,aF) = valueOrElse(D(C), if (isDefined(getString(this, q))) | |
211 | - | then throw("DApp already inited") | |
212 | - | else if (!(isDefined(assetInfo(fromBase58String(A))))) | |
213 | - | then throw("asset id is not correct asset id") | |
214 | - | else if ((size(fromBase58String(aC)) != 32)) | |
215 | - | then throw("group1Admin1PubKey is not correct") | |
216 | - | else if ((size(fromBase58String(aD)) != 32)) | |
217 | - | then throw("group1Admin1PubKey is not correct") | |
218 | - | else if ((size(fromBase58String(aE)) != 32)) | |
219 | - | then throw("group1Admin1PubKey is not correct") | |
220 | - | else [StringEntry(q, A), StringEntry(u, aC), StringEntry(v, aD), StringEntry(w, aE), IntegerEntry(r, aF)]) | |
221 | - | ||
222 | - | ||
223 | - | ||
224 | - | @Callable(C) | |
225 | - | func stake () = valueOrElse(E(), if ((size(C.payments) != 1)) | |
162 | + | @Callable(A) | |
163 | + | func stake () = valueOrElse(C(), if ((size(A.payments) != 1)) | |
226 | 164 | then throw("One payment expected") | |
227 | 165 | else { | |
228 | - | let | |
229 | - | let | |
230 | - | let | |
231 | - | if (( | |
166 | + | let ak = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
167 | + | let al = ak._1 | |
168 | + | let am = ak._2 | |
169 | + | if ((am != fromBase58String(y))) | |
232 | 170 | then throw("Wrong payment asset") | |
233 | 171 | else { | |
234 | - | let | |
235 | - | let | |
236 | - | let | |
237 | - | let | |
238 | - | let | |
239 | - | let | |
240 | - | [IntegerEntry(( | |
172 | + | let J = toString(A.caller) | |
173 | + | let an = I(J) | |
174 | + | let aa = an._1 | |
175 | + | let ab = an._2 | |
176 | + | let O = an._3 | |
177 | + | let K = an._4 | |
178 | + | [IntegerEntry((J + e), aa), IntegerEntry((J + f), ab), IntegerEntry((J + g), (O + al)), IntegerEntry(h, (K + al))] | |
241 | 179 | } | |
242 | 180 | }) | |
243 | 181 | ||
244 | 182 | ||
245 | 183 | ||
246 | - | @Callable( | |
247 | - | func unstake ( | |
248 | - | let | |
249 | - | if ((0 >= | |
184 | + | @Callable(A) | |
185 | + | func unstake (ao) = valueOrElse(C(), { | |
186 | + | let J = toString(A.caller) | |
187 | + | if ((0 >= ao)) | |
250 | 188 | then throw("Amount must be greater than 0") | |
251 | 189 | else { | |
252 | - | let | |
253 | - | let | |
254 | - | let | |
255 | - | let | |
256 | - | let | |
257 | - | if (( | |
190 | + | let ap = I(J) | |
191 | + | let aa = ap._1 | |
192 | + | let ab = ap._2 | |
193 | + | let O = ap._3 | |
194 | + | let K = ap._4 | |
195 | + | if ((ao > O)) | |
258 | 196 | then throw("You can't unstake more than staked") | |
259 | - | else [IntegerEntry(( | |
197 | + | else [IntegerEntry((J + e), aa), IntegerEntry((J + f), ab), IntegerEntry((J + g), (O - ao)), IntegerEntry(h, (K - ao)), ScriptTransfer(A.caller, ao, fromBase58String(y))] | |
260 | 198 | } | |
261 | 199 | }) | |
262 | 200 | ||
263 | 201 | ||
264 | 202 | ||
265 | - | @Callable( | |
266 | - | func claim () = valueOrElse( | |
267 | - | let | |
268 | - | let | |
269 | - | let | |
270 | - | let | |
271 | - | let | |
272 | - | let | |
273 | - | let | |
274 | - | let | |
275 | - | let | |
276 | - | let | |
277 | - | let | |
278 | - | if ((( | |
203 | + | @Callable(A) | |
204 | + | func claim () = valueOrElse(C(), { | |
205 | + | let J = toString(A.caller) | |
206 | + | let aq = I(J) | |
207 | + | let aa = aq._1 | |
208 | + | let ab = aq._2 | |
209 | + | let O = aq._3 | |
210 | + | let K = aq._4 | |
211 | + | let ar = Q(J) | |
212 | + | let ad = ar._1 | |
213 | + | let ae = ar._2 | |
214 | + | let af = ar._3 | |
215 | + | let V = ar._4 | |
216 | + | if (((ab + ae) == 0)) | |
279 | 217 | then throw("Nothing to claim") | |
280 | - | else [IntegerEntry(( | |
218 | + | else [IntegerEntry((J + e), aa), IntegerEntry((J + f), 0), IntegerEntry((J + j), ad), IntegerEntry((J + k), 0), ScriptTransfer(A.caller, (ab + ae), fromBase58String(y))] | |
281 | 219 | }) | |
282 | 220 | ||
283 | 221 | ||
284 | 222 | ||
285 | - | @Callable( | |
286 | - | func stakeNFT () = valueOrElse( | |
223 | + | @Callable(A) | |
224 | + | func stakeNFT () = valueOrElse(C(), if ((size(A.payments) != 1)) | |
287 | 225 | then throw("One payment expected") | |
288 | 226 | else { | |
289 | - | let | |
290 | - | let | |
291 | - | let | |
292 | - | let | |
293 | - | if (!(isDefined(getString(this, ( | |
227 | + | let as = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
228 | + | let al = as._1 | |
229 | + | let am = as._2 | |
230 | + | let at = D(am) | |
231 | + | if (!(isDefined(getString(this, (at + o))))) | |
294 | 232 | then throw("Wrong nft asset") | |
295 | 233 | else { | |
296 | - | let | |
297 | - | let | |
298 | - | let | |
299 | - | let | |
300 | - | let | |
301 | - | let | |
302 | - | [IntegerEntry(( | |
234 | + | let J = toString(A.caller) | |
235 | + | let au = Q(J) | |
236 | + | let aa = au._1 | |
237 | + | let ab = au._2 | |
238 | + | let af = au._3 | |
239 | + | let V = au._4 | |
240 | + | [IntegerEntry((J + j), aa), IntegerEntry((J + k), ab), IntegerEntry((J + m), (af + 1)), IntegerEntry(l, (V + 1)), BooleanEntry((((J + "_") + at) + n), true)] | |
303 | 241 | } | |
304 | 242 | }) | |
305 | 243 | ||
306 | 244 | ||
307 | 245 | ||
308 | - | @Callable( | |
309 | - | func unstakeNFT ( | |
310 | - | let | |
311 | - | if (!(isDefined(getBoolean(this, ((( | |
246 | + | @Callable(A) | |
247 | + | func unstakeNFT (G) = valueOrElse(C(), { | |
248 | + | let J = toString(A.caller) | |
249 | + | if (!(isDefined(getBoolean(this, (((J + "_") + G) + n))))) | |
312 | 250 | then throw("You didn't staked") | |
313 | 251 | else { | |
314 | - | let | |
315 | - | let | |
316 | - | let | |
317 | - | let | |
318 | - | let | |
319 | - | [IntegerEntry(( | |
252 | + | let av = Q(J) | |
253 | + | let aa = av._1 | |
254 | + | let ab = av._2 | |
255 | + | let af = av._3 | |
256 | + | let V = av._4 | |
257 | + | [IntegerEntry((J + j), aa), IntegerEntry((J + k), ab), IntegerEntry((J + m), (af - 1)), IntegerEntry(l, (V - 1)), DeleteEntry((((J + "_") + G) + n)), ScriptTransfer(A.caller, 1, fromBase58String(G))] | |
320 | 258 | } | |
321 | 259 | }) | |
322 | 260 | ||
323 | 261 | ||
324 | 262 | ||
325 | - | @Callable(C) | |
326 | - | func issueNFT (ap,aS,aT) = valueOrElse(E(), valueOrElse(B(C), { | |
327 | - | let aU = valueOrErrorMessage(addressFromString(ap), "Wrong user address") | |
328 | - | let aV = Issue(aS, aT, 1, 0, false) | |
329 | - | let ad = calculateAssetId(aV) | |
330 | - | let af = valueOrElse(getString(this, s), "") | |
331 | - | let aW = (af + (if ((af != "")) | |
332 | - | then (c + toBase58String(ad)) | |
333 | - | else ("" + toBase58String(ad)))) | |
334 | - | [aV, StringEntry((toBase58String(ad) + o), ap), StringEntry(s, aW), ScriptTransfer(aU, 1, ad)] | |
263 | + | @Callable(A) | |
264 | + | func issueNFT (Y,aw,ax) = valueOrElse(C(), valueOrElse(z(A), { | |
265 | + | let ay = valueOrErrorMessage(addressFromString(Y), "Wrong user address") | |
266 | + | let az = Issue(aw, ax, 1, 0, false) | |
267 | + | let aA = calculateAssetId(az) | |
268 | + | [az, StringEntry((toBase58String(aA) + o), Y), ScriptTransfer(ay, 1, aA)] | |
335 | 269 | })) | |
336 | 270 | ||
337 | 271 | ||
338 | 272 | ||
339 | - | @Callable( | |
340 | - | func airdrop () = valueOrElse( | |
273 | + | @Callable(A) | |
274 | + | func airdrop () = valueOrElse(C(), valueOrElse(z(A), if ((size(A.payments) != 1)) | |
341 | 275 | then throw("One payment expected") | |
342 | 276 | else { | |
343 | - | let | |
344 | - | let | |
345 | - | let | |
346 | - | if (( | |
277 | + | let aB = $Tuple2(A.payments[0].amount, A.payments[0].assetId) | |
278 | + | let al = aB._1 | |
279 | + | let am = aB._2 | |
280 | + | if ((am != fromBase58String(y))) | |
347 | 281 | then throw("Wrong payment asset") | |
348 | 282 | else { | |
349 | - | let Y = getIntegerValue(this, r) | |
350 | - | let M = valueOrElse(getInteger(this, h), 0) | |
351 | - | let X = valueOrElse(getInteger(this, l), 0) | |
352 | - | let N = valueOrElse(getInteger(this, d), 0) | |
353 | - | let aY = valueOrElse(getInteger(this, i), 0) | |
354 | - | let aZ = if ((X == 0)) | |
355 | - | then $Tuple2(0, aH) | |
283 | + | let K = valueOrElse(getInteger(this, h), 0) | |
284 | + | let V = valueOrElse(getInteger(this, l), 0) | |
285 | + | let L = valueOrElse(getInteger(this, d), 0) | |
286 | + | let aC = valueOrElse(getInteger(this, i), 0) | |
287 | + | let aD = if ((V == 0)) | |
288 | + | then $Tuple2(0, al) | |
356 | 289 | else { | |
357 | - | let | |
358 | - | $Tuple2( | |
290 | + | let aE = fraction(al, V, 100) | |
291 | + | $Tuple2(aE, (al - aE)) | |
359 | 292 | } | |
360 | - | let | |
361 | - | let | |
362 | - | let | |
363 | - | then ( | |
364 | - | else | |
365 | - | let | |
366 | - | then ( | |
367 | - | else | |
368 | - | [IntegerEntry(d, | |
293 | + | let aF = aD._1 | |
294 | + | let aG = aD._2 | |
295 | + | let aH = if ((K > 0)) | |
296 | + | then (L + fraction(aG, a, K)) | |
297 | + | else L | |
298 | + | let aI = if ((V > 0)) | |
299 | + | then (aC + (aF / V)) | |
300 | + | else aC | |
301 | + | [IntegerEntry(d, aH), IntegerEntry(i, aI), IntegerEntry(p, al)] | |
369 | 302 | } | |
370 | 303 | })) | |
371 | 304 | ||
372 | 305 | ||
373 | 306 | ||
374 | - | @Callable( | |
375 | - | func activate () = valueOrElse( | |
307 | + | @Callable(A) | |
308 | + | func activate () = valueOrElse(z(A), if (valueOrElse(getBoolean(this, r), true)) | |
376 | 309 | then throw("dApp already active") | |
377 | - | else [BooleanEntry( | |
310 | + | else [BooleanEntry(r, true)]) | |
378 | 311 | ||
379 | 312 | ||
380 | 313 | ||
381 | - | @Callable( | |
382 | - | func shutdown () = valueOrElse( | |
314 | + | @Callable(A) | |
315 | + | func shutdown () = valueOrElse(z(A), if (!(valueOrElse(getBoolean(this, r), true))) | |
383 | 316 | then throw("dApp already shutdown") | |
384 | - | else [BooleanEntry( | |
317 | + | else [BooleanEntry(r, false)]) | |
385 | 318 | ||
386 | 319 | ||
387 | - | @Verifier( | |
388 | - | func | |
389 | - | let | |
390 | - | let | |
320 | + | @Verifier(aJ) | |
321 | + | func aK () = { | |
322 | + | let aL = { | |
323 | + | let aM = if (sigVerify(aJ.bodyBytes, aJ.proofs[0], v)) | |
391 | 324 | then 1 | |
392 | 325 | else 0 | |
393 | - | let | |
326 | + | let aN = if (sigVerify(aJ.bodyBytes, aJ.proofs[1], w)) | |
394 | 327 | then 1 | |
395 | 328 | else 0 | |
396 | - | let | |
329 | + | let aO = if (sigVerify(aJ.bodyBytes, aJ.proofs[2], x)) | |
397 | 330 | then 1 | |
398 | 331 | else 0 | |
399 | - | ((( | |
332 | + | (((aM + aN) + aO) >= 2) | |
400 | 333 | } | |
401 | - | let | |
402 | - | if ($isInstanceOf( | |
334 | + | let F = aJ | |
335 | + | if ($isInstanceOf(F, "InvokeScriptTransaction")) | |
403 | 336 | then { | |
404 | - | let | |
405 | - | let | |
406 | - | let | |
407 | - | then ( | |
337 | + | let aP = F | |
338 | + | let aQ = sigVerify(aJ.bodyBytes, aJ.proofs[0], aJ.senderPublicKey) | |
339 | + | let aR = if ((aP.fee == 900000)) | |
340 | + | then (aP.feeAssetId == unit) | |
408 | 341 | else false | |
409 | - | let | |
410 | - | let | |
411 | - | if (if (if (if ( | |
412 | - | then | |
342 | + | let aS = (aP.function == "init") | |
343 | + | let aT = (size(aP.payments) == 0) | |
344 | + | if (if (if (if (aR) | |
345 | + | then aS | |
413 | 346 | else false) | |
414 | - | then | |
347 | + | then aQ | |
415 | 348 | else false) | |
416 | - | then | |
349 | + | then aT | |
417 | 350 | else false) | |
418 | 351 | then true | |
419 | - | else | |
352 | + | else aL | |
420 | 353 | } | |
421 | - | else | |
354 | + | else aL | |
422 | 355 | } | |
423 | 356 |
github/deemru/w8io/169f3d6 140.40 ms ◑