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