tx · DF52xJm5AuQYyAk7Un1sthMcPYNCprLbw2XkVAapD9RU 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01600000 Waves 2023.08.26 19:18 [2727852] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "DF52xJm5AuQYyAk7Un1sthMcPYNCprLbw2XkVAapD9RU", "fee": 1600000, "feeAssetId": null, "timestamp": 1693066683567, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "4cneYhRK4nZWZFuzUnMQykTQjm6VrksAAWAEYd6qk7UTmeARSUEa97sf4sA9H7vEmHfXVg3DVfPKms2AzXmH5hB2" ], "script": "base64:BgIiCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgUKAwgIAVYAAk02AMCEPQACTTgAgMLXLwAITUlMTElPTjYAgIDpg7HeFgAOTUFSS0VUSU5HU0hBUkUAoI0GAAlURUFNU0hBUkUAwJoMAA1BQ1RJVklUWVNIQVJFAKCNBgALUExBWUVSU0hBUkUAgLUYAApZRUFSTUlMTElTAICG68d1AAlDSEVDS1RJTUUAgMngq7ABAANEQVkAgLiZKQAQbWFya2V0aW5nQWRkcktleQINbWFya2V0aW5nQWRkcgALdGVhbUFkZHJLZXkCCHRlYW1BZGRyABRsYXN0TWFya2V0aW5nVGltZUtleQIZbGFzdENsYWltZWRUaW1lX21hcmtldGluZwAWbWFya2V0aW5nQW1vdW50TGVmdEtleQITbWFya2V0aW5nQW1vdW50TGVmdAAPbGFzdFRlYW1UaW1lS2V5AhRsYXN0Q2xhaW1lZFRpbWVfdGVhbQARdGVhbUFtb3VudExlZnRLZXkCDnRlYW1BbW91bnRMZWZ0ABVsYXN0QWN0aXZpdGllc1RpbWVLZXkCGmxhc3RDbGFpbWVkVGltZV9hY3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JZAgFAXICXzIARL6sCA==", "height": 2727852, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AZpenSdpDEr3T6NYRLJeAx6biDs47JvLuB2kCBBssEHQ Next: HnZ8TwPbpjFMkJLnsATeuvNoNp36vTnGsWTzhBggQQER Diff:
Old | New | Differences | |
---|---|---|---|
78 | 78 | ||
79 | 79 | let idxWlgUserAmAvailNow = 25 | |
80 | 80 | ||
81 | + | let idxWlgUserTotalAvail = 28 | |
82 | + | ||
83 | + | let idxWlgEffUserTime = 29 | |
84 | + | ||
81 | 85 | let dappRest = 0 | |
82 | 86 | ||
83 | 87 | let dappStaking = 1 | |
84 | 88 | ||
85 | 89 | let dappEconomy = 2 | |
86 | 90 | ||
87 | - | let dappWlg = | |
91 | + | let dappWlg = 3 | |
88 | 92 | ||
89 | - | let dappPuzzle = | |
93 | + | let dappPuzzle = 4 | |
90 | 94 | ||
91 | - | let dappInvestFund = | |
95 | + | let dappInvestFund = 5 | |
92 | 96 | ||
93 | 97 | func getPieces (userAddrStrOrEmpty,stakingContract) = { | |
94 | 98 | let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_") | |
113 | 117 | } | |
114 | 118 | ||
115 | 119 | ||
116 | - | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = { | |
120 | + | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection,userProportion6) = { | |
117 | 121 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
118 | 122 | let economyUsd = assetBalance(contracts[dappEconomy], usdtId) | |
119 | 123 | let restUsd = assetBalance(contracts[dappRest], usdtId) | |
148 | 152 | let curPeriod = min([((now - issueTime) / YEARMILLIS), 2]) | |
149 | 153 | let eff = getPieces(userAddrOpt, contracts[dappStaking]) | |
150 | 154 | let curPeriodDistribution = distributionByPeriod(curPeriod) | |
151 | - | let userAmount = fraction(if ((lastUserPeriod == curPeriod)) | |
152 | - | then fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
155 | + | let $t079142 = if ((lastUserPeriod == curPeriod)) | |
156 | + | then { | |
157 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
158 | + | let userPart = fraction(a0, userProportion6, M6) | |
159 | + | let effTime = (lastUserTime + fraction((nowLimited - lastUserTime), userProportion6, M6)) | |
160 | + | $Tuple3(userPart, a0, effTime) | |
161 | + | } | |
153 | 162 | else if ((lastUserPeriod == (curPeriod - 1))) | |
154 | - | then (fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)) | |
155 | - | else ((fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) + distributionByPeriod((curPeriod - 1))) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)), eff[1], eff[0]) | |
163 | + | then { | |
164 | + | let a1 = fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) | |
165 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
166 | + | let avail = (a1 + a0) | |
167 | + | let userPart = fraction(avail, userProportion6, M6) | |
168 | + | let effTime = if ((a1 >= userPart)) | |
169 | + | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 1)))) | |
170 | + | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, (userPart - a1), curPeriodDistribution)) | |
171 | + | $Tuple3(userPart, avail, effTime) | |
172 | + | } | |
173 | + | else { | |
174 | + | let a2 = fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) | |
175 | + | let a1 = distributionByPeriod((curPeriod - 1)) | |
176 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
177 | + | let avail = ((a2 + a1) + a0) | |
178 | + | let userPart = fraction(avail, userProportion6, M6) | |
179 | + | let effTime = if ((a2 >= userPart)) | |
180 | + | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 2)))) | |
181 | + | else if (((a2 + a1) >= userPart)) | |
182 | + | then ((issueTime + (YEARMILLIS * (curPeriod - 1))) + fraction(YEARMILLIS, (userPart - a2), distributionByPeriod((curPeriod - 1)))) | |
183 | + | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, ((userPart - a2) - a1), curPeriodDistribution)) | |
184 | + | $Tuple3(userPart, avail, effTime) | |
185 | + | } | |
186 | + | let userAmount = $t079142._1 | |
187 | + | let userAvailable = $t079142._2 | |
188 | + | let effLastTime = $t079142._3 | |
156 | 189 | let sLandDailyAmount = fraction(fraction(curPeriodDistribution, DAY, YEARMILLIS), 25, eff[0]) | |
157 | 190 | let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0) | |
158 | - | [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, userAmount, sLandDailyAmount, investFundTotal] | |
191 | + | [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, fraction(userAmount, eff[1], eff[0]), sLandDailyAmount, investFundTotal, fraction(userAvailable, eff[1], eff[0]), effLastTime] | |
159 | 192 | } | |
160 | 193 | ||
161 | 194 | ||
203 | 236 | ||
204 | 237 | let IdxCfgEconomyDapp = 2 | |
205 | 238 | ||
206 | - | let IdxCfgGovernanceDapp = 3 | |
207 | - | ||
208 | 239 | let IdxCfgWlgDapp = 4 | |
209 | 240 | ||
210 | 241 | let IdxCfgPuzzlePoolDapp = 5 | |
230 | 261 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
231 | 262 | ||
232 | 263 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
233 | - | ||
234 | - | let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp) | |
235 | 264 | ||
236 | 265 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
237 | 266 | ||
312 | 341 | } | |
313 | 342 | ||
314 | 343 | ||
315 | - | func claimInternal (addr) = { | |
344 | + | func claimInternal (addr,proportion6) = { | |
316 | 345 | let caller = addressFromStringValue(addr) | |
317 | - | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, | |
346 | + | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0, proportion6) | |
318 | 347 | let now = lastBlock.timestamp | |
319 | 348 | let issueTime = curStats[idxWlgIssueTime] | |
320 | 349 | let marketingAmountLeft = curStats[idxWlgMarketingAmLeft] | |
328 | 357 | else { | |
329 | 358 | let userAmount = curStats[idxWlgUserAmAvailNow] | |
330 | 359 | let userKey = keyStakersAmountPaidUser(addr) | |
331 | - | $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, wlgAssetId), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userAmount)), IntegerEntry(stakersAmountLeftKey, (curStats[idxWlgAmLeftTotal] - userAmount)), IntegerEntry(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), now)], userAmount) | |
360 | + | let userTotal = curStats[idxWlgUserTotalAvail] | |
361 | + | let userEffTime = curStats[idxWlgEffUserTime] | |
362 | + | $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, 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)) | |
332 | 363 | } | |
333 | 364 | } | |
334 | 365 | ||
364 | 395 | if ((MINSHOPPAYMENT > usdtAmt)) | |
365 | 396 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
366 | 397 | else { | |
367 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, | |
398 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt, MULT6) | |
368 | 399 | let curWlgAmount = curStats[idxWlgAmount] | |
369 | 400 | let fundsUsd = curStats[idxWlgFunds] | |
370 | 401 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
406 | 437 | if ((pmtAssetId != wlgAssetId)) | |
407 | 438 | then throw("WLGOLD payments only!") | |
408 | 439 | else { | |
409 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, | |
440 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0, MULT6) | |
410 | 441 | let curWlgAmount = curStats[idxWlgAmount] | |
411 | 442 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
412 | 443 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
432 | 463 | if ((size(i.payments) != 0)) | |
433 | 464 | then throw("No payments required") | |
434 | 465 | else { | |
435 | - | let actions = claimInternal(toString(i.caller))._1 | |
466 | + | let actions = claimInternal(toString(i.caller), MULT6)._1 | |
436 | 467 | $Tuple2(actions, prologResult) | |
437 | 468 | } | |
438 | 469 | } | |
442 | 473 | @Callable(i) | |
443 | 474 | func onStakeUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
444 | 475 | then throw("Permission denied") | |
445 | - | else claimInternal(addr) | |
476 | + | else claimInternal(addr, MULT6) | |
477 | + | ||
478 | + | ||
479 | + | ||
480 | + | @Callable(i) | |
481 | + | func claimRob (owner,robber,ownerProportion6) = if ((i.caller != stakingContract)) | |
482 | + | then throw("Permission denied") | |
483 | + | else { | |
484 | + | let r = claimInternal(owner, ownerProportion6) | |
485 | + | $Tuple2((r._1 :+ ScriptTransfer(addressFromStringValue(robber), (r._2._2 - r._2._1), wlgAssetId)), r._2) | |
486 | + | } | |
446 | 487 | ||
447 | 488 |
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 DAY = 86400000 | |
23 | 23 | ||
24 | 24 | let marketingAddrKey = "marketingAddr" | |
25 | 25 | ||
26 | 26 | let teamAddrKey = "teamAddr" | |
27 | 27 | ||
28 | 28 | let lastMarketingTimeKey = "lastClaimedTime_marketing" | |
29 | 29 | ||
30 | 30 | let marketingAmountLeftKey = "marketingAmountLeft" | |
31 | 31 | ||
32 | 32 | let lastTeamTimeKey = "lastClaimedTime_team" | |
33 | 33 | ||
34 | 34 | let teamAmountLeftKey = "teamAmountLeft" | |
35 | 35 | ||
36 | 36 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
37 | 37 | ||
38 | 38 | let actAmountLeftKey = "activitiesAmountLeft" | |
39 | 39 | ||
40 | 40 | let stakersAmountLeftKey = "stakersAmountLeft" | |
41 | 41 | ||
42 | 42 | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func distributionByPeriod (period) = fraction(MILLION6, (PLAYERSHARE * (period + 1)), (6 * M6)) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | let wlgIssueTimeKey = "wlg_issueTime" | |
52 | 52 | ||
53 | 53 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
54 | 54 | ||
55 | 55 | let zbIssuedAmountKey = "zbill_issuedAmount" | |
56 | 56 | ||
57 | 57 | let idxWlgAmount = 0 | |
58 | 58 | ||
59 | 59 | let idxWlgPrice = 1 | |
60 | 60 | ||
61 | 61 | let idxWlgFunds = 2 | |
62 | 62 | ||
63 | 63 | let idxWlgIssueTime = 7 | |
64 | 64 | ||
65 | 65 | let idxWlgMarketingAmLeft = 10 | |
66 | 66 | ||
67 | 67 | let idxWlgMarketingAmAvailNow = 11 | |
68 | 68 | ||
69 | 69 | let idxWlgTeamAmLeft = 14 | |
70 | 70 | ||
71 | 71 | let idxWlgTeamAmAvailNow = 15 | |
72 | 72 | ||
73 | 73 | let idxWlgActAmLeft = 18 | |
74 | 74 | ||
75 | 75 | let idxWlgActAmAvailNow = 19 | |
76 | 76 | ||
77 | 77 | let idxWlgAmLeftTotal = 22 | |
78 | 78 | ||
79 | 79 | let idxWlgUserAmAvailNow = 25 | |
80 | 80 | ||
81 | + | let idxWlgUserTotalAvail = 28 | |
82 | + | ||
83 | + | let idxWlgEffUserTime = 29 | |
84 | + | ||
81 | 85 | let dappRest = 0 | |
82 | 86 | ||
83 | 87 | let dappStaking = 1 | |
84 | 88 | ||
85 | 89 | let dappEconomy = 2 | |
86 | 90 | ||
87 | - | let dappWlg = | |
91 | + | let dappWlg = 3 | |
88 | 92 | ||
89 | - | let dappPuzzle = | |
93 | + | let dappPuzzle = 4 | |
90 | 94 | ||
91 | - | let dappInvestFund = | |
95 | + | let dappInvestFund = 5 | |
92 | 96 | ||
93 | 97 | func getPieces (userAddrStrOrEmpty,stakingContract) = { | |
94 | 98 | let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_") | |
95 | 99 | func adder (acc,item) = (acc + parseIntValue(item)) | |
96 | 100 | ||
97 | 101 | let totalPower = { | |
98 | 102 | let $l = props | |
99 | 103 | let $s = size($l) | |
100 | 104 | let $acc0 = 0 | |
101 | 105 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
102 | 106 | then $a | |
103 | 107 | else adder($a, $l[$i]) | |
104 | 108 | ||
105 | 109 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
106 | 110 | then $a | |
107 | 111 | else throw("List size exceeds 6") | |
108 | 112 | ||
109 | 113 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
110 | 114 | } | |
111 | 115 | let usersPower = valueOrElse(getInteger(stakingContract, ("stakedPiecesByOwner_" + userAddrStrOrEmpty)), 0) | |
112 | 116 | [totalPower, usersPower] | |
113 | 117 | } | |
114 | 118 | ||
115 | 119 | ||
116 | - | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection) = { | |
120 | + | func getWlgStats (userAddrOpt,contracts,usdtId,usdtBalanceCorrection,userProportion6) = { | |
117 | 121 | let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
118 | 122 | let economyUsd = assetBalance(contracts[dappEconomy], usdtId) | |
119 | 123 | let restUsd = assetBalance(contracts[dappRest], usdtId) | |
120 | 124 | let wlgUsd = (assetBalance(contracts[dappWlg], usdtId) - usdtBalanceCorrection) | |
121 | 125 | let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId) | |
122 | 126 | let investFundContract = contracts[dappInvestFund] | |
123 | 127 | let investFundTotal = (assetBalance(investFundContract, usdtId) + valueOrElse(getInteger(investFundContract, zbIssuedAmountKey), 0)) | |
124 | 128 | let totalFundsUsd = ((economyUsd + wlgUsd) + investFundTotal) | |
125 | 129 | let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet") | |
126 | 130 | let now = lastBlock.timestamp | |
127 | 131 | let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized") | |
128 | 132 | let marketingTotal = fraction(MILLION6, MARKETINGSHARE, M6) | |
129 | 133 | let marketingAmountLeft = valueOrElse(getInteger(contracts[dappWlg], marketingAmountLeftKey), marketingTotal) | |
130 | 134 | let lastMarketingTime = valueOrElse(getInteger(contracts[dappWlg], lastMarketingTimeKey), issueTime) | |
131 | 135 | let marketingAddr = addressFromStringValue(value(getString(contracts[dappWlg], marketingAddrKey))) | |
132 | 136 | let marketingAmountAvailableNow = min([fraction(marketingTotal, (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft]) | |
133 | 137 | let marketingWlgold = assetBalance(marketingAddr, wlgId) | |
134 | 138 | let teamTotal = fraction(MILLION6, TEAMSHARE, M6) | |
135 | 139 | let teamAmountLeft = valueOrElse(getInteger(contracts[dappWlg], teamAmountLeftKey), teamTotal) | |
136 | 140 | let lastTeamTime = valueOrElse(getInteger(contracts[dappWlg], lastTeamTimeKey), issueTime) | |
137 | 141 | let teamAddr = addressFromStringValue(value(getString(contracts[dappWlg], teamAddrKey))) | |
138 | 142 | let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEARMILLIS)), teamAmountLeft]) | |
139 | 143 | let teamWlgold = assetBalance(teamAddr, wlgId) | |
140 | 144 | let actTotal = fraction(MILLION6, ACTIVITYSHARE, M6) | |
141 | 145 | let actAmountLeft = valueOrElse(getInteger(contracts[dappWlg], actAmountLeftKey), actTotal) | |
142 | 146 | let lastActivitiesTime = valueOrElse(getInteger(contracts[dappWlg], lastActivitiesTimeKey), issueTime) | |
143 | 147 | let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEARMILLIS)), actAmountLeft]) | |
144 | 148 | let actWlgold = assetBalance(contracts[dappRest], wlgId) | |
145 | 149 | let lastUserTime = valueOrElse(getInteger(contracts[dappWlg], keyLastClaimedTimeByUser(userAddrOpt)), issueTime) | |
146 | 150 | let lastUserPeriod = ((lastUserTime - issueTime) / YEARMILLIS) | |
147 | 151 | let nowLimited = min([now, (issueTime + (3 * YEARMILLIS))]) | |
148 | 152 | let curPeriod = min([((now - issueTime) / YEARMILLIS), 2]) | |
149 | 153 | let eff = getPieces(userAddrOpt, contracts[dappStaking]) | |
150 | 154 | let curPeriodDistribution = distributionByPeriod(curPeriod) | |
151 | - | let userAmount = fraction(if ((lastUserPeriod == curPeriod)) | |
152 | - | then fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
155 | + | let $t079142 = if ((lastUserPeriod == curPeriod)) | |
156 | + | then { | |
157 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - lastUserTime), YEARMILLIS) | |
158 | + | let userPart = fraction(a0, userProportion6, M6) | |
159 | + | let effTime = (lastUserTime + fraction((nowLimited - lastUserTime), userProportion6, M6)) | |
160 | + | $Tuple3(userPart, a0, effTime) | |
161 | + | } | |
153 | 162 | else if ((lastUserPeriod == (curPeriod - 1))) | |
154 | - | then (fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)) | |
155 | - | else ((fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) + distributionByPeriod((curPeriod - 1))) + fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS)), eff[1], eff[0]) | |
163 | + | then { | |
164 | + | let a1 = fraction(distributionByPeriod((curPeriod - 1)), ((issueTime + (YEARMILLIS * curPeriod)) - lastUserTime), YEARMILLIS) | |
165 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
166 | + | let avail = (a1 + a0) | |
167 | + | let userPart = fraction(avail, userProportion6, M6) | |
168 | + | let effTime = if ((a1 >= userPart)) | |
169 | + | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 1)))) | |
170 | + | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, (userPart - a1), curPeriodDistribution)) | |
171 | + | $Tuple3(userPart, avail, effTime) | |
172 | + | } | |
173 | + | else { | |
174 | + | let a2 = fraction(distributionByPeriod((curPeriod - 2)), ((issueTime + (YEARMILLIS * (curPeriod - 1))) - lastUserTime), YEARMILLIS) | |
175 | + | let a1 = distributionByPeriod((curPeriod - 1)) | |
176 | + | let a0 = fraction(curPeriodDistribution, (nowLimited - (issueTime + (YEARMILLIS * curPeriod))), YEARMILLIS) | |
177 | + | let avail = ((a2 + a1) + a0) | |
178 | + | let userPart = fraction(avail, userProportion6, M6) | |
179 | + | let effTime = if ((a2 >= userPart)) | |
180 | + | then (lastUserTime + fraction(YEARMILLIS, userPart, distributionByPeriod((curPeriod - 2)))) | |
181 | + | else if (((a2 + a1) >= userPart)) | |
182 | + | then ((issueTime + (YEARMILLIS * (curPeriod - 1))) + fraction(YEARMILLIS, (userPart - a2), distributionByPeriod((curPeriod - 1)))) | |
183 | + | else ((issueTime + (YEARMILLIS * curPeriod)) + fraction(YEARMILLIS, ((userPart - a2) - a1), curPeriodDistribution)) | |
184 | + | $Tuple3(userPart, avail, effTime) | |
185 | + | } | |
186 | + | let userAmount = $t079142._1 | |
187 | + | let userAvailable = $t079142._2 | |
188 | + | let effLastTime = $t079142._3 | |
156 | 189 | let sLandDailyAmount = fraction(fraction(curPeriodDistribution, DAY, YEARMILLIS), 25, eff[0]) | |
157 | 190 | let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0) | |
158 | - | [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, userAmount, sLandDailyAmount, investFundTotal] | |
191 | + | [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, fraction(userAmount, eff[1], eff[0]), sLandDailyAmount, investFundTotal, fraction(userAvailable, eff[1], eff[0]), effLastTime] | |
159 | 192 | } | |
160 | 193 | ||
161 | 194 | ||
162 | 195 | let chain = take(drop(this.bytes, 1), 1) | |
163 | 196 | ||
164 | 197 | let usdtAssetId = match chain { | |
165 | 198 | case _ => | |
166 | 199 | if ((base58'2W' == $match0)) | |
167 | 200 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
168 | 201 | else if ((base58'2T' == $match0)) | |
169 | 202 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
170 | 203 | else throw("Unknown chain") | |
171 | 204 | } | |
172 | 205 | ||
173 | 206 | let defaultRestAddressStr = match chain { | |
174 | 207 | case _ => | |
175 | 208 | if ((base58'2W' == $match0)) | |
176 | 209 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
177 | 210 | else if ((base58'2T' == $match0)) | |
178 | 211 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
179 | 212 | else throw("Unknown chain") | |
180 | 213 | } | |
181 | 214 | ||
182 | 215 | let arbitrageDelay = match chain { | |
183 | 216 | case _ => | |
184 | 217 | if ((base58'2W' == $match0)) | |
185 | 218 | then 86400000 | |
186 | 219 | else if ((base58'2T' == $match0)) | |
187 | 220 | then 60000 | |
188 | 221 | else throw("Unknown chain") | |
189 | 222 | } | |
190 | 223 | ||
191 | 224 | let SEP = "__" | |
192 | 225 | ||
193 | 226 | let MULT6 = 1000000 | |
194 | 227 | ||
195 | 228 | let MULT8 = 100000000 | |
196 | 229 | ||
197 | 230 | let MINSHOPPAYMENT = 100000 | |
198 | 231 | ||
199 | 232 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
200 | 233 | ||
201 | 234 | ||
202 | 235 | let IdxCfgStakingDapp = 1 | |
203 | 236 | ||
204 | 237 | let IdxCfgEconomyDapp = 2 | |
205 | 238 | ||
206 | - | let IdxCfgGovernanceDapp = 3 | |
207 | - | ||
208 | 239 | let IdxCfgWlgDapp = 4 | |
209 | 240 | ||
210 | 241 | let IdxCfgPuzzlePoolDapp = 5 | |
211 | 242 | ||
212 | 243 | let IdxCfgInvestFundDapp = 6 | |
213 | 244 | ||
214 | 245 | func keyRestCfg () = "%s__restConfig" | |
215 | 246 | ||
216 | 247 | ||
217 | 248 | func keyRestAddress () = "%s__restAddr" | |
218 | 249 | ||
219 | 250 | ||
220 | 251 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
221 | 252 | ||
222 | 253 | ||
223 | 254 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
224 | 255 | ||
225 | 256 | ||
226 | 257 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
227 | 258 | ||
228 | 259 | let restCfg = readRestCfgOrFail(restContract) | |
229 | 260 | ||
230 | 261 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
231 | 262 | ||
232 | 263 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
233 | - | ||
234 | - | let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp) | |
235 | 264 | ||
236 | 265 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
237 | 266 | ||
238 | 267 | let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp) | |
239 | 268 | ||
240 | 269 | let investFundContract = getContractAddressOrFail(restCfg, IdxCfgInvestFundDapp) | |
241 | 270 | ||
242 | 271 | let wlgAssetIdKey = "wlg_assetId" | |
243 | 272 | ||
244 | 273 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet") | |
245 | 274 | ||
246 | 275 | let IdxEffUser = 1 | |
247 | 276 | ||
248 | 277 | func keyResProportions () = "resTypesProportions" | |
249 | 278 | ||
250 | 279 | ||
251 | 280 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
252 | 281 | ||
253 | 282 | ||
254 | 283 | func asInt (v) = match v { | |
255 | 284 | case n: Int => | |
256 | 285 | n | |
257 | 286 | case _ => | |
258 | 287 | throw("fail to cast into Int") | |
259 | 288 | } | |
260 | 289 | ||
261 | 290 | ||
262 | 291 | func getVotingPower (userAddrStrOrEmpty) = { | |
263 | 292 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
264 | 293 | func adder (acc,item) = (acc + parseIntValue(item)) | |
265 | 294 | ||
266 | 295 | let totalPower = { | |
267 | 296 | let $l = props | |
268 | 297 | let $s = size($l) | |
269 | 298 | let $acc0 = 0 | |
270 | 299 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
271 | 300 | then $a | |
272 | 301 | else adder($a, $l[$i]) | |
273 | 302 | ||
274 | 303 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
275 | 304 | then $a | |
276 | 305 | else throw("List size exceeds 6") | |
277 | 306 | ||
278 | 307 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
279 | 308 | } | |
280 | 309 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
281 | 310 | [totalPower, usersPower] | |
282 | 311 | } | |
283 | 312 | ||
284 | 313 | ||
285 | 314 | func fixedPoint (val,decimals) = { | |
286 | 315 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
287 | 316 | let lowPart = toString((val % tenPow)) | |
288 | 317 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
289 | 318 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
290 | 319 | } | |
291 | 320 | ||
292 | 321 | ||
293 | 322 | let profitAddrKey = "profitAddr" | |
294 | 323 | ||
295 | 324 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
296 | 325 | ||
297 | 326 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
298 | 327 | ||
299 | 328 | ||
300 | 329 | func prolog () = asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
301 | 330 | ||
302 | 331 | ||
303 | 332 | func getSwapLimitWlg (addr) = { | |
304 | 333 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
305 | 334 | let now = lastBlock.timestamp | |
306 | 335 | if ((arbitrageDelay > (now - lastTime))) | |
307 | 336 | then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min")) | |
308 | 337 | else { | |
309 | 338 | let pieces = getVotingPower(addr)[IdxEffUser] | |
310 | 339 | (pieces * MULT8) | |
311 | 340 | } | |
312 | 341 | } | |
313 | 342 | ||
314 | 343 | ||
315 | - | func claimInternal (addr) = { | |
344 | + | func claimInternal (addr,proportion6) = { | |
316 | 345 | let caller = addressFromStringValue(addr) | |
317 | - | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, | |
346 | + | let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0, proportion6) | |
318 | 347 | let now = lastBlock.timestamp | |
319 | 348 | let issueTime = curStats[idxWlgIssueTime] | |
320 | 349 | let marketingAmountLeft = curStats[idxWlgMarketingAmLeft] | |
321 | 350 | let marketingAmount = curStats[idxWlgMarketingAmAvailNow] | |
322 | 351 | let teamAmountLeft = curStats[idxWlgTeamAmLeft] | |
323 | 352 | let teamAmount = curStats[idxWlgTeamAmAvailNow] | |
324 | 353 | let actAmountLeft = curStats[idxWlgActAmLeft] | |
325 | 354 | let actAmount = curStats[idxWlgActAmAvailNow] | |
326 | 355 | if (((now - issueTime) > CHECKTIME)) | |
327 | 356 | then throw("Please modify contract for next 1.5 years, according to stats") | |
328 | 357 | else { | |
329 | 358 | let userAmount = curStats[idxWlgUserAmAvailNow] | |
330 | 359 | let userKey = keyStakersAmountPaidUser(addr) | |
331 | - | $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, wlgAssetId), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userAmount)), IntegerEntry(stakersAmountLeftKey, (curStats[idxWlgAmLeftTotal] - userAmount)), IntegerEntry(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(keyLastClaimedTimeByUser(addr), now)], userAmount) | |
360 | + | let userTotal = curStats[idxWlgUserTotalAvail] | |
361 | + | let userEffTime = curStats[idxWlgEffUserTime] | |
362 | + | $Tuple2([ScriptTransfer(addressFromStringValue(value(getString(marketingAddrKey))), marketingAmount, wlgAssetId), ScriptTransfer(addressFromStringValue(value(getString(teamAddrKey))), teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, 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)) | |
332 | 363 | } | |
333 | 364 | } | |
334 | 365 | ||
335 | 366 | ||
336 | 367 | @Callable(i) | |
337 | 368 | func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this)) | |
338 | 369 | then throw("Permission denied") | |
339 | 370 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
340 | 371 | then throw("Already initialized") | |
341 | 372 | else { | |
342 | 373 | let issuedAmount = MILLION6 | |
343 | 374 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
344 | 375 | let assetId = calculateAssetId(issue) | |
345 | 376 | [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)] | |
346 | 377 | } | |
347 | 378 | ||
348 | 379 | ||
349 | 380 | ||
350 | 381 | @Callable(i) | |
351 | 382 | func buyWlg (minAmount) = { | |
352 | 383 | let prologResult = prolog() | |
353 | 384 | if ((size(i.payments) != 1)) | |
354 | 385 | then throw("exactly 1 payment must be attached") | |
355 | 386 | else { | |
356 | 387 | let pmt = i.payments[0] | |
357 | 388 | let usdtAmt = pmt.amount | |
358 | 389 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "USDT payments only!") | |
359 | 390 | if ((pmtAssetId != usdtAssetId)) | |
360 | 391 | then throw("USDT payments only!") | |
361 | 392 | else { | |
362 | 393 | let caller = i.caller | |
363 | 394 | let addr = toString(caller) | |
364 | 395 | if ((MINSHOPPAYMENT > usdtAmt)) | |
365 | 396 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
366 | 397 | else { | |
367 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, | |
398 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, usdtAmt, MULT6) | |
368 | 399 | let curWlgAmount = curStats[idxWlgAmount] | |
369 | 400 | let fundsUsd = curStats[idxWlgFunds] | |
370 | 401 | let wlgPrice = fraction(fundsUsd, MULT8, curWlgAmount) | |
371 | 402 | let buyPrice = fraction(wlgPrice, 6, 5) | |
372 | 403 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
373 | 404 | let maxWlg = getSwapLimitWlg(addr) | |
374 | 405 | if ((wlgAmount > maxWlg)) | |
375 | 406 | then throw((("You can get max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
376 | 407 | else if ((minAmount > wlgAmount)) | |
377 | 408 | then throw("Price changed during operation, please try again") | |
378 | 409 | else { | |
379 | 410 | let profitAmount = (usdtAmt / 6) | |
380 | 411 | let deltaFunds = (usdtAmt - profitAmount) | |
381 | 412 | let reissued = fraction(curWlgAmount, deltaFunds, fundsUsd) | |
382 | 413 | $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) | |
383 | 414 | } | |
384 | 415 | } | |
385 | 416 | } | |
386 | 417 | } | |
387 | 418 | } | |
388 | 419 | ||
389 | 420 | ||
390 | 421 | ||
391 | 422 | @Callable(i) | |
392 | 423 | func sellWlg (minAmount) = { | |
393 | 424 | let prologResult = prolog() | |
394 | 425 | if ((size(i.payments) != 1)) | |
395 | 426 | then throw("exactly 1 payment must be attached") | |
396 | 427 | else { | |
397 | 428 | let pmt = i.payments[0] | |
398 | 429 | let wlgAmt = pmt.amount | |
399 | 430 | let caller = i.caller | |
400 | 431 | let addr = toString(caller) | |
401 | 432 | let maxWlg = getSwapLimitWlg(addr) | |
402 | 433 | if ((wlgAmt > maxWlg)) | |
403 | 434 | then throw((("You can spend max " + fixedPoint(maxWlg, 8)) + " WLGOLD")) | |
404 | 435 | else { | |
405 | 436 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WLGOLD payments only!") | |
406 | 437 | if ((pmtAssetId != wlgAssetId)) | |
407 | 438 | then throw("WLGOLD payments only!") | |
408 | 439 | else { | |
409 | - | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, | |
440 | + | let curStats = getWlgStats("", [restContract, stakingContract, economyContract, wlgContract, puzzlePoolContract, investFundContract], usdtAssetId, 0, MULT6) | |
410 | 441 | let curWlgAmount = curStats[idxWlgAmount] | |
411 | 442 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
412 | 443 | let usdtAmt = fraction(wlgAmt, sellPrice, MULT8) | |
413 | 444 | if ((MINSHOPPAYMENT > usdtAmt)) | |
414 | 445 | then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT")) | |
415 | 446 | else if ((minAmount > usdtAmt)) | |
416 | 447 | then throw("Price changed during operation, please try again") | |
417 | 448 | else { | |
418 | 449 | let profitAmount = (usdtAmt / 4) | |
419 | 450 | let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds]) | |
420 | 451 | $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) | |
421 | 452 | } | |
422 | 453 | } | |
423 | 454 | } | |
424 | 455 | } | |
425 | 456 | } | |
426 | 457 | ||
427 | 458 | ||
428 | 459 | ||
429 | 460 | @Callable(i) | |
430 | 461 | func claim () = { | |
431 | 462 | let prologResult = prolog() | |
432 | 463 | if ((size(i.payments) != 0)) | |
433 | 464 | then throw("No payments required") | |
434 | 465 | else { | |
435 | - | let actions = claimInternal(toString(i.caller))._1 | |
466 | + | let actions = claimInternal(toString(i.caller), MULT6)._1 | |
436 | 467 | $Tuple2(actions, prologResult) | |
437 | 468 | } | |
438 | 469 | } | |
439 | 470 | ||
440 | 471 | ||
441 | 472 | ||
442 | 473 | @Callable(i) | |
443 | 474 | func onStakeUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
444 | 475 | then throw("Permission denied") | |
445 | - | else claimInternal(addr) | |
476 | + | else claimInternal(addr, MULT6) | |
477 | + | ||
478 | + | ||
479 | + | ||
480 | + | @Callable(i) | |
481 | + | func claimRob (owner,robber,ownerProportion6) = if ((i.caller != stakingContract)) | |
482 | + | then throw("Permission denied") | |
483 | + | else { | |
484 | + | let r = claimInternal(owner, ownerProportion6) | |
485 | + | $Tuple2((r._1 :+ ScriptTransfer(addressFromStringValue(robber), (r._2._2 - r._2._1), wlgAssetId)), r._2) | |
486 | + | } | |
446 | 487 | ||
447 | 488 |
github/deemru/w8io/026f985 58.31 ms ◑