tx · 4t1JDHitYd8g9E5n4PB6XJiAiBmtW72kvkRfrf3U1MiL

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.02000000 Waves

2023.10.07 01:57 [2787403] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "4t1JDHitYd8g9E5n4PB6XJiAiBmtW72kvkRfrf3U1MiL", "fee": 2000000, "feeAssetId": null, "timestamp": 1696633095023, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "5sCUWzHBoSvsJcxDuaxXUXwHeKtggDpKWAr95SDzAgGLzQfH1bsbRK4dEFTEZRiPZvFZQ4Azbc7UMNakcnRyFpzJ" ], "script": "base64:BgIzCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgUKAwgIARIAEgMKAQESAwoBCBIDCgEIbQACTTYAwIQ9AAJNOACAwtcvAAhNSUxMSU9ONgCAgOmDsd4WAA5NQVJLRVRJTkdTSEFSRQCgjQYACVRFQU1TSEFSRQDAmgwADUFDVElWSVRZU0hBUkUAoI0GAAtQTEFZRVJTSEFSRQCAtRgACllFQVJNSUxMSVMAgIbrx3UACUNIRUNLVElNRQCAyeCrsAEACURBWU1JTExJUwCAuJkpABBtYXJrZXRpbmdBZGRyS2V5Ag1tYXJrZXRpbmdBZGRyAAt0ZWFtQWRkcktleQIIdGVhbUFkZHIAFGxhc3RNYXJrZXRpbmdUaW1lS2V5AhlsYXN0Q2xhaW1lZFRpbWVfbWFya2V0aW5nABZtYXJrZXRpbmdBbW91bnRMZWZ0S2V5AhNtYXJrZXRpbmdBbW91bnRMZWZ0AA9sYXN0VGVhbVRpbWVLZXkCFGxhc3RDbGFpbWVkVGltZV90ZWFtABF0ZWFtQW1vdW50TGVmdEtleQIOdGVhbUFtb3VudExlZ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3VsdAkBBWFzSW50AQkA/AcEBQ9zdGFraW5nQ29udHJhY3QCDnVwZGF0ZUFjY1N0YXRzCQDMCAIFBGFkZHIJAMwIAgUCeHAFA25pbAUDbmlsCQCUCgIFB2FjdGlvbnMJAJQKAgUMcHJvbG9nUmVzdWx0BQ5hY2NTdGF0c1Jlc3VsdAFpAQl0YWtlV2xnWHABBGFkZHIDCQECIT0CCAUBaQZjYWxsZXIFD3N0YWtpbmdDb250cmFjdAkAAgECEVBlcm1pc3Npb24gZGVuaWVkBA0kdDAxMDk1NjEwOTk5CQEOdGFrZVhwSW50ZXJuYWwCBQRhZGRyAAAEB2FjdGlvbnMIBQ0kdDAxMDk1NjEwOTk5Al8xBAJ4cAgFDSR0MDEwOTU2MTA5OTkCXzIJAJQKAgUHYWN0aW9ucwUCeHABaQESY2hlY2tXbGdYcFJFQURPTkxZAQRhZGRyBA0kdDAxMTA3NjExMTI0CQEOdGFrZVhwSW50ZXJuYWwCBQRhZGRyAAAEB2lnbm9yZWQIBQ0kdDAxMTA3NjExMTI0Al8xBAdkZWx0YVhQCAUNJHQwMTEwNzYxMTEyNAJfMgQGbHZsS2V5CQEMa2V5VXNlckxldmVsAQUEYWRkcgQFeHBLZXkJAQlrZXlVc2VyWFABBQRhZGRyBAJ4cAkBC3ZhbHVlT3JFbHNlAgkAmggCBQ9zdGFraW5nQ29udHJhY3QFBXhwS2V5AAAEBW5ld1hQCQBkAgUCeHAFB2RlbHRhWFAECWx2bFBvaW50cwkBB2xldmVsVXACCQELdmFsdWVPckVsc2UCCQCaCAIFD3N0YWtpbmdDb250cmFjdAUGbHZsS2V5AAAFBW5ld1hQCQCUCgIFA25pbAUJbHZsUG9pbnRzAF1ozNU=", "height": 2787403, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B5qhKauRHBTzKGVMBsvE3fnnNe6Gt15BH6kwyt863i7D Next: D4X9oU19yFxnnFszRKAoPbZ8eu6UWbxLLU1yshMNdVXx Diff:
OldNewDifferences
5959
6060 let acresStakedTotalKey = "acresStakedAmountTotal"
6161
62-let idxWlgAmount = 0
62+func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr)
6363
64-let idxWlgPrice = 1
6564
66-let idxWlgFunds = 2
65+let wlgStakedTotalKey = "wlgStakedAmountTotal"
6766
68-let idxWlgIssueTime = 7
67+func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr)
6968
70-let idxWlgMarketingAmLeft = 10
71-
72-let idxWlgMarketingAmAvailNow = 11
73-
74-let idxWlgTeamAmLeft = 14
75-
76-let idxWlgTeamAmAvailNow = 15
77-
78-let idxWlgActAmLeft = 18
79-
80-let idxWlgActAmAvailNow = 19
81-
82-let idxWlgAmLeftTotal = 22
83-
84-let idxWlgUserAmAvailNow = 25
85-
86-let idxWlgUserTotalAvail = 28
87-
88-let idxWlgEffUserTime = 29
8969
9070 let dappRest = 0
9171
211191 }
212192
213193
194+let SCALE8 = 100000000
195+
196+let xpLevelScale = 3200
197+
198+let xpLevelRecipPow = 4000
199+
200+let numPointsOnLevelUp = 3
201+
202+let wlgBaseAmountXp = 100000000000
203+
204+func keyUserXP (addr) = ("userXP_" + addr)
205+
206+
207+func keyUserLevel (addr) = ("userLevel_" + addr)
208+
209+
210+let xpWlg = 10000
211+
212+func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8)
213+
214+
215+func levelUp (currLevel,newXP) = {
216+ let newLevel = levelByXP(newXP)
217+[newLevel, (numPointsOnLevelUp * (newLevel - currLevel))]
218+ }
219+
220+
214221 let chain = take(drop(this.bytes, 1), 1)
215222
216223 let usdtAssetId = match chain {
294301 let wlgAssetIdKey = "wlg_assetId"
295302
296303 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
304+
305+let idxWlgAmount = 0
306+
307+let idxWlgPrice = 1
308+
309+let idxWlgFunds = 2
310+
311+let idxWlgIssueTime = 7
312+
313+let idxWlgMarketingAmLeft = 10
314+
315+let idxWlgMarketingAmAvailNow = 11
316+
317+let idxWlgTeamAmLeft = 14
318+
319+let idxWlgTeamAmAvailNow = 15
320+
321+let idxWlgActAmLeft = 18
322+
323+let idxWlgActAmAvailNow = 19
324+
325+let idxWlgAmLeftTotal = 22
326+
327+let idxWlgUserAmAvailNow = 25
328+
329+let idxWlgUserTotalAvail = 28
330+
331+let idxWlgEffUserTime = 29
297332
298333 let IdxEffUser = 1
299334
388423 }
389424
390425
426+func takeXpInternal (addr,delta) = {
427+ let now = lastBlock.timestamp
428+ let timeKey = keyWlgStakedTimeByUser(addr)
429+ let amountKey = keyWlgStakedAmountByUser(addr)
430+ let lastTime = valueOrElse(getInteger(timeKey), 0)
431+ let oldUser = valueOrElse(getInteger(amountKey), 0)
432+ let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0)
433+ let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS)
434+ $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser)
435+ }
436+
437+
391438 @Callable(i)
392439 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
393440 then throw("Permission denied")
410457 else {
411458 let pmt = i.payments[0]
412459 let usdtAmt = pmt.amount
413- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "USDT payments only!")
414- if ((pmtAssetId != usdtAssetId))
460+ if (if (!(isDefined(pmt.assetId)))
461+ then true
462+ else (value(pmt.assetId) != usdtAssetId))
415463 then throw("USDT payments only!")
416464 else {
417465 let caller = i.caller
456504 let maxWlg = getSwapLimitWlg(addr)
457505 if ((wlgAmt > maxWlg))
458506 then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
459- else {
460- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!")
461- if ((pmtAssetId != wlgAssetId))
462- then throw("WLGOLD payments only!")
463- else {
464- let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, MULT6)
465- let curWlgAmount = curStats[idxWlgAmount]
466- let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
467- let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
468- if ((MINSHOPPAYMENT > usdtAmt))
469- then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
470- else if ((minAmount > usdtAmt))
471- then throw("Price changed during operation, please try again")
472- else {
473- let profitAmount = (usdtAmt / 4)
474- let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
475- $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
476- }
477- }
478- }
507+ else if (if (!(isDefined(pmt.assetId)))
508+ then true
509+ else (value(pmt.assetId) != wlgAssetId))
510+ then throw("WLGOLD payments only!")
511+ else {
512+ let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, MULT6)
513+ let curWlgAmount = curStats[idxWlgAmount]
514+ let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
515+ let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
516+ if ((MINSHOPPAYMENT > usdtAmt))
517+ then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
518+ else if ((minAmount > usdtAmt))
519+ then throw("Price changed during operation, please try again")
520+ else {
521+ let profitAmount = (usdtAmt / 4)
522+ let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
523+ $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
524+ }
525+ }
479526 }
480527 }
481528
517564 }
518565
519566
567+
568+@Callable(i)
569+func stakeWlgold () = {
570+ let prologResult = prolog()
571+ if ((size(i.payments) != 1))
572+ then throw("exactly 1 payment must be attached")
573+ else {
574+ let pmt = i.payments[0]
575+ let amt = pmt.amount
576+ let addr = toString(i.caller)
577+ if (if (!(isDefined(pmt.assetId)))
578+ then true
579+ else (value(pmt.assetId) != wlgAssetId))
580+ then throw("WLGOLD payments only!")
581+ else {
582+ let $t01003810083 = takeXpInternal(addr, amt)
583+ let actions = $t01003810083._1
584+ let xp = $t01003810083._2
585+ let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil))
586+ $Tuple2(actions, $Tuple2(prologResult, accStatsResult))
587+ }
588+ }
589+ }
590+
591+
592+
593+@Callable(i)
594+func unstakeWlgold (amount) = {
595+ let prologResult = prolog()
596+ if ((size(i.payments) != 0))
597+ then throw("No payments required")
598+ else if ((0 >= amount))
599+ then throw("Amount should be positive")
600+ else {
601+ let addr = toString(i.caller)
602+ let $t01046710525 = takeXpInternal(addr, -(amount))
603+ let actions = $t01046710525._1
604+ let xp = $t01046710525._2
605+ let oldUser = $t01046710525._3
606+ if ((amount > oldUser))
607+ then throw(((("You have only " + fixedPoint(oldUser, 8)) + " WLGOLD staked, tried to unstake ") + fixedPoint(amount, 8)))
608+ else {
609+ let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil))
610+ $Tuple2(actions, $Tuple2(prologResult, accStatsResult))
611+ }
612+ }
613+ }
614+
615+
616+
617+@Callable(i)
618+func takeWlgXp (addr) = if ((i.caller != stakingContract))
619+ then throw("Permission denied")
620+ else {
621+ let $t01095610999 = takeXpInternal(addr, 0)
622+ let actions = $t01095610999._1
623+ let xp = $t01095610999._2
624+ $Tuple2(actions, xp)
625+ }
626+
627+
628+
629+@Callable(i)
630+func checkWlgXpREADONLY (addr) = {
631+ let $t01107611124 = takeXpInternal(addr, 0)
632+ let ignored = $t01107611124._1
633+ let deltaXP = $t01107611124._2
634+ let lvlKey = keyUserLevel(addr)
635+ let xpKey = keyUserXP(addr)
636+ let xp = valueOrElse(getInteger(stakingContract, xpKey), 0)
637+ let newXP = (xp + deltaXP)
638+ let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, lvlKey), 0), newXP)
639+ $Tuple2(nil, lvlPoints)
640+ }
641+
642+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let M6 = 1000000
55
66 let M8 = 100000000
77
88 let MILLION6 = 100000000000000
99
1010 let MARKETINGSHARE = 100000
1111
1212 let TEAMSHARE = 200000
1313
1414 let ACTIVITYSHARE = 100000
1515
1616 let PLAYERSHARE = 400000
1717
1818 let YEARMILLIS = 31557600000
1919
2020 let CHECKTIME = 47336400000
2121
2222 let DAYMILLIS = 86400000
2323
2424 let marketingAddrKey = "marketingAddr"
2525
2626 let teamAddrKey = "teamAddr"
2727
2828 let lastMarketingTimeKey = "lastClaimedTime_marketing"
2929
3030 let marketingAmountLeftKey = "marketingAmountLeft"
3131
3232 let lastTeamTimeKey = "lastClaimedTime_team"
3333
3434 let teamAmountLeftKey = "teamAmountLeft"
3535
3636 let lastActivitiesTimeKey = "lastClaimedTime_activities"
3737
3838 let actAmountLeftKey = "activitiesAmountLeft"
3939
4040 let stakersAmountLeftKey = "stakersAmountLeft"
4141
4242 func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
4343
4444
4545 func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
4646
4747
4848 func distributionByPeriod (period) = fraction(MILLION6, (PLAYERSHARE * (period + 1)), (6 * M6))
4949
5050
5151 let wlgIssueTimeKey = "wlg_issueTime"
5252
5353 let wlgIssuedAmountKey = "wlg_issuedAmount"
5454
5555 let zbIssuedAmountKey = "zbill_issuedAmount"
5656
5757 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
5858
5959
6060 let acresStakedTotalKey = "acresStakedAmountTotal"
6161
62-let idxWlgAmount = 0
62+func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr)
6363
64-let idxWlgPrice = 1
6564
66-let idxWlgFunds = 2
65+let wlgStakedTotalKey = "wlgStakedAmountTotal"
6766
68-let idxWlgIssueTime = 7
67+func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr)
6968
70-let idxWlgMarketingAmLeft = 10
71-
72-let idxWlgMarketingAmAvailNow = 11
73-
74-let idxWlgTeamAmLeft = 14
75-
76-let idxWlgTeamAmAvailNow = 15
77-
78-let idxWlgActAmLeft = 18
79-
80-let idxWlgActAmAvailNow = 19
81-
82-let idxWlgAmLeftTotal = 22
83-
84-let idxWlgUserAmAvailNow = 25
85-
86-let idxWlgUserTotalAvail = 28
87-
88-let idxWlgEffUserTime = 29
8969
9070 let dappRest = 0
9171
9272 let dappStaking = 1
9373
9474 let dappEconomy = 2
9575
9676 let dappWlg = 3
9777
9878 let dappPuzzle = 4
9979
10080 let dappInvestFund = 5
10181
10282 let dappAcres = 6
10383
10484 func getLands (userAddrStrOrEmpty,stakingContract,acresContract) = {
10585 let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_")
10686 func adder (acc,item) = (acc + parseIntValue(item))
10787
10888 let totalPieces = {
10989 let $l = props
11090 let $s = size($l)
11191 let $acc0 = 0
11292 func $f0_1 ($a,$i) = if (($i >= $s))
11393 then $a
11494 else adder($a, $l[$i])
11595
11696 func $f0_2 ($a,$i) = if (($i >= $s))
11797 then $a
11898 else throw("List size exceeds 6")
11999
120100 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
121101 }
122102 let userPieces = valueOrElse(getInteger(stakingContract, ("stakedPiecesByOwner_" + userAddrStrOrEmpty)), 0)
123103 let totalAcres = valueOrElse(getInteger(acresContract, acresStakedTotalKey), 0)
124104 let userAcres = valueOrElse(getInteger(acresContract, keyAcresStakedAmountByUser(userAddrStrOrEmpty)), 0)
125105 [totalPieces, userPieces, totalAcres, userAcres]
126106 }
127107
128108
129109 let idxTotalPieces = 0
130110
131111 let idxUserPieces = 1
132112
133113 let idxTotalAcres = 2
134114
135115 let idxUserAcres = 3
136116
137117 func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection,userProportion6) = {
138118 let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet")
139119 let economyUsd = assetBalance(contracts[dappEconomy], usdtId)
140120 let restUsd = assetBalance(contracts[dappRest], usdtId)
141121 let wlgUsd = (assetBalance(contracts[dappWlg], usdtId) - usdtBalanceCorrection)
142122 let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId)
143123 let investFundContract = contracts[dappInvestFund]
144124 let investFundTotal = (assetBalance(investFundContract, usdtId) + valueOrElse(getInteger(investFundContract, zbIssuedAmountKey), 0))
145125 let totalFundsUsd = ((economyUsd + wlgUsd) + investFundTotal)
146126 let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet")
147127 let now = lastBlock.timestamp
148128 let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized")
149129 let marketingTotal = fraction(MILLION6, MARKETINGSHARE, M6)
150130 let marketingAmountLeft = valueOrElse(getInteger(contracts[dappWlg], marketingAmountLeftKey), marketingTotal)
151131 let lastMarketingTime = valueOrElse(getInteger(contracts[dappWlg], lastMarketingTimeKey), issueTime)
152132 let marketingAddr = addressFromStringValue(value(getString(contracts[dappWlg], marketingAddrKey)))
153133 let marketingAmountAvailableNow = min([fraction(marketingTotal, (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft])
154134 let marketingWlgold = assetBalance(marketingAddr, wlgId)
155135 let teamTotal = fraction(MILLION6, TEAMSHARE, M6)
156136 let teamAmountLeft = valueOrElse(getInteger(contracts[dappWlg], teamAmountLeftKey), teamTotal)
157137 let lastTeamTime = valueOrElse(getInteger(contracts[dappWlg], lastTeamTimeKey), issueTime)
158138 let teamAddr = addressFromStringValue(value(getString(contracts[dappWlg], teamAddrKey)))
159139 let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEARMILLIS)), teamAmountLeft])
160140 let teamWlgold = assetBalance(teamAddr, wlgId)
161141 let actTotal = fraction(MILLION6, ACTIVITYSHARE, M6)
162142 let actAmountLeft = valueOrElse(getInteger(contracts[dappWlg], actAmountLeftKey), actTotal)
163143 let lastActivitiesTime = valueOrElse(getInteger(contracts[dappWlg], lastActivitiesTimeKey), issueTime)
164144 let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEARMILLIS)), actAmountLeft])
165145 let actWlgold = assetBalance(contracts[dappRest], wlgId)
166146 let lastUserTime = valueOrElse(getInteger(contracts[dappWlg], keyLastClaimedTimeByUser(userAddrOpt)), issueTime)
167147 let lastUserPeriod = ((lastUserTime - issueTime) / YEARMILLIS)
168148 let nowLimited = min([now, (issueTime + (3 * YEARMILLIS))])
169149 let curPeriod = min([((now - issueTime) / YEARMILLIS), 2])
170150 let eff = getLands(userAddrOpt, contracts[dappStaking], contracts[dappAcres])
171151 let curPeriodDistribution = distributionByPeriod(curPeriod)
172152 let $t079142 = if ((lastUserPeriod == curPeriod))
173153 then {
174154 let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS)
175155 let userPart = fraction(a0, userProportion6, M6)
176156 let effTime = (lastUserTime + fraction((nowLimited - lastUserTime), userProportion6, M6))
177157 $Tuple3(userPart, a0, effTime)
178158 }
179159 else if ((lastUserPeriod == (curPeriod - 1)))
180160 then {
181161 let a1 = fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS)
182162 let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)
183163 let avail = (a1 + a0)
184164 let userPart = fraction(avail, userProportion6, M6)
185165 let effTime = if ((a1 >= userPart))
186166 then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 1))))
187167 else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, (userPart - a1), curPeriodDistribution))
188168 $Tuple3(userPart, avail, effTime)
189169 }
190170 else {
191171 let a2 = fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS)
192172 let a1 = distributionByPeriod((curPeriod - 1))
193173 let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)
194174 let avail = ((a2 + a1) + a0)
195175 let userPart = fraction(avail, userProportion6, M6)
196176 let effTime = if ((a2 >= userPart))
197177 then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 2))))
198178 else if (((a2 + a1) >= userPart))
199179 then ((issueTime + (YEARMILLIS * (curPeriod - 1))) + fraction(YEARMILLIS, (userPart - a2), distributionByPeriod((curPeriod - 1))))
200180 else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, ((userPart - a2) - a1), curPeriodDistribution))
201181 $Tuple3(userPart, avail, effTime)
202182 }
203183 let userAmount = $t079142._1
204184 let userAvailable = $t079142._2
205185 let effLastTime = $t079142._3
206186 let sLandDailyAmount = fraction(fraction(curPeriodDistribution, DAYMILLIS, YEARMILLIS), 25, eff[idxTotalPieces])
207187 let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0)
208188 let robbedUser = fraction(userAmount, ((eff[idxUserPieces] * M8) + eff[idxUserAcres]), ((eff[idxTotalPieces] * M8) + eff[idxTotalAcres]))
209189 let unrobbedUser = fraction(userAvailable, ((eff[idxUserPieces] * M8) + eff[idxUserAcres]), ((eff[idxTotalPieces] * M8) + eff[idxTotalAcres]))
210190 [issuedAmount, fraction(totalFundsUsd, M8, issuedAmount), totalFundsUsd, economyUsd, restUsd, wlgUsd, puzzleUsd, issueTime, lastMarketingTime, marketingTotal, marketingAmountLeft, marketingAmountAvailableNow, marketingWlgold, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, robbedUser, sLandDailyAmount, investFundTotal, unrobbedUser, effLastTime]
211191 }
212192
213193
194+let SCALE8 = 100000000
195+
196+let xpLevelScale = 3200
197+
198+let xpLevelRecipPow = 4000
199+
200+let numPointsOnLevelUp = 3
201+
202+let wlgBaseAmountXp = 100000000000
203+
204+func keyUserXP (addr) = ("userXP_" + addr)
205+
206+
207+func keyUserLevel (addr) = ("userLevel_" + addr)
208+
209+
210+let xpWlg = 10000
211+
212+func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8)
213+
214+
215+func levelUp (currLevel,newXP) = {
216+ let newLevel = levelByXP(newXP)
217+[newLevel, (numPointsOnLevelUp * (newLevel - currLevel))]
218+ }
219+
220+
214221 let chain = take(drop(this.bytes, 1), 1)
215222
216223 let usdtAssetId = match chain {
217224 case _ =>
218225 if ((base58'2W' == $match0))
219226 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
220227 else if ((base58'2T' == $match0))
221228 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
222229 else throw("Unknown chain")
223230 }
224231
225232 let defaultRestAddressStr = match chain {
226233 case _ =>
227234 if ((base58'2W' == $match0))
228235 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
229236 else if ((base58'2T' == $match0))
230237 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
231238 else throw("Unknown chain")
232239 }
233240
234241 let arbitrageDelay = match chain {
235242 case _ =>
236243 if ((base58'2W' == $match0))
237244 then 86400000
238245 else if ((base58'2T' == $match0))
239246 then 60000
240247 else throw("Unknown chain")
241248 }
242249
243250 let SEP = "__"
244251
245252 let MULT6 = 1000000
246253
247254 let MULT8 = 100000000
248255
249256 let MINSHOPPAYMENT = 100000
250257
251258 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
252259
253260
254261 let IdxCfgStakingDapp = 1
255262
256263 let IdxCfgEconomyDapp = 2
257264
258265 let IdxCfgWlgDapp = 4
259266
260267 let IdxCfgPuzzlePoolDapp = 5
261268
262269 let IdxCfgInvestFundDapp = 6
263270
264271 let IdxCfgAcresDapp = 8
265272
266273 func keyRestCfg () = "%s__restConfig"
267274
268275
269276 func keyRestAddress () = "%s__restAddr"
270277
271278
272279 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
273280
274281
275282 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
276283
277284
278285 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
279286
280287 let restCfg = readRestCfgOrFail(restContract)
281288
282289 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
283290
284291 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
285292
286293 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
287294
288295 let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp)
289296
290297 let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp)
291298
292299 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
293300
294301 let wlgAssetIdKey = "wlg_assetId"
295302
296303 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
304+
305+let idxWlgAmount = 0
306+
307+let idxWlgPrice = 1
308+
309+let idxWlgFunds = 2
310+
311+let idxWlgIssueTime = 7
312+
313+let idxWlgMarketingAmLeft = 10
314+
315+let idxWlgMarketingAmAvailNow = 11
316+
317+let idxWlgTeamAmLeft = 14
318+
319+let idxWlgTeamAmAvailNow = 15
320+
321+let idxWlgActAmLeft = 18
322+
323+let idxWlgActAmAvailNow = 19
324+
325+let idxWlgAmLeftTotal = 22
326+
327+let idxWlgUserAmAvailNow = 25
328+
329+let idxWlgUserTotalAvail = 28
330+
331+let idxWlgEffUserTime = 29
297332
298333 let IdxEffUser = 1
299334
300335 func keyResProportions () = "resTypesProportions"
301336
302337
303338 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
304339
305340
306341 func asInt (v) = match v {
307342 case n: Int =>
308343 n
309344 case _ =>
310345 throw("fail to cast into Int")
311346 }
312347
313348
314349 func getVotingPower (userAddrStrOrEmpty) = {
315350 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
316351 func adder (acc,item) = (acc + parseIntValue(item))
317352
318353 let totalPower = {
319354 let $l = props
320355 let $s = size($l)
321356 let $acc0 = 0
322357 func $f0_1 ($a,$i) = if (($i >= $s))
323358 then $a
324359 else adder($a, $l[$i])
325360
326361 func $f0_2 ($a,$i) = if (($i >= $s))
327362 then $a
328363 else throw("List size exceeds 6")
329364
330365 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
331366 }
332367 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
333368 [totalPower, usersPower]
334369 }
335370
336371
337372 func fixedPoint (val,decimals) = {
338373 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
339374 let lowPart = toString((val % tenPow))
340375 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
341376 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
342377 }
343378
344379
345380 let profitAddrKey = "profitAddr"
346381
347382 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
348383
349384 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
350385
351386
352387 func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil))
353388
354389
355390 func getSwapLimitWlg (addr) = {
356391 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
357392 let now = lastBlock.timestamp
358393 if ((arbitrageDelay > (now - lastTime)))
359394 then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
360395 else {
361396 let pieces = getVotingPower(addr)[IdxEffUser]
362397 let acresAmount = valueOrElse(getInteger(acresContract, keyAcresStakedAmountByUser(addr)), 0)
363398 ((pieces * MULT8) + acresAmount)
364399 }
365400 }
366401
367402
368403 func claimInternal (addr,proportion6) = {
369404 let caller = addressFromStringValue(addr)
370405 let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, proportion6)
371406 let now = lastBlock.timestamp
372407 let issueTime = curStats[idxWlgIssueTime]
373408 let marketingAmountLeft = curStats[idxWlgMarketingAmLeft]
374409 let marketingAmount = curStats[idxWlgMarketingAmAvailNow]
375410 let teamAmountLeft = curStats[idxWlgTeamAmLeft]
376411 let teamAmount = curStats[idxWlgTeamAmAvailNow]
377412 let actAmountLeft = curStats[idxWlgActAmLeft]
378413 let actAmount = curStats[idxWlgActAmAvailNow]
379414 if (((now - issueTime) > CHECKTIME))
380415 then throw("Please modify contract for next 1.5 years, according to stats")
381416 else {
382417 let userAmount = curStats[idxWlgUserAmAvailNow]
383418 let userKey = keyStakersAmountPaidUser(addr)
384419 let userTotal = curStats[idxWlgUserTotalAvail]
385420 let userEffTime = curStats[idxWlgEffUserTime]
386421 $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userTotal)), IntegerEntry(stakersAmountLeftKey, (curStats[idxWlgAmLeftTotal] - userTotal)), IntegerEntry(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), userEffTime)], $Tuple2(userAmount, userTotal))
387422 }
388423 }
389424
390425
426+func takeXpInternal (addr,delta) = {
427+ let now = lastBlock.timestamp
428+ let timeKey = keyWlgStakedTimeByUser(addr)
429+ let amountKey = keyWlgStakedAmountByUser(addr)
430+ let lastTime = valueOrElse(getInteger(timeKey), 0)
431+ let oldUser = valueOrElse(getInteger(amountKey), 0)
432+ let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0)
433+ let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS)
434+ $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser)
435+ }
436+
437+
391438 @Callable(i)
392439 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
393440 then throw("Permission denied")
394441 else if (isDefined(getBinary(wlgAssetIdKey)))
395442 then throw("Already initialized")
396443 else {
397444 let issuedAmount = MILLION6
398445 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
399446 let assetId = calculateAssetId(issue)
400447 [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)]
401448 }
402449
403450
404451
405452 @Callable(i)
406453 func buyWlg (minAmount) = {
407454 let prologResult = prolog()
408455 if ((size(i.payments) != 1))
409456 then throw("exactly 1 payment must be attached")
410457 else {
411458 let pmt = i.payments[0]
412459 let usdtAmt = pmt.amount
413- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "USDT payments only!")
414- if ((pmtAssetId != usdtAssetId))
460+ if (if (!(isDefined(pmt.assetId)))
461+ then true
462+ else (value(pmt.assetId) != usdtAssetId))
415463 then throw("USDT payments only!")
416464 else {
417465 let caller = i.caller
418466 let addr = toString(caller)
419467 if ((MINSHOPPAYMENT > usdtAmt))
420468 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
421469 else {
422470 let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, usdtAmt, MULT6)
423471 let curWlgAmount = curStats[idxWlgAmount]
424472 let fundsUsd = curStats[idxWlgFunds]
425473 let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount)
426474 let buyPrice = fraction(wlgPrice, 6, 5)
427475 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
428476 let maxWlg = getSwapLimitWlg(addr)
429477 if ((wlgAmount > maxWlg))
430478 then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
431479 else if ((minAmount > wlgAmount))
432480 then throw("Price changed during operation, please try again")
433481 else {
434482 let profitAmount = (usdtAmt / 6)
435483 let deltaFunds = (usdtAmt - profitAmount)
436484 let reissued = fraction(curWlgAmount, deltaFunds, fundsUsd)
437485 $Tuple2([Reissue(wlgAssetId, reissued, true), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount + reissued)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult)
438486 }
439487 }
440488 }
441489 }
442490 }
443491
444492
445493
446494 @Callable(i)
447495 func sellWlg (minAmount) = {
448496 let prologResult = prolog()
449497 if ((size(i.payments) != 1))
450498 then throw("exactly 1 payment must be attached")
451499 else {
452500 let pmt = i.payments[0]
453501 let wlgAmt = pmt.amount
454502 let caller = i.caller
455503 let addr = toString(caller)
456504 let maxWlg = getSwapLimitWlg(addr)
457505 if ((wlgAmt > maxWlg))
458506 then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD"))
459- else {
460- let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!")
461- if ((pmtAssetId != wlgAssetId))
462- then throw("WLGOLD payments only!")
463- else {
464- let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, MULT6)
465- let curWlgAmount = curStats[idxWlgAmount]
466- let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
467- let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
468- if ((MINSHOPPAYMENT > usdtAmt))
469- then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
470- else if ((minAmount > usdtAmt))
471- then throw("Price changed during operation, please try again")
472- else {
473- let profitAmount = (usdtAmt / 4)
474- let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
475- $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
476- }
477- }
478- }
507+ else if (if (!(isDefined(pmt.assetId)))
508+ then true
509+ else (value(pmt.assetId) != wlgAssetId))
510+ then throw("WLGOLD payments only!")
511+ else {
512+ let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, MULT6)
513+ let curWlgAmount = curStats[idxWlgAmount]
514+ let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
515+ let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
516+ if ((MINSHOPPAYMENT > usdtAmt))
517+ then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
518+ else if ((minAmount > usdtAmt))
519+ then throw("Price changed during operation, please try again")
520+ else {
521+ let profitAmount = (usdtAmt / 4)
522+ let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
523+ $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curWlgAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(addressFromStringValue(value(getString(profitAddrKey))), profitAmount, usdtAssetId), ScriptTransfer(caller, usdtAmt, usdtAssetId)], prologResult)
524+ }
525+ }
479526 }
480527 }
481528
482529
483530
484531 @Callable(i)
485532 func claim () = {
486533 let prologResult = prolog()
487534 if ((size(i.payments) != 0))
488535 then throw("No payments required")
489536 else {
490537 let r = claimInternal(toString(i.caller), MULT6)
491538 let actions = r._1
492539 $Tuple2((actions :+ ScriptTransfer(i.caller, r._2._1, wlgAssetId)), prologResult)
493540 }
494541 }
495542
496543
497544
498545 @Callable(i)
499546 func onStakeUnstakeLand (addr) = if (if ((i.caller != stakingContract))
500547 then (i.caller != acresContract)
501548 else false)
502549 then throw("Permission denied")
503550 else {
504551 let r = claimInternal(addr, MULT6)
505552 let actions = r._1
506553 $Tuple2((actions :+ ScriptTransfer(addressFromStringValue(addr), r._2._1, wlgAssetId)), r._2)
507554 }
508555
509556
510557
511558 @Callable(i)
512559 func claimRob (owner,robber,ownerProportion6) = if ((i.caller != stakingContract))
513560 then throw("Permission denied")
514561 else {
515562 let r = claimInternal(owner, ownerProportion6)
516563 $Tuple2((r._1 :+ ScriptTransfer(addressFromStringValue(robber), (r._2._2 - r._2._1), wlgAssetId)), r._2)
517564 }
518565
519566
567+
568+@Callable(i)
569+func stakeWlgold () = {
570+ let prologResult = prolog()
571+ if ((size(i.payments) != 1))
572+ then throw("exactly 1 payment must be attached")
573+ else {
574+ let pmt = i.payments[0]
575+ let amt = pmt.amount
576+ let addr = toString(i.caller)
577+ if (if (!(isDefined(pmt.assetId)))
578+ then true
579+ else (value(pmt.assetId) != wlgAssetId))
580+ then throw("WLGOLD payments only!")
581+ else {
582+ let $t01003810083 = takeXpInternal(addr, amt)
583+ let actions = $t01003810083._1
584+ let xp = $t01003810083._2
585+ let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil))
586+ $Tuple2(actions, $Tuple2(prologResult, accStatsResult))
587+ }
588+ }
589+ }
590+
591+
592+
593+@Callable(i)
594+func unstakeWlgold (amount) = {
595+ let prologResult = prolog()
596+ if ((size(i.payments) != 0))
597+ then throw("No payments required")
598+ else if ((0 >= amount))
599+ then throw("Amount should be positive")
600+ else {
601+ let addr = toString(i.caller)
602+ let $t01046710525 = takeXpInternal(addr, -(amount))
603+ let actions = $t01046710525._1
604+ let xp = $t01046710525._2
605+ let oldUser = $t01046710525._3
606+ if ((amount > oldUser))
607+ then throw(((("You have only " + fixedPoint(oldUser, 8)) + " WLGOLD staked, tried to unstake ") + fixedPoint(amount, 8)))
608+ else {
609+ let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil))
610+ $Tuple2(actions, $Tuple2(prologResult, accStatsResult))
611+ }
612+ }
613+ }
614+
615+
616+
617+@Callable(i)
618+func takeWlgXp (addr) = if ((i.caller != stakingContract))
619+ then throw("Permission denied")
620+ else {
621+ let $t01095610999 = takeXpInternal(addr, 0)
622+ let actions = $t01095610999._1
623+ let xp = $t01095610999._2
624+ $Tuple2(actions, xp)
625+ }
626+
627+
628+
629+@Callable(i)
630+func checkWlgXpREADONLY (addr) = {
631+ let $t01107611124 = takeXpInternal(addr, 0)
632+ let ignored = $t01107611124._1
633+ let deltaXP = $t01107611124._2
634+ let lvlKey = keyUserLevel(addr)
635+ let xpKey = keyUserXP(addr)
636+ let xp = valueOrElse(getInteger(stakingContract, xpKey), 0)
637+ let newXP = (xp + deltaXP)
638+ let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, lvlKey), 0), newXP)
639+ $Tuple2(nil, lvlPoints)
640+ }
641+
642+

github/deemru/w8io/026f985 
64.17 ms