tx · CGFVXtKMtfaVtUDrytrDBEfPjcvyTazp1nAyZ4YodnRG 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01800000 Waves 2024.09.13 05:39 [3281265] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "CGFVXtKMtfaVtUDrytrDBEfPjcvyTazp1nAyZ4YodnRG", "fee": 1800000, "feeAssetId": null, "timestamp": 1726195184569, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "aP4cTfNWJcsSFCpCza4BQRdth2Xy3BYYtJx8mmT9fosycAXEQj2BU7XKm9mVMu9wEWhWoFTSwTruWkyawHhBNgi" ], "script": "base64:BgIsCAISBgoECAgICBIDCgEIEgMKAQESAwoBARIAEgMKAQgSABIDCgEIEgMKAQhyAApEQVlfTUlMTElTAIC4mSkABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABVkZWZhdWx0UmVzdEFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQUUN1dkZidmg0TGtQVW5yblUxejNqbmJBMXA5bTNXTmh2AwkAAAIBAVQFByRtYXRjaDACIzNNdW1rR0d6dENLQVhwV0RxeGtkZG9mcVhTVWJxUWt2U0p5CQACAQINVW5rbm93biBjaGFpbgAQYWNyZXMyQWRkcmVzc1N0cgQHJG1hdGNoMAUFY2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1vdW50TGVmdAUDbmlsBQ13bGdBbW91bnRMZWZ0AWkBCXRha2VXbGdYcAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQEDSR0MDEzMzA2MTMzNDkJAQ50YWtlWHBJbnRlcm5hbAIFBGFkZHIAAAQHYWN0aW9ucwgFDSR0MDEzMzA2MTMzNDkCXzEEAnhwCAUNJHQwMTMzMDYxMzM0OQJfMgkAlAoCBQdhY3Rpb25zBQJ4cAFpARJjaGVja1dsZ1hwUkVBRE9OTFkBBGFkZHIEDSR0MDEzNDI2MTM0NzQJAQ50YWtlWHBJbnRlcm5hbAIFBGFkZHIAAAQHaWdub3JlZAgFDSR0MDEzNDI2MTM0NzQCXzEEB2RlbHRhWFAIBQ0kdDAxMzQyNjEzNDc0Al8yBAVuZXdYUAkAZAIJAQt2YWx1ZU9yRWxzZQIJAJoIAgUPc3Rha2luZ0NvbnRyYWN0CQEJa2V5VXNlclhQAQUEYWRkcgAABQdkZWx0YVhQBAlsdmxQb2ludHMJAQdsZXZlbFVwAgkBC3ZhbHVlT3JFbHNlAgkAmggCBQ9zdGFraW5nQ29udHJhY3QJAQxrZXlVc2VyTGV2ZWwBBQRhZGRyAAAFBW5ld1hQCQCUCgIFA25pbAkAzQgCBQlsdmxQb2ludHMFBW5ld1hQALWhdkE=", "height": 3281265, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3LBWi3NoargvPCRarwy2edDaabb4VzLkFCrKvpwZqpwA Next: 9sW4poLPS2SUg3hUuqhsvvUkWTCuEyL86tfGieGt26xR Diff:
Old | New | Differences | |
---|---|---|---|
155 | 155 | let actAmountLeftKey = "activitiesAmountLeft" | |
156 | 156 | ||
157 | 157 | let stakersAmountLeftKey = "stakersAmountLeft" | |
158 | - | ||
159 | - | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
160 | - | ||
161 | 158 | ||
162 | 159 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
163 | 160 | ||
336 | 333 | let $t079142 = if ((lastUserPeriod == curPeriod)) | |
337 | 334 | then { | |
338 | 335 | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS) | |
339 | - | let effTime = | |
336 | + | let effTime = nowLimited | |
340 | 337 | $Tuple2(a0, effTime) | |
341 | 338 | } | |
342 | 339 | else if ((lastUserPeriod == (curPeriod - 1))) | |
408 | 405 | func claimInternal2 (addr) = { | |
409 | 406 | let caller = addressFromStringValue(addr) | |
410 | 407 | let curStats = getWlgStats2(addr, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
411 | - | let now = lastBlock.timestamp | |
412 | - | let issueTime = curStats[ixWlgIssueTime] | |
413 | - | let teamAmountLeft = curStats[ixWlgTeamAmLeft] | |
414 | - | let teamAmount = curStats[ixWlgTeamAmAvailNow] | |
415 | - | let actAmountLeft = curStats[ixWlgActAmLeft] | |
416 | - | let actAmount = curStats[ixWlgActAmAvailNow] | |
417 | - | let userAmount = curStats[ixWlgUserAmAvailNow] | |
418 | - | let userKey = keyStakersAmountPaidUser(addr) | |
419 | - | let userTotal = curStats[ixWlgUserAmAvailNow] | |
408 | + | let userTimeKey = keyLastClaimTimeByUser(addr) | |
409 | + | let lastUserTime = valueOrElse(getInteger(userTimeKey), 0) | |
420 | 410 | let userEffTime = curStats[ixWlgEffUserTime] | |
421 | - | $Tuple2([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[ixWlgAmLeftTotal] - userTotal)), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), userEffTime)], userAmount) | |
411 | + | if ((lastUserTime == userEffTime)) | |
412 | + | then $Tuple2(nil, 0) | |
413 | + | else { | |
414 | + | let now = lastBlock.timestamp | |
415 | + | let issueTime = curStats[ixWlgIssueTime] | |
416 | + | let teamAmountLeft = curStats[ixWlgTeamAmLeft] | |
417 | + | let teamAmount = curStats[ixWlgTeamAmAvailNow] | |
418 | + | let actAmountLeft = curStats[ixWlgActAmLeft] | |
419 | + | let actAmount = curStats[ixWlgActAmAvailNow] | |
420 | + | let userAmount = curStats[ixWlgUserAmAvailNow] | |
421 | + | let userKey = keyStakersAmountPaidUser(addr) | |
422 | + | let userTotal = curStats[ixWlgUserAmAvailNow] | |
423 | + | $Tuple2([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[ixWlgAmLeftTotal] - userTotal)), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, userEffTime)], userAmount) | |
424 | + | } | |
422 | 425 | } | |
423 | 426 | ||
424 | 427 | ||
561 | 564 | else false) | |
562 | 565 | then throw("Permission denied") | |
563 | 566 | else { | |
564 | - | let $ | |
565 | - | let actions = $ | |
566 | - | let wlgClaimedAmount = $ | |
567 | + | let $t01098111035 = claimInternal2(addr) | |
568 | + | let actions = $t01098111035._1 | |
569 | + | let wlgClaimedAmount = $t01098111035._2 | |
567 | 570 | $Tuple2((actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId)), wlgClaimedAmount) | |
568 | 571 | } | |
569 | 572 | ||
585 | 588 | func takeWlgXp (addr) = if ((i.caller != stakingContract)) | |
586 | 589 | then throw("Permission denied") | |
587 | 590 | else { | |
588 | - | let $ | |
589 | - | let actions = $ | |
590 | - | let xp = $ | |
591 | + | let $t01330613349 = takeXpInternal(addr, 0) | |
592 | + | let actions = $t01330613349._1 | |
593 | + | let xp = $t01330613349._2 | |
591 | 594 | $Tuple2(actions, xp) | |
592 | 595 | } | |
593 | 596 | ||
595 | 598 | ||
596 | 599 | @Callable(i) | |
597 | 600 | func checkWlgXpREADONLY (addr) = { | |
598 | - | let $ | |
599 | - | let ignored = $ | |
600 | - | let deltaXP = $ | |
601 | + | let $t01342613474 = takeXpInternal(addr, 0) | |
602 | + | let ignored = $t01342613474._1 | |
603 | + | let deltaXP = $t01342613474._2 | |
601 | 604 | let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP) | |
602 | 605 | let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP) | |
603 | 606 | $Tuple2(nil, (lvlPoints :+ newXP)) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let DAY_MILLIS = 86400000 | |
5 | 5 | ||
6 | 6 | let chain = take(drop(this.bytes, 1), 1) | |
7 | 7 | ||
8 | 8 | let usdtAssetId = match chain { | |
9 | 9 | case _ => | |
10 | 10 | if ((base58'2W' == $match0)) | |
11 | 11 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
12 | 12 | else if ((base58'2T' == $match0)) | |
13 | 13 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
14 | 14 | else throw("Unknown chain") | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | let defaultRestAddressStr = match chain { | |
18 | 18 | case _ => | |
19 | 19 | if ((base58'2W' == $match0)) | |
20 | 20 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
21 | 21 | else if ((base58'2T' == $match0)) | |
22 | 22 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
23 | 23 | else throw("Unknown chain") | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | let acres2AddressStr = match chain { | |
27 | 27 | case _ => | |
28 | 28 | if ((base58'2W' == $match0)) | |
29 | 29 | then "3P4UH3T9nXpMNpUmSmQjPmEz3G85t3zn6eA" | |
30 | 30 | else if ((base58'2T' == $match0)) | |
31 | 31 | then "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh" | |
32 | 32 | else throw("Unknown chain") | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | let arbitrageDelay = match chain { | |
36 | 36 | case _ => | |
37 | 37 | if ((base58'2W' == $match0)) | |
38 | 38 | then DAY_MILLIS | |
39 | 39 | else if ((base58'2T' == $match0)) | |
40 | 40 | then 60000 | |
41 | 41 | else throw("Unknown chain") | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | let SEP = "__" | |
45 | 45 | ||
46 | 46 | let MULT6 = 1000000 | |
47 | 47 | ||
48 | 48 | let MULT8 = 100000000 | |
49 | 49 | ||
50 | 50 | let MINSHOPPAYMENT = 100000 | |
51 | 51 | ||
52 | 52 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | let IdxCfgStakingDapp = 1 | |
56 | 56 | ||
57 | 57 | let IdxCfgWlgDapp = 4 | |
58 | 58 | ||
59 | 59 | let IdxCfgPuzzlePoolDapp = 5 | |
60 | 60 | ||
61 | 61 | let IdxCfgInvestFundDapp = 6 | |
62 | 62 | ||
63 | 63 | let IdxCfgAcresDapp = 8 | |
64 | 64 | ||
65 | 65 | func keyRestCfg () = "%s__restConfig" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyRestAddress () = "%s__restAddr" | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func keyRest2Address () = "%s__rest2Addr" | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
81 | 81 | ||
82 | 82 | let restCfg = readRestCfgOrFail(restContract) | |
83 | 83 | ||
84 | 84 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
85 | 85 | ||
86 | 86 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
87 | 87 | ||
88 | 88 | let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp) | |
89 | 89 | ||
90 | 90 | let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp) | |
91 | 91 | ||
92 | 92 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
93 | 93 | ||
94 | 94 | let wlgAssetIdKey = "wlg_assetId" | |
95 | 95 | ||
96 | 96 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
97 | 97 | ||
98 | 98 | func asInt (v) = match v { | |
99 | 99 | case n: Int => | |
100 | 100 | n | |
101 | 101 | case _ => | |
102 | 102 | throw("fail to cast into Int") | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func fixedPoint (val,decimals) = { | |
107 | 107 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
108 | 108 | let lowPart = toString((val % tenPow)) | |
109 | 109 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
110 | 110 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
111 | 111 | } | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | let SCALE8 = 100000000 | |
115 | 115 | ||
116 | 116 | let xpLevelScale = 3200 | |
117 | 117 | ||
118 | 118 | let xpLevelRecipPow = 4000 | |
119 | 119 | ||
120 | 120 | let numPointsOnLevelUp = 3 | |
121 | 121 | ||
122 | 122 | let wlgBaseAmountXp = 100000000000 | |
123 | 123 | ||
124 | 124 | func keyUserXP (addr) = ("userXP_" + addr) | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func keyUserLevel (addr) = ("userLevel_" + addr) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | let xpWlg = 10000 | |
131 | 131 | ||
132 | 132 | func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func levelUp (currLevel,newXP) = { | |
136 | 136 | let newLevel = levelByXP(newXP) | |
137 | 137 | [newLevel, (numPointsOnLevelUp * (newLevel - currLevel))] | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | let MILLION6 = 100000000000000 | |
142 | 142 | ||
143 | 143 | let PLAYERSHARE = 400000 | |
144 | 144 | ||
145 | 145 | let DAYMILLIS = 86400000 | |
146 | 146 | ||
147 | 147 | let teamAddrKey = "teamAddr" | |
148 | 148 | ||
149 | 149 | let lastTeamTimeKey = "lastClaimedTime_team" | |
150 | 150 | ||
151 | 151 | let teamAmountLeftKey = "teamAmountLeft" | |
152 | 152 | ||
153 | 153 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
154 | 154 | ||
155 | 155 | let actAmountLeftKey = "activitiesAmountLeft" | |
156 | 156 | ||
157 | 157 | let stakersAmountLeftKey = "stakersAmountLeft" | |
158 | - | ||
159 | - | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
160 | - | ||
161 | 158 | ||
162 | 159 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
163 | 160 | ||
164 | 161 | ||
165 | 162 | let wlgIssueTimeKey = "wlg_issueTime" | |
166 | 163 | ||
167 | 164 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
168 | 165 | ||
169 | 166 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
170 | 167 | ||
171 | 168 | ||
172 | 169 | func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr) | |
173 | 170 | ||
174 | 171 | ||
175 | 172 | let wlgStakedTotalKey = "wlgStakedAmountTotal" | |
176 | 173 | ||
177 | 174 | func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr) | |
178 | 175 | ||
179 | 176 | ||
180 | 177 | let M6_ = 1000000 | |
181 | 178 | ||
182 | 179 | let M8_ = 100000000 | |
183 | 180 | ||
184 | 181 | let MILL6 = 100000000000000 | |
185 | 182 | ||
186 | 183 | let TEAM_SHARE = 200000 | |
187 | 184 | ||
188 | 185 | let ACTIVITY_SHARE = 100000 | |
189 | 186 | ||
190 | 187 | let PLAYER_SHARE = 400000 | |
191 | 188 | ||
192 | 189 | let YEAR_MILLIS = 31557600000 | |
193 | 190 | ||
194 | 191 | let chn = take(drop(this.bytes, 1), 1) | |
195 | 192 | ||
196 | 193 | let USDT_TVL_CORR = match chn { | |
197 | 194 | case _ => | |
198 | 195 | if ((base58'2W' == $match0)) | |
199 | 196 | then 1208630000 | |
200 | 197 | else if ((base58'2T' == $match0)) | |
201 | 198 | then 0 | |
202 | 199 | else throw("Unknown chain") | |
203 | 200 | } | |
204 | 201 | ||
205 | 202 | let teamAdrKey = "teamAddr" | |
206 | 203 | ||
207 | 204 | let lastTeamTimKey = "lastClaimedTime_team" | |
208 | 205 | ||
209 | 206 | let teamAmtLeftKey = "teamAmountLeft" | |
210 | 207 | ||
211 | 208 | let lastActivitiesTimKey = "lastClaimedTime_activities" | |
212 | 209 | ||
213 | 210 | let actAmtLeftKey = "activitiesAmountLeft" | |
214 | 211 | ||
215 | 212 | let stakersAmtLeftKey = "stakersAmountLeft" | |
216 | 213 | ||
217 | 214 | func keyLastClaimTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
218 | 215 | ||
219 | 216 | ||
220 | 217 | func distrByPeriod (period) = fraction(MILL6, (PLAYER_SHARE * (period + 1)), (6 * M6_)) | |
221 | 218 | ||
222 | 219 | ||
223 | 220 | let wlgIssueTimKey = "wlg_issueTime" | |
224 | 221 | ||
225 | 222 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
226 | 223 | ||
227 | 224 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
228 | 225 | ||
229 | 226 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
230 | 227 | ||
231 | 228 | ||
232 | 229 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
233 | 230 | ||
234 | 231 | let dapp2Rest = 0 | |
235 | 232 | ||
236 | 233 | let dapp2Staking = 1 | |
237 | 234 | ||
238 | 235 | let dapp2Wlg = 2 | |
239 | 236 | ||
240 | 237 | let dapp2Puzzle = 3 | |
241 | 238 | ||
242 | 239 | let dapp2InvestFund = 4 | |
243 | 240 | ||
244 | 241 | let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
245 | 242 | ||
246 | 243 | func getLevelByAcres (acres) = { | |
247 | 244 | let acr = (acres / M8_) | |
248 | 245 | func checker (acc,item) = if ((item > acr)) | |
249 | 246 | then acc | |
250 | 247 | else (acc + 1) | |
251 | 248 | ||
252 | 249 | let idx = { | |
253 | 250 | let $l = levels | |
254 | 251 | let $s = size($l) | |
255 | 252 | let $acc0 = 0 | |
256 | 253 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
257 | 254 | then $a | |
258 | 255 | else checker($a, $l[$i]) | |
259 | 256 | ||
260 | 257 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
261 | 258 | then $a | |
262 | 259 | else throw("List size exceeds 10") | |
263 | 260 | ||
264 | 261 | $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) | |
265 | 262 | } | |
266 | 263 | (idx + 1) | |
267 | 264 | } | |
268 | 265 | ||
269 | 266 | ||
270 | 267 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
271 | 268 | ||
272 | 269 | ||
273 | 270 | func getFarmingPowers (userAddrStrOrEmpty,stakingContract) = { | |
274 | 271 | let totalAcres = valueOrElse(getInteger(stakingContract, acresStakdTotalKey), 0) | |
275 | 272 | let totalFP = getFarmingPowerByAcres(totalAcres) | |
276 | 273 | let userAcres = valueOrElse(getInteger(stakingContract, keyAcresStakedAmtByUser(userAddrStrOrEmpty)), 0) | |
277 | 274 | let userFP = getFarmingPowerByAcres(userAcres) | |
278 | 275 | [totalFP, userFP] | |
279 | 276 | } | |
280 | 277 | ||
281 | 278 | ||
282 | 279 | let idxTotalFP = 0 | |
283 | 280 | ||
284 | 281 | let idxUserFP = 1 | |
285 | 282 | ||
286 | 283 | let ixWlgAmount = 0 | |
287 | 284 | ||
288 | 285 | let ixWlgPrice = 1 | |
289 | 286 | ||
290 | 287 | let ixWlgFunds = 2 | |
291 | 288 | ||
292 | 289 | let ixWlgIssueTime = 6 | |
293 | 290 | ||
294 | 291 | let ixWlgTeamAmLeft = 9 | |
295 | 292 | ||
296 | 293 | let ixWlgTeamAmAvailNow = 10 | |
297 | 294 | ||
298 | 295 | let ixWlgActAmLeft = 13 | |
299 | 296 | ||
300 | 297 | let ixWlgActAmAvailNow = 14 | |
301 | 298 | ||
302 | 299 | let ixWlgAmLeftTotal = 17 | |
303 | 300 | ||
304 | 301 | let ixWlgUserAmAvailNow = 21 | |
305 | 302 | ||
306 | 303 | let ixWlgEffUserTime = 22 | |
307 | 304 | ||
308 | 305 | func getWlgStats2 (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = { | |
309 | 306 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
310 | 307 | let restUsd = assetBalance(contracts[dapp2Rest], usdtId) | |
311 | 308 | let wlgUsd = (assetBalance(contracts[dapp2Wlg], usdtId) - usdtBalanceCorrection) | |
312 | 309 | let puzzleUsd = assetBalance(contracts[dapp2Puzzle], usdtId) | |
313 | 310 | let investFndContract = contracts[dapp2InvestFund] | |
314 | 311 | let investFundTotal = (assetBalance(investFndContract, usdtId) + valueOrElse(getInteger(investFndContract, zbIssuedAmtKey), 0)) | |
315 | 312 | let totalFundsUsd = (wlgUsd + investFundTotal) | |
316 | 313 | let wlgId = valueOrErrorMessage(getBinary(contracts[dapp2Wlg], "wlg_assetId"), "Not initialized yet") | |
317 | 314 | let now = lastBlock.timestamp | |
318 | 315 | let issueTime = valueOrErrorMessage(getInteger(contracts[dapp2Wlg], wlgIssueTimKey), "Not initialized") | |
319 | 316 | let teamTotal = fraction(MILL6, TEAM_SHARE, M6_) | |
320 | 317 | let teamAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], teamAmtLeftKey), teamTotal) | |
321 | 318 | let lastTeamTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastTeamTimKey), issueTime) | |
322 | 319 | let teamAddr = addressFromStringValue(value(getString(contracts[dapp2Wlg], teamAdrKey))) | |
323 | 320 | let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEAR_MILLIS)), teamAmountLeft]) | |
324 | 321 | let teamWlgold = assetBalance(teamAddr, wlgId) | |
325 | 322 | let actTotal = fraction(MILL6, ACTIVITY_SHARE, M6_) | |
326 | 323 | let actAmountLeft = valueOrElse(getInteger(contracts[dapp2Wlg], actAmtLeftKey), actTotal) | |
327 | 324 | let lastActivitiesTime = valueOrElse(getInteger(contracts[dapp2Wlg], lastActivitiesTimKey), issueTime) | |
328 | 325 | let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEAR_MILLIS)), actAmountLeft]) | |
329 | 326 | let actWlgold = assetBalance(contracts[dapp2Rest], wlgId) | |
330 | 327 | let lastUserTime = valueOrElse(getInteger(contracts[dapp2Wlg], keyLastClaimTimeByUser(userAddrOpt)), issueTime) | |
331 | 328 | let lastUserPeriod = ((lastUserTime - issueTime) / YEAR_MILLIS) | |
332 | 329 | let nowLimited = min([now, (issueTime + (3 * YEAR_MILLIS))]) | |
333 | 330 | let curPeriod = min([((now - issueTime) / YEAR_MILLIS), 2]) | |
334 | 331 | let eff = getFarmingPowers(userAddrOpt, contracts[dapp2Staking]) | |
335 | 332 | let curPeriodDistribution = distrByPeriod(curPeriod) | |
336 | 333 | let $t079142 = if ((lastUserPeriod == curPeriod)) | |
337 | 334 | then { | |
338 | 335 | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEAR_MILLIS) | |
339 | - | let effTime = | |
336 | + | let effTime = nowLimited | |
340 | 337 | $Tuple2(a0, effTime) | |
341 | 338 | } | |
342 | 339 | else if ((lastUserPeriod == (curPeriod - 1))) | |
343 | 340 | then { | |
344 | 341 | let a1 = fraction(distrByPeriod((curPeriod - 1)), ((issueTime + (YEAR_MILLIS * curPeriod)) - lastUserTime), YEAR_MILLIS) | |
345 | 342 | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS) | |
346 | 343 | let avail = (a1 + a0) | |
347 | 344 | let effTime = if ((a1 >= avail)) | |
348 | 345 | then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 1)))) | |
349 | 346 | else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, (avail - a1), curPeriodDistribution)) | |
350 | 347 | $Tuple2(avail, effTime) | |
351 | 348 | } | |
352 | 349 | else { | |
353 | 350 | let a2 = fraction(distrByPeriod((curPeriod - 2)), ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) - lastUserTime), YEAR_MILLIS) | |
354 | 351 | let a1 = distrByPeriod((curPeriod - 1)) | |
355 | 352 | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEAR_MILLIS * curPeriod))), YEAR_MILLIS) | |
356 | 353 | let avail = ((a2 + a1) + a0) | |
357 | 354 | let effTime = if ((a2 >= avail)) | |
358 | 355 | then (lastUserTime + fraction(YEAR_MILLIS, avail, distrByPeriod((curPeriod - 2)))) | |
359 | 356 | else if (((a2 + a1) >= avail)) | |
360 | 357 | then ((issueTime + (YEAR_MILLIS * (curPeriod - 1))) + fraction(YEAR_MILLIS, (avail - a2), distrByPeriod((curPeriod - 1)))) | |
361 | 358 | else ((issueTime + (YEAR_MILLIS * curPeriod)) + fraction(YEAR_MILLIS, ((avail - a2) - a1), curPeriodDistribution)) | |
362 | 359 | $Tuple2(avail, effTime) | |
363 | 360 | } | |
364 | 361 | let userAvailable = $t079142._1 | |
365 | 362 | let effLastTime = $t079142._2 | |
366 | 363 | let amountLeftTotal = valueOrElse(getInteger(contracts[dapp2Wlg], stakersAmtLeftKey), 0) | |
367 | 364 | let unrobbedUser = if ((eff[idxTotalFP] != 0)) | |
368 | 365 | then fraction(userAvailable, eff[idxUserFP], eff[idxTotalFP]) | |
369 | 366 | else 0 | |
370 | 367 | [issuedAmount, fraction((totalFundsUsd - USDT_TVL_CORR), M8_, issuedAmount), totalFundsUsd, restUsd, wlgUsd, puzzleUsd, issueTime, lastTeamTime, teamTotal, teamAmountLeft, teamAmountAvailableNow, teamWlgold, actTotal, actAmountLeft, actAmountAvailableNow, actWlgold, curPeriod, amountLeftTotal, curPeriodDistribution, lastUserTime, investFundTotal, unrobbedUser, effLastTime] | |
371 | 368 | } | |
372 | 369 | ||
373 | 370 | ||
374 | 371 | let net = take(drop(this.bytes, 1), 1) | |
375 | 372 | ||
376 | 373 | let defaultRest2AddressStr = match net { | |
377 | 374 | case _ => | |
378 | 375 | if ((base58'2W' == $match0)) | |
379 | 376 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
380 | 377 | else if ((base58'2T' == $match0)) | |
381 | 378 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
382 | 379 | else throw("Unknown chain") | |
383 | 380 | } | |
384 | 381 | ||
385 | 382 | let profitAddrKey = "profitAddr" | |
386 | 383 | ||
387 | 384 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
388 | 385 | ||
389 | 386 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
390 | 387 | ||
391 | 388 | ||
392 | 389 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
393 | 390 | ||
394 | 391 | let acres2Contract = addressFromStringValue(acres2AddressStr) | |
395 | 392 | ||
396 | 393 | func prolog2 () = asInt(reentrantInvoke(acres2Contract, "saveLastTx", nil, nil)) | |
397 | 394 | ||
398 | 395 | ||
399 | 396 | func getSwapLimitWlg (addr) = { | |
400 | 397 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
401 | 398 | let now = lastBlock.timestamp | |
402 | 399 | if ((arbitrageDelay > (now - lastTime))) | |
403 | 400 | then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min")) | |
404 | 401 | else valueOrElse(getInteger(acres2Contract, keyAcresStakedAmountByUser(addr)), 0) | |
405 | 402 | } | |
406 | 403 | ||
407 | 404 | ||
408 | 405 | func claimInternal2 (addr) = { | |
409 | 406 | let caller = addressFromStringValue(addr) | |
410 | 407 | let curStats = getWlgStats2(addr, [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
411 | - | let now = lastBlock.timestamp | |
412 | - | let issueTime = curStats[ixWlgIssueTime] | |
413 | - | let teamAmountLeft = curStats[ixWlgTeamAmLeft] | |
414 | - | let teamAmount = curStats[ixWlgTeamAmAvailNow] | |
415 | - | let actAmountLeft = curStats[ixWlgActAmLeft] | |
416 | - | let actAmount = curStats[ixWlgActAmAvailNow] | |
417 | - | let userAmount = curStats[ixWlgUserAmAvailNow] | |
418 | - | let userKey = keyStakersAmountPaidUser(addr) | |
419 | - | let userTotal = curStats[ixWlgUserAmAvailNow] | |
408 | + | let userTimeKey = keyLastClaimTimeByUser(addr) | |
409 | + | let lastUserTime = valueOrElse(getInteger(userTimeKey), 0) | |
420 | 410 | let userEffTime = curStats[ixWlgEffUserTime] | |
421 | - | $Tuple2([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[ixWlgAmLeftTotal] - userTotal)), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), userEffTime)], userAmount) | |
411 | + | if ((lastUserTime == userEffTime)) | |
412 | + | then $Tuple2(nil, 0) | |
413 | + | else { | |
414 | + | let now = lastBlock.timestamp | |
415 | + | let issueTime = curStats[ixWlgIssueTime] | |
416 | + | let teamAmountLeft = curStats[ixWlgTeamAmLeft] | |
417 | + | let teamAmount = curStats[ixWlgTeamAmAvailNow] | |
418 | + | let actAmountLeft = curStats[ixWlgActAmLeft] | |
419 | + | let actAmount = curStats[ixWlgActAmAvailNow] | |
420 | + | let userAmount = curStats[ixWlgUserAmAvailNow] | |
421 | + | let userKey = keyStakersAmountPaidUser(addr) | |
422 | + | let userTotal = curStats[ixWlgUserAmAvailNow] | |
423 | + | $Tuple2([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[ixWlgAmLeftTotal] - userTotal)), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, userEffTime)], userAmount) | |
424 | + | } | |
422 | 425 | } | |
423 | 426 | ||
424 | 427 | ||
425 | 428 | func takeXpInternal (addr,delta) = { | |
426 | 429 | let now = lastBlock.timestamp | |
427 | 430 | let timeKey = keyWlgStakedTimeByUser(addr) | |
428 | 431 | let amountKey = keyWlgStakedAmountByUser(addr) | |
429 | 432 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
430 | 433 | let oldUser = valueOrElse(getInteger(amountKey), 0) | |
431 | 434 | let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0) | |
432 | 435 | let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS) | |
433 | 436 | $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser) | |
434 | 437 | } | |
435 | 438 | ||
436 | 439 | ||
437 | 440 | @Callable(i) | |
438 | 441 | func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this)) | |
439 | 442 | then throw("Permission denied") | |
440 | 443 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
441 | 444 | then throw("Already initialized") | |
442 | 445 | else { | |
443 | 446 | let issuedAmount = MILLION6 | |
444 | 447 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
445 | 448 | let assetId = calculateAssetId(issue) | |
446 | 449 | [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MILLION6, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(teamAddrKey, teamAddr), StringEntry(profitAddrKey, profitAddr)] | |
447 | 450 | } | |
448 | 451 | ||
449 | 452 | ||
450 | 453 | ||
451 | 454 | @Callable(i) | |
452 | 455 | func constructorV2 (rest2Addr) = if ((i.caller != this)) | |
453 | 456 | then throw("Permission denied") | |
454 | 457 | else [StringEntry(keyRest2Address(), rest2Addr)] | |
455 | 458 | ||
456 | 459 | ||
457 | 460 | ||
458 | 461 | @Callable(i) | |
459 | 462 | func buyWlg (minAmount) = { | |
460 | 463 | let prologResult = prolog2() | |
461 | 464 | if ((prologResult == prologResult)) | |
462 | 465 | then if ((size(i.payments) != 1)) | |
463 | 466 | then throw("exactly 1 payment must be attached") | |
464 | 467 | else { | |
465 | 468 | let pmt = i.payments[0] | |
466 | 469 | let usdtAmt = pmt.amount | |
467 | 470 | if (if (!(isDefined(pmt.assetId))) | |
468 | 471 | then true | |
469 | 472 | else (value(pmt.assetId) != usdtAssetId)) | |
470 | 473 | then throw("USDT payments only!") | |
471 | 474 | else { | |
472 | 475 | let caller = i.caller | |
473 | 476 | let addr = toString(caller) | |
474 | 477 | if ((MINSHOPPAYMENT > usdtAmt)) | |
475 | 478 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
476 | 479 | else { | |
477 | 480 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt) | |
478 | 481 | let curWlgAmount = curStats[ixWlgAmount] | |
479 | 482 | let fundsUsd = curStats[ixWlgFunds] | |
480 | 483 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
481 | 484 | let buyPrice = fraction(wlgPrice, 6, 5) | |
482 | 485 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
483 | 486 | let maxWlg = getSwapLimitWlg(addr) | |
484 | 487 | if ((wlgAmount > maxWlg)) | |
485 | 488 | then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
486 | 489 | else if ((minAmount > wlgAmount)) | |
487 | 490 | then throw("Price changed during operation, please try again") | |
488 | 491 | else { | |
489 | 492 | let profitAmount = (usdtAmt / 6) | |
490 | 493 | let deltaFunds = (usdtAmt - profitAmount) | |
491 | 494 | let reissued = fraction(curWlgAmount, deltaFunds, fundsUsd) | |
492 | 495 | $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) | |
493 | 496 | } | |
494 | 497 | } | |
495 | 498 | } | |
496 | 499 | } | |
497 | 500 | else throw("Strict value is not equal to itself.") | |
498 | 501 | } | |
499 | 502 | ||
500 | 503 | ||
501 | 504 | ||
502 | 505 | @Callable(i) | |
503 | 506 | func sellWlg (minAmount) = { | |
504 | 507 | let prologResult = prolog2() | |
505 | 508 | if ((prologResult == prologResult)) | |
506 | 509 | then if ((size(i.payments) != 1)) | |
507 | 510 | then throw("exactly 1 payment must be attached") | |
508 | 511 | else { | |
509 | 512 | let pmt = i.payments[0] | |
510 | 513 | let wlgAmt = pmt.amount | |
511 | 514 | let caller = i.caller | |
512 | 515 | let addr = toString(caller) | |
513 | 516 | let maxWlg = getSwapLimitWlg(addr) | |
514 | 517 | if ((wlgAmt > maxWlg)) | |
515 | 518 | then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
516 | 519 | else if (if (!(isDefined(pmt.assetId))) | |
517 | 520 | then true | |
518 | 521 | else (value(pmt.assetId) != wlgAssetId)) | |
519 | 522 | then throw("WLGOLD payments only!") | |
520 | 523 | else { | |
521 | 524 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
522 | 525 | let curWlgAmount = curStats[ixWlgAmount] | |
523 | 526 | let sellPrice = fraction(curStats[ixWlgPrice], 4, 5) | |
524 | 527 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
525 | 528 | if ((MINSHOPPAYMENT > usdtAmt)) | |
526 | 529 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
527 | 530 | else if ((minAmount > usdtAmt)) | |
528 | 531 | then throw("Price changed during operation, please try again") | |
529 | 532 | else { | |
530 | 533 | let profitAmount = (usdtAmt / 4) | |
531 | 534 | $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) | |
532 | 535 | } | |
533 | 536 | } | |
534 | 537 | } | |
535 | 538 | else throw("Strict value is not equal to itself.") | |
536 | 539 | } | |
537 | 540 | ||
538 | 541 | ||
539 | 542 | ||
540 | 543 | @Callable(i) | |
541 | 544 | func claim () = { | |
542 | 545 | let prologResult = prolog2() | |
543 | 546 | if ((prologResult == prologResult)) | |
544 | 547 | then if ((size(i.payments) != 0)) | |
545 | 548 | then throw("No payments required") | |
546 | 549 | else { | |
547 | 550 | let r = claimInternal2(toString(i.caller)) | |
548 | 551 | let actions = r._1 | |
549 | 552 | $Tuple2((actions :+ ScriptTransfer(i.caller, r._2, wlgAssetId)), prologResult) | |
550 | 553 | } | |
551 | 554 | else throw("Strict value is not equal to itself.") | |
552 | 555 | } | |
553 | 556 | ||
554 | 557 | ||
555 | 558 | ||
556 | 559 | @Callable(i) | |
557 | 560 | func onStakeUnstakeLand (addr) = if (if (if ((i.caller != stakingContract)) | |
558 | 561 | then (i.caller != acresContract) | |
559 | 562 | else false) | |
560 | 563 | then (i.caller != acres2Contract) | |
561 | 564 | else false) | |
562 | 565 | then throw("Permission denied") | |
563 | 566 | else { | |
564 | - | let $ | |
565 | - | let actions = $ | |
566 | - | let wlgClaimedAmount = $ | |
567 | + | let $t01098111035 = claimInternal2(addr) | |
568 | + | let actions = $t01098111035._1 | |
569 | + | let wlgClaimedAmount = $t01098111035._2 | |
567 | 570 | $Tuple2((actions :+ ScriptTransfer(addressFromStringValue(addr), wlgClaimedAmount, wlgAssetId)), wlgClaimedAmount) | |
568 | 571 | } | |
569 | 572 | ||
570 | 573 | ||
571 | 574 | ||
572 | 575 | @Callable(i) | |
573 | 576 | func burnWlgold () = if ((i.caller != acres2Contract)) | |
574 | 577 | then throw("Permission denied") | |
575 | 578 | else { | |
576 | 579 | let wlgAmt = i.payments[0].amount | |
577 | 580 | let curStats = getWlgStats2("", [rest2Contract, acres2Contract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0) | |
578 | 581 | let wlgAmountLeft = (curStats[ixWlgAmount] - wlgAmt) | |
579 | 582 | $Tuple2([Burn(wlgAssetId, wlgAmt), IntegerEntry(wlgIssuedAmountKey, wlgAmountLeft)], wlgAmountLeft) | |
580 | 583 | } | |
581 | 584 | ||
582 | 585 | ||
583 | 586 | ||
584 | 587 | @Callable(i) | |
585 | 588 | func takeWlgXp (addr) = if ((i.caller != stakingContract)) | |
586 | 589 | then throw("Permission denied") | |
587 | 590 | else { | |
588 | - | let $ | |
589 | - | let actions = $ | |
590 | - | let xp = $ | |
591 | + | let $t01330613349 = takeXpInternal(addr, 0) | |
592 | + | let actions = $t01330613349._1 | |
593 | + | let xp = $t01330613349._2 | |
591 | 594 | $Tuple2(actions, xp) | |
592 | 595 | } | |
593 | 596 | ||
594 | 597 | ||
595 | 598 | ||
596 | 599 | @Callable(i) | |
597 | 600 | func checkWlgXpREADONLY (addr) = { | |
598 | - | let $ | |
599 | - | let ignored = $ | |
600 | - | let deltaXP = $ | |
601 | + | let $t01342613474 = takeXpInternal(addr, 0) | |
602 | + | let ignored = $t01342613474._1 | |
603 | + | let deltaXP = $t01342613474._2 | |
601 | 604 | let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP) | |
602 | 605 | let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP) | |
603 | 606 | $Tuple2(nil, (lvlPoints :+ newXP)) | |
604 | 607 | } | |
605 | 608 | ||
606 | 609 |
github/deemru/w8io/169f3d6 68.42 ms ◑