tx · 5XtFPcExVvWtUxBnpdaRBA5wDjDgnPW8dyMpyTAUbjYK 3N3A5ytTFmeT6yY7uHBR1x4RaURVqd2vFih: -0.01100000 Waves 2024.10.03 13:17 [3310540] smart account 3N3A5ytTFmeT6yY7uHBR1x4RaURVqd2vFih > SELF 0.00000000 Waves
{ "type": 13, "id": "5XtFPcExVvWtUxBnpdaRBA5wDjDgnPW8dyMpyTAUbjYK", "fee": 1100000, "feeAssetId": null, "timestamp": 1727950649512, "version": 2, "chainId": 84, "sender": "3N3A5ytTFmeT6yY7uHBR1x4RaURVqd2vFih", "senderPublicKey": "FCkc6XaNdqHBY98YHzkNmomKLXrs8QG3w1zKAuACmZgF", "proofs": [ "5Dh9pDVPtoByYw4UbDSuBhHp9wtg4B4gyCEAGi96Cj12EZYxRjw9mrzn9JzE5DG5A8cfeXKzNyyxPSTyns5RDi2n" ], "script": "base64:BgIRCAISAwoBCBIAEgQKAgQIEgAVARdzdGF0aWNLZXlfb3JhY2xlQWRkcmVzcwACFHN0YXRpY19vcmFjbGVBZGRyZXNzARhzdGF0aWNLZXlfYnJlZWRlckFkZHJlc3MAAhVzdGF0aWNfYnJlZWRlckFkZHJlc3MBFnN0YXRpY0tleV9pdGVtc0FkZHJlc3MAAhNzdGF0aWNfaXRlbXNBZGRyZXNzARJzdGF0aWNLZXlfZXh0cmFGZWUAAg9zdGF0aWNfZXh0cmFGZWUBGHN0YXRpY0tleV9leHRyYUZlZVJlbW92ZQACFXN0YXRpY19leHRyYUZlZVJlbW92ZQEXc3RhdGljS2V5X2ZlZUFnZ3JlZ2F0b3IAAhRzdGF0aWNfZmVlQWdncmVnYXRvcgAJd2VhcmFibGVzCQDMCAICCEFSVC1DQVBFCQDMCAICB0FSVC1IQVQJAMwIAgIKQVJULVhTQ0FSRgkAzAgCAgxBUlQtWFNXRUFURVIFA25pbAEPa2V5QXJ0ZWZhY3REdWNrAgZkdWNrSWQId2VhcmFibGUJAKwCAgkArAICBQZkdWNrSWQCAV8FCHd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aGlsZHJlbgkBBWFzSW50AQkA/AcECQERZ2V0QnJlZWRlckFkZHJlc3MAAhZ2YWxpZGF0ZUFuZEdldENoaWxkcmVuCQDMCAIFBmR1Y2tJZAUDbmlsBQNuaWwDCQAAAgUIY2hpbGRyZW4FCGNoaWxkcmVuCQDOCAIFA2FjYwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQgFB3BheW1lbnQHYXNzZXRJZAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQDOCAIFA2FjYwkBCHdlYXJJdGVtAgkA2AQBCQEFdmFsdWUBCAUHcGF5bWVudAdhc3NldElkCQDYBAEJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAEHYXNzZXRJZAkAzggCCgACJGwIBQFpCHBheW1lbnRzCgACJHMJAJADAQUCJGwKAAUkYWNjMAUDbmlsCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQpoYW5kbGVJdGVtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA2CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGBQx2YWxpZFBheW1lbnQAFCB/fA==", "height": 3310540, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EEH7mHzDZDfAJyfVpbEE38xn5Kx4Rx31buFB6qkv8Mqn Next: BaH2HTzbjpWKJiNWKDLE6Tgw9Uv3nYPo3fuRgTaah2pt Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func staticKey_oracleAddress () = "static_oracleAddress" | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func staticKey_breederAddress () = "static_breederAddress" | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func staticKey_itemsAddress () = "static_itemsAddress" | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func staticKey_extraFee () = "static_extraFee" | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func staticKey_extraFeeRemove () = "static_extraFeeRemove" | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func staticKey_feeAggregator () = "static_feeAggregator" | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | let wearables = ["ART-CAPE", "ART-HAT", "ART-XSCARF", "ART-XSWEATER"] | |
23 | 23 | ||
24 | 24 | func keyArtefactDuck (duckId,wearable) = ((duckId + "_") + wearable) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keyTypesDuck (duckId,type) = ((duckId + "_") + type) | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | func tryGetStringExternal (address,key) = match getString(address, key) { | |
31 | 31 | case a: String => | |
32 | 32 | a | |
33 | 33 | case _ => | |
34 | 34 | "" | |
35 | 35 | } | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func tryGetString (key) = tryGetStringExternal(this, key) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | func asInt (value) = match value { | |
42 | 42 | case int: Int => | |
43 | 43 | int | |
44 | 44 | case _ => | |
45 | 45 | throw("wrong type, expected: Int") | |
46 | 46 | } | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func asString (value) = match value { | |
50 | 50 | case string: String => | |
51 | 51 | string | |
52 | 52 | case _ => | |
53 | 53 | throw("wrong type, expected: String") | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress()))) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_breederAddress()))) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress()))) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator()))) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func checkAdditionalPayment (payment,amountOverride) = if (isDefined(payment.assetId)) | |
70 | 70 | then throw("WCAP: Please attach waves") | |
71 | 71 | else { | |
72 | 72 | let feeAmount = if ((amountOverride != 0)) | |
73 | 73 | then amountOverride | |
74 | 74 | else getIntegerValue(getOracle(), staticKey_extraFee()) | |
75 | 75 | if ((payment.amount != feeAmount)) | |
76 | 76 | then throw((("WCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets")) | |
77 | 77 | else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)] | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func tryGetCosmeticItem (item) = { | |
82 | 82 | let key = ("direct_cosmetic_" + item) | |
83 | 83 | match getInteger(getItemsAddress(), key) { | |
84 | 84 | case a: Int => | |
85 | 85 | a | |
86 | 86 | case _ => | |
87 | 87 | unit | |
88 | 88 | } | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func tryGetType (wearable) = tryGetStringExternal(getItemsAddress(), ("type_cosmetic_" + wearable)) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func wearItem (assetIdWearAble,duckId) = { | |
96 | 96 | let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetIdWearAble], nil)) | |
97 | 97 | if ((artefactName == artefactName)) | |
98 | 98 | then if (if (!(containsElement(wearables, artefactName))) | |
99 | 99 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
100 | 100 | else false) | |
101 | 101 | then throw("WRITD: Unsupported wearable") | |
102 | 102 | else { | |
103 | 103 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
104 | 104 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
105 | 105 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
106 | 106 | else nil | |
107 | 107 | if ((boostDuck == boostDuck)) | |
108 | 108 | then if ((artefactId != "")) | |
109 | 109 | then throw(("Duck is already wearing a " + artefactName)) | |
110 | 110 | else { | |
111 | 111 | let type = tryGetType(artefactName) | |
112 | 112 | let typeOnDuck = if ((type != "")) | |
113 | 113 | then (tryGetString(keyTypesDuck(duckId, type)) != "") | |
114 | 114 | else throw(("Type undefined, please contact admins " + artefactName)) | |
115 | 115 | if (typeOnDuck) | |
116 | 116 | then throw("You can only attach 1 from each type to your duck!") | |
117 | 117 | else { | |
118 | 118 | let typeResult = if ((type != "")) | |
119 | 119 | then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)] | |
120 | 120 | else nil | |
121 | 121 | ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult) | |
122 | 122 | } | |
123 | 123 | } | |
124 | 124 | else throw("Strict value is not equal to itself.") | |
125 | 125 | } | |
126 | 126 | else throw("Strict value is not equal to itself.") | |
127 | 127 | } | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func configureOracle (oracle) = if ((i.caller != this)) | |
132 | 132 | then throw("admin only") | |
133 | 133 | else [StringEntry(staticKey_oracleAddress(), oracle)] | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Callable(i) | |
138 | 138 | func wearItemToDuck () = { | |
139 | 139 | let firstPayment = value(i.payments[0]) | |
140 | 140 | let secondPayment = value(i.payments[1]) | |
141 | 141 | let validPayment = checkAdditionalPayment(i.payments[2], 0) | |
142 | 142 | let duckId = toBase58String(value(firstPayment.assetId)) | |
143 | 143 | let secondAssetId = toBase58String(value(secondPayment.assetId)) | |
144 | 144 | if (if ((firstPayment.amount != 1)) | |
145 | 145 | then true | |
146 | 146 | else (secondPayment.amount != 1)) | |
147 | 147 | then throw("WRITD: NFT is not attached") | |
148 | 148 | else { | |
149 | 149 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
150 | 150 | if ((children == children)) | |
151 | 151 | then ((wearItem(secondAssetId, duckId) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment) | |
152 | 152 | else throw("Strict value is not equal to itself.") | |
153 | 153 | } | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(i) | |
159 | 159 | func removeItemFromDuck (burnItem,artefactName) = { | |
160 | 160 | let wavesFee = if (burnItem) | |
161 | 161 | then 0 | |
162 | 162 | else getIntegerValue(getOracle(), staticKey_extraFeeRemove()) | |
163 | 163 | let duckPayment = value(i.payments[0]) | |
164 | 164 | let roboDuckPayment = value(i.payments[1]) | |
165 | 165 | let validPayment = checkAdditionalPayment(i.payments[2], wavesFee) | |
166 | 166 | let duckId = toBase58String(value(duckPayment.assetId)) | |
167 | 167 | let roboDuckId = toBase58String(value(roboDuckPayment.assetId)) | |
168 | 168 | if (if ((duckPayment.amount != 1)) | |
169 | 169 | then true | |
170 | 170 | else (roboDuckPayment.amount != 1)) | |
171 | 171 | then throw("WRITD: NFT is not attached") | |
172 | 172 | else { | |
173 | 173 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
174 | 174 | if ((children == children)) | |
175 | 175 | then { | |
176 | 176 | let artefactNameRoboduck = asString(invoke(getItemsAddress(), "checkArtefactDetails", [roboDuckId], nil)) | |
177 | 177 | if ((artefactNameRoboduck == artefactNameRoboduck)) | |
178 | 178 | then if ((artefactNameRoboduck != "ART-ROBODUCK")) | |
179 | 179 | then throw("Only rododuck can remove items!") | |
180 | 180 | else if (if (!(containsElement(wearables, artefactName))) | |
181 | 181 | then !(isDefined(tryGetCosmeticItem(artefactName))) | |
182 | 182 | else false) | |
183 | 183 | then throw("WRITD: Unsupported wearable") | |
184 | 184 | else { | |
185 | 185 | let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName)) | |
186 | 186 | let boostDuck = if ((artefactName == "ART-XSCARF")) | |
187 | 187 | then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil) | |
188 | 188 | else nil | |
189 | 189 | if ((boostDuck == boostDuck)) | |
190 | 190 | then if ((artefactId == "")) | |
191 | 191 | then throw(("Duck not wearing a " + artefactName)) | |
192 | 192 | else { | |
193 | 193 | let type = tryGetType(artefactName) | |
194 | 194 | let typeResult = if ((type != "")) | |
195 | 195 | then [DeleteEntry(keyTypesDuck(duckId, type))] | |
196 | 196 | else nil | |
197 | 197 | let burn = if (burnItem) | |
198 | 198 | then [Burn(fromBase58String(artefactId), 1)] | |
199 | 199 | else [ScriptTransfer(i.caller, 1, fromBase58String(artefactId))] | |
200 | 200 | ((([DeleteEntry(keyArtefactDuck(duckId, artefactName)), ScriptTransfer(i.caller, 1, duckPayment.assetId), Burn(fromBase58String(roboDuckId), 1)] ++ burn) ++ validPayment) ++ typeResult) | |
201 | 201 | } | |
202 | 202 | else throw("Strict value is not equal to itself.") | |
203 | 203 | } | |
204 | 204 | else throw("Strict value is not equal to itself.") | |
205 | 205 | } | |
206 | 206 | else throw("Strict value is not equal to itself.") | |
207 | 207 | } | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | ||
212 | 212 | @Callable(i) | |
213 | 213 | func wearXItemsToDuck () = { | |
214 | 214 | let validPayment = checkAdditionalPayment(i.payments[1], 0) | |
215 | 215 | if ((3 > size(i.payments))) | |
216 | 216 | then throw("WWXITD: Please attach at least 1 item and 1 duck!") | |
217 | 217 | else if ((size(i.payments) > 7)) | |
218 | 218 | then throw("WWXITD: You can only attach 5 items and one duck!") | |
219 | 219 | else { | |
220 | 220 | func handleItem (acc,payment) = { | |
221 | 221 | let index = indexOf(i.payments, payment) | |
222 | 222 | if ((index == 0)) | |
223 | 223 | then { | |
224 | 224 | let duckId = toBase58String(value(payment.assetId)) | |
225 | 225 | if ((payment.amount != 1)) | |
226 | 226 | then throw("WRITD: Duck is not attached") | |
227 | 227 | else { | |
228 | 228 | let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil)) | |
229 | 229 | if ((children == children)) | |
230 | 230 | then (acc ++ [ScriptTransfer(i.caller, 1, payment.assetId)]) | |
231 | 231 | else throw("Strict value is not equal to itself.") | |
232 | 232 | } | |
233 | 233 | } | |
234 | 234 | else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId)))) | |
235 | 235 | } | |
236 | 236 | ||
237 | 237 | ({ | |
238 | 238 | let $l = i.payments | |
239 | 239 | let $s = size($l) | |
240 | 240 | let $acc0 = nil | |
241 | 241 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
242 | 242 | then $a | |
243 | 243 | else handleItem($a, $l[$i]) | |
244 | 244 | ||
245 | 245 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
246 | 246 | then $a | |
247 | 247 | else throw("List size exceeds 6") | |
248 | 248 | ||
249 | 249 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
250 | 250 | } ++ validPayment) | |
251 | 251 | } | |
252 | 252 | } | |
253 | 253 | ||
254 | 254 |
github/deemru/w8io/026f985 37.50 ms ◑