tx · 7gbRoMG6CsZTqFywwXtMe34zNTsC9zBwsdNrq7Fny9n7

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.02200000 Waves

2024.11.17 18:23 [3375627] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "7gbRoMG6CsZTqFywwXtMe34zNTsC9zBwsdNrq7Fny9n7", "fee": 2200000, "feeAssetId": null, "timestamp": 1731856992792, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "6WW8o4LQ4yHmBRg9FHdULXn2tSfAYMnEYP4PqyMMyxoDdTKZMVxbSwhe6vRaov2r1EywnnzAt9kf6qxrMDxPvtd" ], "script": "base64:BgJCCAISBgoECAgICBIDCgEIEgMKAQESBAoCCAESAwoBARIECgIIARIAEgMKAQgSAwoBARIDCgEBEgASAwoBCBIDCgEIggEACkRBWV9NSUxMSVMAgLiZKQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZHRBc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwASCE2nqyCAM/TtG7yo7ui5O8yYLdC136B5ao1CP5qA//uQMJAAACAQFUBQckbWF0Y2gwASBVsdifcoeC7+XjW42sBatl3ppDoS8WuwXzGreHpfHFGAkAAgECDVVua25vd24gY2hhaW4AFWRlZmF1bHRSZXN0QWRkcmVzc1N0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BRQ3V2RmJ2aDRMa1BVbnJuVTF6M2puYkExcDltM1dOaHYDCQAAAgEBVAUHJG1hdGNoMAIjM011bWtHR3p0Q0tBWHBXRHF4a2Rkb2ZxWFNVYnFRa3ZTSnkJAAIBAg1Vbmtub3duIGNoYWluABBhY3Jlcz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kAgkBC3ZhbHVlT3JFbHNlAgkAmggCBQ9zdGFraW5nQ29udHJhY3QJAQlrZXlVc2VyWFABBQRhZGRyAAAFB2RlbHRhWFAECWx2bFBvaW50cwkBB2xldmVsVXACCQELdmFsdWVPckVsc2UCCQCaCAIFD3N0YWtpbmdDb250cmFjdAkBDGtleVVzZXJMZXZlbAEFBGFkZHIAAAUFbmV3WFAJAJQKAgUDbmlsCQDNCAIFCWx2bFBvaW50cwUFbmV3WFAARs76Zg==", "height": 3375627, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DDcidiwvRopooNb6KPA5bzJxz5JBZPoB2Wu5Z2aRrujh Next: 5HCYZ5sZ7T97L6sD4uAdTCSoEiNoa79Y16oNJU5ZuvVS Diff:
OldNewDifferences
2929 then "3P4UH3T9nXpMNpUmSmQjPmEz3G85t3zn6eA"
3030 else if ((base58'2T' == $match0))
3131 then "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh"
32- else throw("Unknown chain")
33-}
34-
35-let arbitrageDelay = match chain {
36- case _ =>
37- if ((base58'2W' == $match0))
38- then DAY_MILLIS
39- else if ((base58'2T' == $match0))
40- then 60000
4132 else throw("Unknown chain")
4233 }
4334
156147
157148 let stakersAmountLeftKey = "stakersAmountLeft"
158149
159-func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
150+func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr)
151+
152+
153+func keyLastWlgTradeLimitByUser (addr) = ("lastWlgLimitUser_" + addr)
160154
161155
162156 let wlgIssueTimeKey = "wlg_issueTime"
411405 func prolog2 () = asInt(reentrantInvoke(acres2Contract, "saveLastTx", nil, nil))
412406
413407
414-func getSwapLimitWlg (addr) = {
415- let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
416- let now = lastBlock.timestamp
417- if ((arbitrageDelay > (now - lastTime)))
418- then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
419- else valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0)
408+func getSwapLimitWlgold (addr) = {
409+ let lastTime = valueOrElse(getInteger(keyLastWlgTradeTimeByUser(addr)), 0)
410+ let defaultLimit = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0)
411+ let lastLimitLeft = valueOrElse(getInteger(keyLastWlgTradeLimitByUser(addr)), defaultLimit)
412+ let currentLimit = (lastLimitLeft + fraction(defaultLimit, (lastBlock.timestamp - lastTime), DAY_MILLIS))
413+ min([currentLimit, defaultLimit])
420414 }
421415
422416
503497
504498
505499 @Callable(i)
506-func buyWlg (minAmount) = {
500+func buyWlg (minToReceive) = {
507501 let prologResult = prolog2()
508502 if ((prologResult == prologResult))
509503 then if ((size(i.payments) != 1))
524518 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt)
525519 let curWlgAmount = curStats[ixWlgAmount]
526520 let wlgPrice = curStats[ixWlgPrice]
527- let buyPrice = fraction(wlgPrice, 6, 5)
521+ let buyPrice = fraction(wlgPrice, 6, 5, CEILING)
528522 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
529- let maxWlg = getSwapLimitWlg(addr)
523+ let maxWlg = getSwapLimitWlgold(addr)
530524 if ((wlgAmount > maxWlg))
531- then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
532- else if ((minAmount > wlgAmount))
525+ then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment"))
526+ else if ((minToReceive > wlgAmount))
533527 then throw("Price changed during operation, please try again")
534528 else {
535529 let profitAmount = (usdtAmt / 6)
536- $Tuple2([Reissue(wlgAssetId, wlgAmount, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + wlgAmount)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult)
530+ $Tuple2([Reissue(wlgAssetId, wlgAmount, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + wlgAmount)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult)
537531 }
538532 }
539533 }
546540 @Callable(i)
547541 func buyWlgREADONLY (address,usdtAmt) = {
548542 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt)
549- let curWlgAmount = curStats[ixWlgAmount]
550543 let wlgPrice = curStats[ixWlgPrice]
551- let buyPrice = fraction(wlgPrice, 6, 5)
544+ let buyPrice = fraction(wlgPrice, 6, 5, CEILING)
552545 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
553- let maxWlg = getSwapLimitWlg(address)
546+ let maxWlg = getSwapLimitWlgold(address)
554547 let maxUsdt = fraction(maxWlg, buyPrice, MULT8)
555548 let profitAmount = (usdtAmt / 6)
556549 $Tuple2(nil, [wlgAmount, MINSHOPPAYMENT, maxUsdt, profitAmount])
569562 let wlgAmt = pmt.amount
570563 let caller = i.caller
571564 let addr = toString(caller)
572- let maxWlg = getSwapLimitWlg(addr)
565+ let maxWlg = getSwapLimitWlgold(addr)
573566 if ((wlgAmt > maxWlg))
574- then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
567+ then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment"))
575568 else if (if (!(isDefined(pmt.assetId)))
576569 then true
577570 else (value(pmt.assetId) != wlgAssetId))
587580 then throw("Price changed during operation, please try again")
588581 else {
589582 let profitAmount = (usdtAmt / 5)
590- $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - wlgAmt)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
583+ $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - wlgAmt)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
591584 }
592585 }
593586 }
598591
599592 @Callable(i)
600593 func sellWlgREADONLY (address,wlgAmt) = {
601- let maxWlg = getSwapLimitWlg(address)
594+ let maxWlg = getSwapLimitWlgold(address)
602595 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
603- let curWlgAmount = curStats[ixWlgAmount]
604596 let sellPrice = (curStats[ixWlgPrice] / 2)
605597 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
606598 let minWlg = fraction(MINSHOPPAYMENT, MULT8, sellPrice)
617609 then if ((size(i.payments) != 0))
618610 then throw("No payments required")
619611 else {
620- let $t01128511354 = claimInternal2(toString(i.caller))
621- let actions = $t01128511354._1
622- let wlgClaimedAmount = $t01128511354._2
612+ let $t01193312002 = claimInternal2(toString(i.caller))
613+ let actions = $t01193312002._1
614+ let wlgClaimedAmount = $t01193312002._2
623615 $Tuple2((actions :+ ScriptTransfer(i.caller, wlgClaimedAmount, wlgAssetId)), prologResult)
624616 }
625617 else throw("Strict value is not equal to itself.")
635627 else false)
636628 then throw("Permission denied")
637629 else {
638- let $t01167311727 = claimInternal2(addr)
639- let actions = $t01167311727._1
640- let wlgClaimedAmount = $t01167311727._2
630+ let $t01232112375 = claimInternal2(addr)
631+ let actions = $t01232112375._1
632+ let wlgClaimedAmount = $t01232112375._2
641633 $Tuple2(if ((wlgClaimedAmount > 0))
642634 then (actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId))
643635 else actions, wlgClaimedAmount)
723715 func takeWlgXp (addr) = if ((i.caller != stakingContract))
724716 then throw("Permission denied")
725717 else {
726- let $t01979119834 = takeXpInternal(addr, 0)
727- let actions = $t01979119834._1
728- let xp = $t01979119834._2
718+ let $t02043920482 = takeXpInternal(addr, 0)
719+ let actions = $t02043920482._1
720+ let xp = $t02043920482._2
729721 $Tuple2(actions, xp)
730722 }
731723
733725
734726 @Callable(i)
735727 func checkWlgXpREADONLY (addr) = {
736- let $t01991119959 = takeXpInternal(addr, 0)
737- let ignored = $t01991119959._1
738- let deltaXP = $t01991119959._2
728+ let $t02055920607 = takeXpInternal(addr, 0)
729+ let ignored = $t02055920607._1
730+ let deltaXP = $t02055920607._2
739731 let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP)
740732 let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP)
741733 $Tuple2(nil, (lvlPoints :+ newXP))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let DAY_MILLIS = 86400000
55
66 let chain = take(drop(this.bytes, 1), 1)
77
88 let usdtAssetId = match chain {
99 case _ =>
1010 if ((base58'2W' == $match0))
1111 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
1212 else if ((base58'2T' == $match0))
1313 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
1414 else throw("Unknown chain")
1515 }
1616
1717 let defaultRestAddressStr = match chain {
1818 case _ =>
1919 if ((base58'2W' == $match0))
2020 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
2121 else if ((base58'2T' == $match0))
2222 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
2323 else throw("Unknown chain")
2424 }
2525
2626 let acres2AddressStr = match chain {
2727 case _ =>
2828 if ((base58'2W' == $match0))
2929 then "3P4UH3T9nXpMNpUmSmQjPmEz3G85t3zn6eA"
3030 else if ((base58'2T' == $match0))
3131 then "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh"
32- else throw("Unknown chain")
33-}
34-
35-let arbitrageDelay = match chain {
36- case _ =>
37- if ((base58'2W' == $match0))
38- then DAY_MILLIS
39- else if ((base58'2T' == $match0))
40- then 60000
4132 else throw("Unknown chain")
4233 }
4334
4435 let SEP = "__"
4536
4637 let MULT6 = 1000000
4738
4839 let MULT8 = 100000000
4940
5041 let MINSHOPPAYMENT = 100000
5142
5243 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
5344
5445
5546 let IdxCfgStakingDapp = 1
5647
5748 let IdxCfgWlgDapp = 4
5849
5950 let IdxCfgPuzzlePoolDapp = 5
6051
6152 let IdxCfgInvestFundDapp = 6
6253
6354 let IdxCfgAcresDapp = 8
6455
6556 func keyRestCfg () = "%s__restConfig"
6657
6758
6859 func keyRestAddress () = "%s__restAddr"
6960
7061
7162 func keyRest2Address () = "%s__rest2Addr"
7263
7364
7465 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
7566
7667
7768 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
7869
7970
8071 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
8172
8273 let restCfg = readRestCfgOrFail(restContract)
8374
8475 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
8576
8677 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
8778
8879 let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp)
8980
9081 let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp)
9182
9283 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
9384
9485 let wlgAssetIdKey = "wlg_assetId"
9586
9687 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
9788
9889 func asInt (v) = match v {
9990 case n: Int =>
10091 n
10192 case _ =>
10293 throw("fail to cast into Int")
10394 }
10495
10596
10697 func fixedPoint (val,decimals) = {
10798 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
10899 let lowPart = toString((val % tenPow))
109100 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
110101 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
111102 }
112103
113104
114105 let SCALE8 = 100000000
115106
116107 let xpLevelScale = 3200
117108
118109 let xpLevelRecipPow = 4000
119110
120111 let numPointsOnLevelUp = 3
121112
122113 let wlgBaseAmountXp = 100000000000
123114
124115 func keyUserXP (addr) = ("userXP_" + addr)
125116
126117
127118 func keyUserLevel (addr) = ("userLevel_" + addr)
128119
129120
130121 let xpWlg = 10000
131122
132123 func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8)
133124
134125
135126 func levelUp (currLevel,newXP) = {
136127 let newLevel = levelByXP(newXP)
137128 [newLevel, (numPointsOnLevelUp * (newLevel - currLevel))]
138129 }
139130
140131
141132 let MILLION6 = 100000000000000
142133
143134 let PLAYERSHARE = 400000
144135
145136 let DAYMILLIS = 86400000
146137
147138 let teamAddrKey = "teamAddr"
148139
149140 let lastTeamTimeKey = "lastClaimedTime_team"
150141
151142 let teamAmountLeftKey = "teamAmountLeft"
152143
153144 let lastActivitiesTimeKey = "lastClaimedTime_activities"
154145
155146 let actAmountLeftKey = "activitiesAmountLeft"
156147
157148 let stakersAmountLeftKey = "stakersAmountLeft"
158149
159-func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
150+func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr)
151+
152+
153+func keyLastWlgTradeLimitByUser (addr) = ("lastWlgLimitUser_" + addr)
160154
161155
162156 let wlgIssueTimeKey = "wlg_issueTime"
163157
164158 let wlgIssuedAmountKey = "wlg_issuedAmount"
165159
166160 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
167161
168162
169163 func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr)
170164
171165
172166 let wlgStakedTotalKey = "wlgStakedAmountTotal"
173167
174168 func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr)
175169
176170
177171 let M6_ = 1000000
178172
179173 let M8_ = 100000000
180174
181175 let TEAM_SHARE = 200000
182176
183177 let ACTIVITY_SHARE = 100000
184178
185179 let PLAYER_SHARE = 400000
186180
187181 let YEAR_MILLIS = 31557600000
188182
189183 let DAY_MS = 86400000
190184
191185 let DAY_BLOCKS = 1440
192186
193187 let ISSUE10 = 1000000000
194188
195189 let PLAYERS10_SHARE = 800000
196190
197191 let MARKETING10_SHARE = 100000
198192
199193 let TEAM10_SHARE = 100000
200194
201195 let NEW_STAKING_START = 1731279600000
202196
203197 let marketingAddrKey = "marketingAddr"
204198
205199 let teamAdrKey = "teamAddr"
206200
207201 let lastTeamTimKey = "lastClaimedTime_team"
208202
209203 let teamAmtLeftKey = "teamAmountLeft"
210204
211205 let lastActivitiesTimKey = "lastClaimedTime_activities"
212206
213207 let actAmtLeftKey = "activitiesAmountLeft"
214208
215209 let stakersAmtLeftKey = "stakersAmountLeft"
216210
217211 func keyLastClaimTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
218212
219213
220214 func distrByPeriod (issuedAmount,period) = fraction(issuedAmount, (PLAYER_SHARE * (period + 1)), (6 * M6_))
221215
222216
223217 let wlgIssue10TimeKey = "wlg_issue10Time"
224218
225219 let wlgIssueTimKey = "wlg_issueTime"
226220
227221 let wlgIssuedAmtKey = "wlg_issuedAmount"
228222
229223 let zbIssuedAmtKey = "zbill_issuedAmount"
230224
231225 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
232226
233227
234228 let totalFarmingPowerKey = "totalFarmingPower"
235229
236230 let dapp2Rest = 0
237231
238232 let dapp2Staking = 1
239233
240234 let dapp2Wlg = 2
241235
242236 let dapp2Puzzle = 3
243237
244238 let dapp2InvestFund = 4
245239
246240 let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000]
247241
248242 func getLevelByAcres (acres) = {
249243 let acr = ((acres + 99999999) / M8_)
250244 func checker (acc,item) = if ((item >= acr))
251245 then acc
252246 else (acc + 1)
253247
254248 let $l = levelAcres
255249 let $s = size($l)
256250 let $acc0 = 0
257251 func $f0_1 ($a,$i) = if (($i >= $s))
258252 then $a
259253 else checker($a, $l[$i])
260254
261255 func $f0_2 ($a,$i) = if (($i >= $s))
262256 then $a
263257 else throw("List size exceeds 10")
264258
265259 $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)
266260 }
267261
268262
269263 func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
270264
271265
272266 func getFarmingPowers (userAddrStrOrEmpty,acres2Contract) = {
273267 let totalFP = valueOrElse(getInteger(acres2Contract, totalFarmingPowerKey), 0)
274268 let userAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0)
275269 let userFP = getFarmingPowerByAcres(userAcres)
276270 [totalFP, userFP]
277271 }
278272
279273
280274 func keyUserBet (addr) = ("userBet_" + addr)
281275
282276
283277 func keyUserTickets (addr) = ("userTickets_" + addr)
284278
285279
286280 let keyTotalTickets = "totalTickets"
287281
288282 func winningBet (day) = (toInt(value(value(blockInfoByHeight((day * DAY_BLOCKS))).vrf)) % 4)
289283
290284
291285 let idxTotalFP = 0
292286
293287 let idxUserFP = 1
294288
295289 let ixWlgAmount = 0
296290
297291 let ixWlgWlg = 1
298292
299293 let ixWlgPrice = 2
300294
301295 let ixWlgIssueTime = 8
302296
303297 let ixWlgTeamAmLeft = 11
304298
305299 let ixWlgTeamAmAvailNow = 12
306300
307301 let ixWlgActAmLeft = 15
308302
309303 let ixWlgActAmAvailNow = 16
310304
311305 let ixWlgAmLeftTotal = 19
312306
313307 let ixWlgUserAmAvailNow = 23
314308
315309 let ixWlgEffUserTime = 24
316310
317311 let ixWlgIssue10Amount = 25
318312
319313 let ixWlgMarketingIssue10Amount = 26
320314
321315 let ixWlgTeamIssue10Amount = 27
322316
323317 let ixWlgUser10part = 28
324318
325319 let ixWlgIssue10Time = 29
326320
327321 func getWlgStats2 (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = {
328322 let issuedAmount = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssuedAmtKey), "WLGOLD is not issued yet")
329323 let restUsd = assetBalance(contracts[dapp2Rest], usdtId)
330324 let wlgUsd = (assetBalance(contracts[dapp2Wlg], usdtId) - usdtBalanceCorrection)
331325 let puzzleUsd = assetBalance(contracts[dapp2Puzzle], usdtId)
332326 let acres2Usd = assetBalance(contracts[dapp2Staking], usdtId)
333327 let investFndContract = contracts[dapp2InvestFund]
334328 let investFundTotal = (assetBalance(investFndContract, usdtId) + valueOrElse(getInteger(investFndContract, zbIssuedAmtKey), 0))
335329 let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal)
336330 let wlgId = valueOrErrorMessage(getBinary(contracts[dapp2Wlg], "wlg_assetId"), "Not initialized yet")
337331 let now = lastBlock.timestamp
338332 let issueTime = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssueTimKey), "Not initialized")
339333 let wlgWlg = assetBalance(contracts[dapp2Wlg], wlgId)
340334 let teamTotal = fraction(issuedAmount, TEAM_SHARE, M6_)
341335 let teamAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], teamAmtLeftKey), teamTotal)
342336 let lastTeamTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastTeamTimKey), issueTime)
343337 let teamAddr = addressFromStringValue(value(getString(contracts[dapp2Wlg], teamAdrKey)))
344338 let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEAR_MILLIS)), teamAmountLeft])
345339 let teamWlgold = assetBalance(teamAddr, wlgId)
346340 let actTotal = fraction(issuedAmount, ACTIVITY_SHARE, M6_)
347341 let actAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], actAmtLeftKey), actTotal)
348342 let lastActivitiesTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastActivitiesTimKey), issueTime)
349343 let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEAR_MILLIS)), actAmountLeft])
350344 let actWlgold = assetBalance(contracts[dapp2Rest], wlgId)
351345 let lastUserTime = valueOrElse(getInteger(contracts[dapp2Wlg], keyLastClaimTimeByUser(userAddrOpt)), issueTime)
352346 let lastUserPeriod = ((lastUserTime - issueTime) / YEAR_MILLIS)
353347 let nowLimited = min([now, (issueTime + (3 * YEAR_MILLIS))])
354348 let curPeriod = min([((now - issueTime) / YEAR_MILLIS), 2])
355349 let eff = getFarmingPowers(userAddrOpt, contracts[dapp2Staking])
356350 let curPeriodDistribution = distrByPeriod(issuedAmount, curPeriod)
357351 let prevPeriodEnd = (issueTime + (YEAR_MILLIS * curPeriod))
358352 let prevPrevPeriodEnd = (issueTime + (YEAR_MILLIS * (curPeriod - 1)))
359353 let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS)
360354 let userAvailable = if ((lastUserPeriod == curPeriod))
361355 then a0
362356 else if ((lastUserPeriod == (curPeriod - 1)))
363357 then {
364358 let a1 = fraction(distrByPeriod(issuedAmount, (curPeriod - 1)), (prevPeriodEnd - lastUserTime), YEAR_MILLIS)
365359 (a1 + a0)
366360 }
367361 else {
368362 let a2 = fraction(distrByPeriod(issuedAmount, (curPeriod - 2)), (prevPrevPeriodEnd - lastUserTime), YEAR_MILLIS)
369363 let a1 = distrByPeriod(issuedAmount, (curPeriod - 1))
370364 ((a2 + a1) + a0)
371365 }
372366 let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0)
373367 let userAmount = if ((eff[idxTotalFP] != 0))
374368 then fraction(userAvailable, eff[idxUserFP], eff[idxTotalFP])
375369 else 0
376370 let lastIssue10Time = valueOrElse(getInteger(contracts[dapp2Wlg], wlgIssue10TimeKey), NEW_STAKING_START)
377371 let issue10Amount = fraction(ISSUE10, max([(now - lastIssue10Time), 0]), DAY_MS)
378372 let marketingIssue10Amount = fraction(issue10Amount, MARKETING10_SHARE, M6_)
379373 let teamIssue10Amount = fraction(issue10Amount, TEAM10_SHARE, M6_)
380374 let user10Interval = max([(now - max([NEW_STAKING_START, lastUserTime])), 0])
381375 let user10part = if ((eff[idxTotalFP] != 0))
382376 then fraction(fraction(fraction(ISSUE10, user10Interval, DAY_MS), eff[idxUserFP], eff[idxTotalFP]), PLAYERS10_SHARE, M6_)
383377 else 0
384378 let newIssue10Time = max([NEW_STAKING_START, now])
385379 [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]]
386380 }
387381
388382
389383 let net = take(drop(this.bytes, 1), 1)
390384
391385 let defaultRest2AddressStr = match net {
392386 case _ =>
393387 if ((base58'2W' == $match0))
394388 then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8"
395389 else if ((base58'2T' == $match0))
396390 then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv"
397391 else throw("Unknown chain")
398392 }
399393
400394 let profitAddrKey = "profitAddr"
401395
402396 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
403397
404398 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
405399
406400
407401 let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr))
408402
409403 let acres2Contract = addressFromStringValue(acres2AddressStr)
410404
411405 func prolog2 () = asInt(reentrantInvoke(acres2Contract, "saveLastTx", nil, nil))
412406
413407
414-func getSwapLimitWlg (addr) = {
415- let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
416- let now = lastBlock.timestamp
417- if ((arbitrageDelay > (now - lastTime)))
418- then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
419- else valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0)
408+func getSwapLimitWlgold (addr) = {
409+ let lastTime = valueOrElse(getInteger(keyLastWlgTradeTimeByUser(addr)), 0)
410+ let defaultLimit = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0)
411+ let lastLimitLeft = valueOrElse(getInteger(keyLastWlgTradeLimitByUser(addr)), defaultLimit)
412+ let currentLimit = (lastLimitLeft + fraction(defaultLimit, (lastBlock.timestamp - lastTime), DAY_MILLIS))
413+ min([currentLimit, defaultLimit])
420414 }
421415
422416
423417 func claimInternal2 (addr) = {
424418 let curStats = getWlgStats2(addr, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
425419 let userTimeKey = keyLastClaimTimeByUser(addr)
426420 let lastUserTime = valueOrElse(getInteger(userTimeKey), 0)
427421 let userEffTime = curStats[ixWlgEffUserTime]
428422 if ((lastUserTime == userEffTime))
429423 then $Tuple2(nil, 0)
430424 else {
431425 let now = lastBlock.timestamp
432426 let issueTime = curStats[ixWlgIssueTime]
433427 let teamAmountLeft = curStats[ixWlgTeamAmLeft]
434428 let teamAmount = (curStats[ixWlgTeamAmAvailNow] + curStats[ixWlgTeamIssue10Amount])
435429 let teamTransfer = if ((teamAmount > 0))
436430 then [ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId)]
437431 else nil
438432 let actAmountLeft = curStats[ixWlgActAmLeft]
439433 let actAmount = curStats[ixWlgActAmAvailNow]
440434 let actTransfer = if ((actAmount > 0))
441435 then [ScriptTransfer(restContract, actAmount, wlgAssetId)]
442436 else nil
443437 let marketingAmount = curStats[ixWlgMarketingIssue10Amount]
444438 let marketingTransfer = if ((marketingAmount > 0))
445439 then [ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId)]
446440 else nil
447441 let userAmount = curStats[ixWlgUserAmAvailNow]
448442 let userKey = keyStakersAmountPaidUser(addr)
449443 let userTotal = (userAmount + curStats[ixWlgUser10part])
450444 let issued10Amount = curStats[ixWlgIssue10Amount]
451445 $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)
452446 }
453447 }
454448
455449
456450 func takeXpInternal (addr,delta) = {
457451 let now = lastBlock.timestamp
458452 let timeKey = keyWlgStakedTimeByUser(addr)
459453 let amountKey = keyWlgStakedAmountByUser(addr)
460454 let lastTime = valueOrElse(getInteger(timeKey), 0)
461455 let oldUser = valueOrElse(getInteger(amountKey), 0)
462456 let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0)
463457 let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS)
464458 $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser)
465459 }
466460
467461
468462 func claimTicketsInternal (addr,userBetStr) = {
469463 let totalTicketsKey = keyTotalTickets
470464 let ticketsKey = keyUserTickets(addr)
471465 let betKey = keyUserBet(addr)
472466 let dayBet = split(userBetStr, "_")
473467 let oldTotalTickets = valueOrElse(getInteger(totalTicketsKey), 0)
474468 let oldTickets = valueOrElse(getInteger(ticketsKey), 0)
475469 let deltaTickets = if ((winningBet(parseIntValue(dayBet[0])) == parseIntValue(dayBet[1])))
476470 then 1
477471 else 0
478472 $Tuple3(if ((deltaTickets == 0))
479473 then nil
480474 else [IntegerEntry(ticketsKey, (oldTickets + deltaTickets)), IntegerEntry(totalTicketsKey, (oldTotalTickets + deltaTickets))], DeleteEntry(betKey), deltaTickets)
481475 }
482476
483477
484478 @Callable(i)
485479 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
486480 then throw("Permission denied")
487481 else if (isDefined(getBinary(wlgAssetIdKey)))
488482 then throw("Already initialized")
489483 else {
490484 let issuedAmount = MILLION6
491485 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
492486 let assetId = calculateAssetId(issue)
493487 [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)]
494488 }
495489
496490
497491
498492 @Callable(i)
499493 func constructorV2 (rest2Addr) = if ((i.caller != this))
500494 then throw("Permission denied")
501495 else [StringEntry(keyRest2Address(), rest2Addr)]
502496
503497
504498
505499 @Callable(i)
506-func buyWlg (minAmount) = {
500+func buyWlg (minToReceive) = {
507501 let prologResult = prolog2()
508502 if ((prologResult == prologResult))
509503 then if ((size(i.payments) != 1))
510504 then throw("exactly 1 payment must be attached")
511505 else {
512506 let pmt = i.payments[0]
513507 let usdtAmt = pmt.amount
514508 if (if (!(isDefined(pmt.assetId)))
515509 then true
516510 else (value(pmt.assetId) != usdtAssetId))
517511 then throw("USDT payments only!")
518512 else {
519513 let caller = i.caller
520514 let addr = toString(caller)
521515 if ((MINSHOPPAYMENT > usdtAmt))
522516 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
523517 else {
524518 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt)
525519 let curWlgAmount = curStats[ixWlgAmount]
526520 let wlgPrice = curStats[ixWlgPrice]
527- let buyPrice = fraction(wlgPrice, 6, 5)
521+ let buyPrice = fraction(wlgPrice, 6, 5, CEILING)
528522 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
529- let maxWlg = getSwapLimitWlg(addr)
523+ let maxWlg = getSwapLimitWlgold(addr)
530524 if ((wlgAmount > maxWlg))
531- then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
532- else if ((minAmount > wlgAmount))
525+ then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment"))
526+ else if ((minToReceive > wlgAmount))
533527 then throw("Price changed during operation, please try again")
534528 else {
535529 let profitAmount = (usdtAmt / 6)
536- $Tuple2([Reissue(wlgAssetId, wlgAmount, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + wlgAmount)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult)
530+ $Tuple2([Reissue(wlgAssetId, wlgAmount, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + wlgAmount)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult)
537531 }
538532 }
539533 }
540534 }
541535 else throw("Strict value is not equal to itself.")
542536 }
543537
544538
545539
546540 @Callable(i)
547541 func buyWlgREADONLY (address,usdtAmt) = {
548542 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt)
549- let curWlgAmount = curStats[ixWlgAmount]
550543 let wlgPrice = curStats[ixWlgPrice]
551- let buyPrice = fraction(wlgPrice, 6, 5)
544+ let buyPrice = fraction(wlgPrice, 6, 5, CEILING)
552545 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
553- let maxWlg = getSwapLimitWlg(address)
546+ let maxWlg = getSwapLimitWlgold(address)
554547 let maxUsdt = fraction(maxWlg, buyPrice, MULT8)
555548 let profitAmount = (usdtAmt / 6)
556549 $Tuple2(nil, [wlgAmount, MINSHOPPAYMENT, maxUsdt, profitAmount])
557550 }
558551
559552
560553
561554 @Callable(i)
562555 func sellWlg (minAmount) = {
563556 let prologResult = prolog2()
564557 if ((prologResult == prologResult))
565558 then if ((size(i.payments) != 1))
566559 then throw("exactly 1 payment must be attached")
567560 else {
568561 let pmt = i.payments[0]
569562 let wlgAmt = pmt.amount
570563 let caller = i.caller
571564 let addr = toString(caller)
572- let maxWlg = getSwapLimitWlg(addr)
565+ let maxWlg = getSwapLimitWlgold(addr)
573566 if ((wlgAmt > maxWlg))
574- then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
567+ then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD at the moment"))
575568 else if (if (!(isDefined(pmt.assetId)))
576569 then true
577570 else (value(pmt.assetId) != wlgAssetId))
578571 then throw("WLGOLD payments only!")
579572 else {
580573 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
581574 let curWlgAmount = curStats[ixWlgAmount]
582575 let sellPrice = (curStats[ixWlgPrice] / 2)
583576 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
584577 if ((MINSHOPPAYMENT > usdtAmt))
585578 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
586579 else if ((minAmount > usdtAmt))
587580 then throw("Price changed during operation, please try again")
588581 else {
589582 let profitAmount = (usdtAmt / 5)
590- $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - wlgAmt)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
583+ $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - wlgAmt)), IntegerEntry(keyLastWlgTradeTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
591584 }
592585 }
593586 }
594587 else throw("Strict value is not equal to itself.")
595588 }
596589
597590
598591
599592 @Callable(i)
600593 func sellWlgREADONLY (address,wlgAmt) = {
601- let maxWlg = getSwapLimitWlg(address)
594+ let maxWlg = getSwapLimitWlgold(address)
602595 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
603- let curWlgAmount = curStats[ixWlgAmount]
604596 let sellPrice = (curStats[ixWlgPrice] / 2)
605597 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
606598 let minWlg = fraction(MINSHOPPAYMENT, MULT8, sellPrice)
607599 let profitAmount = (usdtAmt / 5)
608600 $Tuple2(nil, [usdtAmt, minWlg, maxWlg, profitAmount])
609601 }
610602
611603
612604
613605 @Callable(i)
614606 func claim () = {
615607 let prologResult = prolog2()
616608 if ((prologResult == prologResult))
617609 then if ((size(i.payments) != 0))
618610 then throw("No payments required")
619611 else {
620- let $t01128511354 = claimInternal2(toString(i.caller))
621- let actions = $t01128511354._1
622- let wlgClaimedAmount = $t01128511354._2
612+ let $t01193312002 = claimInternal2(toString(i.caller))
613+ let actions = $t01193312002._1
614+ let wlgClaimedAmount = $t01193312002._2
623615 $Tuple2((actions :+ ScriptTransfer(i.caller, wlgClaimedAmount, wlgAssetId)), prologResult)
624616 }
625617 else throw("Strict value is not equal to itself.")
626618 }
627619
628620
629621
630622 @Callable(i)
631623 func onStakeUnstakeLand (addr) = if (if (if ((i.caller != stakingContract))
632624 then (i.caller != acresContract)
633625 else false)
634626 then (i.caller != acres2Contract)
635627 else false)
636628 then throw("Permission denied")
637629 else {
638- let $t01167311727 = claimInternal2(addr)
639- let actions = $t01167311727._1
640- let wlgClaimedAmount = $t01167311727._2
630+ let $t01232112375 = claimInternal2(addr)
631+ let actions = $t01232112375._1
632+ let wlgClaimedAmount = $t01232112375._2
641633 $Tuple2(if ((wlgClaimedAmount > 0))
642634 then (actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId))
643635 else actions, wlgClaimedAmount)
644636 }
645637
646638
647639
648640 @Callable(i)
649641 func burnWlgold (wlgAmt) = if ((i.caller != acres2Contract))
650642 then throw("Permission denied")
651643 else {
652644 let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0)
653645 if ((wlgAmt > curStats[ixWlgWlg]))
654646 then throw(((("Only " + fixedPoint(curStats[ixWlgWlg], 8)) + " WLGOLD left on contract, can't burn ") + fixedPoint(wlgAmt, 8)))
655647 else {
656648 let wlgAmountLeft = (curStats[ixWlgAmount] - wlgAmt)
657649 $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, wlgAmountLeft)], wlgAmountLeft)
658650 }
659651 }
660652
661653
662654
663655 @Callable(i)
664656 func betForTicket (bet) = {
665657 let prologResult = prolog2()
666658 if ((prologResult == prologResult))
667659 then if ((size(i.payments) != 0))
668660 then throw("No payments required")
669661 else if (((bet / 4) != 0))
670662 then throw("Invalid bet: should be 0..3")
671663 else {
672664 let moment = (height % DAY_BLOCKS)
673665 if ((moment > (DAY_BLOCKS - 3)))
674666 then throw((("Cannot bet: the day is almost ended, please wait " + toString((DAY_BLOCKS - moment))) + " blocks"))
675667 else {
676668 let addr = toString(i.caller)
677669 let stakedAcres = valueOrElse(getInteger(acres2Contract, keyAcresStakedAmtByUser(addr)), 0)
678670 let lvl = getLevelByAcres(stakedAcres)
679671 if ((lvl == 0))
680672 then throw("You need to stake some ACRES to bet")
681673 else {
682674 let tomorrow = ((height / DAY_BLOCKS) + 1)
683675 let betKey = keyUserBet(addr)
684676 let userBetStr = getString(betKey)
685677 let newBetEntry = StringEntry(betKey, ((toString(tomorrow) + "_") + toString(bet)))
686678 if (isDefined(userBetStr))
687679 then {
688680 let userBet = value(userBetStr)
689681 if ((split(userBet, "_")[0] == toString(tomorrow)))
690682 then throw("You already bet for tomorrow")
691683 else {
692684 let r = claimTicketsInternal(addr, userBet)
693685 $Tuple2(((r._1 :+ r._2) :+ newBetEntry), r._2)
694686 }
695687 }
696688 else $Tuple2([newBetEntry], 0)
697689 }
698690 }
699691 }
700692 else throw("Strict value is not equal to itself.")
701693 }
702694
703695
704696
705697 @Callable(i)
706698 func claimTickets () = {
707699 let prologResult = prolog2()
708700 if ((prologResult == prologResult))
709701 then if ((size(i.payments) != 0))
710702 then throw("No payments required")
711703 else {
712704 let addr = toString(i.caller)
713705 let userBetStr = valueOrErrorMessage(getString(keyUserBet(addr)), "You have no tickets to claim")
714706 let r = claimTicketsInternal(addr, userBetStr)
715707 $Tuple2((r._1 :+ r._2), r._3)
716708 }
717709 else throw("Strict value is not equal to itself.")
718710 }
719711
720712
721713
722714 @Callable(i)
723715 func takeWlgXp (addr) = if ((i.caller != stakingContract))
724716 then throw("Permission denied")
725717 else {
726- let $t01979119834 = takeXpInternal(addr, 0)
727- let actions = $t01979119834._1
728- let xp = $t01979119834._2
718+ let $t02043920482 = takeXpInternal(addr, 0)
719+ let actions = $t02043920482._1
720+ let xp = $t02043920482._2
729721 $Tuple2(actions, xp)
730722 }
731723
732724
733725
734726 @Callable(i)
735727 func checkWlgXpREADONLY (addr) = {
736- let $t01991119959 = takeXpInternal(addr, 0)
737- let ignored = $t01991119959._1
738- let deltaXP = $t01991119959._2
728+ let $t02055920607 = takeXpInternal(addr, 0)
729+ let ignored = $t02055920607._1
730+ let deltaXP = $t02055920607._2
739731 let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP)
740732 let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP)
741733 $Tuple2(nil, (lvlPoints :+ newXP))
742734 }
743735
744736

github/deemru/w8io/169f3d6 
92.53 ms