tx · GcfYNFwa8wzERYTomDtNgdyEtAhTjfH3T5qHYn36Lcjz 3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe: -0.01300000 Waves 2024.10.18 21:20 [3332593] smart account 3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe > SELF 0.00000000 Waves
{ "type": 13, "id": "GcfYNFwa8wzERYTomDtNgdyEtAhTjfH3T5qHYn36Lcjz", "fee": 1300000, "feeAssetId": null, "timestamp": 1729275638246, "version": 2, "chainId": 84, "sender": "3N1oZwpYE3p4x63jWiKpszmfLU3Lk3KtSWe", "senderPublicKey": "CqqNd9FdJdY64okp1oAAQ8z3kyrEcd6UKxtboqZgrSaP", "proofs": [ "4sSPXx3Ux8PE7hJi4T9obZxnUnZaQRUMsB1Aux6owCc1t2RP5xFEgeUPNFFvSXirzLB4xGGpooRwFssK4MR9H2sN" ], "script": "base64:BgIRCAISAwoBCBIAEgQKAgQIEgAhAQdnZXRCb29sAQNrZXkEByRtYXRjaDAJAJsIAgUEdGhpcwUDa2V5AwkAAQIFByRtYXRjaDACB0Jvb2xlYW4EAWIFByRtYXRjaDAFAWIHAQlpc1Rlc3RFbnYACQEHZ2V0Qm9vbAECB1RFU1RFTlYBF3N0YXRpY0tleV9vcmFjbGVBZGRyZXNzAAIUc3RhdGljX29yYWNsZUFkZHJlc3MBGHN0YXRpY0tleV9icmVlZGVyQWRkcmVzcwACFXN0YXRpY19icmVlZGVyQWRkcmVzcwEWc3RhdGljS2V5X2l0ZW1zQWRkcmVzcwACE3N0YXRpY19pdGVtc0FkZHJlc3MBEnN0YXRpY0tleV9leHRyYUZlZQACD3N0YXRpY19leHRyYUZlZQEYc3RhdGljS2V5X2V4dHJhRmVlUmVtb3ZlAAIVc3RhdGljX2V4dHJhRmVlUmVtb3ZlARdzdGF0aWNLZXlfZmVlQWdncmVnYXRvcgACFHN0YXRpY19mZWVBZ2dyZWdhdG9yAAl3ZWFyYWJsZXMJAMwIAgIIQVJULUNBUEUJAMwIA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PdGhpcmRVc2VyU2lnbmVkBAckbWF0Y2gwBQJ0eAkAZwIFD3NpZ25hdHVyZXNDb3VudAACKsHjUg==", "height": 3332593, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J1dfTGD5c2L46L9o891ki6iC66cKaeUQu7W9v9EBhYag Next: A58P45XBxWJVReZM3jtpcTPjNFDBCPrSiJXboKL9HHWK Diff:
Old | New | Differences | |
---|---|---|---|
77 | 77 | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
78 | 78 | ||
79 | 79 | ||
80 | + | func getTurtleIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleIncubatorAddress"))) | |
81 | + | ||
82 | + | ||
83 | + | func getTurtleBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleBreederAddress"))) | |
84 | + | ||
85 | + | ||
86 | + | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_incubatorAddress"))) | |
87 | + | ||
88 | + | ||
89 | + | func getCanineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineIncubatorAddress"))) | |
90 | + | ||
91 | + | ||
92 | + | func getCanineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineBreederAddress"))) | |
93 | + | ||
94 | + | ||
95 | + | func getFelineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineIncubatorAddress"))) | |
96 | + | ||
97 | + | ||
98 | + | func getFelineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineBreederAddress"))) | |
99 | + | ||
100 | + | ||
101 | + | func getMutantBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_mutantIncubatorAddress"))) | |
102 | + | ||
103 | + | ||
80 | 104 | func checkAdditionalPayment (payment,amountOverride) = if (isDefined(payment.assetId)) | |
81 | 105 | then throw("WCAP: Please attach waves") | |
82 | 106 | else { | |
103 | 127 | func tryGetType (wearable) = tryGetStringExternal(getItemsAddress(), ("type_cosmetic_" + wearable)) | |
104 | 128 | ||
105 | 129 | ||
106 | - | func wearItem (assetIdWearAble,duckId) = { | |
130 | + | func wearItem (assetIdWearAble,duckId,allTypes) = { | |
107 | 131 | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetIdWearAble], nil)) | |
108 | 132 | if ((artefactName == artefactName)) | |
109 | 133 | then if (if (!(containsElement(wearables, artefactName))) | |
120 | 144 | then throw(("Duck is already wearing a " + artefactName)) | |
121 | 145 | else { | |
122 | 146 | let type = tryGetType(artefactName) | |
123 | - | let typeOnDuck = if ((type != "")) | |
124 | - | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
125 | - | else throw(("Type undefined, please contact admins " + artefactName)) | |
126 | - | if (typeOnDuck) | |
127 | - | then throw("You can only attach 1 from each type to your duck!") | |
147 | + | if (if (!(allTypes)) | |
148 | + | then (type != "PET") | |
149 | + | else false) | |
150 | + | then throw("You can't attach this item to your NFT! Pets only!") | |
128 | 151 | else { | |
129 | - | let typeResult = if ((type != "")) | |
130 | - | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
131 | - | else nil | |
132 | - | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
152 | + | let typeOnDuck = if ((type != "")) | |
153 | + | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
154 | + | else throw(("Type undefined, please contact admins " + artefactName)) | |
155 | + | if (typeOnDuck) | |
156 | + | then throw("You can only attach 1 from each type to your duck!") | |
157 | + | else { | |
158 | + | let typeResult = if ((type != "")) | |
159 | + | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
160 | + | else nil | |
161 | + | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
162 | + | } | |
133 | 163 | } | |
134 | 164 | } | |
135 | 165 | else throw("Strict value is not equal to itself.") | |
136 | 166 | } | |
137 | 167 | else throw("Strict value is not equal to itself.") | |
168 | + | } | |
169 | + | ||
170 | + | ||
171 | + | func tryGetBooleanExternal (address,key) = match getBoolean(address, key) { | |
172 | + | case b: Boolean => | |
173 | + | b | |
174 | + | case _ => | |
175 | + | false | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | func getIfAllTypesAllowed (assetId) = { | |
180 | + | let issuer = value(assetInfo(assetId)).issuer | |
181 | + | let blacklisted = tryGetBooleanExternal(issuer, (toBase58String(assetId) + "_blacklisted")) | |
182 | + | if (blacklisted) | |
183 | + | then throw("GO FUCK YOURSELF") | |
184 | + | else { | |
185 | + | let name = value(assetInfo(assetId)).name | |
186 | + | if (if ((issuer == getIncubatorAddress())) | |
187 | + | then true | |
188 | + | else (issuer == getBreederAddress())) | |
189 | + | then true | |
190 | + | else if (if ((issuer == getTurtleIncubatorAddress())) | |
191 | + | then true | |
192 | + | else (issuer == getTurtleBreederAddress())) | |
193 | + | then false | |
194 | + | else if (if ((issuer == getCanineIncubatorAddress())) | |
195 | + | then true | |
196 | + | else (issuer == getCanineBreederAddress())) | |
197 | + | then false | |
198 | + | else if (if ((issuer == getFelineIncubatorAddress())) | |
199 | + | then true | |
200 | + | else (issuer == getFelineBreederAddress())) | |
201 | + | then false | |
202 | + | else if ((issuer == getMutantBreederAddress())) | |
203 | + | then false | |
204 | + | else throw("MAG: Asset is not supported") | |
205 | + | } | |
138 | 206 | } | |
139 | 207 | ||
140 | 208 | ||
157 | 225 | else (secondPayment.amount != 1)) | |
158 | 226 | then throw("WRITD: NFT is not attached") | |
159 | 227 | else { | |
160 | - | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
161 | - | if ((children == children)) | |
162 | - | then ((wearItem(secondAssetId, duckId) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
163 | - | else throw("Strict value is not equal to itself.") | |
228 | + | let allTypes = getIfAllTypesAllowed(value(firstPayment.assetId)) | |
229 | + | ((wearItem(secondAssetId, duckId, allTypes) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
164 | 230 | } | |
165 | 231 | } | |
166 | 232 | ||
242 | 308 | else throw("Strict value is not equal to itself.") | |
243 | 309 | } | |
244 | 310 | } | |
245 | - | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)))) | |
311 | + | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)), true)) | |
246 | 312 | } | |
247 | 313 | ||
248 | 314 | ({ |
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 | + | func getTurtleIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleIncubatorAddress"))) | |
81 | + | ||
82 | + | ||
83 | + | func getTurtleBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleBreederAddress"))) | |
84 | + | ||
85 | + | ||
86 | + | func getIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_incubatorAddress"))) | |
87 | + | ||
88 | + | ||
89 | + | func getCanineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineIncubatorAddress"))) | |
90 | + | ||
91 | + | ||
92 | + | func getCanineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_canineBreederAddress"))) | |
93 | + | ||
94 | + | ||
95 | + | func getFelineIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineIncubatorAddress"))) | |
96 | + | ||
97 | + | ||
98 | + | func getFelineBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_felineBreederAddress"))) | |
99 | + | ||
100 | + | ||
101 | + | func getMutantBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_mutantIncubatorAddress"))) | |
102 | + | ||
103 | + | ||
80 | 104 | func checkAdditionalPayment (payment,amountOverride) = if (isDefined(payment.assetId)) | |
81 | 105 | then throw("WCAP: Please attach waves") | |
82 | 106 | else { | |
83 | 107 | let feeAmount = if ((amountOverride != 0)) | |
84 | 108 | then amountOverride | |
85 | 109 | else getIntegerValue(getOracle(), staticKey_extraFee()) | |
86 | 110 | if ((payment.amount != feeAmount)) | |
87 | 111 | then throw((("WCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
88 | 112 | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
89 | 113 | } | |
90 | 114 | ||
91 | 115 | ||
92 | 116 | func tryGetCosmeticItem (item) = { | |
93 | 117 | let key = ("direct_cosmetic_" + item) | |
94 | 118 | match getInteger(getItemsAddress(), key) { | |
95 | 119 | case a: Int => | |
96 | 120 | a | |
97 | 121 | case _ => | |
98 | 122 | unit | |
99 | 123 | } | |
100 | 124 | } | |
101 | 125 | ||
102 | 126 | ||
103 | 127 | func tryGetType (wearable) = tryGetStringExternal(getItemsAddress(), ("type_cosmetic_" + wearable)) | |
104 | 128 | ||
105 | 129 | ||
106 | - | func wearItem (assetIdWearAble,duckId) = { | |
130 | + | func wearItem (assetIdWearAble,duckId,allTypes) = { | |
107 | 131 | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetIdWearAble], nil)) | |
108 | 132 | if ((artefactName == artefactName)) | |
109 | 133 | then if (if (!(containsElement(wearables, artefactName))) | |
110 | 134 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
111 | 135 | else false) | |
112 | 136 | then throw("WRITD: Unsupported wearable") | |
113 | 137 | else { | |
114 | 138 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
115 | 139 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
116 | 140 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
117 | 141 | else nil | |
118 | 142 | if ((boostDuck == boostDuck)) | |
119 | 143 | then if ((artefactId != "")) | |
120 | 144 | then throw(("Duck is already wearing a " + artefactName)) | |
121 | 145 | else { | |
122 | 146 | let type = tryGetType(artefactName) | |
123 | - | let typeOnDuck = if ((type != "")) | |
124 | - | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
125 | - | else throw(("Type undefined, please contact admins " + artefactName)) | |
126 | - | if (typeOnDuck) | |
127 | - | then throw("You can only attach 1 from each type to your duck!") | |
147 | + | if (if (!(allTypes)) | |
148 | + | then (type != "PET") | |
149 | + | else false) | |
150 | + | then throw("You can't attach this item to your NFT! Pets only!") | |
128 | 151 | else { | |
129 | - | let typeResult = if ((type != "")) | |
130 | - | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
131 | - | else nil | |
132 | - | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
152 | + | let typeOnDuck = if ((type != "")) | |
153 | + | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
154 | + | else throw(("Type undefined, please contact admins " + artefactName)) | |
155 | + | if (typeOnDuck) | |
156 | + | then throw("You can only attach 1 from each type to your duck!") | |
157 | + | else { | |
158 | + | let typeResult = if ((type != "")) | |
159 | + | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
160 | + | else nil | |
161 | + | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
162 | + | } | |
133 | 163 | } | |
134 | 164 | } | |
135 | 165 | else throw("Strict value is not equal to itself.") | |
136 | 166 | } | |
137 | 167 | else throw("Strict value is not equal to itself.") | |
168 | + | } | |
169 | + | ||
170 | + | ||
171 | + | func tryGetBooleanExternal (address,key) = match getBoolean(address, key) { | |
172 | + | case b: Boolean => | |
173 | + | b | |
174 | + | case _ => | |
175 | + | false | |
176 | + | } | |
177 | + | ||
178 | + | ||
179 | + | func getIfAllTypesAllowed (assetId) = { | |
180 | + | let issuer = value(assetInfo(assetId)).issuer | |
181 | + | let blacklisted = tryGetBooleanExternal(issuer, (toBase58String(assetId) + "_blacklisted")) | |
182 | + | if (blacklisted) | |
183 | + | then throw("GO FUCK YOURSELF") | |
184 | + | else { | |
185 | + | let name = value(assetInfo(assetId)).name | |
186 | + | if (if ((issuer == getIncubatorAddress())) | |
187 | + | then true | |
188 | + | else (issuer == getBreederAddress())) | |
189 | + | then true | |
190 | + | else if (if ((issuer == getTurtleIncubatorAddress())) | |
191 | + | then true | |
192 | + | else (issuer == getTurtleBreederAddress())) | |
193 | + | then false | |
194 | + | else if (if ((issuer == getCanineIncubatorAddress())) | |
195 | + | then true | |
196 | + | else (issuer == getCanineBreederAddress())) | |
197 | + | then false | |
198 | + | else if (if ((issuer == getFelineIncubatorAddress())) | |
199 | + | then true | |
200 | + | else (issuer == getFelineBreederAddress())) | |
201 | + | then false | |
202 | + | else if ((issuer == getMutantBreederAddress())) | |
203 | + | then false | |
204 | + | else throw("MAG: Asset is not supported") | |
205 | + | } | |
138 | 206 | } | |
139 | 207 | ||
140 | 208 | ||
141 | 209 | @Callable(i) | |
142 | 210 | func configureOracle (oracle) = if ((i.caller != this)) | |
143 | 211 | then throw("admin only") | |
144 | 212 | else [StringEntry(staticKey_oracleAddress(), oracle)] | |
145 | 213 | ||
146 | 214 | ||
147 | 215 | ||
148 | 216 | @Callable(i) | |
149 | 217 | func wearItemToDuck () = { | |
150 | 218 | let firstPayment = value(i.payments[0]) | |
151 | 219 | let secondPayment = value(i.payments[1]) | |
152 | 220 | let validPayment = checkAdditionalPayment(i.payments[2], 0) | |
153 | 221 | let duckId = toBase58String(value(firstPayment.assetId)) | |
154 | 222 | let secondAssetId = toBase58String(value(secondPayment.assetId)) | |
155 | 223 | if (if ((firstPayment.amount != 1)) | |
156 | 224 | then true | |
157 | 225 | else (secondPayment.amount != 1)) | |
158 | 226 | then throw("WRITD: NFT is not attached") | |
159 | 227 | else { | |
160 | - | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
161 | - | if ((children == children)) | |
162 | - | then ((wearItem(secondAssetId, duckId) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
163 | - | else throw("Strict value is not equal to itself.") | |
228 | + | let allTypes = getIfAllTypesAllowed(value(firstPayment.assetId)) | |
229 | + | ((wearItem(secondAssetId, duckId, allTypes) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
164 | 230 | } | |
165 | 231 | } | |
166 | 232 | ||
167 | 233 | ||
168 | 234 | ||
169 | 235 | @Callable(i) | |
170 | 236 | func removeItemFromDuck (burnItem,artefactName) = { | |
171 | 237 | let wavesFee = if (burnItem) | |
172 | 238 | then 0 | |
173 | 239 | else getIntegerValue(getOracle(), staticKey_extraFeeRemove()) | |
174 | 240 | let duckPayment = value(i.payments[0]) | |
175 | 241 | let roboDuckPayment = value(i.payments[1]) | |
176 | 242 | let validPayment = checkAdditionalPayment(i.payments[2], wavesFee) | |
177 | 243 | let duckId = toBase58String(value(duckPayment.assetId)) | |
178 | 244 | let roboDuckId = toBase58String(value(roboDuckPayment.assetId)) | |
179 | 245 | if (if ((duckPayment.amount != 1)) | |
180 | 246 | then true | |
181 | 247 | else (roboDuckPayment.amount != 1)) | |
182 | 248 | then throw("WRITD: NFT is not attached") | |
183 | 249 | else { | |
184 | 250 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
185 | 251 | if ((children == children)) | |
186 | 252 | then { | |
187 | 253 | let artefactNameRoboduck = asString(invoke(getItemsAddress(), "checkArtefactDetails", [roboDuckId], nil)) | |
188 | 254 | if ((artefactNameRoboduck == artefactNameRoboduck)) | |
189 | 255 | then if ((artefactNameRoboduck != "ART-ROBODUCK")) | |
190 | 256 | then throw("Only rododuck can remove items!") | |
191 | 257 | else if (if (!(containsElement(wearables, artefactName))) | |
192 | 258 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
193 | 259 | else false) | |
194 | 260 | then throw("WRITD: Unsupported wearable") | |
195 | 261 | else { | |
196 | 262 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
197 | 263 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
198 | 264 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
199 | 265 | else nil | |
200 | 266 | if ((boostDuck == boostDuck)) | |
201 | 267 | then if ((artefactId == "")) | |
202 | 268 | then throw(("Duck not wearing a " + artefactName)) | |
203 | 269 | else { | |
204 | 270 | let type = tryGetType(artefactName) | |
205 | 271 | let typeResult = if ((type != "")) | |
206 | 272 | then [DeleteEntry(keyTypesDuck(duckId, type))] | |
207 | 273 | else nil | |
208 | 274 | let burn = if (burnItem) | |
209 | 275 | then [Burn(fromBase58String(artefactId), 1)] | |
210 | 276 | else [ScriptTransfer(i.caller, 1, fromBase58String(artefactId))] | |
211 | 277 | ((([DeleteEntry(keyArtefactDuck(duckId, artefactName)), ScriptTransfer(i.caller, 1, duckPayment.assetId), Burn(fromBase58String(roboDuckId), 1)] ++ burn) ++ validPayment) ++ typeResult) | |
212 | 278 | } | |
213 | 279 | else throw("Strict value is not equal to itself.") | |
214 | 280 | } | |
215 | 281 | else throw("Strict value is not equal to itself.") | |
216 | 282 | } | |
217 | 283 | else throw("Strict value is not equal to itself.") | |
218 | 284 | } | |
219 | 285 | } | |
220 | 286 | ||
221 | 287 | ||
222 | 288 | ||
223 | 289 | @Callable(i) | |
224 | 290 | func wearXItemsToDuck () = { | |
225 | 291 | let validPayment = checkAdditionalPayment(i.payments[1], 0) | |
226 | 292 | if ((3 > size(i.payments))) | |
227 | 293 | then throw("WWXITD: Please attach at least 1 item and 1 duck!") | |
228 | 294 | else if ((size(i.payments) > 7)) | |
229 | 295 | then throw("WWXITD: You can only attach 5 items and one duck!") | |
230 | 296 | else { | |
231 | 297 | func handleItem (acc,payment) = { | |
232 | 298 | let index = indexOf(i.payments, payment) | |
233 | 299 | if ((index == 0)) | |
234 | 300 | then { | |
235 | 301 | let duckId = toBase58String(value(payment.assetId)) | |
236 | 302 | if ((payment.amount != 1)) | |
237 | 303 | then throw("WRITD: Duck is not attached") | |
238 | 304 | else { | |
239 | 305 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
240 | 306 | if ((children == children)) | |
241 | 307 | then (acc ++ [ScriptTransfer(i.caller, 1, payment.assetId)]) | |
242 | 308 | else throw("Strict value is not equal to itself.") | |
243 | 309 | } | |
244 | 310 | } | |
245 | - | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)))) | |
311 | + | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)), true)) | |
246 | 312 | } | |
247 | 313 | ||
248 | 314 | ({ | |
249 | 315 | let $l = i.payments | |
250 | 316 | let $s = size($l) | |
251 | 317 | let $acc0 = nil | |
252 | 318 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
253 | 319 | then $a | |
254 | 320 | else handleItem($a, $l[$i]) | |
255 | 321 | ||
256 | 322 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
257 | 323 | then $a | |
258 | 324 | else throw("List size exceeds 6") | |
259 | 325 | ||
260 | 326 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
261 | 327 | } ++ validPayment) | |
262 | 328 | } | |
263 | 329 | } | |
264 | 330 | ||
265 | 331 | ||
266 | 332 | @Verifier(tx) | |
267 | 333 | func verify () = if (isTestEnv()) | |
268 | 334 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
269 | 335 | else { | |
270 | 336 | let firstUser = base58'6TdaXEfhnjYquvPf3yV7MFxt2CbgFmaqsvGwkKfXtKi4' | |
271 | 337 | let secondUser = base58'7DsP2WaMLocbHuUxux7pbXRjTrrZ1TFQPsi5QumS3gr8' | |
272 | 338 | let thirdUser = base58'BpFWP3p3JgYrrP45xfrKzeMcWMEXoinj4FVPPkUiA8D3' | |
273 | 339 | let firstUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], firstUser)) | |
274 | 340 | then 1 | |
275 | 341 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], firstUser)) | |
276 | 342 | then 1 | |
277 | 343 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], firstUser)) | |
278 | 344 | then 1 | |
279 | 345 | else 0 | |
280 | 346 | let secondUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], secondUser)) | |
281 | 347 | then 1 | |
282 | 348 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], secondUser)) | |
283 | 349 | then 1 | |
284 | 350 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], secondUser)) | |
285 | 351 | then 1 | |
286 | 352 | else 0 | |
287 | 353 | let thirdUserSigned = if (sigVerify(tx.bodyBytes, tx.proofs[0], thirdUser)) | |
288 | 354 | then 1 | |
289 | 355 | else if (sigVerify(tx.bodyBytes, tx.proofs[1], thirdUser)) | |
290 | 356 | then 1 | |
291 | 357 | else if (sigVerify(tx.bodyBytes, tx.proofs[2], thirdUser)) | |
292 | 358 | then 1 | |
293 | 359 | else 0 | |
294 | 360 | let signaturesCount = ((firstUserSigned + secondUserSigned) + thirdUserSigned) | |
295 | 361 | match tx { | |
296 | 362 | case _ => | |
297 | 363 | (signaturesCount >= 2) | |
298 | 364 | } | |
299 | 365 | } | |
300 | 366 |
github/deemru/w8io/169f3d6 35.73 ms ◑