tx · 6eK19d1JP3qiR2a8AaK6PBGhZ9GXZL9EVFoU65mehnvT

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.01200000 Waves

2023.07.02 19:43 [2648547] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "6eK19d1JP3qiR2a8AaK6PBGhZ9GXZL9EVFoU65mehnvT", "fee": 1200000, "feeAssetId": null, "timestamp": 1688316217549, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "4E55GNUCivVzQ4VHNkaDzSMBNHmpjkgBM2nX9ysC94Y3SVAGCM41KxEm1febEaJUuWHminh9Q5LamSpKAaJ3mM4e" ], "script": "base64:BgIgCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgMKAQhFAQprZXlCbG9ja2VkAAIQY29udHJhY3RzQmxvY2tlZAALSWR4RWZmVG90YWwAAAAKSWR4RWZmVXNlcgABAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4ADmFyYml0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Pc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAQ1jbGFpbUludGVybmFsAQkBEUBleHRyTmF0aXZlKDEwNjIpAQUEYWRkcgFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkBDWNsYWltSW50ZXJuYWwBCQERQGV4dHJOYXRpdmUoMTA2MikBBQRhZGRyAGT001U=", "height": 2648547, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CDpwHRtmo6zdWy3NCUS5Rw66qFpeG3gn1asXF4FW8SDH Next: 35Z36AT5VfLXJ5FB19VsrV2o1EZ4SWLja7GZ2EFMY4Qt Diff:
OldNewDifferences
253253 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
254254 let now = lastBlock.timestamp
255255 if ((arbitrageDelay > (now - lastTime)))
256- then throw("Arbitrages are possible once a 10 minutes")
256+ then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "ms"))
257257 else {
258258 let pieces = getVotingPower(addr)[IdxEffUser]
259259 let pow8 = pow(pieces, 0, B8, 8, 8, CEILING)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func keyBlocked () = "contractsBlocked"
55
66
77 let IdxEffTotal = 0
88
99 let IdxEffUser = 1
1010
1111 let chain = take(drop(this.bytes, 1), 1)
1212
1313 let usdtAssetId = match chain {
1414 case _ =>
1515 if ((base58'2W' == $match0))
1616 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
1717 else if ((base58'2T' == $match0))
1818 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
1919 else throw("Unknown chain")
2020 }
2121
2222 let defaultRestAddressStr = match chain {
2323 case _ =>
2424 if ((base58'2W' == $match0))
2525 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
2626 else if ((base58'2T' == $match0))
2727 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
2828 else throw("Unknown chain")
2929 }
3030
3131 let arbitrageDelay = match chain {
3232 case _ =>
3333 if ((base58'2W' == $match0))
3434 then 600000
3535 else if ((base58'2T' == $match0))
3636 then 60000
3737 else throw("Unknown chain")
3838 }
3939
4040 let SEP = "__"
4141
4242 let MULT6 = 1000000
4343
4444 let MULT8 = 100000000
4545
4646 let SSIZE = 25
4747
4848 let MSIZE = 100
4949
5050 let LSIZE = 225
5151
5252 let XLSIZE = 400
5353
5454 let XXLSIZE = 625
5555
5656 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
5757
5858
5959 let IdxCfgStakingDapp = 1
6060
6161 let IdxCfgEconomyDapp = 2
6262
6363 let IdxCfgWlgDapp = 4
6464
6565 let IdxCfgPuzzlePoolDapp = 5
6666
6767 func keyRestCfg () = "%s__restConfig"
6868
6969
7070 func keyRestAddress () = "%s__restAddr"
7171
7272
7373 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
7474
7575
7676 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
7777
7878
7979 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
8080
8181 let restCfg = readRestCfgOrFail(restContract)
8282
8383 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
8484
8585 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
8686
8787 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
8888
8989 let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp)
9090
9191 let recLandSize = 1
9292
9393 func keyResProportions () = "resTypesProportions"
9494
9595
9696 func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr)
9797
9898
9999 let wlgIssuedAmountKey = "wlg_issuedAmount"
100100
101101 let wlgAssetIdKey = "wlg_assetId"
102102
103103 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet")
104104
105105 let idxWlgAmount = 0
106106
107107 let idxWlgPrice = 1
108108
109109 let idxWlgFunds = 2
110110
111111 func asInt (v) = match v {
112112 case n: Int =>
113113 n
114114 case _ =>
115115 throw("fail to cast into Int")
116116 }
117117
118118
119119 func numPiecesBySize (landSize) = match landSize {
120120 case _ =>
121121 if (("S" == $match0))
122122 then SSIZE
123123 else if (("M" == $match0))
124124 then MSIZE
125125 else if (("L" == $match0))
126126 then LSIZE
127127 else if (("XL" == $match0))
128128 then XLSIZE
129129 else if (("XXL" == $match0))
130130 then XXLSIZE
131131 else throw("Unknown land size")
132132 }
133133
134134
135135 func getVotingPower (userAddrStrOrEmpty) = {
136136 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
137137 func adder (acc,item) = (acc + parseIntValue(item))
138138
139139 let totalPower = {
140140 let $l = props
141141 let $s = size($l)
142142 let $acc0 = 0
143143 func $f0_1 ($a,$i) = if (($i >= $s))
144144 then $a
145145 else adder($a, $l[$i])
146146
147147 func $f0_2 ($a,$i) = if (($i >= $s))
148148 then $a
149149 else throw("List size exceeds 6")
150150
151151 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
152152 }
153153 let usersPower = if ((userAddrStrOrEmpty == ""))
154154 then 0
155155 else {
156156 let landsStr = getString(stakingContract, keyStakedLandsByOwner(userAddrStrOrEmpty))
157157 let lands = if (isDefined(landsStr))
158158 then split_51C(value(landsStr), "_")
159159 else nil
160160 func oneLand (acc,landAssetId) = {
161161 let asset = value(assetInfo(fromBase58String(landAssetId)))
162162 let landSize = split(asset.description, "_")[recLandSize]
163163 (acc + numPiecesBySize(landSize))
164164 }
165165
166166 let $l = lands
167167 let $s = size($l)
168168 let $acc0 = 0
169169 func $f1_1 ($a,$i) = if (($i >= $s))
170170 then $a
171171 else oneLand($a, $l[$i])
172172
173173 func $f1_2 ($a,$i) = if (($i >= $s))
174174 then $a
175175 else throw("List size exceeds 100")
176176
177177 $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
178178 }
179179 [totalPower, usersPower]
180180 }
181181
182182
183183 func getWlgStats () = {
184184 let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmountKey), "WLGOLD is not issued yet")
185185 let economyUsd = assetBalance(economyContract, usdtAssetId)
186186 let restUsd = assetBalance(restContract, usdtAssetId)
187187 let wlgUsd = assetBalance(wlgContract, usdtAssetId)
188188 let puzzleUsd = assetBalance(puzzlePoolContract, usdtAssetId)
189189 let totalFundsUsd = (((economyUsd + restUsd) + wlgUsd) + puzzleUsd)
190190 [issuedAmount, fraction(totalFundsUsd, MULT8, issuedAmount), totalFundsUsd, economyUsd, restUsd, wlgUsd, puzzleUsd]
191191 }
192192
193193
194194 func fixedPoint (val,decimals) = {
195195 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
196196 ((toString((val / tenPow)) + ".") + toString((val % tenPow)))
197197 }
198198
199199
200200 let MULT14 = 100000000000000
201201
202202 let MARKETINGSHARE = 100000
203203
204204 let TEAMSHARE = 200000
205205
206206 let ACTIVITYSHARE = 100000
207207
208208 let PLAYERSHARE = 400000
209209
210210 let YEARMILLIS = 31557600000
211211
212212 let WEEKMILLIS = 604800000
213213
214214 let MAXPERIOD = 156
215215
216216 let A6 = 100000000
217217
218218 let B8 = 50000000
219219
220220 let wlgIssueTimeKey = "wlg_issueTime"
221221
222222 let marketingAddrKey = "marketingAddr"
223223
224224 let teamAddrKey = "teamAddr"
225225
226226 let profitAddrKey = "profitAddr"
227227
228228 let lastMarketingTimeKey = "lastClaimedTime_marketing"
229229
230230 let lastTeamTimeKey = "lastClaimedTime_team"
231231
232232 let lastActivitiesTimeKey = "lastClaimedTime_activities"
233233
234234 func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
235235
236236
237237 func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
238238
239239
240240 let stakersAmountLeftKey = "stakersAmountLeft"
241241
242242 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
243243
244244 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
245245
246246
247247 func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false))
248248 then throw("Contracts are under maintenance")
249249 else asInt(invoke(stakingContract, "saveLastTx", nil, nil))
250250
251251
252252 func getSwapLimit (addr) = {
253253 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
254254 let now = lastBlock.timestamp
255255 if ((arbitrageDelay > (now - lastTime)))
256- then throw("Arbitrages are possible once a 10 minutes")
256+ then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "ms"))
257257 else {
258258 let pieces = getVotingPower(addr)[IdxEffUser]
259259 let pow8 = pow(pieces, 0, B8, 8, 8, CEILING)
260260 fraction(A6, pow8, MULT8)
261261 }
262262 }
263263
264264
265265 func claimInternal (caller) = {
266266 let callerAddr = toString(caller)
267267 let now = lastBlock.timestamp
268268 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
269269 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
270270 let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey)))
271271 let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS)
272272 let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime)
273273 let teamAddr = addressFromStringValue(value(getString(teamAddrKey)))
274274 let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
275275 let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime)
276276 let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
277277 let curPeriod = ((now - issueTime) / WEEKMILLIS)
278278 if ((curPeriod > (MAXPERIOD / 2)))
279279 then throw("Please modify contract for next 1.5 years, according to stats")
280280 else {
281281 let eff = getVotingPower(callerAddr)
282282 let totalPieces = eff[IdxEffTotal]
283283 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
284284 let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod))))
285285 let userTimeKey = keyLastClaimedTimeByUser(callerAddr)
286286 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
287287 let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
288288 let userKey = keyStakersAmountPaidUser(callerAddr)
289289 $Tuple2([ScriptTransfer(marketingAddr, marketingAmount, wlgAssetId), ScriptTransfer(teamAddr, 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, (amountLeftTotal - userAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], userAmount)
290290 }
291291 }
292292
293293
294294 @Callable(i)
295295 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
296296 then throw("Permission denied")
297297 else if (isDefined(getBinary(wlgAssetIdKey)))
298298 then throw("Already initialized")
299299 else {
300300 let issuedAmount = MULT14
301301 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
302302 let assetId = calculateAssetId(issue)
303303 [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MULT14, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr), StringEntry(profitAddrKey, profitAddr)]
304304 }
305305
306306
307307
308308 @Callable(i)
309309 func buyWlg (minAmount) = {
310310 let prologResult = prolog()
311311 if ((size(i.payments) != 1))
312312 then throw("exactly 1 payment must be attached")
313313 else {
314314 let pmt = i.payments[0]
315315 let usdtAmt = pmt.amount
316316 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
317317 if ((pmtAssetId != usdtAssetId))
318318 then throw("USDT payments only!")
319319 else {
320320 let caller = i.caller
321321 let addr = toString(caller)
322322 let maxUsdt = getSwapLimit(addr)
323323 if ((usdtAmt > maxUsdt))
324324 then throw((("You can spend max " + fixedPoint(maxUsdt, 6)) + " USDT"))
325325 else {
326326 let curStats = getWlgStats()
327327 let curWlgAmount = curStats[idxWlgAmount]
328328 let oldFundsUsd = (curStats[idxWlgFunds] - usdtAmt)
329329 let wlgPrice = fraction(oldFundsUsd, MULT8, curWlgAmount)
330330 let buyPrice = fraction(wlgPrice, 6, 5)
331331 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
332332 if ((minAmount > wlgAmount))
333333 then throw("Price changed during operation, please try again")
334334 else {
335335 let profitAmount = (usdtAmt / 6)
336336 let deltaFunds = (usdtAmt - profitAmount)
337337 let reissued = fraction(curWlgAmount, deltaFunds, oldFundsUsd)
338338 $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)
339339 }
340340 }
341341 }
342342 }
343343 }
344344
345345
346346
347347 @Callable(i)
348348 func sellWlg (minAmount) = {
349349 let prologResult = prolog()
350350 if ((size(i.payments) != 1))
351351 then throw("exactly 1 payment must be attached")
352352 else {
353353 let pmt = i.payments[0]
354354 let wlgAmt = pmt.amount
355355 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
356356 if ((pmtAssetId != wlgAssetId))
357357 then throw("WLGOLD payments only!")
358358 else {
359359 let caller = i.caller
360360 let addr = toString(caller)
361361 let maxUsdt = getSwapLimit(addr)
362362 let curStats = getWlgStats()
363363 let curWlgAmount = curStats[idxWlgAmount]
364364 let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
365365 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
366366 if ((usdtAmt > maxUsdt))
367367 then throw((("You can get max " + fixedPoint(maxUsdt, 6)) + " USDT"))
368368 else if ((minAmount > usdtAmt))
369369 then throw("Price changed during operation, please try again")
370370 else {
371371 let profitAmount = (usdtAmt / 4)
372372 let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
373373 $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)
374374 }
375375 }
376376 }
377377 }
378378
379379
380380
381381 @Callable(i)
382382 func claim () = {
383383 let prologResult = prolog()
384384 let actions = claimInternal(i.caller)._1
385385 $Tuple2(actions, prologResult)
386386 }
387387
388388
389389
390390 @Callable(i)
391391 func onStakeLand (addr) = if ((i.caller != stakingContract))
392392 then throw("Permission denied")
393393 else claimInternal(addressFromStringValue(addr))
394394
395395
396396
397397 @Callable(i)
398398 func onUnstakeLand (addr) = if ((i.caller != stakingContract))
399399 then throw("Permission denied")
400400 else claimInternal(addressFromStringValue(addr))
401401
402402

github/deemru/w8io/026f985 
44.72 ms