tx · BZGMAks3Tw8M2gq64Pee4atbDcJUiBTSVqRY6RcYozHt 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.02600000 Waves 2024.11.25 15:14 [3386927] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "BZGMAks3Tw8M2gq64Pee4atbDcJUiBTSVqRY6RcYozHt", "fee": 2600000, "feeAssetId": null, "timestamp": 1732536862056, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "2SfA3EzngkC1MGiNXowSLm8DA69GU3TKhJ9AAcxQJNZDQJ9vBqQLDbQrDXESFg3EyUcwYpe54iXrpDjjKfosp4T3" ], "script": "base64:BgJHCAISBgoECAgICBIDCgEIEgMKAQESBAoCCAESAwoBARIECgIIARIAEgMKAQgSAwoBARIDCgEBEgMKAQgSAwoBCBIDCgEBEgCQAQADU0VQAgJfXwAFTVVMVDYAwIQ9AAVNVUxUOACAwtcvAA5NSU5TSE9QUEFZTUVOVACgjQYACkRBWV9NSUxMSVMAgLiZKQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEACkRBWV9CTE9DS1MEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDAAoAsDCQAAAgEBVAUHJG1hdGNoMAA8CQACAQINVW5rbm93biBjaGFpbgALV0VFS19CTE9DS1MEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDAA4E4DCQAAAgEBVAUHJG1hdGNoMAC0AQkAAgECDVVua25vd24gY2hhaW4AC3VzZHRBc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwASCE2nqyCAM/TtG7yo7ui5O8yYLdC136B5ao1CP5qA//uQMJAAACAQFUBQckbWF0Y2gwASBVs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GVyBQR0aGlzCQACAQIRUGVybWlzc2lvbiBkZW5pZWQEBHdlZWsJAGkCBQZoZWlnaHQFC1dFRUtfQkxPQ0tTCQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIJAQ5rZXlOdW1ORlQyRHJhdwEFBHdlZWsFCW51bVByaXplcwUDbmlsBQludW1Qcml6ZXMBaQEJb3BlbkNoZXN0AAMJAQEhAQURS1NfQUxMT1dfTkZUX0RSQVcJAAIBAhRUZW1wb3JhcmlseSBkaXNhYmxlZAQMcHJvbG9nUmVzdWx0CQEHcHJvbG9nMgADCQAAAgUMcHJvbG9nUmVzdWx0BQxwcm9sb2dSZXN1bHQDCQECIT0CCQCQAwEIBQFpCHBheW1lbnRzAAAJAAIBAhRObyBwYXltZW50cyByZXF1aXJlZAQIZHJhd1dlZWsJAGUCCQBpAgUGaGVpZ2h0BQtXRUVLX0JMT0NLUwABBARhZGRyCQClCAEIBQFpBmNhbGxlcgQLdXNlclRpY2tldHMJAQt2YWx1ZU9yRWxzZQIJAJ8IAQkBEmtleVVzZXJXZWVrVGlja2V0cwIFBGFkZHIFCGRyYXdXZWVrAAADCQBnAgAABQt1c2VyVGlja2V0cwkAAgECGU5vIGdlbXMgdG8gb3BlbiB0aGUgY2hlc3QJARFvcGVuQ2hlc3RJbnRlcm5hbAEFBGFkZHIJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4APA4SAQ==", "height": 3386927, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 35XQkjvoqeBNJdAnVoCPD3mW4okgZ6Z2YMn8z6GckqjG Next: 14MoyMZUbpiiwVuCi246oZZa9zNjuKUtYq4YDRy7VB9D Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT8 = 100000000 | |
9 | + | ||
10 | + | let MINSHOPPAYMENT = 100000 | |
11 | + | ||
4 | 12 | let DAY_MILLIS = 86400000 | |
5 | 13 | ||
6 | 14 | let chain = take(drop(this.bytes, 1), 1) | |
15 | + | ||
16 | + | let DAY_BLOCKS = match chain { | |
17 | + | case _ => | |
18 | + | if ((base58'2W' == $match0)) | |
19 | + | then 1440 | |
20 | + | else if ((base58'2T' == $match0)) | |
21 | + | then 60 | |
22 | + | else throw("Unknown chain") | |
23 | + | } | |
24 | + | ||
25 | + | let WEEK_BLOCKS = match chain { | |
26 | + | case _ => | |
27 | + | if ((base58'2W' == $match0)) | |
28 | + | then 10080 | |
29 | + | else if ((base58'2T' == $match0)) | |
30 | + | then 180 | |
31 | + | else throw("Unknown chain") | |
32 | + | } | |
7 | 33 | ||
8 | 34 | let usdtAssetId = match chain { | |
9 | 35 | case _ => | |
11 | 37 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
12 | 38 | else if ((base58'2T' == $match0)) | |
13 | 39 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
40 | + | else throw("Unknown chain") | |
41 | + | } | |
42 | + | ||
43 | + | let defaultRest2AddressStr = match chain { | |
44 | + | case _ => | |
45 | + | if ((base58'2W' == $match0)) | |
46 | + | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
47 | + | else if ((base58'2T' == $match0)) | |
48 | + | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
14 | 49 | else throw("Unknown chain") | |
15 | 50 | } | |
16 | 51 | ||
23 | 58 | else throw("Unknown chain") | |
24 | 59 | } | |
25 | 60 | ||
26 | - | let | |
61 | + | let KS_ALLOW_NFT_DRAW = match chain { | |
27 | 62 | case _ => | |
28 | 63 | if ((base58'2W' == $match0)) | |
29 | - | then | |
64 | + | then false | |
30 | 65 | else if ((base58'2T' == $match0)) | |
31 | - | then | |
66 | + | then true | |
32 | 67 | else throw("Unknown chain") | |
33 | 68 | } | |
34 | - | ||
35 | - | let SEP = "__" | |
36 | - | ||
37 | - | let MULT6 = 1000000 | |
38 | - | ||
39 | - | let MULT8 = 100000000 | |
40 | - | ||
41 | - | let MINSHOPPAYMENT = 100000 | |
42 | 69 | ||
43 | 70 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
44 | 71 | ||
45 | 72 | ||
46 | - | let | |
73 | + | let IdxCfgAcres2Dapp = 1 | |
47 | 74 | ||
48 | - | let IdxCfgWlgDapp = | |
75 | + | let IdxCfgWlgDapp = 2 | |
49 | 76 | ||
50 | - | let IdxCfgPuzzlePoolDapp = | |
77 | + | let IdxCfgPuzzlePoolDapp = 4 | |
51 | 78 | ||
52 | - | let IdxCfgInvestFundDapp = 6 | |
53 | - | ||
54 | - | let IdxCfgAcresDapp = 8 | |
79 | + | let IdxCfgInvestFundDapp = 5 | |
55 | 80 | ||
56 | 81 | func keyRestCfg () = "%s__restConfig" | |
82 | + | ||
83 | + | ||
84 | + | func keyRest2Address () = "%s__rest2Addr" | |
57 | 85 | ||
58 | 86 | ||
59 | 87 | func keyRestAddress () = "%s__restAddr" | |
60 | 88 | ||
61 | 89 | ||
62 | - | func keyRest2Address () = "%s__rest2Addr" | |
63 | - | ||
90 | + | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
64 | 91 | ||
65 | 92 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
66 | 93 | ||
67 | 94 | ||
68 | - | func getContractAddressOrFail ( | |
95 | + | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
69 | 96 | ||
70 | 97 | ||
71 | - | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
98 | + | let IdxCfgStakingDapp = 1 | |
99 | + | ||
100 | + | let IdxCfgAcresDapp = 8 | |
72 | 101 | ||
73 | 102 | let restCfg = readRestCfgOrFail(restContract) | |
74 | 103 | ||
75 | 104 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
76 | 105 | ||
77 | - | let | |
106 | + | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
78 | 107 | ||
79 | - | let | |
108 | + | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
80 | 109 | ||
81 | - | let | |
110 | + | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
82 | 111 | ||
83 | - | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
112 | + | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
113 | + | ||
114 | + | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
115 | + | ||
116 | + | let puzzlePoolContract = getContractAddressOrFail(rest2Cfg, IdxCfgPuzzlePoolDapp) | |
117 | + | ||
118 | + | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
119 | + | ||
120 | + | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
121 | + | ||
84 | 122 | ||
85 | 123 | let wlgAssetIdKey = "wlg_assetId" | |
86 | 124 | ||
87 | 125 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
126 | + | ||
127 | + | func keyUserBet (addr) = ("userBet_" + addr) | |
128 | + | ||
129 | + | ||
130 | + | func keyUserWeekTickets (addr,week) = ((("userWeekTickets_" + addr) + "_") + toString(week)) | |
131 | + | ||
132 | + | ||
133 | + | func keyTotalWeekTickets (week) = ("totalWeekTickets_" + toString(week)) | |
134 | + | ||
135 | + | ||
136 | + | func keyTotalWeekParticipants (week) = ("totalWeekParticipants_" + toString(week)) | |
137 | + | ||
138 | + | ||
139 | + | func keyNumNFT2Draw (week) = ("numNFT2Draw_" + toString(week)) | |
140 | + | ||
141 | + | ||
142 | + | func keyNumNFTDrawn (week) = ("numNFTDrawn_" + toString(week)) | |
143 | + | ||
144 | + | ||
145 | + | func keyWeekWinners (week) = ("weekWinners_" + toString(week)) | |
146 | + | ||
147 | + | ||
148 | + | func winningBet (day) = (toInt(value(value(blockInfoByHeight((day * DAY_BLOCKS))).vrf)) % 4) | |
149 | + | ||
88 | 150 | ||
89 | 151 | func asInt (v) = match v { | |
90 | 152 | case n: Int => | |
92 | 154 | case _ => | |
93 | 155 | throw("fail to cast into Int") | |
94 | 156 | } | |
95 | - | ||
96 | - | ||
97 | - | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
98 | 157 | ||
99 | 158 | ||
100 | 159 | func fixedPoint (val,decimals) = { | |
193 | 252 | ||
194 | 253 | let DAY_MS = 86400000 | |
195 | 254 | ||
196 | - | let DAY_BLOCKS = 1440 | |
197 | - | ||
198 | - | let WEEK_BLOCKS = 10080 | |
199 | - | ||
200 | 255 | let ISSUE10 = 1000000000 | |
201 | 256 | ||
202 | 257 | let PLAYERS10_SHARE = 800000 | |
254 | 309 | ||
255 | 310 | let IdxDtx1PercGemWinner = 1 | |
256 | 311 | ||
312 | + | let DEFAULT_WEEKLY_PRIZES = 5 | |
313 | + | ||
314 | + | func keyUserFullBonus (addr) = ("userFullBonus_" + addr) | |
315 | + | ||
316 | + | ||
257 | 317 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
258 | 318 | ||
259 | 319 | func getLevelByAcres (acres) = { | |
280 | 340 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
281 | 341 | ||
282 | 342 | ||
343 | + | func getFarmingPowerByAcresAndBonus (acres,bonus6) = { | |
344 | + | let notBonused = getFarmingPowerByAcres(acres) | |
345 | + | $Tuple2(fraction(notBonused, (M6_ + bonus6), M6_), notBonused) | |
346 | + | } | |
347 | + | ||
348 | + | ||
283 | 349 | func getFarmingPowers (userAddrStrOrEmpty,acres2Contract) = { | |
284 | 350 | let totalFP = valueOrElse(getInteger(acres2Contract, totalFarmingPowerKey), 0) | |
285 | 351 | let userAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0) | |
286 | - | let userFP = getFarmingPowerByAcres(userAcres) | |
287 | - | [totalFP, userFP] | |
352 | + | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(userAddrStrOrEmpty)), 0) | |
353 | + | let $t079143 = getFarmingPowerByAcresAndBonus(userAcres, userBonus) | |
354 | + | let userFPbonused = $t079143._1 | |
355 | + | let userFPnotBonused = $t079143._2 | |
356 | + | [totalFP, userFPbonused, userFPnotBonused, userBonus] | |
288 | 357 | } | |
289 | - | ||
290 | - | ||
291 | - | func keyUserBet (addr) = ("userBet_" + addr) | |
292 | - | ||
293 | - | ||
294 | - | func keyUserWeekTickets (addr,week) = ((("userWeekTickets_" + addr) + "_") + toString(week)) | |
295 | - | ||
296 | - | ||
297 | - | func keyTotalWeekTickets (week) = ("totalWeekTickets_" + toString(week)) | |
298 | - | ||
299 | - | ||
300 | - | func keyTotalWeekParticipants (week) = ("totalWeekParticipants_" + toString(week)) | |
301 | - | ||
302 | - | ||
303 | - | let DEFAULT_WEEKLY_PRIZES = 1 | |
304 | - | ||
305 | - | func keyNumNFT2Draw (week) = ("numNFT2Draw_" + toString(week)) | |
306 | - | ||
307 | - | ||
308 | - | func keyNumNFTDrawn (week) = ("numNFTDrawn_" + toString(week)) | |
309 | - | ||
310 | - | ||
311 | - | func keyWeekWinners (week) = ("weekWinners_" + toString(week)) | |
312 | - | ||
313 | - | ||
314 | - | func winningBet (day) = (toInt(value(value(blockInfoByHeight((day * DAY_BLOCKS))).vrf)) % 4) | |
315 | 358 | ||
316 | 359 | ||
317 | 360 | let idxTotalFP = 0 | |
318 | 361 | ||
319 | - | let | |
362 | + | let idxUserFPbonused = 1 | |
320 | 363 | ||
321 | 364 | let ixWlgAmount = 0 | |
322 | 365 | ||
397 | 440 | } | |
398 | 441 | let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0) | |
399 | 442 | let userAmount = if ((eff[idxTotalFP] != 0)) | |
400 | - | then fraction(userAvailable, eff[ | |
443 | + | then fraction(userAvailable, eff[idxUserFPbonused], eff[idxTotalFP]) | |
401 | 444 | else 0 | |
402 | 445 | let lastIssue10Time = valueOrElse(getInteger(contracts[dapp2Wlg], wlgIssue10TimeKey), NEW_STAKING_START) | |
403 | 446 | let issue10Amount = fraction(ISSUE10, max([(now - lastIssue10Time), 0]), DAY_MS) | |
405 | 448 | let teamIssue10Amount = fraction(issue10Amount, TEAM10_SHARE, M6_) | |
406 | 449 | let user10Interval = max([(now - max([NEW_STAKING_START, lastUserTime])), 0]) | |
407 | 450 | let user10part = if ((eff[idxTotalFP] != 0)) | |
408 | - | then fraction(fraction(fraction(ISSUE10, user10Interval, DAY_MS), eff[ | |
451 | + | then fraction(fraction(fraction(ISSUE10, user10Interval, DAY_MS), eff[idxUserFPbonused], eff[idxTotalFP]), PLAYERS10_SHARE, M6_) | |
409 | 452 | else 0 | |
410 | 453 | let newIssue10Time = max([NEW_STAKING_START, now]) | |
411 | 454 | let acresStakedTotal = valueOrElse(getInteger(contracts[dapp2Staking], acresStakdTotalKey), 0) | |
413 | 456 | } | |
414 | 457 | ||
415 | 458 | ||
416 | - | let net = take(drop(this.bytes, 1), 1) | |
417 | - | ||
418 | - | let defaultRest2AddressStr = match net { | |
419 | - | case _ => | |
420 | - | if ((base58'2W' == $match0)) | |
421 | - | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
422 | - | else if ((base58'2T' == $match0)) | |
423 | - | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
424 | - | else throw("Unknown chain") | |
425 | - | } | |
426 | - | ||
427 | 459 | let profitAddrKey = "profitAddr" | |
428 | 460 | ||
429 | 461 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
430 | 462 | ||
431 | 463 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
432 | 464 | ||
433 | - | ||
434 | - | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
435 | - | ||
436 | - | let acres2Contract = addressFromStringValue(acres2AddressStr) | |
437 | 465 | ||
438 | 466 | func prolog2 () = asInt(reentrantInvoke(acres2Contract, "saveLastTx", nil, nil)) | |
439 | 467 | ||
682 | 710 | then if ((size(i.payments) != 0)) | |
683 | 711 | then throw("No payments required") | |
684 | 712 | else { | |
685 | - | let $ | |
686 | - | let actions = $ | |
687 | - | let wlgClaimedAmount = $ | |
713 | + | let $t01404514114 = claimInternal2(toString(i.caller)) | |
714 | + | let actions = $t01404514114._1 | |
715 | + | let wlgClaimedAmount = $t01404514114._2 | |
688 | 716 | $Tuple2((actions :+ ScriptTransfer(i.caller, wlgClaimedAmount, wlgAssetId)), prologResult) | |
689 | 717 | } | |
690 | 718 | else throw("Strict value is not equal to itself.") | |
700 | 728 | else false) | |
701 | 729 | then throw("Permission denied") | |
702 | 730 | else { | |
703 | - | let $ | |
704 | - | let actions = $ | |
705 | - | let wlgClaimedAmount = $ | |
731 | + | let $t01443314487 = claimInternal2(addr) | |
732 | + | let actions = $t01443314487._1 | |
733 | + | let wlgClaimedAmount = $t01443314487._2 | |
706 | 734 | $Tuple2(if ((wlgClaimedAmount > 0)) | |
707 | 735 | then (actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId)) | |
708 | 736 | else actions, wlgClaimedAmount) | |
731 | 759 | if ((prologResult == prologResult)) | |
732 | 760 | then if ((size(i.payments) != 0)) | |
733 | 761 | then throw("No payments required") | |
734 | - | else if (((bet / 4) != 0)) | |
735 | - | then throw("Invalid bet: should be 0..3") | |
736 | - | else { | |
737 | - | let moment = (height % DAY_BLOCKS) | |
738 | - | if ((moment > (DAY_BLOCKS - 3))) | |
739 | - | then throw((("Cannot bet: the day is almost ended, please wait " + toString((DAY_BLOCKS - moment))) + " blocks")) | |
762 | + | else { | |
763 | + | let addr = toString(i.caller) | |
764 | + | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
765 | + | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
766 | + | let weekTickets = valueOrElse(getInteger(keyTotalWeekTickets(drawWeek)), 0) | |
767 | + | if (if ((userTickets > 0)) | |
768 | + | then (weekTickets > 0) | |
769 | + | else false) | |
770 | + | then throw("Please open the chest first") | |
771 | + | else if (((bet / 4) != 0)) | |
772 | + | then throw("Invalid bet: should be 0..3") | |
740 | 773 | else { | |
741 | - | let addr = toString(i.caller) | |
742 | - | let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(addr)), 0) | |
743 | - | let lvl = getLevelByAcres(stakedAcres) | |
744 | - | if ((lvl == 0)) | |
745 | - | then throw("You need to stake some ACRES to bet") | |
774 | + | let moment = (height % DAY_BLOCKS) | |
775 | + | if ((moment > (DAY_BLOCKS - 3))) | |
776 | + | then throw((("Cannot bet: the day is almost ended, please wait " + toString((DAY_BLOCKS - moment))) + " blocks")) | |
746 | 777 | else { | |
747 | - | let tomorrow = ((height / DAY_BLOCKS) + 1) | |
748 | - | let betKey = keyUserBet(addr) | |
749 | - | let oldUserBetStr = getString(betKey) | |
750 | - | let newBetEntry = StringEntry(betKey, ((toString(tomorrow) + "_") + toString(bet))) | |
751 | - | if (isDefined(oldUserBetStr)) | |
752 | - | then { | |
753 | - | let userBet = value(oldUserBetStr) | |
754 | - | if ((split(userBet, "_")[0] == toString(tomorrow))) | |
755 | - | then throw("You already bet for tomorrow") | |
756 | - | else { | |
757 | - | let r = claimTicketsInternal(addr, userBet) | |
758 | - | $Tuple2((r._1 :+ newBetEntry), r._2) | |
778 | + | let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(addr)), 0) | |
779 | + | let lvl = getLevelByAcres(stakedAcres) | |
780 | + | if ((lvl == 0)) | |
781 | + | then throw("You need to stake some ACRES to bet") | |
782 | + | else { | |
783 | + | let tomorrow = ((height / DAY_BLOCKS) + 1) | |
784 | + | let betKey = keyUserBet(addr) | |
785 | + | let oldUserBetStr = getString(betKey) | |
786 | + | let newBetEntry = StringEntry(betKey, ((toString(tomorrow) + "_") + toString(bet))) | |
787 | + | if (isDefined(oldUserBetStr)) | |
788 | + | then { | |
789 | + | let userBet = value(oldUserBetStr) | |
790 | + | if ((split(userBet, "_")[0] == toString(tomorrow))) | |
791 | + | then throw("You already bet for tomorrow") | |
792 | + | else { | |
793 | + | let r = claimTicketsInternal(addr, userBet) | |
794 | + | $Tuple2((r._1 :+ newBetEntry), r._2) | |
795 | + | } | |
759 | 796 | } | |
797 | + | else $Tuple2([newBetEntry], 0) | |
760 | 798 | } | |
761 | - | else $Tuple2([newBetEntry], 0) | |
762 | 799 | } | |
763 | 800 | } | |
764 | - | ||
801 | + | } | |
765 | 802 | else throw("Strict value is not equal to itself.") | |
766 | 803 | } | |
767 | 804 | ||
771 | 808 | func takeWlgXp (addr) = if ((i.caller != stakingContract)) | |
772 | 809 | then throw("Permission denied") | |
773 | 810 | else { | |
774 | - | let $ | |
775 | - | let actions = $ | |
776 | - | let xp = $ | |
811 | + | let $t01708717130 = takeXpInternal(addr, 0) | |
812 | + | let actions = $t01708717130._1 | |
813 | + | let xp = $t01708717130._2 | |
777 | 814 | $Tuple2(actions, xp) | |
778 | 815 | } | |
779 | 816 | ||
781 | 818 | ||
782 | 819 | @Callable(i) | |
783 | 820 | func checkWlgXpREADONLY (addr) = { | |
784 | - | let $ | |
785 | - | let ignored = $ | |
786 | - | let deltaXP = $ | |
821 | + | let $t01720717255 = takeXpInternal(addr, 0) | |
822 | + | let ignored = $t01720717255._1 | |
823 | + | let deltaXP = $t01720717255._2 | |
787 | 824 | let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP) | |
788 | 825 | let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP) | |
789 | 826 | $Tuple2(nil, (lvlPoints :+ newXP)) | |
802 | 839 | ||
803 | 840 | ||
804 | 841 | @Callable(i) | |
805 | - | func openChest () = { | |
806 | - | let prologResult = prolog2() | |
807 | - | if ((prologResult == prologResult)) | |
808 | - | then if ((size(i.payments) != 0)) | |
809 | - | then throw("No payments required") | |
810 | - | else { | |
811 | - | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
812 | - | let addr = toString(i.caller) | |
813 | - | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
814 | - | if ((0 >= userTickets)) | |
815 | - | then throw("No gems to open the chest") | |
816 | - | else openChestInternal(addr) | |
817 | - | } | |
818 | - | else throw("Strict value is not equal to itself.") | |
819 | - | } | |
842 | + | func openChest () = if (!(KS_ALLOW_NFT_DRAW)) | |
843 | + | then throw("Temporarily disabled") | |
844 | + | else { | |
845 | + | let prologResult = prolog2() | |
846 | + | if ((prologResult == prologResult)) | |
847 | + | then if ((size(i.payments) != 0)) | |
848 | + | then throw("No payments required") | |
849 | + | else { | |
850 | + | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
851 | + | let addr = toString(i.caller) | |
852 | + | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
853 | + | if ((0 >= userTickets)) | |
854 | + | then throw("No gems to open the chest") | |
855 | + | else openChestInternal(addr) | |
856 | + | } | |
857 | + | else throw("Strict value is not equal to itself.") | |
858 | + | } | |
820 | 859 | ||
821 | 860 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let SEP = "__" | |
5 | + | ||
6 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT8 = 100000000 | |
9 | + | ||
10 | + | let MINSHOPPAYMENT = 100000 | |
11 | + | ||
4 | 12 | let DAY_MILLIS = 86400000 | |
5 | 13 | ||
6 | 14 | let chain = take(drop(this.bytes, 1), 1) | |
15 | + | ||
16 | + | let DAY_BLOCKS = match chain { | |
17 | + | case _ => | |
18 | + | if ((base58'2W' == $match0)) | |
19 | + | then 1440 | |
20 | + | else if ((base58'2T' == $match0)) | |
21 | + | then 60 | |
22 | + | else throw("Unknown chain") | |
23 | + | } | |
24 | + | ||
25 | + | let WEEK_BLOCKS = match chain { | |
26 | + | case _ => | |
27 | + | if ((base58'2W' == $match0)) | |
28 | + | then 10080 | |
29 | + | else if ((base58'2T' == $match0)) | |
30 | + | then 180 | |
31 | + | else throw("Unknown chain") | |
32 | + | } | |
7 | 33 | ||
8 | 34 | let usdtAssetId = match chain { | |
9 | 35 | case _ => | |
10 | 36 | if ((base58'2W' == $match0)) | |
11 | 37 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
12 | 38 | else if ((base58'2T' == $match0)) | |
13 | 39 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
40 | + | else throw("Unknown chain") | |
41 | + | } | |
42 | + | ||
43 | + | let defaultRest2AddressStr = match chain { | |
44 | + | case _ => | |
45 | + | if ((base58'2W' == $match0)) | |
46 | + | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
47 | + | else if ((base58'2T' == $match0)) | |
48 | + | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
14 | 49 | else throw("Unknown chain") | |
15 | 50 | } | |
16 | 51 | ||
17 | 52 | let defaultRestAddressStr = match chain { | |
18 | 53 | case _ => | |
19 | 54 | if ((base58'2W' == $match0)) | |
20 | 55 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
21 | 56 | else if ((base58'2T' == $match0)) | |
22 | 57 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
23 | 58 | else throw("Unknown chain") | |
24 | 59 | } | |
25 | 60 | ||
26 | - | let | |
61 | + | let KS_ALLOW_NFT_DRAW = match chain { | |
27 | 62 | case _ => | |
28 | 63 | if ((base58'2W' == $match0)) | |
29 | - | then | |
64 | + | then false | |
30 | 65 | else if ((base58'2T' == $match0)) | |
31 | - | then | |
66 | + | then true | |
32 | 67 | else throw("Unknown chain") | |
33 | 68 | } | |
34 | - | ||
35 | - | let SEP = "__" | |
36 | - | ||
37 | - | let MULT6 = 1000000 | |
38 | - | ||
39 | - | let MULT8 = 100000000 | |
40 | - | ||
41 | - | let MINSHOPPAYMENT = 100000 | |
42 | 69 | ||
43 | 70 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
44 | 71 | ||
45 | 72 | ||
46 | - | let | |
73 | + | let IdxCfgAcres2Dapp = 1 | |
47 | 74 | ||
48 | - | let IdxCfgWlgDapp = | |
75 | + | let IdxCfgWlgDapp = 2 | |
49 | 76 | ||
50 | - | let IdxCfgPuzzlePoolDapp = | |
77 | + | let IdxCfgPuzzlePoolDapp = 4 | |
51 | 78 | ||
52 | - | let IdxCfgInvestFundDapp = 6 | |
53 | - | ||
54 | - | let IdxCfgAcresDapp = 8 | |
79 | + | let IdxCfgInvestFundDapp = 5 | |
55 | 80 | ||
56 | 81 | func keyRestCfg () = "%s__restConfig" | |
82 | + | ||
83 | + | ||
84 | + | func keyRest2Address () = "%s__rest2Addr" | |
57 | 85 | ||
58 | 86 | ||
59 | 87 | func keyRestAddress () = "%s__restAddr" | |
60 | 88 | ||
61 | 89 | ||
62 | - | func keyRest2Address () = "%s__rest2Addr" | |
63 | - | ||
90 | + | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
64 | 91 | ||
65 | 92 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
66 | 93 | ||
67 | 94 | ||
68 | - | func getContractAddressOrFail ( | |
95 | + | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
69 | 96 | ||
70 | 97 | ||
71 | - | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
98 | + | let IdxCfgStakingDapp = 1 | |
99 | + | ||
100 | + | let IdxCfgAcresDapp = 8 | |
72 | 101 | ||
73 | 102 | let restCfg = readRestCfgOrFail(restContract) | |
74 | 103 | ||
75 | 104 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
76 | 105 | ||
77 | - | let | |
106 | + | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
78 | 107 | ||
79 | - | let | |
108 | + | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
80 | 109 | ||
81 | - | let | |
110 | + | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
82 | 111 | ||
83 | - | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
112 | + | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
113 | + | ||
114 | + | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
115 | + | ||
116 | + | let puzzlePoolContract = getContractAddressOrFail(rest2Cfg, IdxCfgPuzzlePoolDapp) | |
117 | + | ||
118 | + | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
119 | + | ||
120 | + | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
121 | + | ||
84 | 122 | ||
85 | 123 | let wlgAssetIdKey = "wlg_assetId" | |
86 | 124 | ||
87 | 125 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
126 | + | ||
127 | + | func keyUserBet (addr) = ("userBet_" + addr) | |
128 | + | ||
129 | + | ||
130 | + | func keyUserWeekTickets (addr,week) = ((("userWeekTickets_" + addr) + "_") + toString(week)) | |
131 | + | ||
132 | + | ||
133 | + | func keyTotalWeekTickets (week) = ("totalWeekTickets_" + toString(week)) | |
134 | + | ||
135 | + | ||
136 | + | func keyTotalWeekParticipants (week) = ("totalWeekParticipants_" + toString(week)) | |
137 | + | ||
138 | + | ||
139 | + | func keyNumNFT2Draw (week) = ("numNFT2Draw_" + toString(week)) | |
140 | + | ||
141 | + | ||
142 | + | func keyNumNFTDrawn (week) = ("numNFTDrawn_" + toString(week)) | |
143 | + | ||
144 | + | ||
145 | + | func keyWeekWinners (week) = ("weekWinners_" + toString(week)) | |
146 | + | ||
147 | + | ||
148 | + | func winningBet (day) = (toInt(value(value(blockInfoByHeight((day * DAY_BLOCKS))).vrf)) % 4) | |
149 | + | ||
88 | 150 | ||
89 | 151 | func asInt (v) = match v { | |
90 | 152 | case n: Int => | |
91 | 153 | n | |
92 | 154 | case _ => | |
93 | 155 | throw("fail to cast into Int") | |
94 | 156 | } | |
95 | - | ||
96 | - | ||
97 | - | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
98 | 157 | ||
99 | 158 | ||
100 | 159 | func fixedPoint (val,decimals) = { | |
101 | 160 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
102 | 161 | let lowPart = toString((val % tenPow)) | |
103 | 162 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
104 | 163 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
105 | 164 | } | |
106 | 165 | ||
107 | 166 | ||
108 | 167 | func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue)) | |
109 | 168 | then throw("maxValue should be > 0") | |
110 | 169 | else { | |
111 | 170 | let randomHash = sha256_16Kb((salt + entropy)) | |
112 | 171 | (toInt(randomHash) % maxValue) | |
113 | 172 | } | |
114 | 173 | ||
115 | 174 | ||
116 | 175 | let SCALE8 = 100000000 | |
117 | 176 | ||
118 | 177 | let xpLevelScale = 3200 | |
119 | 178 | ||
120 | 179 | let xpLevelRecipPow = 4000 | |
121 | 180 | ||
122 | 181 | let numPointsOnLevelUp = 3 | |
123 | 182 | ||
124 | 183 | let wlgBaseAmountXp = 100000000000 | |
125 | 184 | ||
126 | 185 | func keyUserXP (addr) = ("userXP_" + addr) | |
127 | 186 | ||
128 | 187 | ||
129 | 188 | func keyUserLevel (addr) = ("userLevel_" + addr) | |
130 | 189 | ||
131 | 190 | ||
132 | 191 | let xpWlg = 10000 | |
133 | 192 | ||
134 | 193 | func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8) | |
135 | 194 | ||
136 | 195 | ||
137 | 196 | func levelUp (currLevel,newXP) = { | |
138 | 197 | let newLevel = levelByXP(newXP) | |
139 | 198 | [newLevel, (numPointsOnLevelUp * (newLevel - currLevel))] | |
140 | 199 | } | |
141 | 200 | ||
142 | 201 | ||
143 | 202 | let MILLION6 = 100000000000000 | |
144 | 203 | ||
145 | 204 | let PLAYERSHARE = 400000 | |
146 | 205 | ||
147 | 206 | let DAYMILLIS = 86400000 | |
148 | 207 | ||
149 | 208 | let teamAddrKey = "teamAddr" | |
150 | 209 | ||
151 | 210 | let lastTeamTimeKey = "lastClaimedTime_team" | |
152 | 211 | ||
153 | 212 | let teamAmountLeftKey = "teamAmountLeft" | |
154 | 213 | ||
155 | 214 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
156 | 215 | ||
157 | 216 | let actAmountLeftKey = "activitiesAmountLeft" | |
158 | 217 | ||
159 | 218 | let stakersAmountLeftKey = "stakersAmountLeft" | |
160 | 219 | ||
161 | 220 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
162 | 221 | ||
163 | 222 | ||
164 | 223 | func keyLastWlgTradeLimitByUser (addr) = ("lastWlgLimitUser_" + addr) | |
165 | 224 | ||
166 | 225 | ||
167 | 226 | let wlgIssueTimeKey = "wlg_issueTime" | |
168 | 227 | ||
169 | 228 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
170 | 229 | ||
171 | 230 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
172 | 231 | ||
173 | 232 | ||
174 | 233 | func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr) | |
175 | 234 | ||
176 | 235 | ||
177 | 236 | let wlgStakedTotalKey = "wlgStakedAmountTotal" | |
178 | 237 | ||
179 | 238 | func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr) | |
180 | 239 | ||
181 | 240 | ||
182 | 241 | let M6_ = 1000000 | |
183 | 242 | ||
184 | 243 | let M8_ = 100000000 | |
185 | 244 | ||
186 | 245 | let TEAM_SHARE = 200000 | |
187 | 246 | ||
188 | 247 | let ACTIVITY_SHARE = 100000 | |
189 | 248 | ||
190 | 249 | let PLAYER_SHARE = 400000 | |
191 | 250 | ||
192 | 251 | let YEAR_MILLIS = 31557600000 | |
193 | 252 | ||
194 | 253 | let DAY_MS = 86400000 | |
195 | 254 | ||
196 | - | let DAY_BLOCKS = 1440 | |
197 | - | ||
198 | - | let WEEK_BLOCKS = 10080 | |
199 | - | ||
200 | 255 | let ISSUE10 = 1000000000 | |
201 | 256 | ||
202 | 257 | let PLAYERS10_SHARE = 800000 | |
203 | 258 | ||
204 | 259 | let MARKETING10_SHARE = 100000 | |
205 | 260 | ||
206 | 261 | let TEAM10_SHARE = 100000 | |
207 | 262 | ||
208 | 263 | let NEW_STAKING_START = 1731279600000 | |
209 | 264 | ||
210 | 265 | let marketingAddrKey = "marketingAddr" | |
211 | 266 | ||
212 | 267 | let teamAdrKey = "teamAddr" | |
213 | 268 | ||
214 | 269 | let lastTeamTimKey = "lastClaimedTime_team" | |
215 | 270 | ||
216 | 271 | let teamAmtLeftKey = "teamAmountLeft" | |
217 | 272 | ||
218 | 273 | let lastActivitiesTimKey = "lastClaimedTime_activities" | |
219 | 274 | ||
220 | 275 | let actAmtLeftKey = "activitiesAmountLeft" | |
221 | 276 | ||
222 | 277 | let stakersAmtLeftKey = "stakersAmountLeft" | |
223 | 278 | ||
224 | 279 | func keyLastClaimTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
225 | 280 | ||
226 | 281 | ||
227 | 282 | func distrByPeriod (issuedAmount,period) = fraction(issuedAmount, (PLAYER_SHARE * (period + 1)), (6 * M6_)) | |
228 | 283 | ||
229 | 284 | ||
230 | 285 | let wlgIssue10TimeKey = "wlg_issue10Time" | |
231 | 286 | ||
232 | 287 | let wlgIssueTimKey = "wlg_issueTime" | |
233 | 288 | ||
234 | 289 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
235 | 290 | ||
236 | 291 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
237 | 292 | ||
238 | 293 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
239 | 294 | ||
240 | 295 | ||
241 | 296 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
242 | 297 | ||
243 | 298 | let totalFarmingPowerKey = "totalFarmingPower" | |
244 | 299 | ||
245 | 300 | let dapp2Rest = 0 | |
246 | 301 | ||
247 | 302 | let dapp2Staking = 1 | |
248 | 303 | ||
249 | 304 | let dapp2Wlg = 2 | |
250 | 305 | ||
251 | 306 | let dapp2Puzzle = 3 | |
252 | 307 | ||
253 | 308 | let dapp2InvestFund = 4 | |
254 | 309 | ||
255 | 310 | let IdxDtx1PercGemWinner = 1 | |
256 | 311 | ||
312 | + | let DEFAULT_WEEKLY_PRIZES = 5 | |
313 | + | ||
314 | + | func keyUserFullBonus (addr) = ("userFullBonus_" + addr) | |
315 | + | ||
316 | + | ||
257 | 317 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
258 | 318 | ||
259 | 319 | func getLevelByAcres (acres) = { | |
260 | 320 | let acr = ((acres + 99999999) / M8_) | |
261 | 321 | func checker (acc,item) = if ((item >= acr)) | |
262 | 322 | then acc | |
263 | 323 | else (acc + 1) | |
264 | 324 | ||
265 | 325 | let $l = levelAcres | |
266 | 326 | let $s = size($l) | |
267 | 327 | let $acc0 = 0 | |
268 | 328 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
269 | 329 | then $a | |
270 | 330 | else checker($a, $l[$i]) | |
271 | 331 | ||
272 | 332 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
273 | 333 | then $a | |
274 | 334 | else throw("List size exceeds 10") | |
275 | 335 | ||
276 | 336 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
277 | 337 | } | |
278 | 338 | ||
279 | 339 | ||
280 | 340 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
281 | 341 | ||
282 | 342 | ||
343 | + | func getFarmingPowerByAcresAndBonus (acres,bonus6) = { | |
344 | + | let notBonused = getFarmingPowerByAcres(acres) | |
345 | + | $Tuple2(fraction(notBonused, (M6_ + bonus6), M6_), notBonused) | |
346 | + | } | |
347 | + | ||
348 | + | ||
283 | 349 | func getFarmingPowers (userAddrStrOrEmpty,acres2Contract) = { | |
284 | 350 | let totalFP = valueOrElse(getInteger(acres2Contract, totalFarmingPowerKey), 0) | |
285 | 351 | let userAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0) | |
286 | - | let userFP = getFarmingPowerByAcres(userAcres) | |
287 | - | [totalFP, userFP] | |
352 | + | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(userAddrStrOrEmpty)), 0) | |
353 | + | let $t079143 = getFarmingPowerByAcresAndBonus(userAcres, userBonus) | |
354 | + | let userFPbonused = $t079143._1 | |
355 | + | let userFPnotBonused = $t079143._2 | |
356 | + | [totalFP, userFPbonused, userFPnotBonused, userBonus] | |
288 | 357 | } | |
289 | - | ||
290 | - | ||
291 | - | func keyUserBet (addr) = ("userBet_" + addr) | |
292 | - | ||
293 | - | ||
294 | - | func keyUserWeekTickets (addr,week) = ((("userWeekTickets_" + addr) + "_") + toString(week)) | |
295 | - | ||
296 | - | ||
297 | - | func keyTotalWeekTickets (week) = ("totalWeekTickets_" + toString(week)) | |
298 | - | ||
299 | - | ||
300 | - | func keyTotalWeekParticipants (week) = ("totalWeekParticipants_" + toString(week)) | |
301 | - | ||
302 | - | ||
303 | - | let DEFAULT_WEEKLY_PRIZES = 1 | |
304 | - | ||
305 | - | func keyNumNFT2Draw (week) = ("numNFT2Draw_" + toString(week)) | |
306 | - | ||
307 | - | ||
308 | - | func keyNumNFTDrawn (week) = ("numNFTDrawn_" + toString(week)) | |
309 | - | ||
310 | - | ||
311 | - | func keyWeekWinners (week) = ("weekWinners_" + toString(week)) | |
312 | - | ||
313 | - | ||
314 | - | func winningBet (day) = (toInt(value(value(blockInfoByHeight((day * DAY_BLOCKS))).vrf)) % 4) | |
315 | 358 | ||
316 | 359 | ||
317 | 360 | let idxTotalFP = 0 | |
318 | 361 | ||
319 | - | let | |
362 | + | let idxUserFPbonused = 1 | |
320 | 363 | ||
321 | 364 | let ixWlgAmount = 0 | |
322 | 365 | ||
323 | 366 | let ixWlgWlg = 1 | |
324 | 367 | ||
325 | 368 | let ixWlgPrice = 2 | |
326 | 369 | ||
327 | 370 | let ixWlgIssueTime = 8 | |
328 | 371 | ||
329 | 372 | let ixWlgTeamAmLeft = 11 | |
330 | 373 | ||
331 | 374 | let ixWlgTeamAmAvailNow = 12 | |
332 | 375 | ||
333 | 376 | let ixWlgActAmLeft = 15 | |
334 | 377 | ||
335 | 378 | let ixWlgActAmAvailNow = 16 | |
336 | 379 | ||
337 | 380 | let ixWlgAmLeftTotal = 19 | |
338 | 381 | ||
339 | 382 | let ixWlgUserAmAvailNow = 23 | |
340 | 383 | ||
341 | 384 | let ixWlgEffUserTime = 24 | |
342 | 385 | ||
343 | 386 | let ixWlgIssue10Amount = 25 | |
344 | 387 | ||
345 | 388 | let ixWlgMarketingIssue10Amount = 26 | |
346 | 389 | ||
347 | 390 | let ixWlgTeamIssue10Amount = 27 | |
348 | 391 | ||
349 | 392 | let ixWlgUser10part = 28 | |
350 | 393 | ||
351 | 394 | let ixWlgIssue10Time = 29 | |
352 | 395 | ||
353 | 396 | func getWlgStats2 (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = { | |
354 | 397 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
355 | 398 | let restUsd = assetBalance(contracts[dapp2Rest], usdtId) | |
356 | 399 | let wlgUsd = (assetBalance(contracts[dapp2Wlg], usdtId) - usdtBalanceCorrection) | |
357 | 400 | let puzzleUsd = assetBalance(contracts[dapp2Puzzle], usdtId) | |
358 | 401 | let acres2Usd = assetBalance(contracts[dapp2Staking], usdtId) | |
359 | 402 | let investFndContract = contracts[dapp2InvestFund] | |
360 | 403 | let investFundTotal = (assetBalance(investFndContract, usdtId) + valueOrElse(getInteger(investFndContract, zbIssuedAmtKey), 0)) | |
361 | 404 | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
362 | 405 | let wlgId = valueOrErrorMessage(getBinary(contracts[dapp2Wlg], "wlg_assetId"), "Not initialized yet") | |
363 | 406 | let now = lastBlock.timestamp | |
364 | 407 | let issueTime = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssueTimKey), "Not initialized") | |
365 | 408 | let wlgWlg = assetBalance(contracts[dapp2Wlg], wlgId) | |
366 | 409 | let teamTotal = fraction(issuedAmount, TEAM_SHARE, M6_) | |
367 | 410 | let teamAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], teamAmtLeftKey), teamTotal) | |
368 | 411 | let lastTeamTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastTeamTimKey), issueTime) | |
369 | 412 | let teamAddr = addressFromStringValue(value(getString(contracts[dapp2Wlg], teamAdrKey))) | |
370 | 413 | let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEAR_MILLIS)), teamAmountLeft]) | |
371 | 414 | let teamWlgold = assetBalance(teamAddr, wlgId) | |
372 | 415 | let actTotal = fraction(issuedAmount, ACTIVITY_SHARE, M6_) | |
373 | 416 | let actAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], actAmtLeftKey), actTotal) | |
374 | 417 | let lastActivitiesTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastActivitiesTimKey), issueTime) | |
375 | 418 | let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEAR_MILLIS)), actAmountLeft]) | |
376 | 419 | let actWlgold = assetBalance(contracts[dapp2Rest], wlgId) | |
377 | 420 | let lastUserTime = valueOrElse(getInteger(contracts[dapp2Wlg], keyLastClaimTimeByUser(userAddrOpt)), issueTime) | |
378 | 421 | let lastUserPeriod = ((lastUserTime - issueTime) / YEAR_MILLIS) | |
379 | 422 | let nowLimited = min([now, (issueTime + (3 * YEAR_MILLIS))]) | |
380 | 423 | let curPeriod = min([((now - issueTime) / YEAR_MILLIS), 2]) | |
381 | 424 | let eff = getFarmingPowers(userAddrOpt, contracts[dapp2Staking]) | |
382 | 425 | let curPeriodDistribution = distrByPeriod(issuedAmount, curPeriod) | |
383 | 426 | let prevPeriodEnd = (issueTime + (YEAR_MILLIS * curPeriod)) | |
384 | 427 | let prevPrevPeriodEnd = (issueTime + (YEAR_MILLIS * (curPeriod - 1))) | |
385 | 428 | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS) | |
386 | 429 | let userAvailable = if ((lastUserPeriod == curPeriod)) | |
387 | 430 | then a0 | |
388 | 431 | else if ((lastUserPeriod == (curPeriod - 1))) | |
389 | 432 | then { | |
390 | 433 | let a1 = fraction(distrByPeriod(issuedAmount, (curPeriod - 1)), (prevPeriodEnd - lastUserTime), YEAR_MILLIS) | |
391 | 434 | (a1 + a0) | |
392 | 435 | } | |
393 | 436 | else { | |
394 | 437 | let a2 = fraction(distrByPeriod(issuedAmount, (curPeriod - 2)), (prevPrevPeriodEnd - lastUserTime), YEAR_MILLIS) | |
395 | 438 | let a1 = distrByPeriod(issuedAmount, (curPeriod - 1)) | |
396 | 439 | ((a2 + a1) + a0) | |
397 | 440 | } | |
398 | 441 | let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0) | |
399 | 442 | let userAmount = if ((eff[idxTotalFP] != 0)) | |
400 | - | then fraction(userAvailable, eff[ | |
443 | + | then fraction(userAvailable, eff[idxUserFPbonused], eff[idxTotalFP]) | |
401 | 444 | else 0 | |
402 | 445 | let lastIssue10Time = valueOrElse(getInteger(contracts[dapp2Wlg], wlgIssue10TimeKey), NEW_STAKING_START) | |
403 | 446 | let issue10Amount = fraction(ISSUE10, max([(now - lastIssue10Time), 0]), DAY_MS) | |
404 | 447 | let marketingIssue10Amount = fraction(issue10Amount, MARKETING10_SHARE, M6_) | |
405 | 448 | let teamIssue10Amount = fraction(issue10Amount, TEAM10_SHARE, M6_) | |
406 | 449 | let user10Interval = max([(now - max([NEW_STAKING_START, lastUserTime])), 0]) | |
407 | 450 | let user10part = if ((eff[idxTotalFP] != 0)) | |
408 | - | then fraction(fraction(fraction(ISSUE10, user10Interval, DAY_MS), eff[ | |
451 | + | then fraction(fraction(fraction(ISSUE10, user10Interval, DAY_MS), eff[idxUserFPbonused], eff[idxTotalFP]), PLAYERS10_SHARE, M6_) | |
409 | 452 | else 0 | |
410 | 453 | let newIssue10Time = max([NEW_STAKING_START, now]) | |
411 | 454 | let acresStakedTotal = valueOrElse(getInteger(contracts[dapp2Staking], acresStakdTotalKey), 0) | |
412 | 455 | [issuedAmount, wlgWlg, fraction(totalFundsUsd, M8_, issuedAmount), totalFundsUsd, restUsd, acres2Usd, wlgUsd, puzzleUsd, issueTime, lastTeamTime, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, investFundTotal, userAmount, nowLimited, issue10Amount, marketingIssue10Amount, teamIssue10Amount, user10part, newIssue10Time, eff[idxTotalFP], acresStakedTotal] | |
413 | 456 | } | |
414 | 457 | ||
415 | 458 | ||
416 | - | let net = take(drop(this.bytes, 1), 1) | |
417 | - | ||
418 | - | let defaultRest2AddressStr = match net { | |
419 | - | case _ => | |
420 | - | if ((base58'2W' == $match0)) | |
421 | - | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
422 | - | else if ((base58'2T' == $match0)) | |
423 | - | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
424 | - | else throw("Unknown chain") | |
425 | - | } | |
426 | - | ||
427 | 459 | let profitAddrKey = "profitAddr" | |
428 | 460 | ||
429 | 461 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
430 | 462 | ||
431 | 463 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
432 | 464 | ||
433 | - | ||
434 | - | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
435 | - | ||
436 | - | let acres2Contract = addressFromStringValue(acres2AddressStr) | |
437 | 465 | ||
438 | 466 | func prolog2 () = asInt(reentrantInvoke(acres2Contract, "saveLastTx", nil, nil)) | |
439 | 467 | ||
440 | 468 | ||
441 | 469 | func getSwapLimitWlgold (addr) = { | |
442 | 470 | let lastTime = valueOrElse(getInteger(keyLastWlgTradeTimeByUser(addr)), 0) | |
443 | 471 | let defaultLimit = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0) | |
444 | 472 | let lastLimitLeft = valueOrElse(getInteger(keyLastWlgTradeLimitByUser(addr)), defaultLimit) | |
445 | 473 | let currentLimit = (lastLimitLeft + fraction(defaultLimit, (lastBlock.timestamp - lastTime), DAY_MILLIS)) | |
446 | 474 | min([currentLimit, defaultLimit]) | |
447 | 475 | } | |
448 | 476 | ||
449 | 477 | ||
450 | 478 | func claimInternal2 (addr) = { | |
451 | 479 | let curStats = getWlgStats2(addr, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
452 | 480 | let userTimeKey = keyLastClaimTimeByUser(addr) | |
453 | 481 | let lastUserTime = valueOrElse(getInteger(userTimeKey), 0) | |
454 | 482 | let userEffTime = curStats[ixWlgEffUserTime] | |
455 | 483 | if ((lastUserTime == userEffTime)) | |
456 | 484 | then $Tuple2(nil, 0) | |
457 | 485 | else { | |
458 | 486 | let now = lastBlock.timestamp | |
459 | 487 | let issueTime = curStats[ixWlgIssueTime] | |
460 | 488 | let teamAmountLeft = curStats[ixWlgTeamAmLeft] | |
461 | 489 | let teamAmount = (curStats[ixWlgTeamAmAvailNow] + curStats[ixWlgTeamIssue10Amount]) | |
462 | 490 | let teamTransfer = if ((teamAmount > 0)) | |
463 | 491 | then [ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId)] | |
464 | 492 | else nil | |
465 | 493 | let actAmountLeft = curStats[ixWlgActAmLeft] | |
466 | 494 | let actAmount = curStats[ixWlgActAmAvailNow] | |
467 | 495 | let actTransfer = if ((actAmount > 0)) | |
468 | 496 | then [ScriptTransfer(restContract, actAmount, wlgAssetId)] | |
469 | 497 | else nil | |
470 | 498 | let marketingAmount = curStats[ixWlgMarketingIssue10Amount] | |
471 | 499 | let marketingTransfer = if ((marketingAmount > 0)) | |
472 | 500 | then [ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId)] | |
473 | 501 | else nil | |
474 | 502 | let userAmount = curStats[ixWlgUserAmAvailNow] | |
475 | 503 | let userKey = keyStakersAmountPaidUser(addr) | |
476 | 504 | let userTotal = (userAmount + curStats[ixWlgUser10part]) | |
477 | 505 | let issued10Amount = curStats[ixWlgIssue10Amount] | |
478 | 506 | $Tuple2(((([Reissue(wlgAssetId, issued10Amount, true), IntegerEntry(wlgIssuedAmountKey, (curStats[ixWlgAmount] + issued10Amount)), IntegerEntry(wlgIssue10TimeKey, curStats[ixWlgIssue10Time]), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userAmount)), IntegerEntry(stakersAmountLeftKey, (curStats[ixWlgAmLeftTotal] - userAmount)), IntegerEntry(teamAmountLeftKey, ((teamAmountLeft - teamAmount) + curStats[ixWlgTeamIssue10Amount])), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, userEffTime)] ++ teamTransfer) ++ actTransfer) ++ marketingTransfer), userTotal) | |
479 | 507 | } | |
480 | 508 | } | |
481 | 509 | ||
482 | 510 | ||
483 | 511 | func takeXpInternal (addr,delta) = { | |
484 | 512 | let now = lastBlock.timestamp | |
485 | 513 | let timeKey = keyWlgStakedTimeByUser(addr) | |
486 | 514 | let amountKey = keyWlgStakedAmountByUser(addr) | |
487 | 515 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
488 | 516 | let oldUser = valueOrElse(getInteger(amountKey), 0) | |
489 | 517 | let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0) | |
490 | 518 | let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS) | |
491 | 519 | $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser) | |
492 | 520 | } | |
493 | 521 | ||
494 | 522 | ||
495 | 523 | func openChestInternal (addr) = { | |
496 | 524 | let week = (height / WEEK_BLOCKS) | |
497 | 525 | let drawWeek = (week - 1) | |
498 | 526 | let numPrizes = valueOrElse(getInteger(keyNumNFT2Draw(drawWeek)), DEFAULT_WEEKLY_PRIZES) | |
499 | 527 | let prizesDrawn = valueOrElse(getInteger(keyNumNFTDrawn(drawWeek)), 0) | |
500 | 528 | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
501 | 529 | if ((0 >= userTickets)) | |
502 | 530 | then $Tuple2(nil, unit) | |
503 | 531 | else { | |
504 | 532 | let weekTickets = valueOrElse(getInteger(keyTotalWeekTickets(drawWeek)), 0) | |
505 | 533 | if ((0 >= weekTickets)) | |
506 | 534 | then $Tuple2([DeleteEntry(keyUserWeekTickets(addr, drawWeek))], unit) | |
507 | 535 | else { | |
508 | 536 | let entropy = value(value(blockInfoByHeight((week * WEEK_BLOCKS))).vrf) | |
509 | 537 | let salt = fromBase58String(split(valueOrElse(getString(keyLastWeekTxIdByUser(addr)), "42_DEFAULT"), "_")[1]) | |
510 | 538 | let random = getRandomNumber(weekTickets, salt, entropy) | |
511 | 539 | if (((userTickets * numPrizes) > random)) | |
512 | 540 | then { | |
513 | 541 | let issueResult = invoke(acres2Contract, "issueNFT", [addr, IdxDtx1PercGemWinner], nil) | |
514 | 542 | let winners = getString(keyWeekWinners(drawWeek)) | |
515 | 543 | let newWinners = if (isDefined(winners)) | |
516 | 544 | then ((value(winners) + "_") + addr) | |
517 | 545 | else addr | |
518 | 546 | $Tuple2([IntegerEntry(keyNumNFTDrawn(drawWeek), (prizesDrawn + 1)), DeleteEntry(keyUserWeekTickets(addr, drawWeek)), StringEntry(keyWeekWinners(drawWeek), newWinners)], issueResult) | |
519 | 547 | } | |
520 | 548 | else { | |
521 | 549 | let random1 = (getRandomNumber(9, (base58'29' + salt), entropy) + 1) | |
522 | 550 | let consTickets = fraction(userTickets, random1, 10) | |
523 | 551 | $Tuple2([DeleteEntry(keyUserWeekTickets(addr, drawWeek)), IntegerEntry(keyUserWeekTickets(addr, week), consTickets)], consTickets) | |
524 | 552 | } | |
525 | 553 | } | |
526 | 554 | } | |
527 | 555 | } | |
528 | 556 | ||
529 | 557 | ||
530 | 558 | func claimTicketsInternal (addr,userBetStr) = { | |
531 | 559 | let week = (height / WEEK_BLOCKS) | |
532 | 560 | let ticketsKey = keyUserWeekTickets(addr, week) | |
533 | 561 | let dayBet = split(userBetStr, "_") | |
534 | 562 | let oldTotalTickets = valueOrElse(getInteger(keyTotalWeekTickets(week)), 0) | |
535 | 563 | let oldTickets = valueOrElse(getInteger(ticketsKey), 0) | |
536 | 564 | let deltaTickets = if ((winningBet(parseIntValue(dayBet[0])) == parseIntValue(dayBet[1]))) | |
537 | 565 | then 1 | |
538 | 566 | else 0 | |
539 | 567 | let oldParticipants = valueOrElse(getInteger(keyTotalWeekParticipants(week)), 0) | |
540 | 568 | let updateParticipants = if (if ((oldTickets == 0)) | |
541 | 569 | then (deltaTickets == 1) | |
542 | 570 | else false) | |
543 | 571 | then [IntegerEntry(keyTotalWeekParticipants(week), (oldParticipants + 1))] | |
544 | 572 | else nil | |
545 | 573 | $Tuple2(if ((deltaTickets == 0)) | |
546 | 574 | then nil | |
547 | 575 | else ((updateParticipants :+ IntegerEntry(ticketsKey, (oldTickets + deltaTickets))) :+ IntegerEntry(keyTotalWeekTickets(week), (oldTotalTickets + deltaTickets))), deltaTickets) | |
548 | 576 | } | |
549 | 577 | ||
550 | 578 | ||
551 | 579 | @Callable(i) | |
552 | 580 | func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this)) | |
553 | 581 | then throw("Permission denied") | |
554 | 582 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
555 | 583 | then throw("Already initialized") | |
556 | 584 | else { | |
557 | 585 | let issuedAmount = MILLION6 | |
558 | 586 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
559 | 587 | let assetId = calculateAssetId(issue) | |
560 | 588 | [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MILLION6, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr), StringEntry(profitAddrKey, profitAddr)] | |
561 | 589 | } | |
562 | 590 | ||
563 | 591 | ||
564 | 592 | ||
565 | 593 | @Callable(i) | |
566 | 594 | func constructorV2 (rest2Addr) = if ((i.caller != this)) | |
567 | 595 | then throw("Permission denied") | |
568 | 596 | else [StringEntry(keyRest2Address(), rest2Addr)] | |
569 | 597 | ||
570 | 598 | ||
571 | 599 | ||
572 | 600 | @Callable(i) | |
573 | 601 | func buyWlg (minToReceive) = { | |
574 | 602 | let prologResult = prolog2() | |
575 | 603 | if ((prologResult == prologResult)) | |
576 | 604 | then if ((size(i.payments) != 1)) | |
577 | 605 | then throw("exactly 1 payment must be attached") | |
578 | 606 | else { | |
579 | 607 | let pmt = i.payments[0] | |
580 | 608 | let usdtAmt = pmt.amount | |
581 | 609 | if (if (!(isDefined(pmt.assetId))) | |
582 | 610 | then true | |
583 | 611 | else (value(pmt.assetId) != usdtAssetId)) | |
584 | 612 | then throw("USDT payments only!") | |
585 | 613 | else { | |
586 | 614 | let caller = i.caller | |
587 | 615 | let addr = toString(caller) | |
588 | 616 | if ((MINSHOPPAYMENT > usdtAmt)) | |
589 | 617 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
590 | 618 | else { | |
591 | 619 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt) | |
592 | 620 | let curWlgAmount = curStats[ixWlgAmount] | |
593 | 621 | let wlgPrice = curStats[ixWlgPrice] | |
594 | 622 | let buyPrice = fraction(wlgPrice, 6, 5, CEILING) | |
595 | 623 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
596 | 624 | let maxWlg = getSwapLimitWlgold(addr) | |
597 | 625 | if ((wlgAmount > maxWlg)) | |
598 | 626 | then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment")) | |
599 | 627 | else if ((minToReceive > wlgAmount)) | |
600 | 628 | then throw("Price changed during operation, please try again") | |
601 | 629 | else { | |
602 | 630 | let profitAmount = (usdtAmt / 6) | |
603 | 631 | $Tuple2([Reissue(wlgAssetId, wlgAmount, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + wlgAmount)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), IntegerEntry(keyLastWlgTradeLimitByUser(addr), (maxWlg - wlgAmount)), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult) | |
604 | 632 | } | |
605 | 633 | } | |
606 | 634 | } | |
607 | 635 | } | |
608 | 636 | else throw("Strict value is not equal to itself.") | |
609 | 637 | } | |
610 | 638 | ||
611 | 639 | ||
612 | 640 | ||
613 | 641 | @Callable(i) | |
614 | 642 | func buyWlgREADONLY (address,usdtAmt) = { | |
615 | 643 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt) | |
616 | 644 | let wlgPrice = curStats[ixWlgPrice] | |
617 | 645 | let buyPrice = fraction(wlgPrice, 6, 5, CEILING) | |
618 | 646 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
619 | 647 | let maxWlg = getSwapLimitWlgold(address) | |
620 | 648 | let maxUsdt = fraction(maxWlg, buyPrice, MULT8) | |
621 | 649 | let profitAmount = (usdtAmt / 6) | |
622 | 650 | $Tuple2(nil, [wlgAmount, MINSHOPPAYMENT, maxUsdt, profitAmount]) | |
623 | 651 | } | |
624 | 652 | ||
625 | 653 | ||
626 | 654 | ||
627 | 655 | @Callable(i) | |
628 | 656 | func sellWlg (minAmount) = { | |
629 | 657 | let prologResult = prolog2() | |
630 | 658 | if ((prologResult == prologResult)) | |
631 | 659 | then if ((size(i.payments) != 1)) | |
632 | 660 | then throw("exactly 1 payment must be attached") | |
633 | 661 | else { | |
634 | 662 | let pmt = i.payments[0] | |
635 | 663 | let wlgAmt = pmt.amount | |
636 | 664 | let caller = i.caller | |
637 | 665 | let addr = toString(caller) | |
638 | 666 | let maxWlg = getSwapLimitWlgold(addr) | |
639 | 667 | if ((wlgAmt > maxWlg)) | |
640 | 668 | then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment")) | |
641 | 669 | else if (if (!(isDefined(pmt.assetId))) | |
642 | 670 | then true | |
643 | 671 | else (value(pmt.assetId) != wlgAssetId)) | |
644 | 672 | then throw("WLGOLD payments only!") | |
645 | 673 | else { | |
646 | 674 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
647 | 675 | let curWlgAmount = curStats[ixWlgAmount] | |
648 | 676 | let sellPrice = (curStats[ixWlgPrice] / 2) | |
649 | 677 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
650 | 678 | if ((MINSHOPPAYMENT > usdtAmt)) | |
651 | 679 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
652 | 680 | else if ((minAmount > usdtAmt)) | |
653 | 681 | then throw("Price changed during operation, please try again") | |
654 | 682 | else { | |
655 | 683 | let profitAmount = (usdtAmt / 5) | |
656 | 684 | $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - wlgAmt)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), IntegerEntry(keyLastWlgTradeLimitByUser(addr), (maxWlg - wlgAmt)), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult) | |
657 | 685 | } | |
658 | 686 | } | |
659 | 687 | } | |
660 | 688 | else throw("Strict value is not equal to itself.") | |
661 | 689 | } | |
662 | 690 | ||
663 | 691 | ||
664 | 692 | ||
665 | 693 | @Callable(i) | |
666 | 694 | func sellWlgREADONLY (address,wlgAmt) = { | |
667 | 695 | let maxWlg = getSwapLimitWlgold(address) | |
668 | 696 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
669 | 697 | let sellPrice = (curStats[ixWlgPrice] / 2) | |
670 | 698 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
671 | 699 | let minWlg = fraction(MINSHOPPAYMENT, MULT8, sellPrice) | |
672 | 700 | let profitAmount = (usdtAmt / 5) | |
673 | 701 | $Tuple2(nil, [usdtAmt, minWlg, maxWlg, profitAmount]) | |
674 | 702 | } | |
675 | 703 | ||
676 | 704 | ||
677 | 705 | ||
678 | 706 | @Callable(i) | |
679 | 707 | func claim () = { | |
680 | 708 | let prologResult = prolog2() | |
681 | 709 | if ((prologResult == prologResult)) | |
682 | 710 | then if ((size(i.payments) != 0)) | |
683 | 711 | then throw("No payments required") | |
684 | 712 | else { | |
685 | - | let $ | |
686 | - | let actions = $ | |
687 | - | let wlgClaimedAmount = $ | |
713 | + | let $t01404514114 = claimInternal2(toString(i.caller)) | |
714 | + | let actions = $t01404514114._1 | |
715 | + | let wlgClaimedAmount = $t01404514114._2 | |
688 | 716 | $Tuple2((actions :+ ScriptTransfer(i.caller, wlgClaimedAmount, wlgAssetId)), prologResult) | |
689 | 717 | } | |
690 | 718 | else throw("Strict value is not equal to itself.") | |
691 | 719 | } | |
692 | 720 | ||
693 | 721 | ||
694 | 722 | ||
695 | 723 | @Callable(i) | |
696 | 724 | func onStakeUnstakeLand (addr) = if (if (if ((i.caller != stakingContract)) | |
697 | 725 | then (i.caller != acresContract) | |
698 | 726 | else false) | |
699 | 727 | then (i.caller != acres2Contract) | |
700 | 728 | else false) | |
701 | 729 | then throw("Permission denied") | |
702 | 730 | else { | |
703 | - | let $ | |
704 | - | let actions = $ | |
705 | - | let wlgClaimedAmount = $ | |
731 | + | let $t01443314487 = claimInternal2(addr) | |
732 | + | let actions = $t01443314487._1 | |
733 | + | let wlgClaimedAmount = $t01443314487._2 | |
706 | 734 | $Tuple2(if ((wlgClaimedAmount > 0)) | |
707 | 735 | then (actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId)) | |
708 | 736 | else actions, wlgClaimedAmount) | |
709 | 737 | } | |
710 | 738 | ||
711 | 739 | ||
712 | 740 | ||
713 | 741 | @Callable(i) | |
714 | 742 | func burnWlgold (wlgAmt) = if ((i.caller != acres2Contract)) | |
715 | 743 | then throw("Permission denied") | |
716 | 744 | else { | |
717 | 745 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
718 | 746 | if ((wlgAmt > curStats[ixWlgWlg])) | |
719 | 747 | then throw(((("Only " + fixedPoint(curStats[ixWlgWlg], 8)) + " WLGOLD left on contract, can't burn ") + fixedPoint(wlgAmt, 8))) | |
720 | 748 | else { | |
721 | 749 | let wlgAmountLeft = (curStats[ixWlgAmount] - wlgAmt) | |
722 | 750 | $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, wlgAmountLeft)], wlgAmountLeft) | |
723 | 751 | } | |
724 | 752 | } | |
725 | 753 | ||
726 | 754 | ||
727 | 755 | ||
728 | 756 | @Callable(i) | |
729 | 757 | func betForTicket (bet) = { | |
730 | 758 | let prologResult = prolog2() | |
731 | 759 | if ((prologResult == prologResult)) | |
732 | 760 | then if ((size(i.payments) != 0)) | |
733 | 761 | then throw("No payments required") | |
734 | - | else if (((bet / 4) != 0)) | |
735 | - | then throw("Invalid bet: should be 0..3") | |
736 | - | else { | |
737 | - | let moment = (height % DAY_BLOCKS) | |
738 | - | if ((moment > (DAY_BLOCKS - 3))) | |
739 | - | then throw((("Cannot bet: the day is almost ended, please wait " + toString((DAY_BLOCKS - moment))) + " blocks")) | |
762 | + | else { | |
763 | + | let addr = toString(i.caller) | |
764 | + | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
765 | + | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
766 | + | let weekTickets = valueOrElse(getInteger(keyTotalWeekTickets(drawWeek)), 0) | |
767 | + | if (if ((userTickets > 0)) | |
768 | + | then (weekTickets > 0) | |
769 | + | else false) | |
770 | + | then throw("Please open the chest first") | |
771 | + | else if (((bet / 4) != 0)) | |
772 | + | then throw("Invalid bet: should be 0..3") | |
740 | 773 | else { | |
741 | - | let addr = toString(i.caller) | |
742 | - | let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(addr)), 0) | |
743 | - | let lvl = getLevelByAcres(stakedAcres) | |
744 | - | if ((lvl == 0)) | |
745 | - | then throw("You need to stake some ACRES to bet") | |
774 | + | let moment = (height % DAY_BLOCKS) | |
775 | + | if ((moment > (DAY_BLOCKS - 3))) | |
776 | + | then throw((("Cannot bet: the day is almost ended, please wait " + toString((DAY_BLOCKS - moment))) + " blocks")) | |
746 | 777 | else { | |
747 | - | let tomorrow = ((height / DAY_BLOCKS) + 1) | |
748 | - | let betKey = keyUserBet(addr) | |
749 | - | let oldUserBetStr = getString(betKey) | |
750 | - | let newBetEntry = StringEntry(betKey, ((toString(tomorrow) + "_") + toString(bet))) | |
751 | - | if (isDefined(oldUserBetStr)) | |
752 | - | then { | |
753 | - | let userBet = value(oldUserBetStr) | |
754 | - | if ((split(userBet, "_")[0] == toString(tomorrow))) | |
755 | - | then throw("You already bet for tomorrow") | |
756 | - | else { | |
757 | - | let r = claimTicketsInternal(addr, userBet) | |
758 | - | $Tuple2((r._1 :+ newBetEntry), r._2) | |
778 | + | let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(addr)), 0) | |
779 | + | let lvl = getLevelByAcres(stakedAcres) | |
780 | + | if ((lvl == 0)) | |
781 | + | then throw("You need to stake some ACRES to bet") | |
782 | + | else { | |
783 | + | let tomorrow = ((height / DAY_BLOCKS) + 1) | |
784 | + | let betKey = keyUserBet(addr) | |
785 | + | let oldUserBetStr = getString(betKey) | |
786 | + | let newBetEntry = StringEntry(betKey, ((toString(tomorrow) + "_") + toString(bet))) | |
787 | + | if (isDefined(oldUserBetStr)) | |
788 | + | then { | |
789 | + | let userBet = value(oldUserBetStr) | |
790 | + | if ((split(userBet, "_")[0] == toString(tomorrow))) | |
791 | + | then throw("You already bet for tomorrow") | |
792 | + | else { | |
793 | + | let r = claimTicketsInternal(addr, userBet) | |
794 | + | $Tuple2((r._1 :+ newBetEntry), r._2) | |
795 | + | } | |
759 | 796 | } | |
797 | + | else $Tuple2([newBetEntry], 0) | |
760 | 798 | } | |
761 | - | else $Tuple2([newBetEntry], 0) | |
762 | 799 | } | |
763 | 800 | } | |
764 | - | ||
801 | + | } | |
765 | 802 | else throw("Strict value is not equal to itself.") | |
766 | 803 | } | |
767 | 804 | ||
768 | 805 | ||
769 | 806 | ||
770 | 807 | @Callable(i) | |
771 | 808 | func takeWlgXp (addr) = if ((i.caller != stakingContract)) | |
772 | 809 | then throw("Permission denied") | |
773 | 810 | else { | |
774 | - | let $ | |
775 | - | let actions = $ | |
776 | - | let xp = $ | |
811 | + | let $t01708717130 = takeXpInternal(addr, 0) | |
812 | + | let actions = $t01708717130._1 | |
813 | + | let xp = $t01708717130._2 | |
777 | 814 | $Tuple2(actions, xp) | |
778 | 815 | } | |
779 | 816 | ||
780 | 817 | ||
781 | 818 | ||
782 | 819 | @Callable(i) | |
783 | 820 | func checkWlgXpREADONLY (addr) = { | |
784 | - | let $ | |
785 | - | let ignored = $ | |
786 | - | let deltaXP = $ | |
821 | + | let $t01720717255 = takeXpInternal(addr, 0) | |
822 | + | let ignored = $t01720717255._1 | |
823 | + | let deltaXP = $t01720717255._2 | |
787 | 824 | let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP) | |
788 | 825 | let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP) | |
789 | 826 | $Tuple2(nil, (lvlPoints :+ newXP)) | |
790 | 827 | } | |
791 | 828 | ||
792 | 829 | ||
793 | 830 | ||
794 | 831 | @Callable(i) | |
795 | 832 | func setNumPrizes (numPrizes) = if ((i.caller != this)) | |
796 | 833 | then throw("Permission denied") | |
797 | 834 | else { | |
798 | 835 | let week = (height / WEEK_BLOCKS) | |
799 | 836 | $Tuple2([IntegerEntry(keyNumNFT2Draw(week), numPrizes)], numPrizes) | |
800 | 837 | } | |
801 | 838 | ||
802 | 839 | ||
803 | 840 | ||
804 | 841 | @Callable(i) | |
805 | - | func openChest () = { | |
806 | - | let prologResult = prolog2() | |
807 | - | if ((prologResult == prologResult)) | |
808 | - | then if ((size(i.payments) != 0)) | |
809 | - | then throw("No payments required") | |
810 | - | else { | |
811 | - | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
812 | - | let addr = toString(i.caller) | |
813 | - | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
814 | - | if ((0 >= userTickets)) | |
815 | - | then throw("No gems to open the chest") | |
816 | - | else openChestInternal(addr) | |
817 | - | } | |
818 | - | else throw("Strict value is not equal to itself.") | |
819 | - | } | |
842 | + | func openChest () = if (!(KS_ALLOW_NFT_DRAW)) | |
843 | + | then throw("Temporarily disabled") | |
844 | + | else { | |
845 | + | let prologResult = prolog2() | |
846 | + | if ((prologResult == prologResult)) | |
847 | + | then if ((size(i.payments) != 0)) | |
848 | + | then throw("No payments required") | |
849 | + | else { | |
850 | + | let drawWeek = ((height / WEEK_BLOCKS) - 1) | |
851 | + | let addr = toString(i.caller) | |
852 | + | let userTickets = valueOrElse(getInteger(keyUserWeekTickets(addr, drawWeek)), 0) | |
853 | + | if ((0 >= userTickets)) | |
854 | + | then throw("No gems to open the chest") | |
855 | + | else openChestInternal(addr) | |
856 | + | } | |
857 | + | else throw("Strict value is not equal to itself.") | |
858 | + | } | |
820 | 859 | ||
821 | 860 |
github/deemru/w8io/026f985 447.26 ms ◑