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