tx · 2gMXPUhHd9EYANm6KQ5hd9dVFQniBYQFjfNBWHurPhUq

3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg:  -0.01300000 Waves

2023.11.19 22:36 [2850697] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves

{ "type": 13, "id": "2gMXPUhHd9EYANm6KQ5hd9dVFQniBYQFjfNBWHurPhUq", "fee": 1300000, "feeAssetId": null, "timestamp": 1700422634051, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "2QhM2NGpGjGGAaFj7PYWcNjDRs4DjsdsrFjVeU63nYqn3Azh44oxmb4APjLfWNesrL5tJZHjcMExTUPSoSMjbRR9" ], "script": "base64:BgIqCAISBAoCCAESAwoBARIAEgASBAoCCAESBQoDCAEBEgMKAQESABIDCgEINQAITUlMTElPTjYAgIDpg7HeFgAJREFZTUlMTElTAIC4mSkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQRhZGRyCQCsAgICGGFjcmVzU3Rha2VkQW1vdW50QnlVc2VyXwUEYWRkcgEaa2V5QWNyZXNMb2NrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNMb2NrZWRBbW91bnRCeVVzZXJfBQRhZGRyARdrZXlBY3Jlc0xvY2tlZEV0YUJ5VXNlcgEEYWRkcgkArAICAhVhY3Jlc0xvY2tlZEV0YUJ5VXNlcl8FBGFkZHIAE2FjcmVzU3Rha2VkVG90YWxLZXkCFmFjcmVzU3Rha2VkQW1vdW50VG90YWwACnhwTmV3U0xhbmQAwJaxAgAPREFJTFlSRVNCWVBJRUNFAID40gEAFVVTRFQyQUNSRVNfTVVMVElQTElFUgAKAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0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CXRpbWVzdGFtcAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFDGNsYWltZWRBY3JlcwUMYWNyZXNBc3NldElkBQNuaWwJAJQKAgUMcHJvbG9nUmVzdWx0BQl3bGdSZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQESY2xhaW1BY3Jlc1JFQURPTkxZAQdhZGRyZXNzBAd0aW1lS2V5CQEYa2V5QWNyZXNTdGFrZWRUaW1lQnlVc2VyAQUHYWRkcmVzcwQJYW1vdW50S2V5CQEaa2V5QWNyZXNTdGFrZWRBbW91bnRCeVVzZXIBBQdhZGRyZXNzBAthY3Jlc0Ftb3VudAkBC3ZhbHVlT3JFbHNlAgkAnwgBBQlhbW91bnRLZXkAAAQIbGFzdFRpbWUJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUHdGltZUtleQAABAxjbGFpbWVkQWNyZXMJARJjbGFpbUFjcmVzSW50ZXJuYWwDBQdhZGRyZXNzBQthY3Jlc0Ftb3VudAUIbGFzdFRpbWUJAJQKAgUDbmlsCQDMCAIFDGNsYWltZWRBY3JlcwkAzAgCBQhsYXN0VGltZQUDbmlsANEFNkY=", "height": 2850697, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FQmE36qNwo3eacM5XEnJRiL3NK8U3FRYCrnBo23SdLbD Next: 37ceU5SKy3UcK963jaVgVEpCz9sWKXnLtqfQug7kvvpv Diff:
OldNewDifferences
4141 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
4242 else throw("Unknown chain")
4343 }
44+
45+let promo2MapKey = "promo2Map"
4446
4547 let SEP = "__"
4648
178180 else throw("Unknown chain")
179181 }
180182
181-let promo2MapKey = "promo2Map"
182-
183183 func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr)
184184
185185
238238
239239
240240 @Callable(i)
241-func stakeAcres () = if ((i.caller != this))
242- then throw("Temporarily disabled during promo action")
243- else {
244- let prologResult = prolog()
245- if ((prologResult == prologResult))
246- then {
247- let address = toString(i.caller)
248- if ((size(i.payments) != 1))
249- then throw("exactly 1 payment must be attached")
250- else {
251- let pmt = i.payments[0]
252- let amt = pmt.amount
253- if (if (!(isDefined(pmt.assetId)))
254- then true
255- else (value(pmt.assetId) != acresAssetId))
256- then throw("ACRES payments only!")
257- else {
258- let timeKey = keyAcresStakedTimeByUser(address)
259- let amountKey = keyAcresStakedAmountByUser(address)
260- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
261- let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
262- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
263- let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
264- $Tuple2(((((if ((claimedAcres == 0))
265- then nil
266- else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
267- }
268- }
269- }
270- else throw("Strict value is not equal to itself.")
271- }
272-
273-
274-
275-@Callable(i)
276241 func unstakeAcres (amount) = {
277242 let prologResult = prolog()
278243 if ((prologResult == prologResult))
314279
315280
316281 @Callable(i)
317-func stakeAcresLocked () = {
282+func stakeAcres () = {
318283 let prologResult = prolog()
319284 if ((prologResult == prologResult))
320285 then {
328293 then true
329294 else (value(pmt.assetId) != acresAssetId))
330295 then throw("ACRES payments only!")
331- else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
332- then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
333- else {
334- let now = lastBlock.timestamp
335- if ((PROMO_2_START_TIMESTAMP > now))
336- then throw("Promo2 is not started yet")
337- else if ((now > PROMO_2_END_TIMESTAMP))
338- then throw("Promo2 is already finished")
339- else {
340- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
341- if ((wlgResult == wlgResult))
342- then {
343- let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
344- let promo2Map = valueOrElse(getString(promo2MapKey), "")
345- let newMap2 = if (contains(promo2Map, address))
346- then {
347- let parts = split_51C(promo2Map, address)
348- let oldAmount = parseIntValue(take(drop(parts[1], 1), 14))
349- ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15))
350- }
351- else {
352- let finalPart = ((address + ":") + padL(amt, 14))
353- if ((promo2Map == ""))
354- then finalPart
355- else ((promo2Map + "_") + finalPart)
356- }
357- $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult))
358- }
359- else throw("Strict value is not equal to itself.")
296+ else {
297+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
298+ if ((wlgResult == wlgResult))
299+ then {
300+ let now = lastBlock.timestamp
301+ if (if ((PROMO_2_START_TIMESTAMP > now))
302+ then true
303+ else (now > PROMO_2_END_TIMESTAMP))
304+ then {
305+ let timeKey = keyAcresStakedTimeByUser(address)
306+ let amountKey = keyAcresStakedAmountByUser(address)
307+ let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
308+ let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
309+ let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
310+ $Tuple2(((((if ((claimedAcres == 0))
311+ then nil
312+ else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
360313 }
361- }
314+ else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
315+ then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
316+ else {
317+ let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
318+ let promo2Map = valueOrElse(getString(promo2MapKey), "")
319+ let newMap2 = if (contains(promo2Map, address))
320+ then {
321+ let parts = split_51C(promo2Map, address)
322+ let oldAmount = parseIntValue(take(drop(parts[1], 1), 14))
323+ ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15))
324+ }
325+ else {
326+ let finalPart = ((address + ":") + padL(amt, 14))
327+ if ((promo2Map == ""))
328+ then finalPart
329+ else ((promo2Map + "_") + finalPart)
330+ }
331+ $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult))
332+ }
333+ }
334+ else throw("Strict value is not equal to itself.")
335+ }
362336 }
363337 }
364338 else throw("Strict value is not equal to itself.")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MILLION6 = 100000000000000
55
66 let DAYMILLIS = 86400000
77
88 func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr)
99
1010
1111 func keyAcresLockedAmountByUser (addr) = ("acresLockedAmountByUser_" + addr)
1212
1313
1414 func keyAcresLockedEtaByUser (addr) = ("acresLockedEtaByUser_" + addr)
1515
1616
1717 let acresStakedTotalKey = "acresStakedAmountTotal"
1818
1919 let xpNewSLand = 5000000
2020
2121 let DAILYRESBYPIECE = 3456000
2222
2323 let USDT2ACRES_MULTIPLIER = 10
2424
2525 let chain = take(drop(this.bytes, 1), 1)
2626
2727 let usdtAssetId = match chain {
2828 case _ =>
2929 if ((base58'2W' == $match0))
3030 then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi'
3131 else if ((base58'2T' == $match0))
3232 then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63'
3333 else throw("Unknown chain")
3434 }
3535
3636 let defaultRestAddressStr = match chain {
3737 case _ =>
3838 if ((base58'2W' == $match0))
3939 then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv"
4040 else if ((base58'2T' == $match0))
4141 then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy"
4242 else throw("Unknown chain")
4343 }
44+
45+let promo2MapKey = "promo2Map"
4446
4547 let SEP = "__"
4648
4749 let MULT6 = 1000000
4850
4951 let MULT8 = 100000000
5052
5153 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
5254
5355
5456 let IdxCfgStakingDapp = 1
5557
5658 let IdxCfgEconomyDapp = 2
5759
5860 let IdxCfgWlgDapp = 4
5961
6062 let IdxCfgAcresDapp = 8
6163
6264 func keyRestCfg () = "%s__restConfig"
6365
6466
6567 func keyRestAddress () = "%s__restAddr"
6668
6769
6870 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
6971
7072
7173 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
7274
7375
7476 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
7577
7678 let restCfg = readRestCfgOrFail(restContract)
7779
7880 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
7981
8082 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
8183
8284 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
8385
8486 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
8587
8688 let acresIssuedAmountKey = "acresIssuedAmount"
8789
8890 let acresAssetIdKey = "acresAssetId"
8991
9092 let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet")
9193
9294 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
9395
9496
9597 let IdxEffTotal = 0
9698
9799 func keyResProportions () = "resTypesProportions"
98100
99101
100102 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
101103
102104
103105 func asInt (v) = match v {
104106 case n: Int =>
105107 n
106108 case _ =>
107109 throw("fail to cast into Int")
108110 }
109111
110112
111113 func asTwoIntsTuple (val) = match val {
112114 case t2: (Int, Int) =>
113115 t2
114116 case _ =>
115117 throw("fail to cast into (Int, Int)")
116118 }
117119
118120
119121 func getVotingPower (userAddrStrOrEmpty) = {
120122 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
121123 func adder (acc,item) = (acc + parseIntValue(item))
122124
123125 let totalPower = {
124126 let $l = props
125127 let $s = size($l)
126128 let $acc0 = 0
127129 func $f0_1 ($a,$i) = if (($i >= $s))
128130 then $a
129131 else adder($a, $l[$i])
130132
131133 func $f0_2 ($a,$i) = if (($i >= $s))
132134 then $a
133135 else throw("List size exceeds 6")
134136
135137 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
136138 }
137139 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
138140 [totalPower, usersPower]
139141 }
140142
141143
142144 func fixedPoint (val,decimals) = {
143145 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
144146 let lowPart = toString((val % tenPow))
145147 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
146148 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
147149 }
148150
149151
150152 func padL (val,len) = {
151153 let valS = toString(val)
152154 let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1)
153155 (zeroes + valS)
154156 }
155157
156158
157159 let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000
158160
159161 let BLACKLISTED1 = "3P2NGX4Q5nge1MCauwQW5aqYLdkccSGj1Ep_3P2xFAHW9yhyNohYozWd4HFhEXZu3bsNSoR_3P2yKaZ2gvn9Xe5tti81a7P9LZhHgjvToV9_3P37zQ3cf2ecu55RmJqEiGSivdzN9avt3m9_3P4az6dtzsvGCWFAxa94UdevKzXyEwxEiFG_3P4kZU6X3TTLFcSUe55JSy8BySqitcPgMBz_3P5hCxBEh3NgNizZhNBreyBSqtbhJYLkKPD_3P7HLvucy11yxyMJUwjzXFHHKMEDwi1EwfC_3P8JuaqH9PTQAv8D5HBGgQfKauLTYt2NQft_3P9gTDB4rtDEVbpX3asU63H4Zinh2EnTmZE_3P9iN3qrtfJicUVy7amZeVsetVD3vUMk8be_3PCa2BsAa6JBLirszQfV5r9fJrujfhwtwfP_3PD3i4XN8KtygcFx4ry5M7UGqdfH8VYvtRT_3PDEMnnJNc2kx9cPEmvVvhXUr8SvhANKhsa_3PDGE9tKQizaeZFeDDq5aYSv89nwYbfirpZ_3PDMKQTCrUPZECVXEJJ8m1sHtutSu1naSf1_3PGh2Qu6Yvx8GTCRRVNvBUVZLdaidYSaxo5_3PKkmAtbSK5D2hQdo1RfEg8eXyMbDcRUc92_3PLMnbxzssP8W8E8XjJ1RLBBg8UZL8Cz3P2_3PMuxo4PCAox9s4a7R1eszh4iqqu8gS7jHv_3PNrMtEQChw87WZU1JAJ7aGHykCa8TjnDNK_3PPuBXfWoBy3EEory7c7vgi9Usjka7o5tBj_3PQwyeyEhT4Y6aGAL6tg73aQWJtV1zRt3nR_3PRGDShuMGb84MJtTJvtTg8qDfswkYWcm3e"
160162
161163 let PROMO1_AMOUNT = 4970178
162164
163165 let PROMO_2_START_TIMESTAMP = match chain {
164166 case _ =>
165167 if ((base58'2W' == $match0))
166168 then 1700524800000
167169 else if ((base58'2T' == $match0))
168170 then 1700420400000
169171 else throw("Unknown chain")
170172 }
171173
172174 let PROMO_2_END_TIMESTAMP = match chain {
173175 case _ =>
174176 if ((base58'2W' == $match0))
175177 then 1701043199999
176178 else if ((base58'2T' == $match0))
177179 then 1700496000000
178180 else throw("Unknown chain")
179181 }
180182
181-let promo2MapKey = "promo2Map"
182-
183183 func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr)
184184
185185
186186 func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
187187
188188
189189 func claimAcresInternal (addr,acresAmount,lastClaimTime) = {
190190 let deltaTime = (lastBlock.timestamp - lastClaimTime)
191191 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
192192 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
193193 let gotUsdt = max([0, canGetUsdt])
194194 (gotUsdt * USDT2ACRES_MULTIPLIER)
195195 }
196196
197197
198198 func claimInternal (addr,acresAmount,lastClaimTime) = {
199199 let deltaTime = (lastBlock.timestamp - lastClaimTime)
200200 if ((0 > deltaTime))
201201 then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp)))
202202 else {
203203 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
204204 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
205205 let gotUsdt = if ((0 >= canGetUsdt))
206206 then 0
207207 else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1
208208 (gotUsdt * USDT2ACRES_MULTIPLIER)
209209 }
210210 }
211211
212212
213213 func mergeLocked (oldAmount,oldETA,newAmount,newETA) = {
214214 let now = lastBlock.timestamp
215215 let dt1 = max([0, (oldETA - now)])
216216 let dt2 = max([0, (newETA - now)])
217217 let sum = (oldAmount + newAmount)
218218 let dt = if ((sum == 0))
219219 then 0
220220 else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum))
221221 (now + dt)
222222 }
223223
224224
225225 @Callable(i)
226226 func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this))
227227 then throw("Permission denied")
228228 else if (isDefined(getBinary(acresAssetIdKey)))
229229 then throw("Already initialized")
230230 else {
231231 let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces)
232232 let issuedAmount = (MILLION6 - (nftAcres * MULT8))
233233 let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0)
234234 let assetId = calculateAssetId(issue)
235235 [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)]
236236 }
237237
238238
239239
240240 @Callable(i)
241-func stakeAcres () = if ((i.caller != this))
242- then throw("Temporarily disabled during promo action")
243- else {
244- let prologResult = prolog()
245- if ((prologResult == prologResult))
246- then {
247- let address = toString(i.caller)
248- if ((size(i.payments) != 1))
249- then throw("exactly 1 payment must be attached")
250- else {
251- let pmt = i.payments[0]
252- let amt = pmt.amount
253- if (if (!(isDefined(pmt.assetId)))
254- then true
255- else (value(pmt.assetId) != acresAssetId))
256- then throw("ACRES payments only!")
257- else {
258- let timeKey = keyAcresStakedTimeByUser(address)
259- let amountKey = keyAcresStakedAmountByUser(address)
260- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
261- let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
262- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
263- let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
264- $Tuple2(((((if ((claimedAcres == 0))
265- then nil
266- else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
267- }
268- }
269- }
270- else throw("Strict value is not equal to itself.")
271- }
272-
273-
274-
275-@Callable(i)
276241 func unstakeAcres (amount) = {
277242 let prologResult = prolog()
278243 if ((prologResult == prologResult))
279244 then if ((0 >= amount))
280245 then throw("Amount should be positive")
281246 else {
282247 let address = toString(i.caller)
283248 if ((size(i.payments) != 0))
284249 then throw("No payments required")
285250 else {
286251 let timeKey = keyAcresStakedTimeByUser(address)
287252 let amountKey = keyAcresStakedAmountByUser(address)
288253 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
289254 if ((amount > oldAcresAmount))
290255 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
291256 else {
292257 let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0)
293258 let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0)
294259 let now = lastBlock.timestamp
295260 let unstakableAmount = if (isBlacklistedPromo1(address))
296261 then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT)
297262 else (oldAcresAmount - lockedAmount)
298263 if (if ((lockedETA > now))
299264 then (amount > unstakableAmount)
300265 else false)
301266 then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA)))
302267 else {
303268 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
304269 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
305270 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
306271 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult))
307272 }
308273 }
309274 }
310275 }
311276 else throw("Strict value is not equal to itself.")
312277 }
313278
314279
315280
316281 @Callable(i)
317-func stakeAcresLocked () = {
282+func stakeAcres () = {
318283 let prologResult = prolog()
319284 if ((prologResult == prologResult))
320285 then {
321286 let address = toString(i.caller)
322287 if ((size(i.payments) != 1))
323288 then throw("exactly 1 payment must be attached")
324289 else {
325290 let pmt = i.payments[0]
326291 let amt = pmt.amount
327292 if (if (!(isDefined(pmt.assetId)))
328293 then true
329294 else (value(pmt.assetId) != acresAssetId))
330295 then throw("ACRES payments only!")
331- else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
332- then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
333- else {
334- let now = lastBlock.timestamp
335- if ((PROMO_2_START_TIMESTAMP > now))
336- then throw("Promo2 is not started yet")
337- else if ((now > PROMO_2_END_TIMESTAMP))
338- then throw("Promo2 is already finished")
339- else {
340- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
341- if ((wlgResult == wlgResult))
342- then {
343- let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
344- let promo2Map = valueOrElse(getString(promo2MapKey), "")
345- let newMap2 = if (contains(promo2Map, address))
346- then {
347- let parts = split_51C(promo2Map, address)
348- let oldAmount = parseIntValue(take(drop(parts[1], 1), 14))
349- ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15))
350- }
351- else {
352- let finalPart = ((address + ":") + padL(amt, 14))
353- if ((promo2Map == ""))
354- then finalPart
355- else ((promo2Map + "_") + finalPart)
356- }
357- $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult))
358- }
359- else throw("Strict value is not equal to itself.")
296+ else {
297+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
298+ if ((wlgResult == wlgResult))
299+ then {
300+ let now = lastBlock.timestamp
301+ if (if ((PROMO_2_START_TIMESTAMP > now))
302+ then true
303+ else (now > PROMO_2_END_TIMESTAMP))
304+ then {
305+ let timeKey = keyAcresStakedTimeByUser(address)
306+ let amountKey = keyAcresStakedAmountByUser(address)
307+ let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
308+ let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
309+ let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
310+ $Tuple2(((((if ((claimedAcres == 0))
311+ then nil
312+ else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
360313 }
361- }
314+ else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
315+ then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
316+ else {
317+ let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
318+ let promo2Map = valueOrElse(getString(promo2MapKey), "")
319+ let newMap2 = if (contains(promo2Map, address))
320+ then {
321+ let parts = split_51C(promo2Map, address)
322+ let oldAmount = parseIntValue(take(drop(parts[1], 1), 14))
323+ ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15))
324+ }
325+ else {
326+ let finalPart = ((address + ":") + padL(amt, 14))
327+ if ((promo2Map == ""))
328+ then finalPart
329+ else ((promo2Map + "_") + finalPart)
330+ }
331+ $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult))
332+ }
333+ }
334+ else throw("Strict value is not equal to itself.")
335+ }
362336 }
363337 }
364338 else throw("Strict value is not equal to itself.")
365339 }
366340
367341
368342
369343 @Callable(i)
370344 func buyAcres () = {
371345 let prologResult = prolog()
372346 if ((prologResult == prologResult))
373347 then {
374348 let address = toString(i.caller)
375349 if ((size(i.payments) != 1))
376350 then throw("exactly 1 payment must be attached")
377351 else {
378352 let pmt = i.payments[0]
379353 let amt = pmt.amount
380354 if (if (!(isDefined(pmt.assetId)))
381355 then true
382356 else (value(pmt.assetId) != usdtAssetId))
383357 then throw("USDT payments only!")
384358 else if ((MULT6 > amt))
385359 then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
386360 else {
387361 let acresAmount = (amt * USDT2ACRES_MULTIPLIER)
388362 let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil))
389363 $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult))
390364 }
391365 }
392366 }
393367 else throw("Strict value is not equal to itself.")
394368 }
395369
396370
397371
398372 @Callable(i)
399373 func sendAcres (addr,amount) = if ((i.caller != economyContract))
400374 then throw("Permission denied")
401375 else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount)
402376
403377
404378
405379 @Callable(i)
406380 func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this))
407381 then (i.caller != restContract)
408382 else false)
409383 then throw("Permission denied")
410384 else {
411385 let now = lastBlock.timestamp
412386 let timeKey = keyAcresStakedTimeByUser(addr)
413387 let amountKey = keyAcresStakedAmountByUser(addr)
414388 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
415389 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
416390 let oldTime = valueOrElse(getInteger(timeKey), now)
417391 let etaKey = keyAcresLockedEtaByUser(addr)
418392 let lockedAmountKey = keyAcresLockedAmountByUser(addr)
419393 let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0)
420394 let oldLockedETA = valueOrElse(getInteger(etaKey), 0)
421395 let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS)))
422396 $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount)
423397 }
424398
425399
426400
427401 @Callable(i)
428402 func burnAcres (amount) = if ((i.caller != stakingContract))
429403 then throw("Permission denied")
430404 else {
431405 let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount)
432406 if ((0 > amountLeft))
433407 then throw("Attempt to burn more ACRES, than exists")
434408 else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount)
435409 }
436410
437411
438412
439413 @Callable(i)
440414 func claimAcres () = {
441415 let prologResult = prolog()
442416 if ((prologResult == prologResult))
443417 then {
444418 let address = toString(i.caller)
445419 if ((size(i.payments) != 0))
446420 then throw("No payments required")
447421 else {
448422 let timeKey = keyAcresStakedTimeByUser(address)
449423 let amountKey = keyAcresStakedAmountByUser(address)
450424 let acresAmount = valueOrElse(getInteger(amountKey), 0)
451425 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
452426 let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0))
453427 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult))
454428 }
455429 }
456430 else throw("Strict value is not equal to itself.")
457431 }
458432
459433
460434
461435 @Callable(i)
462436 func claimAcresREADONLY (address) = {
463437 let timeKey = keyAcresStakedTimeByUser(address)
464438 let amountKey = keyAcresStakedAmountByUser(address)
465439 let acresAmount = valueOrElse(getInteger(amountKey), 0)
466440 let lastTime = valueOrElse(getInteger(timeKey), 0)
467441 let claimedAcres = claimAcresInternal(address, acresAmount, lastTime)
468442 $Tuple2(nil, [claimedAcres, lastTime])
469443 }
470444
471445

github/deemru/w8io/169f3d6 
48.66 ms