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:BgIRCAISAwoBCBIAEgQKAgQIEgAVARdzdGF0aWNLZXlfb3JhY2xlQWRkcmVzcwACFHN0YXRpY19vcmFjbGVBZGRyZXNzARhzdGF0aWNLZXlfYnJlZWRlckFkZHJlc3MAAhVzdGF0aWNfYnJlZWRlckFkZHJlc3MBFnN0YXRpY0tleV9pdGVtc0FkZHJlc3MAAhNzdGF0aWNfaXRlbXNBZGRyZXNzARJzdGF0aWNLZXlfZXh0cmFGZWUAAg9zdGF0aWNfZXh0cmFGZWUBGHN0YXRpY0tleV9leHRyYUZlZVJlbW92ZQACFXN0YXRpY19leHRyYUZlZVJlbW92ZQEXc3RhdGljS2V5X2ZlZUFnZ3JlZ2F0b3IAAhRzdGF0aWNfZmVlQWdncmVnYXRvcgAJd2VhcmFibGVzCQDMCAICCEFSVC1DQVBFCQDMCAICB0FSVC1IQVQJAMwIAgIKQVJULVhTQ0FSRgkAzAgCAgxBUlQtWFNXRUFURVIFA25pbAEPa2V5QXJ0ZWZhY3REdWNrAgZkdWNrSWQId2VhcmFibGUJAKwCAgkArAICBQZkdWNrSWQCAV8FCH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jaGlsZHJlbgkBBWFzSW50AQkA/AcECQERZ2V0QnJlZWRlckFkZHJlc3MAAhZ2YWxpZGF0ZUFuZEdldENoaWxkcmVuCQDMCAIFBmR1Y2tJZAUDbmlsBQNuaWwDCQAAAgUIY2hpbGRyZW4FCGNoaWxkcmVuCQDOCAIFA2FjYwkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIAAQgFB3BheW1lbnQHYXNzZXRJZAUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuCQDOCAIFA2FjYwkBCHdlYXJJdGVtAgkA2AQBCQEFdmFsdWUBCAUHcGF5bWVudAdhc3NldElkCQDYBAEJAQV2YWx1ZQEICQCRAwIIBQFpCHBheW1lbnRzAAEHYXNzZXRJZAkAzggCCgACJGwIBQFpCHBheW1lbnRzCgACJHMJAJADAQUCJGwKAAUkYWNjMAUDbmlsCgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQpoYW5kbGVJdGVtAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhNMaXN0IHNpemUgZXhjZWVkcyA2CQEFJGYwXzICCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECCQEFJGYwXzECBQUkYWNjMAAAAAEAAgADAAQABQAGBQx2YWxpZFBheW1lbnQAFCB/fA==", "height": 3310540, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EEH7mHzDZDfAJyfVpbEE38xn5Kx4Rx31buFB6qkv8Mqn Next: BaH2HTzbjpWKJiNWKDLE6Tgw9Uv3nYPo3fuRgTaah2pt Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func staticKey_oracleAddress () = "static_oracleAddress"
55
66
77 func staticKey_breederAddress () = "static_breederAddress"
88
99
1010 func staticKey_itemsAddress () = "static_itemsAddress"
1111
1212
1313 func staticKey_extraFee () = "static_extraFee"
1414
1515
1616 func staticKey_extraFeeRemove () = "static_extraFeeRemove"
1717
1818
1919 func staticKey_feeAggregator () = "static_feeAggregator"
2020
2121
2222 let wearables = ["ART-CAPE", "ART-HAT", "ART-XSCARF", "ART-XSWEATER"]
2323
2424 func keyArtefactDuck (duckId,wearable) = ((duckId + "_") + wearable)
2525
2626
2727 func keyTypesDuck (duckId,type) = ((duckId + "_") + type)
2828
2929
3030 func tryGetStringExternal (address,key) = match getString(address, key) {
3131 case a: String =>
3232 a
3333 case _ =>
3434 ""
3535 }
3636
3737
3838 func tryGetString (key) = tryGetStringExternal(this, key)
3939
4040
4141 func asInt (value) = match value {
4242 case int: Int =>
4343 int
4444 case _ =>
4545 throw("wrong type, expected: Int")
4646 }
4747
4848
4949 func asString (value) = match value {
5050 case string: String =>
5151 string
5252 case _ =>
5353 throw("wrong type, expected: String")
5454 }
5555
5656
5757 func getOracle () = Address(fromBase58String(tryGetString(staticKey_oracleAddress())))
5858
5959
6060 func getBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_breederAddress())))
6161
6262
6363 func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_itemsAddress())))
6464
6565
6666 func getFeeAggregator () = Address(fromBase58String(tryGetStringExternal(getOracle(), staticKey_feeAggregator())))
6767
6868
6969 func checkAdditionalPayment (payment,amountOverride) = if (isDefined(payment.assetId))
7070 then throw("WCAP: Please attach waves")
7171 else {
7272 let feeAmount = if ((amountOverride != 0))
7373 then amountOverride
7474 else getIntegerValue(getOracle(), staticKey_extraFee())
7575 if ((payment.amount != feeAmount))
7676 then throw((("WCAP: Please attach exactly " + toString(feeAmount)) + " amount of wavelets"))
7777 else [ScriptTransfer(getFeeAggregator(), feeAmount, unit)]
7878 }
7979
8080
8181 func tryGetCosmeticItem (item) = {
8282 let key = ("direct_cosmetic_" + item)
8383 match getInteger(getItemsAddress(), key) {
8484 case a: Int =>
8585 a
8686 case _ =>
8787 unit
8888 }
8989 }
9090
9191
9292 func tryGetType (wearable) = tryGetStringExternal(getItemsAddress(), ("type_cosmetic_" + wearable))
9393
9494
9595 func wearItem (assetIdWearAble,duckId) = {
9696 let artefactName = asString(invoke(getItemsAddress(), "checkArtefactDetails", [assetIdWearAble], nil))
9797 if ((artefactName == artefactName))
9898 then if (if (!(containsElement(wearables, artefactName)))
9999 then !(isDefined(tryGetCosmeticItem(artefactName)))
100100 else false)
101101 then throw("WRITD: Unsupported wearable")
102102 else {
103103 let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName))
104104 let boostDuck = if ((artefactName == "ART-XSCARF"))
105105 then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil)
106106 else nil
107107 if ((boostDuck == boostDuck))
108108 then if ((artefactId != ""))
109109 then throw(("Duck is already wearing a " + artefactName))
110110 else {
111111 let type = tryGetType(artefactName)
112112 let typeOnDuck = if ((type != ""))
113113 then (tryGetString(keyTypesDuck(duckId, type)) != "")
114114 else throw(("Type undefined, please contact admins " + artefactName))
115115 if (typeOnDuck)
116116 then throw("You can only attach 1 from each type to your duck!")
117117 else {
118118 let typeResult = if ((type != ""))
119119 then [StringEntry(keyTypesDuck(duckId, type), assetIdWearAble)]
120120 else nil
121121 ([StringEntry(keyArtefactDuck(duckId, artefactName), assetIdWearAble)] ++ typeResult)
122122 }
123123 }
124124 else throw("Strict value is not equal to itself.")
125125 }
126126 else throw("Strict value is not equal to itself.")
127127 }
128128
129129
130130 @Callable(i)
131131 func configureOracle (oracle) = if ((i.caller != this))
132132 then throw("admin only")
133133 else [StringEntry(staticKey_oracleAddress(), oracle)]
134134
135135
136136
137137 @Callable(i)
138138 func wearItemToDuck () = {
139139 let firstPayment = value(i.payments[0])
140140 let secondPayment = value(i.payments[1])
141141 let validPayment = checkAdditionalPayment(i.payments[2], 0)
142142 let duckId = toBase58String(value(firstPayment.assetId))
143143 let secondAssetId = toBase58String(value(secondPayment.assetId))
144144 if (if ((firstPayment.amount != 1))
145145 then true
146146 else (secondPayment.amount != 1))
147147 then throw("WRITD: NFT is not attached")
148148 else {
149149 let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil))
150150 if ((children == children))
151151 then ((wearItem(secondAssetId, duckId) ++ [ScriptTransfer(i.caller, 1, firstPayment.assetId)]) ++ validPayment)
152152 else throw("Strict value is not equal to itself.")
153153 }
154154 }
155155
156156
157157
158158 @Callable(i)
159159 func removeItemFromDuck (burnItem,artefactName) = {
160160 let wavesFee = if (burnItem)
161161 then 0
162162 else getIntegerValue(getOracle(), staticKey_extraFeeRemove())
163163 let duckPayment = value(i.payments[0])
164164 let roboDuckPayment = value(i.payments[1])
165165 let validPayment = checkAdditionalPayment(i.payments[2], wavesFee)
166166 let duckId = toBase58String(value(duckPayment.assetId))
167167 let roboDuckId = toBase58String(value(roboDuckPayment.assetId))
168168 if (if ((duckPayment.amount != 1))
169169 then true
170170 else (roboDuckPayment.amount != 1))
171171 then throw("WRITD: NFT is not attached")
172172 else {
173173 let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil))
174174 if ((children == children))
175175 then {
176176 let artefactNameRoboduck = asString(invoke(getItemsAddress(), "checkArtefactDetails", [roboDuckId], nil))
177177 if ((artefactNameRoboduck == artefactNameRoboduck))
178178 then if ((artefactNameRoboduck != "ART-ROBODUCK"))
179179 then throw("Only rododuck can remove items!")
180180 else if (if (!(containsElement(wearables, artefactName)))
181181 then !(isDefined(tryGetCosmeticItem(artefactName)))
182182 else false)
183183 then throw("WRITD: Unsupported wearable")
184184 else {
185185 let artefactId = tryGetString(keyArtefactDuck(duckId, artefactName))
186186 let boostDuck = if ((artefactName == "ART-XSCARF"))
187187 then invoke(getItemsAddress(), "manipulateBoost", [69, duckId], nil)
188188 else nil
189189 if ((boostDuck == boostDuck))
190190 then if ((artefactId == ""))
191191 then throw(("Duck not wearing a " + artefactName))
192192 else {
193193 let type = tryGetType(artefactName)
194194 let typeResult = if ((type != ""))
195195 then [DeleteEntry(keyTypesDuck(duckId, type))]
196196 else nil
197197 let burn = if (burnItem)
198198 then [Burn(fromBase58String(artefactId), 1)]
199199 else [ScriptTransfer(i.caller, 1, fromBase58String(artefactId))]
200200 ((([DeleteEntry(keyArtefactDuck(duckId, artefactName)), ScriptTransfer(i.caller, 1, duckPayment.assetId), Burn(fromBase58String(roboDuckId), 1)] ++ burn) ++ validPayment) ++ typeResult)
201201 }
202202 else throw("Strict value is not equal to itself.")
203203 }
204204 else throw("Strict value is not equal to itself.")
205205 }
206206 else throw("Strict value is not equal to itself.")
207207 }
208208 }
209209
210210
211211
212212 @Callable(i)
213213 func wearXItemsToDuck () = {
214214 let validPayment = checkAdditionalPayment(i.payments[1], 0)
215215 if ((3 > size(i.payments)))
216216 then throw("WWXITD: Please attach at least 1 item and 1 duck!")
217217 else if ((size(i.payments) > 7))
218218 then throw("WWXITD: You can only attach 5 items and one duck!")
219219 else {
220220 func handleItem (acc,payment) = {
221221 let index = indexOf(i.payments, payment)
222222 if ((index == 0))
223223 then {
224224 let duckId = toBase58String(value(payment.assetId))
225225 if ((payment.amount != 1))
226226 then throw("WRITD: Duck is not attached")
227227 else {
228228 let children = asInt(invoke(getBreederAddress(), "validateAndGetChildren", [duckId], nil))
229229 if ((children == children))
230230 then (acc ++ [ScriptTransfer(i.caller, 1, payment.assetId)])
231231 else throw("Strict value is not equal to itself.")
232232 }
233233 }
234234 else (acc ++ wearItem(toBase58String(value(payment.assetId)), toBase58String(value(i.payments[1].assetId))))
235235 }
236236
237237 ({
238238 let $l = i.payments
239239 let $s = size($l)
240240 let $acc0 = nil
241241 func $f0_1 ($a,$i) = if (($i >= $s))
242242 then $a
243243 else handleItem($a, $l[$i])
244244
245245 func $f0_2 ($a,$i) = if (($i >= $s))
246246 then $a
247247 else throw("List size exceeds 6")
248248
249249 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
250250 } ++ validPayment)
251251 }
252252 }
253253
254254

github/deemru/w8io/026f985 
37.50 ms