tx · 6csyRHykhTHwkEVvRH573VLHdhuuuFSQkC8wsP9bxiUv

3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy:  -0.01200000 Waves

2023.07.05 22:18 [2653022] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves

{ "type": 13, "id": "6csyRHykhTHwkEVvRH573VLHdhuuuFSQkC8wsP9bxiUv", "fee": 1200000, "feeAssetId": null, "timestamp": 1688584827534, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "61BpgGMw3DuH7QryfRRJ7DuviaaHCCyLgHCaYviELRNnLCyRumMdLsF668WHtxdpmajfJWzKMmRV7geaYxT28i3a" ], "script": "base64:BgIgCAISBgoECAgICBIDCgEBEgMKAQESABIDCgEIEgMKAQhHAQprZXlCbG9ja2VkAAIQY29udHJhY3RzQmxvY2tlZAALSWR4RWZmVG90YWwAAAAKSWR4RWZmVXNlcgABAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4ADmFyYml0cmFnZURlbG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gUSd2xnSXNzdWVkQW1vdW50S2V5CQBlAgUMY3VyV2xnQW1vdW50BQZidXJuZWQJAMwIAgkBDEludGVnZXJFbnRyeQIJARRrZXlMYXN0QXJiVGltZUJ5VXNlcgEFBGFkZHIIBQlsYXN0QmxvY2sJdGltZXN0YW1wCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEJAKIIAQUNcHJvZml0QWRkcktleQUMcHJvZml0QW1vdW50BQt1c2R0QXNzZXRJZAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDBQZjYWxsZXIFB3VzZHRBbXQFC3VzZHRBc3NldElkBQNuaWwFDHByb2xvZ1Jlc3VsdAFpAQVjbGFpbQAEDHByb2xvZ1Jlc3VsdAkBBnByb2xvZwAEB2FjdGlvbnMICQENY2xhaW1JbnRlcm5hbAEJAKUIAQgFAWkGY2FsbGVyAl8xCQCUCgIFB2FjdGlvbnMFDHByb2xvZ1Jlc3VsdAFpAQtvblN0YWtlTGFuZAEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgUPc3Rha2luZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJAQ1jbGFpbUludGVybmFsAQUEYWRkcgFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkBDWNsYWltSW50ZXJuYWwBBQRhZGRyAOeqKPY=", "height": 2653022, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HfWA1qkGy3M7f9EkekCsFJRPjZPD3P6P3wVDAkygCXaJ Next: 9vVcraNaAcbrA8GaUbMps37NyWrXPZUgjBiRDx7N37Vf Diff:
OldNewDifferences
199199 }
200200
201201
202-let MULT14 = 100000000000000
202+let MILLION6 = 100000000000000
203203
204204 let MARKETINGSHARE = 100000
205205
228228 let profitAddrKey = "profitAddr"
229229
230230 let lastMarketingTimeKey = "lastClaimedTime_marketing"
231+
232+let marketingAmountLeftKey = "marketingAmountLeft"
231233
232234 let lastTeamTimeKey = "lastClaimedTime_team"
233235
268270 let caller = addressFromStringValue(addr)
269271 let now = lastBlock.timestamp
270272 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
273+ let marketingAmountLeft = valueOrElse(getInteger(marketingAmountLeftKey), 0)
271274 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
272275 let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey)))
273- let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS)
276+ let marketingAmount = min([fraction(fraction(MILLION6, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft])
274277 let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime)
275278 let teamAddr = addressFromStringValue(value(getString(teamAddrKey)))
276- let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
279+ let teamAmount = fraction(fraction(MILLION6, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
277280 let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime)
278- let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
281+ let actAmount = fraction(fraction(MILLION6, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
279282 let curPeriod = ((now - issueTime) / WEEKMILLIS)
280283 if ((curPeriod > (MAXPERIOD / 2)))
281284 then throw("Please modify contract for next 1.5 years, according to stats")
288291 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
289292 let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
290293 let userKey = keyStakersAmountPaidUser(addr)
291- $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)
294+ $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(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], userAmount)
292295 }
293296 }
294297
299302 else if (isDefined(getBinary(wlgAssetIdKey)))
300303 then throw("Already initialized")
301304 else {
302- let issuedAmount = MULT14
305+ let issuedAmount = MILLION6
303306 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
304307 let assetId = calculateAssetId(issue)
305-[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)]
308+[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)]
306309 }
307310
308311
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
202-let MULT14 = 100000000000000
202+let MILLION6 = 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"
231+
232+let marketingAmountLeftKey = "marketingAmountLeft"
231233
232234 let lastTeamTimeKey = "lastClaimedTime_team"
233235
234236 let lastActivitiesTimeKey = "lastClaimedTime_activities"
235237
236238 func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr)
237239
238240
239241 func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr)
240242
241243
242244 let stakersAmountLeftKey = "stakersAmountLeft"
243245
244246 let stakersAmountPaidTotalKey = "stakersAmountPaidTotal"
245247
246248 func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr)
247249
248250
249251 func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false))
250252 then throw("Contracts are under maintenance")
251253 else asInt(invoke(stakingContract, "saveLastTx", nil, nil))
252254
253255
254256 func getSwapLimit (addr) = {
255257 let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0)
256258 let now = lastBlock.timestamp
257259 if ((arbitrageDelay > (now - lastTime)))
258260 then throw((("Arbitrages are possible once a " + toString((arbitrageDelay / 60000))) + "min"))
259261 else {
260262 let pieces = getVotingPower(addr)[IdxEffUser]
261263 let pow8 = pow(pieces, 0, B8, 8, 8, CEILING)
262264 fraction(A6, pow8, MULT8)
263265 }
264266 }
265267
266268
267269 func claimInternal (addr) = {
268270 let caller = addressFromStringValue(addr)
269271 let now = lastBlock.timestamp
270272 let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized")
273+ let marketingAmountLeft = valueOrElse(getInteger(marketingAmountLeftKey), 0)
271274 let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime)
272275 let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey)))
273- let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS)
276+ let marketingAmount = min([fraction(fraction(MILLION6, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS), marketingAmountLeft])
274277 let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime)
275278 let teamAddr = addressFromStringValue(value(getString(teamAddrKey)))
276- let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
279+ let teamAmount = fraction(fraction(MILLION6, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS))
277280 let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime)
278- let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
281+ let actAmount = fraction(fraction(MILLION6, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS))
279282 let curPeriod = ((now - issueTime) / WEEKMILLIS)
280283 if ((curPeriod > (MAXPERIOD / 2)))
281284 then throw("Please modify contract for next 1.5 years, according to stats")
282285 else {
283286 let eff = getVotingPower(addr)
284287 let totalPieces = eff[IdxEffTotal]
285288 let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0)
286289 let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod))))
287290 let userTimeKey = keyLastClaimedTimeByUser(addr)
288291 let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime)
289292 let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS))
290293 let userKey = keyStakersAmountPaidUser(addr)
291- $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)
294+ $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(marketingAmountLeftKey, (marketingAmountLeft - marketingAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], userAmount)
292295 }
293296 }
294297
295298
296299 @Callable(i)
297300 func constructorV1 (restAddr,marketingAddr,teamAddr,profitAddr) = if ((i.caller != this))
298301 then throw("Permission denied")
299302 else if (isDefined(getBinary(wlgAssetIdKey)))
300303 then throw("Already initialized")
301304 else {
302- let issuedAmount = MULT14
305+ let issuedAmount = MILLION6
303306 let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0)
304307 let assetId = calculateAssetId(issue)
305-[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)]
308+[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)]
306309 }
307310
308311
309312
310313 @Callable(i)
311314 func buyWlg (minAmount) = {
312315 let prologResult = prolog()
313316 if ((size(i.payments) != 1))
314317 then throw("exactly 1 payment must be attached")
315318 else {
316319 let pmt = i.payments[0]
317320 let usdtAmt = pmt.amount
318321 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
319322 if ((pmtAssetId != usdtAssetId))
320323 then throw("USDT payments only!")
321324 else {
322325 let caller = i.caller
323326 let addr = toString(caller)
324327 let maxUsdt = getSwapLimit(addr)
325328 if ((usdtAmt > maxUsdt))
326329 then throw((("You can spend max " + fixedPoint(maxUsdt, 6)) + " USDT"))
327330 else if ((MINSHOPPAYMENT > usdtAmt))
328331 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
329332 else {
330333 let curStats = getWlgStats()
331334 let curWlgAmount = curStats[idxWlgAmount]
332335 let oldFundsUsd = (curStats[idxWlgFunds] - usdtAmt)
333336 let wlgPrice = fraction(oldFundsUsd, MULT8, curWlgAmount)
334337 let buyPrice = fraction(wlgPrice, 6, 5)
335338 let wlgAmount = fraction(usdtAmt, MULT8, buyPrice)
336339 if ((minAmount > wlgAmount))
337340 then throw("Price changed during operation, please try again")
338341 else {
339342 let profitAmount = (usdtAmt / 6)
340343 let deltaFunds = (usdtAmt - profitAmount)
341344 let reissued = fraction(curWlgAmount, deltaFunds, oldFundsUsd)
342345 $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)
343346 }
344347 }
345348 }
346349 }
347350 }
348351
349352
350353
351354 @Callable(i)
352355 func sellWlg (minAmount) = {
353356 let prologResult = prolog()
354357 if ((size(i.payments) != 1))
355358 then throw("exactly 1 payment must be attached")
356359 else {
357360 let pmt = i.payments[0]
358361 let wlgAmt = pmt.amount
359362 let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment")
360363 if ((pmtAssetId != wlgAssetId))
361364 then throw("WLGOLD payments only!")
362365 else {
363366 let caller = i.caller
364367 let addr = toString(caller)
365368 let maxUsdt = getSwapLimit(addr)
366369 let curStats = getWlgStats()
367370 let curWlgAmount = curStats[idxWlgAmount]
368371 let sellPrice = fraction(curStats[idxWlgPrice], 4, 5)
369372 let usdtAmt = fraction(wlgAmt, sellPrice, MULT8)
370373 if ((usdtAmt > maxUsdt))
371374 then throw((("You can get max " + fixedPoint(maxUsdt, 6)) + " USDT"))
372375 else if ((MINSHOPPAYMENT > usdtAmt))
373376 then throw((("You can trade min " + fixedPoint(MINSHOPPAYMENT, 6)) + " USDT"))
374377 else if ((minAmount > usdtAmt))
375378 then throw("Price changed during operation, please try again")
376379 else {
377380 let profitAmount = (usdtAmt / 4)
378381 let burned = fraction((usdtAmt + profitAmount), curWlgAmount, curStats[idxWlgFunds])
379382 $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)
380383 }
381384 }
382385 }
383386 }
384387
385388
386389
387390 @Callable(i)
388391 func claim () = {
389392 let prologResult = prolog()
390393 let actions = claimInternal(toString(i.caller))._1
391394 $Tuple2(actions, prologResult)
392395 }
393396
394397
395398
396399 @Callable(i)
397400 func onStakeLand (addr) = if ((i.caller != stakingContract))
398401 then throw("Permission denied")
399402 else claimInternal(addr)
400403
401404
402405
403406 @Callable(i)
404407 func onUnstakeLand (addr) = if ((i.caller != stakingContract))
405408 then throw("Permission denied")
406409 else claimInternal(addr)
407410
408411

github/deemru/w8io/026f985 
110.40 ms