tx · DXhct1DQvaxrZftrrzeSP1QSVkxoshF4c1vrTfEj6Tde 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.02100000 Waves 2024.06.27 14:49 [3169094] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "DXhct1DQvaxrZftrrzeSP1QSVkxoshF4c1vrTfEj6Tde", "fee": 2100000, "feeAssetId": null, "timestamp": 1719488996547, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "4KCmo9M561ubnW21Y5FyWsbipAqz2RkW2Y9wgLmD7kC2axdHXHh9diRMnSdqZfkwLJ528GuBMdvbaEJD95rvT4or" ], "script": "base64:BgIsCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgASAwoBARIDCgEIEgMKAQhyAAJNNgDAhD0AAk04AIDC1y8ACE1JTExJT042AICA6YOx3hYADk1BUktFVElOR1NIQVJFAKCNBgAJVEVBTVNIQVJFAMCaDAANQUNUSVZJVFlTSEFSRQCgjQYAC1BMQVlFUlNIQVJFAIC1GAAKWUVBUk1JTExJUwCAhuvHdQAJQ0hFQ0tUSU1FAIDJ4KuwAQAJREFZTUlMTElTAIC4mSkACEJBTktfRkVFANCGAwACY2gJAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAE1VTRFRfVFZMX0NPUlJFQ1RJT04EByRtYXRjaDAFAmNoAwkAAAIBAVcFByRtYXRjaDAA8PWowAQDCQAAAgEBVAUHJG1hdGNoMAAACQACAQINVW5rbm93biBjaGFpbgAQbWFya2V0aW5nQWRkcktleQINbWFya2V0aW5nQWRkcgALdGVhbUFkZHJLZXkCCHRlYW1BZGRyABRsYXN0TWFya2V0aW5nVGltZUtleQIZbGFzdENsYWltZWRUaW1lX21hcmtldGluZwAWbWFya2V0aW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FjdGlvbnMJAJQKAgUMcHJvbG9nUmVzdWx0BQ5hY2NTdGF0c1Jlc3VsdAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQl0YWtlV2xnWHABBGFkZHIDCQECIT0CCAUBaQZjYWxsZXIFD3N0YWtpbmdDb250cmFjdAkAAgECEVBlcm1pc3Npb24gZGVuaWVkBA0kdDAxMTA5NTExMTM4CQEOdGFrZVhwSW50ZXJuYWwCBQRhZGRyAAAEB2FjdGlvbnMIBQ0kdDAxMTA5NTExMTM4Al8xBAJ4cAgFDSR0MDExMDk1MTExMzgCXzIJAJQKAgUHYWN0aW9ucwUCeHABaQESY2hlY2tXbGdYcFJFQURPTkxZAQRhZGRyBA0kdDAxMTIxNTExMjYzCQEOdGFrZVhwSW50ZXJuYWwCBQRhZGRyAAAEB2lnbm9yZWQIBQ0kdDAxMTIxNTExMjYzAl8xBAdkZWx0YVhQCAUNJHQwMTEyMTUxMTI2MwJfMgQFbmV3WFAJAGQCCQELdmFsdWVPckVsc2UCCQCaCAIFD3N0YWtpbmdDb250cmFjdAkBCWtleVVzZXJYUAEFBGFkZHIAAAUHZGVsdGFYUAQJbHZsUG9pbnRzCQEHbGV2ZWxVcAIJAQt2YWx1ZU9yRWxzZQIJAJoIAgUPc3Rha2luZ0NvbnRyYWN0CQEMa2V5VXNlckxldmVsAQUEYWRkcgAABQVuZXdYUAkAlAoCBQNuaWwJAM0IAgUJbHZsUG9pbnRzBQVuZXdYUABEJ+XN", "height": 3169094, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J4HPKq5EzF5DhwL1GKHvpVXPcP4Z1moziDgahPLPdJDB Next: FrggMfs6QLRkDrUVXQuvh2ve2y8ajdJQMxy6BvGLWcja Diff:
Old | New | Differences | |
---|---|---|---|
22 | 22 | let DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let BANK_FEE = 50000 | |
25 | + | ||
26 | + | let ch = take(drop(this.bytes, 1), 1) | |
27 | + | ||
28 | + | let USDT_TVL_CORRECTION = match ch { | |
29 | + | case _ => | |
30 | + | if ((base58'2W' == $match0)) | |
31 | + | then 1208630000 | |
32 | + | else if ((base58'2T' == $match0)) | |
33 | + | then 0 | |
34 | + | else throw("Unknown chain") | |
35 | + | } | |
25 | 36 | ||
26 | 37 | let marketingAddrKey = "marketingAddr" | |
27 | 38 | ||
194 | 205 | let bankFromUser = fraction(userTemp, BANK_FEE, M6) | |
195 | 206 | let robbedUser = (userTemp - bankFromUser) | |
196 | 207 | let unrobbedUser = fraction(userAvailable, ((eff[idxUserPieces] * M8) + eff[idxUserAcres]), ((eff[idxTotalPieces] * M8) + eff[idxTotalAcres])) | |
197 | - | [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, (bankFromMarketing + bankFromUser), bankWlgold] | |
208 | + | [issuedAmount, fraction((totalFundsUsd - USDT_TVL_CORRECTION), 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, (bankFromMarketing + bankFromUser), bankWlgold] | |
198 | 209 | } | |
199 | 210 | ||
200 | 211 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let M6 = 1000000 | |
5 | 5 | ||
6 | 6 | let M8 = 100000000 | |
7 | 7 | ||
8 | 8 | let MILLION6 = 100000000000000 | |
9 | 9 | ||
10 | 10 | let MARKETINGSHARE = 100000 | |
11 | 11 | ||
12 | 12 | let TEAMSHARE = 200000 | |
13 | 13 | ||
14 | 14 | let ACTIVITYSHARE = 100000 | |
15 | 15 | ||
16 | 16 | let PLAYERSHARE = 400000 | |
17 | 17 | ||
18 | 18 | let YEARMILLIS = 31557600000 | |
19 | 19 | ||
20 | 20 | let CHECKTIME = 47336400000 | |
21 | 21 | ||
22 | 22 | let DAYMILLIS = 86400000 | |
23 | 23 | ||
24 | 24 | let BANK_FEE = 50000 | |
25 | + | ||
26 | + | let ch = take(drop(this.bytes, 1), 1) | |
27 | + | ||
28 | + | let USDT_TVL_CORRECTION = match ch { | |
29 | + | case _ => | |
30 | + | if ((base58'2W' == $match0)) | |
31 | + | then 1208630000 | |
32 | + | else if ((base58'2T' == $match0)) | |
33 | + | then 0 | |
34 | + | else throw("Unknown chain") | |
35 | + | } | |
25 | 36 | ||
26 | 37 | let marketingAddrKey = "marketingAddr" | |
27 | 38 | ||
28 | 39 | let teamAddrKey = "teamAddr" | |
29 | 40 | ||
30 | 41 | let lastMarketingTimeKey = "lastClaimedTime_marketing" | |
31 | 42 | ||
32 | 43 | let marketingAmountLeftKey = "marketingAmountLeft" | |
33 | 44 | ||
34 | 45 | let lastTeamTimeKey = "lastClaimedTime_team" | |
35 | 46 | ||
36 | 47 | let teamAmountLeftKey = "teamAmountLeft" | |
37 | 48 | ||
38 | 49 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
39 | 50 | ||
40 | 51 | let actAmountLeftKey = "activitiesAmountLeft" | |
41 | 52 | ||
42 | 53 | let stakersAmountLeftKey = "stakersAmountLeft" | |
43 | 54 | ||
44 | 55 | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
45 | 56 | ||
46 | 57 | ||
47 | 58 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
48 | 59 | ||
49 | 60 | ||
50 | 61 | func distributionByPeriod (period) = fraction(MILLION6, (PLAYERSHARE * (period + 1)), (6 * M6)) | |
51 | 62 | ||
52 | 63 | ||
53 | 64 | let wlgIssueTimeKey = "wlg_issueTime" | |
54 | 65 | ||
55 | 66 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
56 | 67 | ||
57 | 68 | let zbIssuedAmountKey = "zbill_issuedAmount" | |
58 | 69 | ||
59 | 70 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
60 | 71 | ||
61 | 72 | ||
62 | 73 | let acresStakedTotalKey = "acresStakedAmountTotal" | |
63 | 74 | ||
64 | 75 | func keyWlgStakedAmountByUser (addr) = ("wlgStakedAmountByUser_" + addr) | |
65 | 76 | ||
66 | 77 | ||
67 | 78 | let wlgStakedTotalKey = "wlgStakedAmountTotal" | |
68 | 79 | ||
69 | 80 | func keyWlgStakedTimeByUser (addr) = ("wlgStakedTimeByUser_" + addr) | |
70 | 81 | ||
71 | 82 | ||
72 | 83 | let dappRest = 0 | |
73 | 84 | ||
74 | 85 | let dappStaking = 1 | |
75 | 86 | ||
76 | 87 | let dappEconomy = 2 | |
77 | 88 | ||
78 | 89 | let dappWlg = 3 | |
79 | 90 | ||
80 | 91 | let dappPuzzle = 4 | |
81 | 92 | ||
82 | 93 | let dappInvestFund = 5 | |
83 | 94 | ||
84 | 95 | let dappAcres = 6 | |
85 | 96 | ||
86 | 97 | func getLands (userAddrStrOrEmpty,stakingContract,acresContract) = { | |
87 | 98 | let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_") | |
88 | 99 | func adder (acc,item) = (acc + parseIntValue(item)) | |
89 | 100 | ||
90 | 101 | let totalPieces = { | |
91 | 102 | let $l = props | |
92 | 103 | let $s = size($l) | |
93 | 104 | let $acc0 = 0 | |
94 | 105 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
95 | 106 | then $a | |
96 | 107 | else adder($a, $l[$i]) | |
97 | 108 | ||
98 | 109 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
99 | 110 | then $a | |
100 | 111 | else throw("List size exceeds 6") | |
101 | 112 | ||
102 | 113 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
103 | 114 | } | |
104 | 115 | let userPieces = valueOrElse(getInteger(stakingContract, ("stakedPiecesByOwner_" + userAddrStrOrEmpty)), 0) | |
105 | 116 | let totalAcres = valueOrElse(getInteger(acresContract, acresStakedTotalKey), 0) | |
106 | 117 | let userAcres = valueOrElse(getInteger(acresContract, keyAcresStakedAmountByUser(userAddrStrOrEmpty)), 0) | |
107 | 118 | [totalPieces, userPieces, totalAcres, userAcres] | |
108 | 119 | } | |
109 | 120 | ||
110 | 121 | ||
111 | 122 | let idxTotalPieces = 0 | |
112 | 123 | ||
113 | 124 | let idxUserPieces = 1 | |
114 | 125 | ||
115 | 126 | let idxTotalAcres = 2 | |
116 | 127 | ||
117 | 128 | let idxUserAcres = 3 | |
118 | 129 | ||
119 | 130 | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection,userProportion6) = { | |
120 | 131 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
121 | 132 | let economyUsd = assetBalance(contracts[dappEconomy], usdtId) | |
122 | 133 | let restUsd = assetBalance(contracts[dappRest], usdtId) | |
123 | 134 | let wlgUsd = (assetBalance(contracts[dappWlg], usdtId) - usdtBalanceCorrection) | |
124 | 135 | let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId) | |
125 | 136 | let investFundContract = contracts[dappInvestFund] | |
126 | 137 | let investFundTotal = (assetBalance(investFundContract, usdtId) + valueOrElse(getInteger(investFundContract, zbIssuedAmountKey), 0)) | |
127 | 138 | let totalFundsUsd = ((economyUsd + wlgUsd) + investFundTotal) | |
128 | 139 | let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet") | |
129 | 140 | let now = lastBlock.timestamp | |
130 | 141 | let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized") | |
131 | 142 | let marketingTotal = fraction(MILLION6, MARKETINGSHARE, M6) | |
132 | 143 | let marketingAmountLeft = valueOrElse(getInteger(contracts[dappWlg], marketingAmountLeftKey), marketingTotal) | |
133 | 144 | let lastMarketingTime = valueOrElse(getInteger(contracts[dappWlg], lastMarketingTimeKey), issueTime) | |
134 | 145 | let marketingAddr = addressFromStringValue(value(getString(contracts[dappWlg], marketingAddrKey))) | |
135 | 146 | let marketingTemp = min([fraction(marketingTotal, (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft]) | |
136 | 147 | let bankFromMarketing = fraction(marketingTemp, BANK_FEE, M6) | |
137 | 148 | let marketingAmountAvailableNow = (marketingTemp - bankFromMarketing) | |
138 | 149 | let marketingWlgold = assetBalance(marketingAddr, wlgId) | |
139 | 150 | let bankWlgold = assetBalance(contracts[dappStaking], wlgId) | |
140 | 151 | let teamTotal = fraction(MILLION6, TEAMSHARE, M6) | |
141 | 152 | let teamAmountLeft = valueOrElse(getInteger(contracts[dappWlg], teamAmountLeftKey), teamTotal) | |
142 | 153 | let lastTeamTime = valueOrElse(getInteger(contracts[dappWlg], lastTeamTimeKey), issueTime) | |
143 | 154 | let teamAddr = addressFromStringValue(value(getString(contracts[dappWlg], teamAddrKey))) | |
144 | 155 | let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEARMILLIS)), teamAmountLeft]) | |
145 | 156 | let teamWlgold = assetBalance(teamAddr, wlgId) | |
146 | 157 | let actTotal = fraction(MILLION6, ACTIVITYSHARE, M6) | |
147 | 158 | let actAmountLeft = valueOrElse(getInteger(contracts[dappWlg], actAmountLeftKey), actTotal) | |
148 | 159 | let lastActivitiesTime = valueOrElse(getInteger(contracts[dappWlg], lastActivitiesTimeKey), issueTime) | |
149 | 160 | let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEARMILLIS)), actAmountLeft]) | |
150 | 161 | let actWlgold = assetBalance(contracts[dappRest], wlgId) | |
151 | 162 | let lastUserTime = valueOrElse(getInteger(contracts[dappWlg], keyLastClaimedTimeByUser(userAddrOpt)), issueTime) | |
152 | 163 | let lastUserPeriod = ((lastUserTime - issueTime) / YEARMILLIS) | |
153 | 164 | let nowLimited = min([now, (issueTime + (3 * YEARMILLIS))]) | |
154 | 165 | let curPeriod = min([((now - issueTime) / YEARMILLIS), 2]) | |
155 | 166 | let eff = getLands(userAddrOpt, contracts[dappStaking], contracts[dappAcres]) | |
156 | 167 | let curPeriodDistribution = distributionByPeriod(curPeriod) | |
157 | 168 | let $t079142 = if ((lastUserPeriod == curPeriod)) | |
158 | 169 | then { | |
159 | 170 | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
160 | 171 | let userPart = fraction(a0, userProportion6, M6) | |
161 | 172 | let effTime = (lastUserTime + fraction((nowLimited - lastUserTime), userProportion6, M6)) | |
162 | 173 | $Tuple3(userPart, a0, effTime) | |
163 | 174 | } | |
164 | 175 | else if ((lastUserPeriod == (curPeriod - 1))) | |
165 | 176 | then { | |
166 | 177 | let a1 = fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) | |
167 | 178 | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
168 | 179 | let avail = (a1 + a0) | |
169 | 180 | let userPart = fraction(avail, userProportion6, M6) | |
170 | 181 | let effTime = if ((a1 >= userPart)) | |
171 | 182 | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 1)))) | |
172 | 183 | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, (userPart - a1), curPeriodDistribution)) | |
173 | 184 | $Tuple3(userPart, avail, effTime) | |
174 | 185 | } | |
175 | 186 | else { | |
176 | 187 | let a2 = fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) | |
177 | 188 | let a1 = distributionByPeriod((curPeriod - 1)) | |
178 | 189 | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
179 | 190 | let avail = ((a2 + a1) + a0) | |
180 | 191 | let userPart = fraction(avail, userProportion6, M6) | |
181 | 192 | let effTime = if ((a2 >= userPart)) | |
182 | 193 | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 2)))) | |
183 | 194 | else if (((a2 + a1) >= userPart)) | |
184 | 195 | then ((issueTime + (YEARMILLIS * (curPeriod - 1))) + fraction(YEARMILLIS, (userPart - a2), distributionByPeriod((curPeriod - 1)))) | |
185 | 196 | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, ((userPart - a2) - a1), curPeriodDistribution)) | |
186 | 197 | $Tuple3(userPart, avail, effTime) | |
187 | 198 | } | |
188 | 199 | let userAmount = $t079142._1 | |
189 | 200 | let userAvailable = $t079142._2 | |
190 | 201 | let effLastTime = $t079142._3 | |
191 | 202 | let sLandDailyAmount = fraction(fraction(curPeriodDistribution, DAYMILLIS, YEARMILLIS), 25, eff[idxTotalPieces]) | |
192 | 203 | let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0) | |
193 | 204 | let userTemp = fraction(userAmount, ((eff[idxUserPieces] * M8) + eff[idxUserAcres]), ((eff[idxTotalPieces] * M8) + eff[idxTotalAcres])) | |
194 | 205 | let bankFromUser = fraction(userTemp, BANK_FEE, M6) | |
195 | 206 | let robbedUser = (userTemp - bankFromUser) | |
196 | 207 | let unrobbedUser = fraction(userAvailable, ((eff[idxUserPieces] * M8) + eff[idxUserAcres]), ((eff[idxTotalPieces] * M8) + eff[idxTotalAcres])) | |
197 | - | [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, (bankFromMarketing + bankFromUser), bankWlgold] | |
208 | + | [issuedAmount, fraction((totalFundsUsd - USDT_TVL_CORRECTION), 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, (bankFromMarketing + bankFromUser), bankWlgold] | |
198 | 209 | } | |
199 | 210 | ||
200 | 211 | ||
201 | 212 | let SCALE8 = 100000000 | |
202 | 213 | ||
203 | 214 | let xpLevelScale = 3200 | |
204 | 215 | ||
205 | 216 | let xpLevelRecipPow = 4000 | |
206 | 217 | ||
207 | 218 | let numPointsOnLevelUp = 3 | |
208 | 219 | ||
209 | 220 | let wlgBaseAmountXp = 100000000000 | |
210 | 221 | ||
211 | 222 | func keyUserXP (addr) = ("userXP_" + addr) | |
212 | 223 | ||
213 | 224 | ||
214 | 225 | func keyUserLevel (addr) = ("userLevel_" + addr) | |
215 | 226 | ||
216 | 227 | ||
217 | 228 | let xpWlg = 10000 | |
218 | 229 | ||
219 | 230 | func levelByXP (xp) = fraction(xpLevelScale, pow(xp, 4, xpLevelRecipPow, 4, 4, DOWN), SCALE8) | |
220 | 231 | ||
221 | 232 | ||
222 | 233 | func levelUp (currLevel,newXP) = { | |
223 | 234 | let newLevel = levelByXP(newXP) | |
224 | 235 | [newLevel, (numPointsOnLevelUp * (newLevel - currLevel))] | |
225 | 236 | } | |
226 | 237 | ||
227 | 238 | ||
228 | 239 | let DAY_MILLIS = 86400000 | |
229 | 240 | ||
230 | 241 | let chain = take(drop(this.bytes, 1), 1) | |
231 | 242 | ||
232 | 243 | let usdtAssetId = match chain { | |
233 | 244 | case _ => | |
234 | 245 | if ((base58'2W' == $match0)) | |
235 | 246 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
236 | 247 | else if ((base58'2T' == $match0)) | |
237 | 248 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
238 | 249 | else throw("Unknown chain") | |
239 | 250 | } | |
240 | 251 | ||
241 | 252 | let defaultRestAddressStr = match chain { | |
242 | 253 | case _ => | |
243 | 254 | if ((base58'2W' == $match0)) | |
244 | 255 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
245 | 256 | else if ((base58'2T' == $match0)) | |
246 | 257 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
247 | 258 | else throw("Unknown chain") | |
248 | 259 | } | |
249 | 260 | ||
250 | 261 | let arbitrageDelay = match chain { | |
251 | 262 | case _ => | |
252 | 263 | if ((base58'2W' == $match0)) | |
253 | 264 | then DAY_MILLIS | |
254 | 265 | else if ((base58'2T' == $match0)) | |
255 | 266 | then 60000 | |
256 | 267 | else throw("Unknown chain") | |
257 | 268 | } | |
258 | 269 | ||
259 | 270 | let SEP = "__" | |
260 | 271 | ||
261 | 272 | let MULT6 = 1000000 | |
262 | 273 | ||
263 | 274 | let MULT8 = 100000000 | |
264 | 275 | ||
265 | 276 | let MINSHOPPAYMENT = 100000 | |
266 | 277 | ||
267 | 278 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
268 | 279 | ||
269 | 280 | ||
270 | 281 | let IdxCfgStakingDapp = 1 | |
271 | 282 | ||
272 | 283 | let IdxCfgEconomyDapp = 2 | |
273 | 284 | ||
274 | 285 | let IdxCfgWlgDapp = 4 | |
275 | 286 | ||
276 | 287 | let IdxCfgPuzzlePoolDapp = 5 | |
277 | 288 | ||
278 | 289 | let IdxCfgInvestFundDapp = 6 | |
279 | 290 | ||
280 | 291 | let IdxCfgAcresDapp = 8 | |
281 | 292 | ||
282 | 293 | func keyRestCfg () = "%s__restConfig" | |
283 | 294 | ||
284 | 295 | ||
285 | 296 | func keyRestAddress () = "%s__restAddr" | |
286 | 297 | ||
287 | 298 | ||
288 | 299 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
289 | 300 | ||
290 | 301 | ||
291 | 302 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
292 | 303 | ||
293 | 304 | ||
294 | 305 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
295 | 306 | ||
296 | 307 | let restCfg = readRestCfgOrFail(restContract) | |
297 | 308 | ||
298 | 309 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
299 | 310 | ||
300 | 311 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
301 | 312 | ||
302 | 313 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
303 | 314 | ||
304 | 315 | let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp) | |
305 | 316 | ||
306 | 317 | let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp) | |
307 | 318 | ||
308 | 319 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
309 | 320 | ||
310 | 321 | let wlgAssetIdKey = "wlg_assetId" | |
311 | 322 | ||
312 | 323 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
313 | 324 | ||
314 | 325 | let idxWlgAmount = 0 | |
315 | 326 | ||
316 | 327 | let idxWlgPrice = 1 | |
317 | 328 | ||
318 | 329 | let idxWlgFunds = 2 | |
319 | 330 | ||
320 | 331 | let idxWlgIssueTime = 7 | |
321 | 332 | ||
322 | 333 | let idxWlgMarketingAmLeft = 10 | |
323 | 334 | ||
324 | 335 | let idxWlgMarketingAmAvailNow = 11 | |
325 | 336 | ||
326 | 337 | let idxWlgTeamAmLeft = 14 | |
327 | 338 | ||
328 | 339 | let idxWlgTeamAmAvailNow = 15 | |
329 | 340 | ||
330 | 341 | let idxWlgActAmLeft = 18 | |
331 | 342 | ||
332 | 343 | let idxWlgActAmAvailNow = 19 | |
333 | 344 | ||
334 | 345 | let idxWlgAmLeftTotal = 22 | |
335 | 346 | ||
336 | 347 | let idxWlgUserAmAvailNow = 25 | |
337 | 348 | ||
338 | 349 | let idxWlgUserTotalAvail = 28 | |
339 | 350 | ||
340 | 351 | let idxWlgEffUserTime = 29 | |
341 | 352 | ||
342 | 353 | let idxWlgBankAvailNow = 30 | |
343 | 354 | ||
344 | 355 | let IdxEffUser = 1 | |
345 | 356 | ||
346 | 357 | func keyResProportions () = "resTypesProportions" | |
347 | 358 | ||
348 | 359 | ||
349 | 360 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
350 | 361 | ||
351 | 362 | ||
352 | 363 | func asInt (v) = match v { | |
353 | 364 | case n: Int => | |
354 | 365 | n | |
355 | 366 | case _ => | |
356 | 367 | throw("fail to cast into Int") | |
357 | 368 | } | |
358 | 369 | ||
359 | 370 | ||
360 | 371 | func getVotingPower (userAddrStrOrEmpty) = { | |
361 | 372 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
362 | 373 | func adder (acc,item) = (acc + parseIntValue(item)) | |
363 | 374 | ||
364 | 375 | let totalPower = { | |
365 | 376 | let $l = props | |
366 | 377 | let $s = size($l) | |
367 | 378 | let $acc0 = 0 | |
368 | 379 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
369 | 380 | then $a | |
370 | 381 | else adder($a, $l[$i]) | |
371 | 382 | ||
372 | 383 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
373 | 384 | then $a | |
374 | 385 | else throw("List size exceeds 6") | |
375 | 386 | ||
376 | 387 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
377 | 388 | } | |
378 | 389 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
379 | 390 | [totalPower, usersPower] | |
380 | 391 | } | |
381 | 392 | ||
382 | 393 | ||
383 | 394 | func fixedPoint (val,decimals) = { | |
384 | 395 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
385 | 396 | let lowPart = toString((val % tenPow)) | |
386 | 397 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
387 | 398 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
388 | 399 | } | |
389 | 400 | ||
390 | 401 | ||
391 | 402 | let profitAddrKey = "profitAddr" | |
392 | 403 | ||
393 | 404 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
394 | 405 | ||
395 | 406 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
396 | 407 | ||
397 | 408 | ||
398 | 409 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
399 | 410 | ||
400 | 411 | ||
401 | 412 | func getSwapLimitWlg (addr) = { | |
402 | 413 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
403 | 414 | let now = lastBlock.timestamp | |
404 | 415 | if ((arbitrageDelay > (now - lastTime))) | |
405 | 416 | then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min")) | |
406 | 417 | else { | |
407 | 418 | let pieces = getVotingPower(addr)[IdxEffUser] | |
408 | 419 | let acresAmount = valueOrElse(getInteger(acresContract, keyAcresStakedAmountByUser(addr)), 0) | |
409 | 420 | ((pieces * MULT8) + acresAmount) | |
410 | 421 | } | |
411 | 422 | } | |
412 | 423 | ||
413 | 424 | ||
414 | 425 | func claimInternal (addr,proportion6) = { | |
415 | 426 | let caller = addressFromStringValue(addr) | |
416 | 427 | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, proportion6) | |
417 | 428 | let now = lastBlock.timestamp | |
418 | 429 | let issueTime = curStats[idxWlgIssueTime] | |
419 | 430 | let marketingAmountLeft = curStats[idxWlgMarketingAmLeft] | |
420 | 431 | let marketingAmount = curStats[idxWlgMarketingAmAvailNow] | |
421 | 432 | let teamAmountLeft = curStats[idxWlgTeamAmLeft] | |
422 | 433 | let teamAmount = curStats[idxWlgTeamAmAvailNow] | |
423 | 434 | let actAmountLeft = curStats[idxWlgActAmLeft] | |
424 | 435 | let actAmount = curStats[idxWlgActAmAvailNow] | |
425 | 436 | if (((now - issueTime) > CHECKTIME)) | |
426 | 437 | then throw("Please modify contract for next 1.5 years, according to stats") | |
427 | 438 | else { | |
428 | 439 | let userAmount = curStats[idxWlgUserAmAvailNow] | |
429 | 440 | let userKey = keyStakersAmountPaidUser(addr) | |
430 | 441 | let userTotal = curStats[idxWlgUserTotalAvail] | |
431 | 442 | let userEffTime = curStats[idxWlgEffUserTime] | |
432 | 443 | let bankAmount = curStats[idxWlgBankAvailNow] | |
433 | 444 | $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, bankAmount)) | |
434 | 445 | } | |
435 | 446 | } | |
436 | 447 | ||
437 | 448 | ||
438 | 449 | func takeXpInternal (addr,delta) = { | |
439 | 450 | let now = lastBlock.timestamp | |
440 | 451 | let timeKey = keyWlgStakedTimeByUser(addr) | |
441 | 452 | let amountKey = keyWlgStakedAmountByUser(addr) | |
442 | 453 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
443 | 454 | let oldUser = valueOrElse(getInteger(amountKey), 0) | |
444 | 455 | let oldTotal = valueOrElse(getInteger(wlgStakedTotalKey), 0) | |
445 | 456 | let xp = fraction(fraction(xpWlg, oldUser, wlgBaseAmountXp), (lastTime - now), DAYMILLIS) | |
446 | 457 | $Tuple3([IntegerEntry(timeKey, now), IntegerEntry(amountKey, (oldUser + delta)), IntegerEntry(wlgStakedTotalKey, (oldTotal + delta))], xp, oldUser) | |
447 | 458 | } | |
448 | 459 | ||
449 | 460 | ||
450 | 461 | @Callable(i) | |
451 | 462 | func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this)) | |
452 | 463 | then throw("Permission denied") | |
453 | 464 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
454 | 465 | then throw("Already initialized") | |
455 | 466 | else { | |
456 | 467 | let issuedAmount = MILLION6 | |
457 | 468 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
458 | 469 | let assetId = calculateAssetId(issue) | |
459 | 470 | [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)] | |
460 | 471 | } | |
461 | 472 | ||
462 | 473 | ||
463 | 474 | ||
464 | 475 | @Callable(i) | |
465 | 476 | func buyWlg (minAmount) = { | |
466 | 477 | let prologResult = prolog() | |
467 | 478 | if ((prologResult == prologResult)) | |
468 | 479 | then if ((size(i.payments) != 1)) | |
469 | 480 | then throw("exactly 1 payment must be attached") | |
470 | 481 | else { | |
471 | 482 | let pmt = i.payments[0] | |
472 | 483 | let usdtAmt = pmt.amount | |
473 | 484 | if (if (!(isDefined(pmt.assetId))) | |
474 | 485 | then true | |
475 | 486 | else (value(pmt.assetId) != usdtAssetId)) | |
476 | 487 | then throw("USDT payments only!") | |
477 | 488 | else { | |
478 | 489 | let caller = i.caller | |
479 | 490 | let addr = toString(caller) | |
480 | 491 | if ((MINSHOPPAYMENT > usdtAmt)) | |
481 | 492 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
482 | 493 | else { | |
483 | 494 | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, usdtAmt, MULT6) | |
484 | 495 | let curWlgAmount = curStats[idxWlgAmount] | |
485 | 496 | let fundsUsd = curStats[idxWlgFunds] | |
486 | 497 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
487 | 498 | let buyPrice = fraction(wlgPrice, 6, 5) | |
488 | 499 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
489 | 500 | let maxWlg = getSwapLimitWlg(addr) | |
490 | 501 | if ((wlgAmount > maxWlg)) | |
491 | 502 | then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
492 | 503 | else if ((minAmount > wlgAmount)) | |
493 | 504 | then throw("Price changed during operation, please try again") | |
494 | 505 | else { | |
495 | 506 | let profitAmount = (usdtAmt / 6) | |
496 | 507 | let deltaFunds = (usdtAmt - profitAmount) | |
497 | 508 | let reissued = fraction(curWlgAmount, deltaFunds, fundsUsd) | |
498 | 509 | $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) | |
499 | 510 | } | |
500 | 511 | } | |
501 | 512 | } | |
502 | 513 | } | |
503 | 514 | else throw("Strict value is not equal to itself.") | |
504 | 515 | } | |
505 | 516 | ||
506 | 517 | ||
507 | 518 | ||
508 | 519 | @Callable(i) | |
509 | 520 | func sellWlg (minAmount) = { | |
510 | 521 | let prologResult = prolog() | |
511 | 522 | if ((prologResult == prologResult)) | |
512 | 523 | then if ((size(i.payments) != 1)) | |
513 | 524 | then throw("exactly 1 payment must be attached") | |
514 | 525 | else { | |
515 | 526 | let pmt = i.payments[0] | |
516 | 527 | let wlgAmt = pmt.amount | |
517 | 528 | let caller = i.caller | |
518 | 529 | let addr = toString(caller) | |
519 | 530 | let maxWlg = getSwapLimitWlg(addr) | |
520 | 531 | if ((wlgAmt > maxWlg)) | |
521 | 532 | then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
522 | 533 | else if (if (!(isDefined(pmt.assetId))) | |
523 | 534 | then true | |
524 | 535 | else (value(pmt.assetId) != wlgAssetId)) | |
525 | 536 | then throw("WLGOLD payments only!") | |
526 | 537 | else { | |
527 | 538 | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract, acresContract], usdtAssetId, 0, MULT6) | |
528 | 539 | let curWlgAmount = curStats[idxWlgAmount] | |
529 | 540 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
530 | 541 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
531 | 542 | if ((MINSHOPPAYMENT > usdtAmt)) | |
532 | 543 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
533 | 544 | else if ((minAmount > usdtAmt)) | |
534 | 545 | then throw("Price changed during operation, please try again") | |
535 | 546 | else { | |
536 | 547 | let profitAmount = (usdtAmt / 4) | |
537 | 548 | $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) | |
538 | 549 | } | |
539 | 550 | } | |
540 | 551 | } | |
541 | 552 | else throw("Strict value is not equal to itself.") | |
542 | 553 | } | |
543 | 554 | ||
544 | 555 | ||
545 | 556 | ||
546 | 557 | @Callable(i) | |
547 | 558 | func claim () = { | |
548 | 559 | let prologResult = prolog() | |
549 | 560 | if ((prologResult == prologResult)) | |
550 | 561 | then if ((size(i.payments) != 0)) | |
551 | 562 | then throw("No payments required") | |
552 | 563 | else { | |
553 | 564 | let r = claimInternal(toString(i.caller), MULT6) | |
554 | 565 | let actions = r._1 | |
555 | 566 | $Tuple2(((actions :+ ScriptTransfer(i.caller, r._2._1, wlgAssetId)) :+ ScriptTransfer(stakingContract, r._2._2, wlgAssetId)), prologResult) | |
556 | 567 | } | |
557 | 568 | else throw("Strict value is not equal to itself.") | |
558 | 569 | } | |
559 | 570 | ||
560 | 571 | ||
561 | 572 | ||
562 | 573 | @Callable(i) | |
563 | 574 | func onStakeUnstakeLand (addr) = if (if ((i.caller != stakingContract)) | |
564 | 575 | then (i.caller != acresContract) | |
565 | 576 | else false) | |
566 | 577 | then throw("Permission denied") | |
567 | 578 | else { | |
568 | 579 | let r = claimInternal(addr, MULT6) | |
569 | 580 | let actions = r._1 | |
570 | 581 | $Tuple2(((actions :+ ScriptTransfer(addressFromStringValue(addr), r._2._1, wlgAssetId)) :+ ScriptTransfer(stakingContract, r._2._2, wlgAssetId)), r._2) | |
571 | 582 | } | |
572 | 583 | ||
573 | 584 | ||
574 | 585 | ||
575 | 586 | @Callable(i) | |
576 | 587 | func stakeWlgold () = { | |
577 | 588 | let prologResult = prolog() | |
578 | 589 | if ((prologResult == prologResult)) | |
579 | 590 | then if ((size(i.payments) != 1)) | |
580 | 591 | then throw("exactly 1 payment must be attached") | |
581 | 592 | else { | |
582 | 593 | let pmt = i.payments[0] | |
583 | 594 | let amt = pmt.amount | |
584 | 595 | let addr = toString(i.caller) | |
585 | 596 | if (if (!(isDefined(pmt.assetId))) | |
586 | 597 | then true | |
587 | 598 | else (value(pmt.assetId) != wlgAssetId)) | |
588 | 599 | then throw("WLGOLD payments only!") | |
589 | 600 | else { | |
590 | 601 | let $t01011710162 = takeXpInternal(addr, amt) | |
591 | 602 | let actions = $t01011710162._1 | |
592 | 603 | let xp = $t01011710162._2 | |
593 | 604 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil)) | |
594 | 605 | $Tuple2(actions, $Tuple2(prologResult, accStatsResult)) | |
595 | 606 | } | |
596 | 607 | } | |
597 | 608 | else throw("Strict value is not equal to itself.") | |
598 | 609 | } | |
599 | 610 | ||
600 | 611 | ||
601 | 612 | ||
602 | 613 | @Callable(i) | |
603 | 614 | func unstakeWlgold (amount) = { | |
604 | 615 | let prologResult = prolog() | |
605 | 616 | if ((prologResult == prologResult)) | |
606 | 617 | then if ((size(i.payments) != 0)) | |
607 | 618 | then throw("No payments required") | |
608 | 619 | else if ((0 >= amount)) | |
609 | 620 | then throw("Amount should be positive") | |
610 | 621 | else { | |
611 | 622 | let addr = toString(i.caller) | |
612 | 623 | let $t01054910607 = takeXpInternal(addr, -(amount)) | |
613 | 624 | let actions = $t01054910607._1 | |
614 | 625 | let xp = $t01054910607._2 | |
615 | 626 | let oldUser = $t01054910607._3 | |
616 | 627 | if ((amount > oldUser)) | |
617 | 628 | then throw(((("You have only " + fixedPoint(oldUser, 8)) + " WLGOLD staked, tried to unstake ") + fixedPoint(amount, 8))) | |
618 | 629 | else { | |
619 | 630 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [addr, xp], nil)) | |
620 | 631 | $Tuple2(actions, $Tuple2(prologResult, accStatsResult)) | |
621 | 632 | } | |
622 | 633 | } | |
623 | 634 | else throw("Strict value is not equal to itself.") | |
624 | 635 | } | |
625 | 636 | ||
626 | 637 | ||
627 | 638 | ||
628 | 639 | @Callable(i) | |
629 | 640 | func takeWlgXp (addr) = if ((i.caller != stakingContract)) | |
630 | 641 | then throw("Permission denied") | |
631 | 642 | else { | |
632 | 643 | let $t01109511138 = takeXpInternal(addr, 0) | |
633 | 644 | let actions = $t01109511138._1 | |
634 | 645 | let xp = $t01109511138._2 | |
635 | 646 | $Tuple2(actions, xp) | |
636 | 647 | } | |
637 | 648 | ||
638 | 649 | ||
639 | 650 | ||
640 | 651 | @Callable(i) | |
641 | 652 | func checkWlgXpREADONLY (addr) = { | |
642 | 653 | let $t01121511263 = takeXpInternal(addr, 0) | |
643 | 654 | let ignored = $t01121511263._1 | |
644 | 655 | let deltaXP = $t01121511263._2 | |
645 | 656 | let newXP = (valueOrElse(getInteger(stakingContract, keyUserXP(addr)), 0) + deltaXP) | |
646 | 657 | let lvlPoints = levelUp(valueOrElse(getInteger(stakingContract, keyUserLevel(addr)), 0), newXP) | |
647 | 658 | $Tuple2(nil, (lvlPoints :+ newXP)) | |
648 | 659 | } | |
649 | 660 | ||
650 | 661 |
github/deemru/w8io/026f985 65.26 ms ◑