tx · HsgGtqA5uyEh4cz9JHAmQ5Ru9JNWjcBQm5wDBfoXgWEe

3MrLvyiZvdkfyRa51SVXBYykMsCe1ASZMVL:  -0.01800000 Waves

2024.10.03 12:28 [3310489] smart account 3MrLvyiZvdkfyRa51SVXBYykMsCe1ASZMVL > SELF 0.00000000 Waves

{ "type": 13, "id": "HsgGtqA5uyEh4cz9JHAmQ5Ru9JNWjcBQm5wDBfoXgWEe", "fee": 1800000, "feeAssetId": null, "timestamp": 1727947763098, "version": 2, "chainId": 84, "sender": "3MrLvyiZvdkfyRa51SVXBYykMsCe1ASZMVL", "senderPublicKey": "HaDYDZ6mRDE3nPyxhQvHMhS3eEt5GoKNRsL53fiRybJD", "proofs": [ "qp15e2taMriqnKTitM34jERk5DVJjiZzpgnVatWmJKBcFLbDZnByqVnCkwCjToEYxPHnBHN3irScczo9vPJQ7mB" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEIEg4KDAgBAQgIBAQIAQEBCAAAACkBAAAAFHRyeUdldFN0cmluZ0V4dGVybmFsAAAAAgAAAAdhZGRyZXNzAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAdhZGRyZXNzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAAAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQkBAAAAFHRyeUdldFN0cmluZ0V4dGVybmFsAAAAAgUAAAAEdGhpcwUAAAADa2V5AQAAAAlnZXRPcmFjbGUAAAAACQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQkBAAAADHRyeUdldFN0cmluZwAAAAECAAAAFHN0YXRpY19vcmFjbGVBZGRyZXNzAQAAABJnZXRDZk1hc3RlckFkZHJlc3MAAAAACQEAAAAHQWRkcmVzcwAAAAEJAAJZAAAAAQkBAAAAFHRyeUdldFN0cmluZ0V4dGVybmFsAAAAAgkBAAAACWdldE9yYWNsZQAA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AAADdHhfCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQFAAAACWF1Y3Rpb25JZAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgMJAAAAAAAAAgUAAAAIZnVuY3Rpb24CAAAADWNhbmNlbEF1Y3Rpb24EAAAACWF1Y3Rpb25JZAUAAAAEc3RyMQQAAAAJYWNjZXB0QmlkCQAD/AAAAAQFAAAAEmF1Y3Rpb25EYXBwQWRkcmVzcwIAAAANY2FuY2VsQXVjdGlvbgkABEwAAAACBQAAAAlhdWN0aW9uSWQFAAAAA25pbAUAAAADbmlsAwkAAAAAAAACBQAAAAlhY2NlcHRCaWQFAAAACWFjY2VwdEJpZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAAA3R4XwkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBQAAAAlhdWN0aW9uSWQFAAAAA25pbAkAAAIAAAABAgAAACRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAACAAAAAQIAAAADXzEzAAAAANy7yF8=", "height": 3310489, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B8xJDXDSyxB3WtZT9Wcz7x2uTTnLLQKx76tLG1egRDMr Next: 8nG6b2XxC5AEACR5UCoFYrqd7pEcFcsoDWNab2KNEry9 Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func tryGetStringExternal (address,key) = match getString(address, key) {
55 case a: String =>
66 a
77 case _ =>
88 ""
99 }
1010
1111
1212 func tryGetString (key) = tryGetStringExternal(this, key)
1313
1414
1515 func getOracle () = Address(fromBase58String(tryGetString("static_oracleAddress")))
1616
1717
1818 func getCfMasterAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_cfMasterAddress")))
1919
2020
2121 func getBackendPubKey () = fromBase58String(getStringValue(getOracle(), "static_backendPubKey"))
2222
2323
2424 func getMaxDiff () = getIntegerValue(getOracle(), "static_maxProxyDiff")
2525
2626
2727 func getTurtleIncubatorAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleIncubatorAddress")))
2828
2929
3030 func getTurtleBreederAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_turtleBreederAddress")))
3131
3232
3333 func getItemsAddress () = Address(fromBase58String(tryGetStringExternal(getOracle(), "static_itemsAddress")))
3434
3535
3636 let kTotalLiquidity = "total_liquidity"
3737
3838 let kInitialized = "INITIALIZED"
3939
4040 let kLiquidityThreshold = "LIQUIDITY_THRESHOLD"
4141
4242 let kTotalShareTokens = "total_share_tokens"
4343
4444 let kShareAssetId = "SHARE_ASSET_ID"
4545
4646 let kIncubatorDapp = "INCUBATOR_DAPP"
4747
4848 let kBreederDapp = "BREEDER_DAPP"
4949
5050 let kFarmingDapp = "FARMING_DAPP"
5151
5252 let kMarketProxyDapp = "MARKETPLACE_PROXY_DAPP"
5353
5454 let kAuctionDapp = "AUCTION_DAPP"
5555
5656 let kLocked = "LOCKED"
5757
5858 let kTotalFarmingReward = "total_farming_reward"
5959
6060 let kCeoCollectedFee = "ceo_collected_fee"
6161
6262 let kCeoCollectedFeeOverall = "ceo_fee_overall"
6363
6464 let kToDistr = "to_distribute"
6565
6666 func getInt (key) = match getInteger(this, key) {
6767 case b: Int =>
6868 b
6969 case _ =>
7070 0
7171 }
7272
7373
7474 func tryGetBooleanExternal (address,key) = match getBoolean(address, key) {
7575 case b: Boolean =>
7676 b
7777 case _ =>
7878 false
7979 }
8080
8181
8282 func getBool (key) = tryGetBooleanExternal(this, key)
8383
8484
8585 func getBoolA (a,key) = match getBoolean(a, key) {
8686 case b: Boolean =>
8787 b
8888 case _ =>
8989 unit
9090 }
9191
9292
9393 func tryGetIntegerExternal (address,key) = match getInteger(address, key) {
9494 case b: Int =>
9595 b
9696 case _ =>
9797 0
9898 }
9999
100100
101101 func getAuctionAddr () = tryGetStringExternal(getCfMasterAddress(), kAuctionDapp)
102102
103103
104104 func amountOrClear (amount) = if (contains(amount, "0"))
105105 then ""
106106 else amount
107107
108108
109109 func getAssetOrigin (generation) = {
110110 let incubatorAddress = tryGetStringExternal(getCfMasterAddress(), kIncubatorDapp)
111111 let breederAddress = tryGetStringExternal(getCfMasterAddress(), kBreederDapp)
112112 if ((generation == "G"))
113113 then fromBase58String(incubatorAddress)
114114 else fromBase58String(breederAddress)
115115 }
116116
117117
118118 func getAssetRarity (geno,generation) = {
119119 let quantity = getIntegerValue(Address(getAssetOrigin(generation)), (("stats_" + geno) + "_quantity"))
120120 let power = pow((10000 / quantity), 4, 5, 1, 2, FLOOR)
121121 if ((power > 0))
122122 then power
123123 else 2
124124 }
125125
126126
127127 func asString (value) = match value {
128128 case string: String =>
129129 string
130130 case _ =>
131131 throw("wrong type, expected: String")
132132 }
133133
134134
135135 func getAssetFarmingPower (assetId) = {
136136 let breederAddress = fromBase58String(tryGetStringExternal(getCfMasterAddress(), kBreederDapp))
137137 let incubatorAddress = fromBase58String(tryGetStringExternal(getCfMasterAddress(), kIncubatorDapp))
138138 if (if ((value(assetInfo(assetId)).issuer == Address(breederAddress)))
139139 then true
140140 else (value(assetInfo(assetId)).issuer == Address(incubatorAddress)))
141141 then {
142142 let assetName = value(assetInfo(assetId)).name
143143 let generation = take(takeRight(assetName, 2), 1)
144144 let farmGen = asString(invoke(Address(breederAddress), "getGenFromName", [assetName], nil))
145145 if ((farmGen == farmGen))
146146 then getAssetRarity(farmGen, generation)
147147 else throw("Strict value is not equal to itself.")
148148 }
149149 else throw("MGAFP: _20")
150150 }
151151
152152
153153 func getTurtleAssetFarmingPower (assetId) = {
154154 let breederAddress = getTurtleBreederAddress()
155155 let incubatorAddress = getTurtleIncubatorAddress()
156156 if (if ((value(assetInfo(assetId)).issuer == breederAddress))
157157 then true
158158 else (value(assetInfo(assetId)).issuer == incubatorAddress))
159159 then true
160160 else throw("MGTFP: _20")
161161 }
162162
163163
164164 func getDuckMarketPrice (nftId) = {
165165 let rarity = getAssetFarmingPower(nftId)
166166 let breederAddress = addressFromStringValue(tryGetStringExternal(getCfMasterAddress(), kBreederDapp))
167167 let sterile = tryGetIntegerExternal(breederAddress, (("asset_" + toBase58String(nftId)) + "_children"))
168168 let canBreedText = if ((sterile > 0))
169169 then "0"
170170 else "1"
171171 let val = getInteger(getCfMasterAddress(), ((("r-" + toString(rarity)) + "-b-") + canBreedText))
172172 match val {
173173 case price: Int =>
174174 let minPrice = if ((sterile > 0))
175175 then (200000000 * rarity)
176176 else 18000000000
177177 if ((minPrice > price))
178178 then minPrice
179179 else price
180180 case _ =>
181181 throw((((("There is no price for such duck: " + "r-") + toString(rarity)) + "-b-") + canBreedText))
182182 }
183183 }
184184
185185
186186 func getDuckIdByAuctionId (auctionId) = {
187187 let marketAddr = getAuctionAddr()
188188 tryGetStringExternal(addressFromStringValue(marketAddr), (("auction_" + auctionId) + "_assetId"))
189189 }
190190
191191
192192 func getBidAmount (auctionId,bidId) = {
193193 let marketAddr = getAuctionAddr()
194194 tryGetIntegerExternal(addressFromStringValue(marketAddr), (((("auction_" + auctionId) + "_bid_") + bidId) + "_amount"))
195195 }
196196
197197
198198 func checkDataGetPrice (ach,breed,gen,price,rarity,ts,signature,duckId) = if ((price == 0))
199199 then throw("MCACS: No price calculated, so action not allowed! Please contact admin!")
200200 else {
201201 let isDuck = if ((rarity != "0"))
202202 then (gen != "")
203203 else false
204204 let isTurtle = (rarity != "0")
205205 let text = if (isDuck)
206206 then makeString([rarity, breed, ach, gen, toString(price), toString(ts)], ";")
207207 else if (isTurtle)
208208 then makeString([rarity, breed, toString(price), toString(ts)], ";")
209209 else makeString([gen, toString(price), toString(ts)], ";")
210210 let MSINHOUR = 3600000
211211 if (!(sigVerify_8Kb(toBytes(text), fromBase58String(signature), getBackendPubKey())))
212212 then throw(((((("MCACS: Invalid proof from backend key" + toBase58String(getBackendPubKey())) + " ") + text) + " ") + toString(isDuck)))
213213 else {
214214 let currentTs = lastBlock.timestamp
215215 if ((currentTs > (ts + MSINHOUR)))
216216 then throw("MCACS: Outdated signature!")
217217 else if (isDuck)
218218 then {
219219 let duckRarity = getAssetFarmingPower(fromBase58String(duckId))
220220 let diff = (duckRarity - parseIntValue(split(rarity, ".")[0]))
221221 if (if ((-5 > diff))
222222 then true
223223 else (diff > 5))
224224 then throw(((((("MCACS: It seems not the correct price info was passed! " + toString(duckRarity)) + " ") + rarity) + " ") + toString(diff)))
225225 else price
226226 }
227227 else if (isTurtle)
228228 then if ((getTurtleAssetFarmingPower(fromBase58String(duckId)) == true))
229229 then price
230230 else throw("MCACS: This does not seem a turtle!")
231231 else price
232232 }
233233 }
234234
235235
236236 let fixedPriceDiff = 500000000
237237
238238 @Callable(i)
239239 func configureOracle (oracle) = if ((i.caller != this))
240240 then throw("BCO: admin only")
241241 else [StringEntry("static_oracleAddress", oracle)]
242242
243243
244244
245245 @Callable(i)
246246 func callMarketplaceProxy (function,int1,int2,str1,str2,ach,breed,gen,price,rarity,ts,signature) = {
247247 let auctionDappAddress = addressFromStringValue(getAuctionAddr())
248248 if ((getBoolA(getCfMasterAddress(), ("farm_" + toString(i.caller))) != true))
249249 then throw("_301=")
250250 else if ((function == "initAuction"))
251251 then {
252252 let asset = value(i.payments[0])
253253 let checkDataPrice = checkDataGetPrice(toString(ach), toString(breed), gen, price, toString(rarity), ts, signature, toBase58String(value(asset.assetId)))
254254 let calcPrice = if (tryGetBooleanExternal(getItemsAddress(), (("direct_cosmetic_" + gen) + "_sale")))
255255 then min([tryGetIntegerExternal(getItemsAddress(), ("direct_cosmetic_" + gen)), checkDataPrice])
256256 else checkDataPrice
257257 let maxPriceDiff = (fraction(calcPrice, getMaxDiff(), 100) + fixedPriceDiff)
258258 let initialPrice = int1
259259 let buyoutPrice = int2
260260 if (if (((calcPrice - maxPriceDiff) > initialPrice))
261261 then true
262262 else (initialPrice > buyoutPrice))
263263 then throw(((((("Price is too low, avg price: " + toString(calcPrice)) + ", min. price: ") + toString((calcPrice - maxPriceDiff))) + ", your bid: ") + toString(initialPrice)))
264264 else if ((value(asset.amount) != 1))
265265 then throw("_103")
266266 else {
267267 let initAuction = invoke(auctionDappAddress, "initAuction", [initialPrice, buyoutPrice, str1, str2], [AttachedPayment(value(asset.assetId), 1)])
268268 if ((initAuction == initAuction))
269269 then [StringEntry(("tx_" + toBase58String(i.transactionId)), toBase58String(value(asset.assetId)))]
270270 else throw("Strict value is not equal to itself.")
271271 }
272272 }
273273 else if ((function == "placeBid"))
274274 then {
275275 let auctionId = str1
276276 let duckAssetId = getDuckIdByAuctionId(auctionId)
277277 let bidAmount = value(value(i.payments[0]).amount)
278278 let duckMarketPrice = checkDataGetPrice(toString(ach), toString(breed), gen, price, toString(rarity), ts, signature, duckAssetId)
279279 let maxPriceDiff = fraction(duckMarketPrice, getMaxDiff(), 100)
280280 if ((bidAmount > duckMarketPrice))
281281 then throw(((((("Price is too high, avg price: " + toString(duckMarketPrice)) + ", max. price: ") + toString(duckMarketPrice)) + ", your bid: ") + toString(bidAmount)))
282282 else if ((size(i.payments) != 1))
283283 then throw("_103")
284284 else {
285285 let placeBid = invoke(auctionDappAddress, "placeBid", [auctionId], [AttachedPayment(value(i.payments[0]).assetId, bidAmount)])
286286 if ((placeBid == placeBid))
287287 then [StringEntry(("tx_" + toBase58String(i.transactionId)), auctionId)]
288288 else throw("Strict value is not equal to itself.")
289289 }
290290 }
291291 else if ((function == "acceptBid"))
292292 then if (true)
293293 then throw("MCACS: Accepting bids is disabled for Collective Farms!")
294294 else {
295295 let auctionId = str1
296296 let bidId = str2
297297 let duckAssetId = getDuckIdByAuctionId(auctionId)
298298 let bidAmount = getBidAmount(auctionId, bidId)
299299 let duckMarketPrice = checkDataGetPrice(toString(ach), toString(breed), gen, price, toString(rarity), ts, signature, duckAssetId)
300300 let maxPriceDiff = fraction(duckMarketPrice, getMaxDiff(), 100)
301301 if ((duckMarketPrice > bidAmount))
302302 then throw(((((("Price is too low, avg price: " + toString(duckMarketPrice)) + ", min. price: ") + toString(duckMarketPrice)) + ", your bid: ") + toString(bidAmount)))
303303 else {
304304 let acceptBid = invoke(auctionDappAddress, "acceptBid", [auctionId, bidId], nil)
305305 if ((acceptBid == acceptBid))
306306 then [StringEntry(("tx_" + toBase58String(i.transactionId)), auctionId)]
307307 else throw("Strict value is not equal to itself.")
308308 }
309309 }
310310 else if ((function == "instantBuy"))
311311 then {
312312 let auctionId = str1
313313 let duckAssetId = getDuckIdByAuctionId(auctionId)
314314 let bidAmount = value(value(i.payments[0]).amount)
315315 let duckMarketPrice = checkDataGetPrice(toString(ach), toString(breed), gen, price, toString(rarity), ts, signature, duckAssetId)
316316 let maxPrice = if (tryGetBooleanExternal(getItemsAddress(), (("direct_cosmetic_" + gen) + "_sale")))
317317 then tryGetIntegerExternal(getItemsAddress(), ("direct_cosmetic_" + gen))
318318 else ((duckMarketPrice + fraction(duckMarketPrice, 15, 100)) + fixedPriceDiff)
319319 if ((bidAmount > maxPrice))
320320 then throw(((((("Price is too high, calc price: " + toString(duckMarketPrice)) + ", max. price after item check: ") + toString(maxPrice)) + ", your buy price: ") + toString(bidAmount)))
321321 else if ((size(i.payments) != 1))
322322 then throw("_103")
323323 else {
324324 let instantBuy = invoke(auctionDappAddress, "instantBuy", [auctionId], [AttachedPayment(value(i.payments[0]).assetId, bidAmount)])
325325 if ((instantBuy == instantBuy))
326326 then [StringEntry(("tx_" + toBase58String(i.transactionId)), auctionId)]
327327 else throw("Strict value is not equal to itself.")
328328 }
329329 }
330330 else if ((function == "cancelBid"))
331331 then {
332332 let auctionId = str1
333333 let bidId = str2
334334 let acceptBid = invoke(auctionDappAddress, "cancelBid", [auctionId, bidId], nil)
335335 if ((acceptBid == acceptBid))
336336 then [StringEntry(("tx_" + toBase58String(i.transactionId)), auctionId)]
337337 else throw("Strict value is not equal to itself.")
338338 }
339339 else if ((function == "cancelAuction"))
340340 then {
341341 let auctionId = str1
342342 let acceptBid = invoke(auctionDappAddress, "cancelAuction", [auctionId], nil)
343343 if ((acceptBid == acceptBid))
344344 then [StringEntry(("tx_" + toBase58String(i.transactionId)), auctionId)]
345345 else throw("Strict value is not equal to itself.")
346346 }
347347 else throw("_13")
348348 }
349349
350350

github/deemru/w8io/026f985 
74.68 ms