tx · 5vdMdrLaydDAXtH1w46nY4fXVT2YEDTy9mHqe8EqKWpX

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.01400000 Waves

2023.07.13 16:53 [2664190] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "5vdMdrLaydDAXtH1w46nY4fXVT2YEDTy9mHqe8EqKWpX", "fee": 1400000, "feeAssetId": null, "timestamp": 1689256542412, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "2AqjWPUdVoBDGkQ22mmjbjmo5yZQX4qaQiD4NydRqeXTHyfZu36VF8kbrgRe1dSxHexQMHmMtYyVbBJZMstfPxhD" ], "script": "base64:BgIgCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgMKAQhWAAJNNgDAhD0AAk04AIDC1y8ACE1JTExJT042AICA6YOx3hYADk1BUktFVElOR1NIQVJFAKCNBgAJVEVBTVNIQVJFAMCaDAANQUNUSVZJVFlTSEFSRQCgjQYAC1BMQVlFUlNIQVJFAIC1GAAKWUVBUk1JTExJUwCAhuvHdQAKV0VFS01JTExJUwCAiLKgAgAJTUFYUEVSSU9EAJwBABBtYXJrZXRpbmdBZGRyS2V5Ag1tYXJrZXRpbmdBZGRyAAt0ZWFtQWRkcktleQIIdGVhbUFkZHIAFGxhc3RNYXJrZXRpbmdUaW1lS2V5AhlsYXN0Q2xhaW1lZFRpbWVfbWFya2V0aW5nABZtYXJrZXRpbmdBbW91bnRMZWZ0S2V5AhNtYXJrZXRpbmdBbW91bnRMZWZ0AA9sYXN0VGVhbVRpbWVLZXkCFGxhc3RDbGFpbWVkVGltZV90ZWFtABF0ZWFtQW1vdW50TGVmdEtleQIOdGVhbUFtb3VudExlZnQAFWxhc3RBY3Rpdml0aWVzVGltZUtle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VsdAFpAQtvblN0YWtlTGFuZAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAQ1jbGFpbUludGVybmFsAQUEYWRkcgFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkBDWNsYWltSW50ZXJuYWwBBQRhZGRyACy6LeA=", "height": 2664190, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GP917CufAAnXMqatPFk9BEWpKGCWCbc4fcBGAodw9z7n Next: 81c9RPdPUxWoapgTJWefkEQkmGkaLNnmANXjkdCQQWT7 Diff:
OldNewDifferences
111111 let restUsd = assetBalance(contracts[dappRest], usdtId)
112112 let wlgUsd = assetBalance(contracts[dappWlg], usdtId)
113113 let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId)
114- let totalFundsUsd = ((economyUsd + restUsd) + wlgUsd)
114+ let totalFundsUsd = (economyUsd + wlgUsd)
115115 let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet")
116116 let now = lastBlock.timestamp
117117 let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let M6 = 1000000
55
66 let M8 = 100000000
77
88 let MILLION6 = 100000000000000
99
1010 let MARKETINGSHARE = 100000
1111
1212 let TEAMSHARE = 200000
1313
1414 let ACTIVITYSHARE = 100000
1515
1616 let PLAYERSHARE = 400000
1717
1818 let YEARMILLIS = 31557600000
1919
2020 let WEEKMILLIS = 604800000
2121
2222 let MAXPERIOD = 156
2323
2424 let marketingAddrKey = "marketingAddr"
2525
2626 let teamAddrKey = "teamAddr"
2727
2828 let lastMarketingTimeKey = "lastClaimedTime_marketing"
2929
3030 let marketingAmountLeftKey = "marketingAmountLeft"
3131
3232 let lastTeamTimeKey = "lastClaimedTime_team"
3333
3434 let teamAmountLeftKey = "teamAmountLeft"
3535
3636 let lastActivitiesTimeKey = "lastClaimedTime_activities"
3737
3838 let actAmountLeftKey = "activitiesAmountLeft"
3939
4040 let stakersAmountLeftKey = "stakersAmountLeft"
4141
4242 func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
4343
4444
4545 let wlgIssueTimeKey = "wlg_issueTime"
4646
4747 let wlgIssuedAmountKey = "wlg_issuedAmount"
4848
4949 let idxWlgAmount = 0
5050
5151 let idxWlgPrice = 1
5252
5353 let idxWlgFunds = 2
5454
5555 let idxWlgIssueTime = 7
5656
5757 let idxWlgMarketingAmLeft = 10
5858
5959 let idxWlgMarketingAmAvailNow = 11
6060
6161 let idxWlgTeamAmLeft = 14
6262
6363 let idxWlgTeamAmAvailNow = 15
6464
6565 let idxWlgActAmLeft = 18
6666
6767 let idxWlgActAmAvailNow = 19
6868
6969 let idxWlgCurPeriod = 21
7070
7171 let idxWlgAmLeftTotal = 22
7272
7373 let idxWlgUserAmAvailNow = 25
7474
7575 let dappRest = 0
7676
7777 let dappStaking = 1
7878
7979 let dappEconomy = 2
8080
8181 let dappWlg = 4
8282
8383 let dappPuzzle = 5
8484
8585 func getPieces (userAddrStrOrEmpty,stakingContract) = {
8686 let props = split(valueOrElse(getString(stakingContract, "resTypesProportions"), "0_0_0_0_0_0"), "_")
8787 func adder (acc,item) = (acc + parseIntValue(item))
8888
8989 let totalPower = {
9090 let $l = props
9191 let $s = size($l)
9292 let $acc0 = 0
9393 func $f0_1 ($a,$i) = if (($i >= $s))
9494 then $a
9595 else adder($a, $l[$i])
9696
9797 func $f0_2 ($a,$i) = if (($i >= $s))
9898 then $a
9999 else throw("List size exceeds 6")
100100
101101 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
102102 }
103103 let usersPower = valueOrElse(getInteger(stakingContract, ("stakedPiecesByOwner_" + userAddrStrOrEmpty)), 0)
104104 [totalPower, usersPower]
105105 }
106106
107107
108108 func getWlgStats (userAddrOpt,contracts,usdtId) = {
109109 let issuedAmount = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssuedAmountKey), "WLGOLD is not issued yet")
110110 let economyUsd = assetBalance(contracts[dappEconomy], usdtId)
111111 let restUsd = assetBalance(contracts[dappRest], usdtId)
112112 let wlgUsd = assetBalance(contracts[dappWlg], usdtId)
113113 let puzzleUsd = assetBalance(contracts[dappPuzzle], usdtId)
114- let totalFundsUsd = ((economyUsd + restUsd) + wlgUsd)
114+ let totalFundsUsd = (economyUsd + wlgUsd)
115115 let wlgId = valueOrErrorMessage(getBinary(contracts[dappWlg], "wlg_assetId"), "Not initialized yet")
116116 let now = lastBlock.timestamp
117117 let issueTime = valueOrErrorMessage(getInteger(contracts[dappWlg], wlgIssueTimeKey), "Not initialized")
118118 let marketingTotal = fraction(MILLION6, MARKETINGSHARE, M6)
119119 let marketingAmountLeft = valueOrElse(getInteger(contracts[dappWlg], marketingAmountLeftKey), marketingTotal)
120120 let lastMarketingTime = valueOrElse(getInteger(contracts[dappWlg], lastMarketingTimeKey), issueTime)
121121 let marketingAddr = addressFromStringValue(value(getString(contracts[dappWlg], marketingAddrKey)))
122122 let marketingAmountAvailableNow = min([fraction(marketingTotal, (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft])
123123 let marketingWlgold = assetBalance(marketingAddr, wlgId)
124124 let teamTotal = fraction(MILLION6, TEAMSHARE, M6)
125125 let teamAmountLeft = valueOrElse(getInteger(contracts[dappWlg], teamAmountLeftKey), teamTotal)
126126 let lastTeamTime = valueOrElse(getInteger(contracts[dappWlg], lastTeamTimeKey), issueTime)
127127 let teamAddr = addressFromStringValue(value(getString(contracts[dappWlg], teamAddrKey)))
128128 let teamAmountAvailableNow = min([fraction(teamTotal, (now - lastTeamTime), (3 * YEARMILLIS)), teamAmountLeft])
129129 let teamWlgold = assetBalance(teamAddr, wlgId)
130130 let actTotal = fraction(MILLION6, ACTIVITYSHARE, M6)
131131 let actAmountLeft = valueOrElse(getInteger(contracts[dappRest], actAmountLeftKey), actTotal)
132132 let lastActivitiesTime = valueOrElse(getInteger(contracts[dappRest], lastActivitiesTimeKey), issueTime)
133133 let actAmountAvailableNow = min([fraction(actTotal, (now - lastActivitiesTime), (3 * YEARMILLIS)), actAmountLeft])
134134 let actWlgold = assetBalance(contracts[dappRest], wlgId)
135135 let lastUserTime = valueOrElse(getInteger(contracts[dappWlg], keyLastClaimedTimeByUser(userAddrOpt)), issueTime)
136136 let lastUserPeriod = ((lastUserTime - issueTime) / WEEKMILLIS)
137137 let curPeriod = ((now - issueTime) / WEEKMILLIS)
138138 let period = min([(lastUserPeriod + 1), curPeriod])
139139 let eff = getPieces(userAddrOpt, contracts[dappStaking])
140140 let totalPieces = eff[0]
141141 let amountLeftTotal = valueOrElse(getInteger(contracts[dappWlg], stakersAmountLeftKey), 0)
142142 let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - period))))
143143 let userAmount = fraction(fraction(curPeriodDistribution, eff[1], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
144144 [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]
145145 }
146146
147147
148148 func keyBlocked () = "contractsBlocked"
149149
150150
151151 let KSALLOWWLGOLD = true
152152
153153 let chain = take(drop(this.bytes, 1), 1)
154154
155155 let usdtAssetId = match chain {
156156 case _ =>
157157 if ((base58'2W' == $match0))
158158 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
159159 else if ((base58'2T' == $match0))
160160 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
161161 else throw("Unknown chain")
162162 }
163163
164164 let defaultRestAddressStr = match chain {
165165 case _ =>
166166 if ((base58'2W' == $match0))
167167 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
168168 else if ((base58'2T' == $match0))
169169 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
170170 else throw("Unknown chain")
171171 }
172172
173173 let arbitrageDelay = match chain {
174174 case _ =>
175175 if ((base58'2W' == $match0))
176176 then 600000
177177 else if ((base58'2T' == $match0))
178178 then 60000
179179 else throw("Unknown chain")
180180 }
181181
182182 let SEP = "__"
183183
184184 let MULT6 = 1000000
185185
186186 let MULT8 = 100000000
187187
188188 let MINSHOPPAYMENT = 100000
189189
190190 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
191191
192192
193193 let IdxCfgStakingDapp = 1
194194
195195 let IdxCfgEconomyDapp = 2
196196
197197 let IdxCfgGovernanceDapp = 3
198198
199199 let IdxCfgWlgDapp = 4
200200
201201 let IdxCfgPuzzlePoolDapp = 5
202202
203203 func keyRestCfg () = "%s__restConfig"
204204
205205
206206 func keyRestAddress () = "%s__restAddr"
207207
208208
209209 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
210210
211211
212212 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
213213
214214
215215 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
216216
217217 let restCfg = readRestCfgOrFail(restContract)
218218
219219 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
220220
221221 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
222222
223223 let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp)
224224
225225 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
226226
227227 let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp)
228228
229229 let wlgAssetIdKey = "wlg_assetId"
230230
231231 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet")
232232
233233 let IdxEffUser = 1
234234
235235 func keyResProportions () = "resTypesProportions"
236236
237237
238238 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
239239
240240
241241 func asInt (v) = match v {
242242 case n: Int =>
243243 n
244244 case _ =>
245245 throw("fail to cast into Int")
246246 }
247247
248248
249249 func getVotingPower (userAddrStrOrEmpty) = {
250250 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
251251 func adder (acc,item) = (acc + parseIntValue(item))
252252
253253 let totalPower = {
254254 let $l = props
255255 let $s = size($l)
256256 let $acc0 = 0
257257 func $f0_1 ($a,$i) = if (($i >= $s))
258258 then $a
259259 else adder($a, $l[$i])
260260
261261 func $f0_2 ($a,$i) = if (($i >= $s))
262262 then $a
263263 else throw("List size exceeds 6")
264264
265265 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
266266 }
267267 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
268268 [totalPower, usersPower]
269269 }
270270
271271
272272 func fixedPoint (val,decimals) = {
273273 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
274274 ((toString((val / tenPow)) + ".") + toString((val % tenPow)))
275275 }
276276
277277
278278 let A6 = 100000000
279279
280280 let B8 = 50000000
281281
282282 let profitAddrKey = "profitAddr"
283283
284284 func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
285285
286286
287287 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
288288
289289 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
290290
291291
292292 func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false))
293293 then throw("Contracts are under maintenance")
294294 else asInt(invoke(stakingContract, "saveLastTx", nil, nil))
295295
296296
297297 func getSwapLimit (addr) = {
298298 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
299299 let now = lastBlock.timestamp
300300 if ((arbitrageDelay > (now - lastTime)))
301301 then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
302302 else {
303303 let pieces = getVotingPower(addr)[IdxEffUser]
304304 let pow8 = pow(pieces, 0, B8, 8, 8, CEILING)
305305 fraction(A6, pow8, MULT8)
306306 }
307307 }
308308
309309
310310 func claimInternal (addr) = if (!(KSALLOWWLGOLD))
311311 then $Tuple2(nil, 0)
312312 else {
313313 let caller = addressFromStringValue(addr)
314314 let curStats = getWlgStats(addr, [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId)
315315 let now = lastBlock.timestamp
316316 let issueTime = curStats[idxWlgIssueTime]
317317 let marketingAmountLeft = curStats[idxWlgMarketingAmLeft]
318318 let marketingAmount = curStats[idxWlgMarketingAmAvailNow]
319319 let teamAmountLeft = curStats[idxWlgTeamAmLeft]
320320 let teamAmount = curStats[idxWlgTeamAmAvailNow]
321321 let actAmountLeft = curStats[idxWlgActAmLeft]
322322 let actAmount = curStats[idxWlgActAmAvailNow]
323323 let userTimeKey = keyLastClaimedTimeByUser(addr)
324324 if ((curStats[idxWlgCurPeriod] > (MAXPERIOD / 2)))
325325 then throw("Please modify contract for next 1.5 years, according to stats")
326326 else {
327327 let amountLeftTotal = curStats[idxWlgAmLeftTotal]
328328 let userAmount = curStats[idxWlgUserAmAvailNow]
329329 let userKey = keyStakersAmountPaidUser(addr)
330330 $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, (amountLeftTotal - userAmount)), IntegerEntry(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(teamAmountLeftKey, (teamAmountLeft - teamAmount)), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(actAmountLeftKey, (actAmountLeft - actAmount)), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], userAmount)
331331 }
332332 }
333333
334334
335335 @Callable(i)
336336 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
337337 then throw("Permission denied")
338338 else if (isDefined(getBinary(wlgAssetIdKey)))
339339 then throw("Already initialized")
340340 else {
341341 let issuedAmount = MILLION6
342342 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
343343 let assetId = calculateAssetId(issue)
344344 [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)]
345345 }
346346
347347
348348
349349 @Callable(i)
350350 func buyWlg (minAmount) = if (!(KSALLOWWLGOLD))
351351 then $Tuple2(nil, 0)
352352 else {
353353 let prologResult = prolog()
354354 if ((size(i.payments) != 1))
355355 then throw("exactly 1 payment must be attached")
356356 else {
357357 let pmt = i.payments[0]
358358 let usdtAmt = pmt.amount
359359 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
360360 if ((pmtAssetId != usdtAssetId))
361361 then throw("USDT payments only!")
362362 else {
363363 let caller = i.caller
364364 let addr = toString(caller)
365365 let maxUsdt = getSwapLimit(addr)
366366 if ((usdtAmt > maxUsdt))
367367 then throw((("You can spend max " + fixedPoint(maxUsdt, 6)) + " USDT"))
368368 else if ((MINSHOPPAYMENT > usdtAmt))
369369 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
370370 else {
371371 let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId)
372372 let curWlgAmount = curStats[idxWlgAmount]
373373 let oldFundsUsd = (curStats[idxWlgFunds] - usdtAmt)
374374 let wlgPrice = fraction(oldFundsUsd, MULT8, curWlgAmount)
375375 let buyPrice = fraction(wlgPrice, 6, 5)
376376 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
377377 if ((minAmount > wlgAmount))
378378 then throw("Price changed during operation, please try again")
379379 else {
380380 let profitAmount = (usdtAmt / 6)
381381 let deltaFunds = (usdtAmt - profitAmount)
382382 let reissued = fraction(curWlgAmount, deltaFunds, oldFundsUsd)
383383 $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)
384384 }
385385 }
386386 }
387387 }
388388 }
389389
390390
391391
392392 @Callable(i)
393393 func sellWlg (minAmount) = if (!(KSALLOWWLGOLD))
394394 then $Tuple2(nil, 0)
395395 else {
396396 let prologResult = prolog()
397397 if ((size(i.payments) != 1))
398398 then throw("exactly 1 payment must be attached")
399399 else {
400400 let pmt = i.payments[0]
401401 let wlgAmt = pmt.amount
402402 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
403403 if ((pmtAssetId != wlgAssetId))
404404 then throw("WLGOLD payments only!")
405405 else {
406406 let caller = i.caller
407407 let addr = toString(caller)
408408 let maxUsdt = getSwapLimit(addr)
409409 let curStats = getWlgStats("", [restContract, stakingContract, economyContract, govContract, wlgContract, puzzlePoolContract], usdtAssetId)
410410 let curWlgAmount = curStats[idxWlgAmount]
411411 let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
412412 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
413413 if ((usdtAmt > maxUsdt))
414414 then throw((("You can get max " + fixedPoint(maxUsdt, 6)) + " USDT"))
415415 else if ((MINSHOPPAYMENT > usdtAmt))
416416 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
417417 else if ((minAmount > usdtAmt))
418418 then throw("Price changed during operation, please try again")
419419 else {
420420 let profitAmount = (usdtAmt / 4)
421421 let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
422422 $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)
423423 }
424424 }
425425 }
426426 }
427427
428428
429429
430430 @Callable(i)
431431 func claim () = {
432432 let prologResult = prolog()
433433 let actions = claimInternal(toString(i.caller))._1
434434 $Tuple2(actions, prologResult)
435435 }
436436
437437
438438
439439 @Callable(i)
440440 func onStakeLand (addr) = if ((i.caller != stakingContract))
441441 then throw("Permission denied")
442442 else claimInternal(addr)
443443
444444
445445
446446 @Callable(i)
447447 func onUnstakeLand (addr) = if ((i.caller != stakingContract))
448448 then throw("Permission denied")
449449 else claimInternal(addr)
450450
451451

github/deemru/w8io/026f985 
48.62 ms