tx · HfWA1qkGy3M7f9EkekCsFJRPjZPD3P6P3wVDAkygCXaJ

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.01200000 Waves

2023.07.04 14:51 [2651119] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "HfWA1qkGy3M7f9EkekCsFJRPjZPD3P6P3wVDAkygCXaJ", "fee": 1200000, "feeAssetId": null, "timestamp": 1688471531715, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "4pjdPSZhFA5rrPyzxan5EFgKM2agPSmVTgwbRHaLqVXQxdZAdfZpzn9EkcJmbqqfuMv4xqnnaq4wX4ZtDssHvgRK" ], "script": "base64:BgIgCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgMKAQhGAQprZXlCbG9ja2VkAAIQY29udHJhY3RzQmxvY2tlZAALSWR4RWZmVG90YWwAAAAKSWR4RWZmVXNlcgABAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4ADmF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jYWxsZXIFB3VzZHRBbXQFC3VzZHRBc3NldElkBQNuaWwFDHByb2xvZ1Jlc3VsdAFpAQVjbGFpbQAEDHByb2xvZ1Jlc3VsdAkBBnByb2xvZwAEB2FjdGlvbnMICQENY2xhaW1JbnRlcm5hbAEJAKUIAQgFAWkGY2FsbGVyAl8xCQCUCgIFB2FjdGlvbnMFDHByb2xvZ1Jlc3VsdAFpAQtvblN0YWtlTGFuZAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAQ1jbGFpbUludGVybmFsAQUEYWRkcgFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkBDWNsYWltSW50ZXJuYWwBBQRhZGRyAG09hp8=", "height": 2651119, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4pvsduSPPvkq6HsBcFiGA9Gzbw1pTbTHKadj2MupEw9c Next: 6csyRHykhTHwkEVvRH573VLHdhuuuFSQkC8wsP9bxiUv Diff:
OldNewDifferences
264264 }
265265
266266
267-func claimInternal (caller) = {
268- let callerAddr = toString(caller)
267+func claimInternal (addr) = {
268+ let caller = addressFromStringValue(addr)
269269 let now = lastBlock.timestamp
270270 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
271271 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
280280 if ((curPeriod > (MAXPERIOD / 2)))
281281 then throw("Please modify contract for next 1.5 years, according to stats")
282282 else {
283- let eff = getVotingPower(callerAddr)
283+ let eff = getVotingPower(addr)
284284 let totalPieces = eff[IdxEffTotal]
285285 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
286286 let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod))))
287- let userTimeKey = keyLastClaimedTimeByUser(callerAddr)
287+ let userTimeKey = keyLastClaimedTimeByUser(addr)
288288 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
289289 let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
290- let userKey = keyStakersAmountPaidUser(callerAddr)
290+ let userKey = keyStakersAmountPaidUser(addr)
291291 $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)
292292 }
293293 }
387387 @Callable(i)
388388 func claim () = {
389389 let prologResult = prolog()
390- let actions = claimInternal(i.caller)._1
390+ let actions = claimInternal(toString(i.caller))._1
391391 $Tuple2(actions, prologResult)
392392 }
393393
396396 @Callable(i)
397397 func onStakeLand (addr) = if ((i.caller != stakingContract))
398398 then throw("Permission denied")
399- else claimInternal(addressFromStringValue(addr))
399+ else claimInternal(addr)
400400
401401
402402
403403 @Callable(i)
404404 func onUnstakeLand (addr) = if ((i.caller != stakingContract))
405405 then throw("Permission denied")
406- else claimInternal(addressFromStringValue(addr))
406+ else claimInternal(addr)
407407
408408
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 let MINSHOPPAYMENT = 100000
5757
5858 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
5959
6060
6161 let IdxCfgStakingDapp = 1
6262
6363 let IdxCfgEconomyDapp = 2
6464
6565 let IdxCfgWlgDapp = 4
6666
6767 let IdxCfgPuzzlePoolDapp = 5
6868
6969 func keyRestCfg () = "%s__restConfig"
7070
7171
7272 func keyRestAddress () = "%s__restAddr"
7373
7474
7575 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
7676
7777
7878 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
7979
8080
8181 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
8282
8383 let restCfg = readRestCfgOrFail(restContract)
8484
8585 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
8686
8787 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
8888
8989 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
9090
9191 let puzzlePoolContract = getContractAddressOrFail(restCfg, IdxCfgPuzzlePoolDapp)
9292
9393 let recLandSize = 1
9494
9595 func keyResProportions () = "resTypesProportions"
9696
9797
9898 func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr)
9999
100100
101101 let wlgIssuedAmountKey = "wlg_issuedAmount"
102102
103103 let wlgAssetIdKey = "wlg_assetId"
104104
105105 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "Not initialized yet")
106106
107107 let idxWlgAmount = 0
108108
109109 let idxWlgPrice = 1
110110
111111 let idxWlgFunds = 2
112112
113113 func asInt (v) = match v {
114114 case n: Int =>
115115 n
116116 case _ =>
117117 throw("fail to cast into Int")
118118 }
119119
120120
121121 func numPiecesBySize (landSize) = match landSize {
122122 case _ =>
123123 if (("S" == $match0))
124124 then SSIZE
125125 else if (("M" == $match0))
126126 then MSIZE
127127 else if (("L" == $match0))
128128 then LSIZE
129129 else if (("XL" == $match0))
130130 then XLSIZE
131131 else if (("XXL" == $match0))
132132 then XXLSIZE
133133 else throw("Unknown land size")
134134 }
135135
136136
137137 func getVotingPower (userAddrStrOrEmpty) = {
138138 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
139139 func adder (acc,item) = (acc + parseIntValue(item))
140140
141141 let totalPower = {
142142 let $l = props
143143 let $s = size($l)
144144 let $acc0 = 0
145145 func $f0_1 ($a,$i) = if (($i >= $s))
146146 then $a
147147 else adder($a, $l[$i])
148148
149149 func $f0_2 ($a,$i) = if (($i >= $s))
150150 then $a
151151 else throw("List size exceeds 6")
152152
153153 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
154154 }
155155 let usersPower = if ((userAddrStrOrEmpty == ""))
156156 then 0
157157 else {
158158 let landsStr = getString(stakingContract, keyStakedLandsByOwner(userAddrStrOrEmpty))
159159 let lands = if (isDefined(landsStr))
160160 then split_51C(value(landsStr), "_")
161161 else nil
162162 func oneLand (acc,landAssetId) = {
163163 let asset = value(assetInfo(fromBase58String(landAssetId)))
164164 let landSize = split(asset.description, "_")[recLandSize]
165165 (acc + numPiecesBySize(landSize))
166166 }
167167
168168 let $l = lands
169169 let $s = size($l)
170170 let $acc0 = 0
171171 func $f1_1 ($a,$i) = if (($i >= $s))
172172 then $a
173173 else oneLand($a, $l[$i])
174174
175175 func $f1_2 ($a,$i) = if (($i >= $s))
176176 then $a
177177 else throw("List size exceeds 100")
178178
179179 $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)
180180 }
181181 [totalPower, usersPower]
182182 }
183183
184184
185185 func getWlgStats () = {
186186 let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmountKey), "WLGOLD is not issued yet")
187187 let economyUsd = assetBalance(economyContract, usdtAssetId)
188188 let restUsd = assetBalance(restContract, usdtAssetId)
189189 let wlgUsd = assetBalance(wlgContract, usdtAssetId)
190190 let puzzleUsd = assetBalance(puzzlePoolContract, usdtAssetId)
191191 let totalFundsUsd = ((economyUsd + restUsd) + wlgUsd)
192192 [issuedAmount, fraction(totalFundsUsd, MULT8, issuedAmount), totalFundsUsd, economyUsd, restUsd, wlgUsd, puzzleUsd]
193193 }
194194
195195
196196 func fixedPoint (val,decimals) = {
197197 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
198198 ((toString((val / tenPow)) + ".") + toString((val % tenPow)))
199199 }
200200
201201
202202 let MULT14 = 100000000000000
203203
204204 let MARKETINGSHARE = 100000
205205
206206 let TEAMSHARE = 200000
207207
208208 let ACTIVITYSHARE = 100000
209209
210210 let PLAYERSHARE = 400000
211211
212212 let YEARMILLIS = 31557600000
213213
214214 let WEEKMILLIS = 604800000
215215
216216 let MAXPERIOD = 156
217217
218218 let A6 = 100000000
219219
220220 let B8 = 50000000
221221
222222 let wlgIssueTimeKey = "wlg_issueTime"
223223
224224 let marketingAddrKey = "marketingAddr"
225225
226226 let teamAddrKey = "teamAddr"
227227
228228 let profitAddrKey = "profitAddr"
229229
230230 let lastMarketingTimeKey = "lastClaimedTime_marketing"
231231
232232 let lastTeamTimeKey = "lastClaimedTime_team"
233233
234234 let lastActivitiesTimeKey = "lastClaimedTime_activities"
235235
236236 func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
237237
238238
239239 func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
240240
241241
242242 let stakersAmountLeftKey = "stakersAmountLeft"
243243
244244 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
245245
246246 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
247247
248248
249249 func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false))
250250 then throw("Contracts are under maintenance")
251251 else asInt(invoke(stakingContract, "saveLastTx", nil, nil))
252252
253253
254254 func getSwapLimit (addr) = {
255255 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
256256 let now = lastBlock.timestamp
257257 if ((arbitrageDelay > (now - lastTime)))
258258 then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
259259 else {
260260 let pieces = getVotingPower(addr)[IdxEffUser]
261261 let pow8 = pow(pieces, 0, B8, 8, 8, CEILING)
262262 fraction(A6, pow8, MULT8)
263263 }
264264 }
265265
266266
267-func claimInternal (caller) = {
268- let callerAddr = toString(caller)
267+func claimInternal (addr) = {
268+ let caller = addressFromStringValue(addr)
269269 let now = lastBlock.timestamp
270270 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
271271 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
272272 let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey)))
273273 let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS)
274274 let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime)
275275 let teamAddr = addressFromStringValue(value(getString(teamAddrKey)))
276276 let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
277277 let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime)
278278 let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
279279 let curPeriod = ((now - issueTime) / WEEKMILLIS)
280280 if ((curPeriod > (MAXPERIOD / 2)))
281281 then throw("Please modify contract for next 1.5 years, according to stats")
282282 else {
283- let eff = getVotingPower(callerAddr)
283+ let eff = getVotingPower(addr)
284284 let totalPieces = eff[IdxEffTotal]
285285 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
286286 let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod))))
287- let userTimeKey = keyLastClaimedTimeByUser(callerAddr)
287+ let userTimeKey = keyLastClaimedTimeByUser(addr)
288288 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
289289 let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
290- let userKey = keyStakersAmountPaidUser(callerAddr)
290+ let userKey = keyStakersAmountPaidUser(addr)
291291 $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)
292292 }
293293 }
294294
295295
296296 @Callable(i)
297297 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
298298 then throw("Permission denied")
299299 else if (isDefined(getBinary(wlgAssetIdKey)))
300300 then throw("Already initialized")
301301 else {
302302 let issuedAmount = MULT14
303303 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
304304 let assetId = calculateAssetId(issue)
305305 [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)]
306306 }
307307
308308
309309
310310 @Callable(i)
311311 func buyWlg (minAmount) = {
312312 let prologResult = prolog()
313313 if ((size(i.payments) != 1))
314314 then throw("exactly 1 payment must be attached")
315315 else {
316316 let pmt = i.payments[0]
317317 let usdtAmt = pmt.amount
318318 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
319319 if ((pmtAssetId != usdtAssetId))
320320 then throw("USDT payments only!")
321321 else {
322322 let caller = i.caller
323323 let addr = toString(caller)
324324 let maxUsdt = getSwapLimit(addr)
325325 if ((usdtAmt > maxUsdt))
326326 then throw((("You can spend max " + fixedPoint(maxUsdt, 6)) + " USDT"))
327327 else if ((MINSHOPPAYMENT > usdtAmt))
328328 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
329329 else {
330330 let curStats = getWlgStats()
331331 let curWlgAmount = curStats[idxWlgAmount]
332332 let oldFundsUsd = (curStats[idxWlgFunds] - usdtAmt)
333333 let wlgPrice = fraction(oldFundsUsd, MULT8, curWlgAmount)
334334 let buyPrice = fraction(wlgPrice, 6, 5)
335335 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
336336 if ((minAmount > wlgAmount))
337337 then throw("Price changed during operation, please try again")
338338 else {
339339 let profitAmount = (usdtAmt / 6)
340340 let deltaFunds = (usdtAmt - profitAmount)
341341 let reissued = fraction(curWlgAmount, deltaFunds, oldFundsUsd)
342342 $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)
343343 }
344344 }
345345 }
346346 }
347347 }
348348
349349
350350
351351 @Callable(i)
352352 func sellWlg (minAmount) = {
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 wlgAmt = pmt.amount
359359 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
360360 if ((pmtAssetId != wlgAssetId))
361361 then throw("WLGOLD payments only!")
362362 else {
363363 let caller = i.caller
364364 let addr = toString(caller)
365365 let maxUsdt = getSwapLimit(addr)
366366 let curStats = getWlgStats()
367367 let curWlgAmount = curStats[idxWlgAmount]
368368 let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
369369 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
370370 if ((usdtAmt > maxUsdt))
371371 then throw((("You can get max " + fixedPoint(maxUsdt, 6)) + " USDT"))
372372 else if ((MINSHOPPAYMENT > usdtAmt))
373373 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
374374 else if ((minAmount > usdtAmt))
375375 then throw("Price changed during operation, please try again")
376376 else {
377377 let profitAmount = (usdtAmt / 4)
378378 let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
379379 $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)
380380 }
381381 }
382382 }
383383 }
384384
385385
386386
387387 @Callable(i)
388388 func claim () = {
389389 let prologResult = prolog()
390- let actions = claimInternal(i.caller)._1
390+ let actions = claimInternal(toString(i.caller))._1
391391 $Tuple2(actions, prologResult)
392392 }
393393
394394
395395
396396 @Callable(i)
397397 func onStakeLand (addr) = if ((i.caller != stakingContract))
398398 then throw("Permission denied")
399- else claimInternal(addressFromStringValue(addr))
399+ else claimInternal(addr)
400400
401401
402402
403403 @Callable(i)
404404 func onUnstakeLand (addr) = if ((i.caller != stakingContract))
405405 then throw("Permission denied")
406- else claimInternal(addressFromStringValue(addr))
406+ else claimInternal(addr)
407407
408408

github/deemru/w8io/026f985 
78.78 ms