tx · A58P45XBxWJVReZM3jtpcTPjNFDBCPrSiJXboKL9HHWK 3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe: -0.01500000 Waves 2024.12.27 22:02 [3433324] smart account 3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe > SELF 0.00000000 Waves
{ "type": 13, "id": "A58P45XBxWJVReZM3jtpcTPjNFDBCPrSiJXboKL9HHWK", "fee": 1500000, "feeAssetId": null, "timestamp": 1735326226293, "version": 2, "chainId": 84, "sender": "3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe", "senderPublicKey": "CqqNd9FdJdY64okp1oAAQ8z3kyrEcd6UKxtboqZgrSaP", "proofs": [ "5CNfxYmcrp3vxFDF2qYutGS2iXCEkE1ZDmtGwzf6Q29E2C7jRzJBpmVBpTdB5a6dv9iQREbUDw38Y7dbCjAmPy6p" ], "script": "base64:BgIWCAISAwoBCBIAEgQKAgQIEgASAwoBCCEBB2dldEJvb2wBA2tleQQHJG1hdGNoMAkAmwgCBQR0aGlzBQNrZXkDCQABAgUHJG1hdGNoMAIHQm9vbGVhbgQBYgUHJG1hdGNoMAUBYgcBCWlzVGVzdEVudgAJAQdnZXRCb29sAQIHVEVTVEVOVgEXc3RhdGljS2V5X29yYWNsZUFkZHJlc3MAAhRzdGF0aWNfb3JhY2xlQWRkcmVzcwEYc3RhdGljS2V5X2JyZWVkZXJBZGRyZXNzAAIVc3RhdGljX2JyZWVkZXJBZGRyZXNzARZzdGF0aWNLZXlfaXRlbXNBZGRyZXNzAAITc3RhdGljX2l0ZW1zQWRkcmVzcwESc3RhdGljS2V5X2V4dHJhRmVlAAIPc3RhdGljX2V4dHJhRmVlARhzdGF0aWNLZXlfZXh0cmFGZWVSZW1vdmUAAhVzdGF0aWNfZXh0cmFGZWVSZW1vdmUBF3N0YXRpY0tleV9mZWVBZ2dyZWdhdG9yAAIUc3RhdGljX2ZlZUFnZ3JlZ2F0b3IACXdlYXJhYmxlcwkAzAgCAghBUlQtQ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J0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQlmaXJzdFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFCWZpcnN0VXNlcgABAAAEEHNlY29uZFVzZXJTaWduZWQDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAABQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQpzZWNvbmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwACBQpzZWNvbmRVc2VyAAEAAAQPdGhpcmRVc2VyU2lnbmVkAwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAUJdGhpcmRVc2VyAAEDCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwABBQl0aGlyZFVzZXIAAQMJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAIFCXRoaXJkVXNlcgABAAAED3NpZ25hdHVyZXNDb3VudAkAZAIJAGQCBQ9maXJzdFVzZXJTaWduZWQFEHNlY29uZFVzZXJTaWduZWQFD3RoaXJkVXNlclNpZ25lZAQHJG1hdGNoMAUCdHgJAGcCBQ9zaWduYXR1cmVzQ291bnQAAkab6oA=", "height": 3433324, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GcfYNFwa8wzERYTomDtNgdyEtAhTjfH3T5qHYn36Lcjz Next: ADWHsvHiAEdRJBP3w8b2uNUxPrpsxS7PWuM9cxPuuGuL Diff:
Old | New | Differences | |
---|---|---|---|
329 | 329 | } | |
330 | 330 | ||
331 | 331 | ||
332 | + | ||
333 | + | @Callable(i) | |
334 | + | func calculateWearblesBoost (duckId) = { | |
335 | + | let back = tryGetString(keyTypesDuck(duckId, "BACK")) | |
336 | + | let head = tryGetString(keyTypesDuck(duckId, "HEAD")) | |
337 | + | let left_wing = tryGetString(keyTypesDuck(duckId, "LEFT_WING")) | |
338 | + | let right_wing = tryGetString(keyTypesDuck(duckId, "RIGHT_WING")) | |
339 | + | let top = tryGetString(keyTypesDuck(duckId, "TOP")) | |
340 | + | let pet = tryGetString(keyTypesDuck(duckId, "PET")) | |
341 | + | let tail = tryGetString(keyTypesDuck(duckId, "TAIL")) | |
342 | + | let accessory = tryGetString(keyTypesDuck(duckId, "ACCESSORY")) | |
343 | + | let assetIdArray = [back, head, left_wing, right_wing, top, pet, tail, accessory] | |
344 | + | func countTotalBoost (acc,assetId) = if ((assetId != "")) | |
345 | + | then { | |
346 | + | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetId], nil)) | |
347 | + | if ((artefactName == artefactName)) | |
348 | + | then { | |
349 | + | let boost = valueOrErrorMessage(getInteger(("boost_" + artefactName)), ("No boost found for " + artefactName)) | |
350 | + | (acc + boost) | |
351 | + | } | |
352 | + | else throw("Strict value is not equal to itself.") | |
353 | + | } | |
354 | + | else acc | |
355 | + | ||
356 | + | let totalBoost = { | |
357 | + | let $l = assetIdArray | |
358 | + | let $s = size($l) | |
359 | + | let $acc0 = 0 | |
360 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
361 | + | then $a | |
362 | + | else countTotalBoost($a, $l[$i]) | |
363 | + | ||
364 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
365 | + | then $a | |
366 | + | else throw("List size exceeds 8") | |
367 | + | ||
368 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
369 | + | } | |
370 | + | $Tuple2([IntegerEntry("totalBoost", totalBoost)], totalBoost) | |
371 | + | } | |
372 | + | ||
373 | + | ||
332 | 374 | @Verifier(tx) | |
333 | 375 | func verify () = if (isTestEnv()) | |
334 | 376 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getBool (key) = match getBoolean(this, key) { | |
5 | 5 | case b: Boolean => | |
6 | 6 | b | |
7 | 7 | case _ => | |
8 | 8 | false | |
9 | 9 | } | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func isTestEnv () = getBool("TESTENV") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func staticKey_oracleAddress () = "static_oracleAddress" | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func staticKey_breederAddress () = "static_breederAddress" | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func staticKey_itemsAddress () = "static_itemsAddress" | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func staticKey_extraFee () = "static_extraFee" | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func staticKey_extraFeeRemove () = "static_extraFeeRemove" | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func staticKey_feeAggregator () = "static_feeAggregator" | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | let wearables = ["ART-CAPE", "ART-HAT", "ART-XSCARF", "ART-XSWEATER"] | |
34 | 34 | ||
35 | 35 | func keyArtefactDuck (duckId,wearable) = ((duckId + "_") + wearable) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyTypesDuck (duckId,type) = ((duckId + "_") + type) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
42 | 42 | case a: String => | |
43 | 43 | a | |
44 | 44 | case _ => | |
45 | 45 | "" | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func tryGetString (key) = tryGetStringExternal(this, key) | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func asInt (value) = match value { | |
53 | 53 | case int: Int => | |
54 | 54 | int | |
55 | 55 | case _ => | |
56 | 56 | throw("wrong type, expected: Int") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func asString (value) = match value { | |
61 | 61 | case string: String => | |
62 | 62 | string | |
63 | 63 | case _ => | |
64 | 64 | throw("wrong type, expected: String") | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_breederAddress()))) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress()))) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func getTurtleIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleIncubatorAddress"))) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func getTurtleBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleBreederAddress"))) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_incubatorAddress"))) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func getCanineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineIncubatorAddress"))) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func getCanineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineBreederAddress"))) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getFelineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineIncubatorAddress"))) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getFelineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineBreederAddress"))) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func getMutantBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_mutantIncubatorAddress"))) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func checkAdditionalPayment (payment,amountOverride) = if (isDefined(payment.assetId)) | |
105 | 105 | then throw("WCAP: Please attach waves") | |
106 | 106 | else { | |
107 | 107 | let feeAmount = if ((amountOverride != 0)) | |
108 | 108 | then amountOverride | |
109 | 109 | else getIntegerValue(getOracle(), staticKey_extraFee()) | |
110 | 110 | if ((payment.amount != feeAmount)) | |
111 | 111 | then throw((("WCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
112 | 112 | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
113 | 113 | } | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func tryGetCosmeticItem (item) = { | |
117 | 117 | let key = ("direct_cosmetic_" + item) | |
118 | 118 | match getInteger(getItemsAddress(), key) { | |
119 | 119 | case a: Int => | |
120 | 120 | a | |
121 | 121 | case _ => | |
122 | 122 | unit | |
123 | 123 | } | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func tryGetType (wearable) = tryGetStringExternal(getItemsAddress(), ("type_cosmetic_" + wearable)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func wearItem (assetIdWearAble,duckId,allTypes) = { | |
131 | 131 | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetIdWearAble], nil)) | |
132 | 132 | if ((artefactName == artefactName)) | |
133 | 133 | then if (if (!(containsElement(wearables, artefactName))) | |
134 | 134 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
135 | 135 | else false) | |
136 | 136 | then throw("WRITD: Unsupported wearable") | |
137 | 137 | else { | |
138 | 138 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
139 | 139 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
140 | 140 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
141 | 141 | else nil | |
142 | 142 | if ((boostDuck == boostDuck)) | |
143 | 143 | then if ((artefactId != "")) | |
144 | 144 | then throw(("Duck is already wearing a " + artefactName)) | |
145 | 145 | else { | |
146 | 146 | let type = tryGetType(artefactName) | |
147 | 147 | if (if (!(allTypes)) | |
148 | 148 | then (type != "PET") | |
149 | 149 | else false) | |
150 | 150 | then throw("You can't attach this item to your NFT! Pets only!") | |
151 | 151 | else { | |
152 | 152 | let typeOnDuck = if ((type != "")) | |
153 | 153 | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
154 | 154 | else throw(("Type undefined, please contact admins " + artefactName)) | |
155 | 155 | if (typeOnDuck) | |
156 | 156 | then throw("You can only attach 1 from each type to your duck!") | |
157 | 157 | else { | |
158 | 158 | let typeResult = if ((type != "")) | |
159 | 159 | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
160 | 160 | else nil | |
161 | 161 | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
162 | 162 | } | |
163 | 163 | } | |
164 | 164 | } | |
165 | 165 | else throw("Strict value is not equal to itself.") | |
166 | 166 | } | |
167 | 167 | else throw("Strict value is not equal to itself.") | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func tryGetBooleanExternal (address,key) = match getBoolean(address, key) { | |
172 | 172 | case b: Boolean => | |
173 | 173 | b | |
174 | 174 | case _ => | |
175 | 175 | false | |
176 | 176 | } | |
177 | 177 | ||
178 | 178 | ||
179 | 179 | func getIfAllTypesAllowed (assetId) = { | |
180 | 180 | let issuer = value(assetInfo(assetId)).issuer | |
181 | 181 | let blacklisted = tryGetBooleanExternal(issuer, (toBase58String(assetId) + "_blacklisted")) | |
182 | 182 | if (blacklisted) | |
183 | 183 | then throw("GO FUCK YOURSELF") | |
184 | 184 | else { | |
185 | 185 | let name = value(assetInfo(assetId)).name | |
186 | 186 | if (if ((issuer == getIncubatorAddress())) | |
187 | 187 | then true | |
188 | 188 | else (issuer == getBreederAddress())) | |
189 | 189 | then true | |
190 | 190 | else if (if ((issuer == getTurtleIncubatorAddress())) | |
191 | 191 | then true | |
192 | 192 | else (issuer == getTurtleBreederAddress())) | |
193 | 193 | then false | |
194 | 194 | else if (if ((issuer == getCanineIncubatorAddress())) | |
195 | 195 | then true | |
196 | 196 | else (issuer == getCanineBreederAddress())) | |
197 | 197 | then false | |
198 | 198 | else if (if ((issuer == getFelineIncubatorAddress())) | |
199 | 199 | then true | |
200 | 200 | else (issuer == getFelineBreederAddress())) | |
201 | 201 | then false | |
202 | 202 | else if ((issuer == getMutantBreederAddress())) | |
203 | 203 | then false | |
204 | 204 | else throw("MAG: Asset is not supported") | |
205 | 205 | } | |
206 | 206 | } | |
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(i) | |
210 | 210 | func configureOracle (oracle) = if ((i.caller != this)) | |
211 | 211 | then throw("admin only") | |
212 | 212 | else [StringEntry(staticKey_oracleAddress(), oracle)] | |
213 | 213 | ||
214 | 214 | ||
215 | 215 | ||
216 | 216 | @Callable(i) | |
217 | 217 | func wearItemToDuck () = { | |
218 | 218 | let firstPayment = value(i.payments[0]) | |
219 | 219 | let secondPayment = value(i.payments[1]) | |
220 | 220 | let validPayment = checkAdditionalPayment(i.payments[2], 0) | |
221 | 221 | let duckId = toBase58String(value(firstPayment.assetId)) | |
222 | 222 | let secondAssetId = toBase58String(value(secondPayment.assetId)) | |
223 | 223 | if (if ((firstPayment.amount != 1)) | |
224 | 224 | then true | |
225 | 225 | else (secondPayment.amount != 1)) | |
226 | 226 | then throw("WRITD: NFT is not attached") | |
227 | 227 | else { | |
228 | 228 | let allTypes = getIfAllTypesAllowed(value(firstPayment.assetId)) | |
229 | 229 | ((wearItem(secondAssetId, duckId, allTypes) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
230 | 230 | } | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | ||
235 | 235 | @Callable(i) | |
236 | 236 | func removeItemFromDuck (burnItem,artefactName) = { | |
237 | 237 | let wavesFee = if (burnItem) | |
238 | 238 | then 0 | |
239 | 239 | else getIntegerValue(getOracle(), staticKey_extraFeeRemove()) | |
240 | 240 | let duckPayment = value(i.payments[0]) | |
241 | 241 | let roboDuckPayment = value(i.payments[1]) | |
242 | 242 | let validPayment = checkAdditionalPayment(i.payments[2], wavesFee) | |
243 | 243 | let duckId = toBase58String(value(duckPayment.assetId)) | |
244 | 244 | let roboDuckId = toBase58String(value(roboDuckPayment.assetId)) | |
245 | 245 | if (if ((duckPayment.amount != 1)) | |
246 | 246 | then true | |
247 | 247 | else (roboDuckPayment.amount != 1)) | |
248 | 248 | then throw("WRITD: NFT is not attached") | |
249 | 249 | else { | |
250 | 250 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
251 | 251 | if ((children == children)) | |
252 | 252 | then { | |
253 | 253 | let artefactNameRoboduck = asString(invoke(getItemsAddress(), "checkArtefactDetails", [roboDuckId], nil)) | |
254 | 254 | if ((artefactNameRoboduck == artefactNameRoboduck)) | |
255 | 255 | then if ((artefactNameRoboduck != "ART-ROBODUCK")) | |
256 | 256 | then throw("Only rododuck can remove items!") | |
257 | 257 | else if (if (!(containsElement(wearables, artefactName))) | |
258 | 258 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
259 | 259 | else false) | |
260 | 260 | then throw("WRITD: Unsupported wearable") | |
261 | 261 | else { | |
262 | 262 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
263 | 263 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
264 | 264 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
265 | 265 | else nil | |
266 | 266 | if ((boostDuck == boostDuck)) | |
267 | 267 | then if ((artefactId == "")) | |
268 | 268 | then throw(("Duck not wearing a " + artefactName)) | |
269 | 269 | else { | |
270 | 270 | let type = tryGetType(artefactName) | |
271 | 271 | let typeResult = if ((type != "")) | |
272 | 272 | then [DeleteEntry(keyTypesDuck(duckId, type))] | |
273 | 273 | else nil | |
274 | 274 | let burn = if (burnItem) | |
275 | 275 | then [Burn(fromBase58String(artefactId), 1)] | |
276 | 276 | else [ScriptTransfer(i.caller, 1, fromBase58String(artefactId))] | |
277 | 277 | ((([DeleteEntry(keyArtefactDuck(duckId, artefactName)), ScriptTransfer(i.caller, 1, duckPayment.assetId), Burn(fromBase58String(roboDuckId), 1)] ++ burn) ++ validPayment) ++ typeResult) | |
278 | 278 | } | |
279 | 279 | else throw("Strict value is not equal to itself.") | |
280 | 280 | } | |
281 | 281 | else throw("Strict value is not equal to itself.") | |
282 | 282 | } | |
283 | 283 | else throw("Strict value is not equal to itself.") | |
284 | 284 | } | |
285 | 285 | } | |
286 | 286 | ||
287 | 287 | ||
288 | 288 | ||
289 | 289 | @Callable(i) | |
290 | 290 | func wearXItemsToDuck () = { | |
291 | 291 | let validPayment = checkAdditionalPayment(i.payments[1], 0) | |
292 | 292 | if ((3 > size(i.payments))) | |
293 | 293 | then throw("WWXITD: Please attach at least 1 item and 1 duck!") | |
294 | 294 | else if ((size(i.payments) > 7)) | |
295 | 295 | then throw("WWXITD: You can only attach 5 items and one duck!") | |
296 | 296 | else { | |
297 | 297 | func handleItem (acc,payment) = { | |
298 | 298 | let index = indexOf(i.payments, payment) | |
299 | 299 | if ((index == 0)) | |
300 | 300 | then { | |
301 | 301 | let duckId = toBase58String(value(payment.assetId)) | |
302 | 302 | if ((payment.amount != 1)) | |
303 | 303 | then throw("WRITD: Duck is not attached") | |
304 | 304 | else { | |
305 | 305 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
306 | 306 | if ((children == children)) | |
307 | 307 | then (acc ++ [ScriptTransfer(i.caller, 1, payment.assetId)]) | |
308 | 308 | else throw("Strict value is not equal to itself.") | |
309 | 309 | } | |
310 | 310 | } | |
311 | 311 | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)), true)) | |
312 | 312 | } | |
313 | 313 | ||
314 | 314 | ({ | |
315 | 315 | let $l = i.payments | |
316 | 316 | let $s = size($l) | |
317 | 317 | let $acc0 = nil | |
318 | 318 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
319 | 319 | then $a | |
320 | 320 | else handleItem($a, $l[$i]) | |
321 | 321 | ||
322 | 322 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
323 | 323 | then $a | |
324 | 324 | else throw("List size exceeds 6") | |
325 | 325 | ||
326 | 326 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
327 | 327 | } ++ validPayment) | |
328 | 328 | } | |
329 | 329 | } | |
330 | 330 | ||
331 | 331 | ||
332 | + | ||
333 | + | @Callable(i) | |
334 | + | func calculateWearblesBoost (duckId) = { | |
335 | + | let back = tryGetString(keyTypesDuck(duckId, "BACK")) | |
336 | + | let head = tryGetString(keyTypesDuck(duckId, "HEAD")) | |
337 | + | let left_wing = tryGetString(keyTypesDuck(duckId, "LEFT_WING")) | |
338 | + | let right_wing = tryGetString(keyTypesDuck(duckId, "RIGHT_WING")) | |
339 | + | let top = tryGetString(keyTypesDuck(duckId, "TOP")) | |
340 | + | let pet = tryGetString(keyTypesDuck(duckId, "PET")) | |
341 | + | let tail = tryGetString(keyTypesDuck(duckId, "TAIL")) | |
342 | + | let accessory = tryGetString(keyTypesDuck(duckId, "ACCESSORY")) | |
343 | + | let assetIdArray = [back, head, left_wing, right_wing, top, pet, tail, accessory] | |
344 | + | func countTotalBoost (acc,assetId) = if ((assetId != "")) | |
345 | + | then { | |
346 | + | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetId], nil)) | |
347 | + | if ((artefactName == artefactName)) | |
348 | + | then { | |
349 | + | let boost = valueOrErrorMessage(getInteger(("boost_" + artefactName)), ("No boost found for " + artefactName)) | |
350 | + | (acc + boost) | |
351 | + | } | |
352 | + | else throw("Strict value is not equal to itself.") | |
353 | + | } | |
354 | + | else acc | |
355 | + | ||
356 | + | let totalBoost = { | |
357 | + | let $l = assetIdArray | |
358 | + | let $s = size($l) | |
359 | + | let $acc0 = 0 | |
360 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
361 | + | then $a | |
362 | + | else countTotalBoost($a, $l[$i]) | |
363 | + | ||
364 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
365 | + | then $a | |
366 | + | else throw("List size exceeds 8") | |
367 | + | ||
368 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8) | |
369 | + | } | |
370 | + | $Tuple2([IntegerEntry("totalBoost", totalBoost)], totalBoost) | |
371 | + | } | |
372 | + | ||
373 | + | ||
332 | 374 | @Verifier(tx) | |
333 | 375 | func verify () = if (isTestEnv()) | |
334 | 376 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
335 | 377 | else { | |
336 | 378 | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
337 | 379 | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
338 | 380 | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
339 | 381 | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
340 | 382 | then 1 | |
341 | 383 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
342 | 384 | then 1 | |
343 | 385 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
344 | 386 | then 1 | |
345 | 387 | else 0 | |
346 | 388 | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
347 | 389 | then 1 | |
348 | 390 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
349 | 391 | then 1 | |
350 | 392 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
351 | 393 | then 1 | |
352 | 394 | else 0 | |
353 | 395 | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
354 | 396 | then 1 | |
355 | 397 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
356 | 398 | then 1 | |
357 | 399 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
358 | 400 | then 1 | |
359 | 401 | else 0 | |
360 | 402 | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
361 | 403 | match tx { | |
362 | 404 | case _ => | |
363 | 405 | (signaturesCount >= 2) | |
364 | 406 | } | |
365 | 407 | } | |
366 | 408 |
github/deemru/w8io/169f3d6 41.01 ms ◑