tx · HtAsxNwuDdVkabmoNGMS9h26TvRaodhoxcM11FVNSyzR

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.01100000 Waves

2023.06.15 22:36 [2624183] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "HtAsxNwuDdVkabmoNGMS9h26TvRaodhoxcM11FVNSyzR", "fee": 1100000, "feeAssetId": null, "timestamp": 1686857770104, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "bEGESj9vHqYBf9diWT1nhFEKRozXE3CYr9TiRTCHVD95MCtcpL19SUxw38Ud2Hgt9S5BzPAiiPPyoMSXwdspjp8" ], "script": "base64:BgIVCAISBQoDCAgIEgMKAQESAwoBARIAgQEABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABVkZWZhdWx0UmVzdEFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQUUN1dkZidmg0TGtQVW5yblUxejNqbmJBMXA5bTNXTmh2AwkAAAIBAVQFByRtYXRjaDACIzNNdW1rR0d6dENLQVhwV0RxeGtkZG9mcVhTVWJxUWt2U0p5CQACAQINVW5rbm93biBjaGFpbgARSW5mcmFVcGdyYWRlQ29zdFMEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDAAgMivoCUDCQAAAgEBVAUHJG1hd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JUaW1lCQBoAgADBQpZRUFSTUlMTElTCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMFDW1hcmtldGluZ0FkZHIFD21hcmtldGluZ0Ftb3VudAUKd2xnQXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQh0ZWFtQWRkcgUKdGVhbUFtb3VudAUKd2xnQXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQxyZXN0Q29udHJhY3QFCWFjdEFtb3VudAUKd2xnQXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQZjYWxsZXIFCnVzZXJBbW91bnQFCndsZ0Fzc2V0SWQJAMwIAgkBDEludGVnZXJFbnRyeQIFFGxhc3RNYXJrZXRpbmdUaW1lS2V5BQNub3cJAMwIAgkBDEludGVnZXJFbnRyeQIFD2xhc3RUZWFtVGltZUtleQUDbm93CQDMCAIJAQxJbnRlZ2VyRW50cnkCBRVsYXN0QWN0aXZpdGllc1RpbWVLZXkFA25vdwkAzAgCCQEMSW50ZWdlckVudHJ5AgULdXNlclRpbWVLZXkFA25vdwUDbmlsAMdfh44=", "height": 2624183, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: H5RbdsG7QRKzR6YpJ7yX4U5aoAJd7dndHaBGmXyvaJAZ Next: CdqR3XTDofvQ9yRXju6iewBEpyHWM6VUcn8jhg3Eb3Tq Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let chain = take(drop(this.bytes, 1), 1)
55
66 let usdtAssetId = match chain {
77 case _ =>
88 if ((base58'2W' == $match0))
99 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
1010 else if ((base58'2T' == $match0))
1111 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
1212 else throw("Unknown chain")
1313 }
1414
1515 let defaultRestAddressStr = match chain {
1616 case _ =>
1717 if ((base58'2W' == $match0))
1818 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
1919 else if ((base58'2T' == $match0))
2020 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
2121 else throw("Unknown chain")
2222 }
2323
2424 let InfraUpgradeCostS = match chain {
2525 case _ =>
2626 if ((base58'2W' == $match0))
2727 then 10000000000
2828 else if ((base58'2T' == $match0))
2929 then 100000000
3030 else throw("Unknown chain")
3131 }
3232
3333 let SEP = "__"
3434
3535 let MULT6 = 1000000
3636
3737 let MULT7 = 10000000
3838
3939 let MULT8 = 100000000
4040
4141 let MULT10 = 10000000000
4242
4343 let LANDPREFIX = "LAND"
4444
4545 let DUCKPREFIX = "DUCK"
4646
4747 let ARTPRESALE = "PRESALE"
4848
4949 let NUMRES = 6
5050
5151 let SSIZE = 25
5252
5353 let MSIZE = 100
5454
5555 let LSIZE = 225
5656
5757 let XLSIZE = 400
5858
5959 let XXLSIZE = 625
6060
6161 let DAILYRESBYPIECE = 3456000
6262
6363 let DAYMILLIS = 86400000
6464
6565 let WHMULTIPLIER = 10000000000
6666
6767 let DEFAULTLOCATION = "Africa_F_Africa"
6868
6969 let RESOURCEPRICEMIN = 39637
7070
7171 let ESMAXPACKAGES = 3
7272
7373 let ESBUYCOEF = 4
7474
7575 let ESSELLCOEF = 10
7676
7777 let MAXHP = 100
7878
7979 let resTypes = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"]
8080
8181 let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"]
8282
8383 let prodTypes = ["First Aid Kit L1", "First Aid Kit L2", "First Aid Kit L3", "Backpack L1", "Backpack L2", "Backpack L3", "Food Ration L1", "Food Ration L2", "Food Ration L3", "Jet Pack L1", "Jet Pack L2", "Jet Pack L3", "Shield L1", "Shield L2", "Shield L3"]
8484
8585 let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"]
8686
8787 let productionMatrix = ["1_1_1_2_2_5_1_10_0", "2_2_2_4_4_10_1_10_0", "3_3_3_6_6_15_1_10_0", "2_5_5_2_7_5_2_100_1", "4_10_10_4_14_10_2_100_1", "6_15_15_6_21_15_2_100_1", "1_1_1_1_1_8_1_10_2", "2_2_2_2_2_16_1_10_2", "3_3_3_3_3_24_1_10_2", "9_9_1_5_5_1_5_100_3", "18_18_2_10_10_2_5_100_3", "27_27_3_15_15_3_5_100_3", "2_2_1_2_2_2_1_10_4", "4_4_2_4_4_4_1_10_4", "6_6_3_6_6_6_1_10_4"]
8888
8989 let contIdxAmericas = 0
9090
9191 let contIdxEurope = 1
9292
9393 let contIdxAsia = 2
9494
9595 let contIdxAfrica = 3
9696
9797 let contIdxOceania = 4
9898
9999 let recipeIdxFuel = 0
100100
101101 let recipeIdxMetal = 1
102102
103103 let recipeIdxPlank = 2
104104
105105 let recipeIdxGlass = 3
106106
107107 let recipeIdxPlastic = 4
108108
109109 let recipeIdxProtein = 5
110110
111111 let recipeIdxWeight = 6
112112
113113 let recipeIdxPacksize = 7
114114
115115 let recipeIdxContinent = 8
116116
117117 let recLandNum = 0
118118
119119 let recLandSize = 1
120120
121121 let recTerrains = 2
122122
123123 let recContinent = 3
124124
125125 let whIdxLevels = 0
126126
127127 let whIdxRes = 1
128128
129129 let whIdxMat = 2
130130
131131 let whIdxProd = 3
132132
133133 let whIdxLOFT = 4
134134
135135 let volLocked = 0
136136
137137 let volOccupied = 1
138138
139139 let volFree = 2
140140
141141 let volTotal = 3
142142
143143 let bpIdxLevel = 0
144144
145145 let bpIdxRes = 1
146146
147147 let bpIdxMat = 2
148148
149149 let bpIdxProd = 3
150150
151151 func getPkgSize (prodIdx) = parseIntValue(split(productionMatrix[prodIdx], "_")[recipeIdxPacksize])
152152
153153
154154 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
155155
156156
157157 func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal)
158158
159159
160160 let IdxCfgStakingDapp = 1
161161
162162 let IdxCfgEconomyDapp = 2
163163
164164 let IdxCfgGovernanceDapp = 3
165165
166166 let IdxCfgWlgDapp = 4
167167
168168 func keyRestCfg () = "%s__restConfig"
169169
170170
171171 func keyRestAddress () = "%s__restAddr"
172172
173173
174174 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
175175
176176
177177 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
178178
179179
180180 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
181181
182182 let restCfg = readRestCfgOrFail(restContract)
183183
184184 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
185185
186186 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
187187
188188 let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp)
189189
190190 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
191191
192192 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
193193
194194
195195 func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId)
196196
197197
198198 func keyLandAssetIdToCustomName (assetId) = ("landCustomNameByAssetId_" + assetId)
199199
200200
201201 func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId)
202202
203203
204204 func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId)
205205
206206
207207 func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_")
208208
209209
210210 func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr)
211211
212212
213213 func keyWarehouseByLand (landAssetId) = ("wareHouse_" + landAssetId)
214214
215215
216216 func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr)
217217
218218
219219 func keyDuckAssetIdToCustomName (assetId) = ("duckCustomNameByAssetId_" + assetId)
220220
221221
222222 func keyAddressToCustomName (addr) = ("accountCustomNameByAddr_" + addr)
223223
224224
225225 func keyAddressRefBy (addr) = ("accRefBy_" + addr)
226226
227227
228228 func keyAddressReferrals (addr) = ("accReferrals_" + addr)
229229
230230
231231 func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId)
232232
233233
234234 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
235235
236236
237237 func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId)
238238
239239
240240 func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId)
241241
242242
243243 func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId)
244244
245245
246246 func keyResProportions () = "resTypesProportions"
247247
248248
249249 func keyBlocked () = "contractsBlocked"
250250
251251
252252 func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr)
253253
254254
255255 func keyOrderByLand (landAssetId) = ("landOrder_" + landAssetId)
256256
257257
258258 func keyEsWarehouse () = "emergencyWarehouseProducts"
259259
260260
261261 let locIdxContinent = 0
262262
263263 let locIdxType = 1
264264
265265 let locIdxId = 2
266266
267267 func asString (v) = match v {
268268 case s: String =>
269269 s
270270 case _ =>
271271 throw("fail to cast into String")
272272 }
273273
274274
275275 func asInt (v) = match v {
276276 case n: Int =>
277277 n
278278 case _ =>
279279 throw("fail to cast into Int")
280280 }
281281
282282
283283 func asAnyList (v) = match v {
284284 case l: List[Any] =>
285285 l
286286 case _ =>
287287 throw("fail to cast into List[Any]")
288288 }
289289
290290
291291 func asBoolean (v) = match v {
292292 case s: Boolean =>
293293 s
294294 case _ =>
295295 throw("fail to cast into Boolean")
296296 }
297297
298298
299299 func numPiecesBySize (landSize) = match landSize {
300300 case _ =>
301301 if (("S" == $match0))
302302 then SSIZE
303303 else if (("M" == $match0))
304304 then MSIZE
305305 else if (("L" == $match0))
306306 then LSIZE
307307 else if (("XL" == $match0))
308308 then XLSIZE
309309 else if (("XXL" == $match0))
310310 then XXLSIZE
311311 else throw("Unknown land size")
312312 }
313313
314314
315315 let IdxEffTotal = 0
316316
317317 let IdxEffUser = 1
318318
319319 func getVotingPower (userAddrStrOrEmpty) = {
320320 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
321321 func adder (acc,item) = (acc + parseIntValue(item))
322322
323323 let totalPower = {
324324 let $l = props
325325 let $s = size($l)
326326 let $acc0 = 0
327327 func $f0_1 ($a,$i) = if (($i >= $s))
328328 then $a
329329 else adder($a, $l[$i])
330330
331331 func $f0_2 ($a,$i) = if (($i >= $s))
332332 then $a
333333 else throw("List size exceeds 6")
334334
335335 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
336336 }
337337 let usersPower = if ((userAddrStrOrEmpty == ""))
338338 then 0
339339 else {
340340 let landsStr = getString(stakingContract, keyStakedLandsByOwner(userAddrStrOrEmpty))
341341 let lands = if (isDefined(landsStr))
342342 then split_51C(value(landsStr), "_")
343343 else nil
344344 func oneLand (acc,landAssetId) = {
345345 let asset = value(assetInfo(fromBase58String(landAssetId)))
346346 let landSize = split(asset.description, "_")[recLandSize]
347347 (acc + numPiecesBySize(landSize))
348348 }
349349
350350 let $l = lands
351351 let $s = size($l)
352352 let $acc0 = 0
353353 func $f1_1 ($a,$i) = if (($i >= $s))
354354 then $a
355355 else oneLand($a, $l[$i])
356356
357357 func $f1_2 ($a,$i) = if (($i >= $s))
358358 then $a
359359 else throw("List size exceeds 100")
360360
361361 $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
362362 }
363363 [totalPower, usersPower]
364364 }
365365
366366
367367 func getRecipeMaterials (recipe) = {
368368 func addMat (ac,j) = (ac + parseIntValue(recipe[j]))
369369
370370 let $l = [0, 1, 2, 3, 4, 5]
371371 let $s = size($l)
372372 let $acc0 = 0
373373 func $f0_1 ($a,$i) = if (($i >= $s))
374374 then $a
375375 else addMat($a, $l[$i])
376376
377377 func $f0_2 ($a,$i) = if (($i >= $s))
378378 then $a
379379 else throw("List size exceeds 6")
380380
381381 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
382382 }
383383
384384
385385 let MULT14 = 100000000000000
386386
387387 let MARKETINGSHARE = 100000
388388
389389 let TEAMSHARE = 200000
390390
391391 let ACTIVITYSHARE = 100000
392392
393393 let PLAYERSHARE = 400000
394394
395395 let YEARMILLIS = 31557600000
396396
397397 let wlgAssetIdKey = "wlg_assetId"
398398
399399 let wlgIssueTimeKey = "wlg_issueTime"
400400
401401 let marketingAddrKey = "marketingAddr"
402402
403403 let teamAddrKey = "teamAddr"
404404
405405 let lastMarketingTimeKey = "lastClaimedTime_marketing"
406406
407407 let lastTeamTimeKey = "lastClaimedTime_team"
408408
409409 let lastActivitiesTimeKey = "lastClaimedTime_activities"
410410
411411 func keyLastClaimedTimeByUser (addr) = "lastClaimedTimeUser_ + addr"
412412
413413
414414 @Callable(i)
415415 func constructorV1 (restAddr,marketingAddr,teamAddr) = if ((i.caller != this))
416416 then throw("Permission denied")
417417 else if (isDefined(getString(wlgAssetIdKey)))
418418 then throw("Already initialized")
419419 else {
420420 let issue = Issue("WLGOLD", "WavesLands Gold investment token", MULT14, 8, true, unit, 0)
421421 let assetId = calculateAssetId(issue)
422422 [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr)]
423423 }
424424
425425
426426
427427 @Callable(i)
428428 func buyWlg (amount) = nil
429429
430430
431431
432432 @Callable(i)
433433 func sellWlg (amount) = nil
434434
435435
436436
437437 @Callable(i)
438438 func claim () = {
439439 let caller = i.caller
440440 let callerAddr = toString(caller)
441441 let now = lastBlock.timestamp
442442 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
443443 let wlgAssetId = value(getBinary(wlgAssetIdKey))
444444 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
445445 let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey)))
446446 let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS)
447447 let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime)
448448 let teamAddr = addressFromStringValue(value(getString(teamAddrKey)))
449449 let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
450450 let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime)
451451 let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
452452 let userTimeKey = keyLastClaimedTimeByUser(callerAddr)
453453 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
454454 let eff = getVotingPower(callerAddr)
455455 let userAmount = fraction(fraction(fraction(MULT14, PLAYERSHARE, MULT6), eff[IdxEffUser], eff[IdxEffTotal]), (now - lastUserTime), (3 * YEARMILLIS))
456456 [ScriptTransfer(marketingAddr, marketingAmount, wlgAssetId), ScriptTransfer(teamAddr, teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, wlgAssetId), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)]
457457 }
458458
459459

github/deemru/w8io/026f985 
35.62 ms