tx · E2JN3F1oqYzoP5pTv4TtpwMPbvRbYFbCHmniF6ijiSig

3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg:  -0.01200000 Waves

2023.11.19 18:52 [2850466] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves

{ "type": 13, "id": "E2JN3F1oqYzoP5pTv4TtpwMPbvRbYFbCHmniF6ijiSig", "fee": 1200000, "feeAssetId": null, "timestamp": 1700409143157, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "2xMJZfoQMHuneZUxUsCPbEwvqRGwUTeyzPPcjfKbKNvB4FNTnoGw6YuMX3HrwJyHoz8k2c7kvXfM3BQE3ZzJWbCJ" ], "script": "base64:BgIsCAISBAoCCAESABIDCgEBEgASABIECgIIARIFCgMIAQESAwoBARIAEgMKAQguAAhNSUxMSU9ONgCAgOmDsd4WAAlEQVlNSUxMSVMAgLiZKQEaa2V5QWNyZXNTdGFrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNTdGFrZWRBbW91bnRCeVVzZXJfBQRhZGRyARprZXlBY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcgEEYWRkcgkArAICAhhhY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcl8FBGFkZHIBF2tleUFjcmVzTG9ja2VkRXRhQnlVc2VyAQRhZGRyCQCsAgICFWFjcmVzTG9ja2VkRXRhQnlVc2VyXwUEYWRkcgATYWNyZXNTdGFrZWRUb3RhbEtleQIWYWNyZXNTdGFrZWRBbW91bnRUb3RhbAAKeHBOZXdTTGFuZADAlrECAA9EQUlMWVJFU0JZUElFQ0UAgPjSAQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1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ldNewDifferences
147147 }
148148
149149
150+let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000
151+
150152 func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
151153
152154
202204
203205
204206 @Callable(i)
205-func stakeAcres () = {
206- let prologResult = prolog()
207- if ((prologResult == prologResult))
208- then {
209- let address = toString(i.caller)
210- if ((size(i.payments) != 1))
211- then throw("exactly 1 payment must be attached")
212- else {
213- let pmt = i.payments[0]
214- let amt = pmt.amount
215- if (if (!(isDefined(pmt.assetId)))
216- then true
217- else (value(pmt.assetId) != acresAssetId))
218- then throw("ACRES payments only!")
219- else {
220- let timeKey = keyAcresStakedTimeByUser(address)
221- let amountKey = keyAcresStakedAmountByUser(address)
222- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
223- let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
224- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
225- let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
226- $Tuple2(((((if ((claimedAcres == 0))
227- then nil
228- else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
229- }
230- }
231- }
232- else throw("Strict value is not equal to itself.")
233- }
207+func stakeAcres () = if ((i.caller != this))
208+ then throw("Temporarily disabled during promo action")
209+ else {
210+ let prologResult = prolog()
211+ if ((prologResult == prologResult))
212+ then {
213+ let address = toString(i.caller)
214+ if ((size(i.payments) != 1))
215+ then throw("exactly 1 payment must be attached")
216+ else {
217+ let pmt = i.payments[0]
218+ let amt = pmt.amount
219+ if (if (!(isDefined(pmt.assetId)))
220+ then true
221+ else (value(pmt.assetId) != acresAssetId))
222+ then throw("ACRES payments only!")
223+ else {
224+ let timeKey = keyAcresStakedTimeByUser(address)
225+ let amountKey = keyAcresStakedAmountByUser(address)
226+ let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
227+ let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
228+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
229+ let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
230+ $Tuple2(((((if ((claimedAcres == 0))
231+ then nil
232+ else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
233+ }
234+ }
235+ }
236+ else throw("Strict value is not equal to itself.")
237+ }
234238
235239
236240
268272 }
269273 }
270274 }
275+ else throw("Strict value is not equal to itself.")
276+ }
277+
278+
279+
280+@Callable(i)
281+func stakeAcresLocked () = {
282+ let prologResult = prolog()
283+ if ((prologResult == prologResult))
284+ then {
285+ let address = toString(i.caller)
286+ if ((size(i.payments) != 1))
287+ then throw("exactly 1 payment must be attached")
288+ else {
289+ let pmt = i.payments[0]
290+ let amt = pmt.amount
291+ if (if (!(isDefined(pmt.assetId)))
292+ then true
293+ else (value(pmt.assetId) != acresAssetId))
294+ then throw("ACRES payments only!")
295+ else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
296+ then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
297+ else {
298+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
299+ if ((wlgResult == wlgResult))
300+ then {
301+ let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
302+ $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult))
303+ }
304+ else throw("Strict value is not equal to itself.")
305+ }
306+ }
307+ }
271308 else throw("Strict value is not equal to itself.")
272309 }
273310
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 }
4444
4545 let SEP = "__"
4646
4747 let MULT6 = 1000000
4848
4949 let MULT8 = 100000000
5050
5151 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
5252
5353
5454 let IdxCfgStakingDapp = 1
5555
5656 let IdxCfgEconomyDapp = 2
5757
5858 let IdxCfgWlgDapp = 4
5959
6060 let IdxCfgAcresDapp = 8
6161
6262 func keyRestCfg () = "%s__restConfig"
6363
6464
6565 func keyRestAddress () = "%s__restAddr"
6666
6767
6868 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
6969
7070
7171 func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
7272
7373
7474 let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr))
7575
7676 let restCfg = readRestCfgOrFail(restContract)
7777
7878 let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp)
7979
8080 let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp)
8181
8282 let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp)
8383
8484 let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp)
8585
8686 let acresIssuedAmountKey = "acresIssuedAmount"
8787
8888 let acresAssetIdKey = "acresAssetId"
8989
9090 let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet")
9191
9292 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
9393
9494
9595 let IdxEffTotal = 0
9696
9797 func keyResProportions () = "resTypesProportions"
9898
9999
100100 func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr)
101101
102102
103103 func asInt (v) = match v {
104104 case n: Int =>
105105 n
106106 case _ =>
107107 throw("fail to cast into Int")
108108 }
109109
110110
111111 func asTwoIntsTuple (val) = match val {
112112 case t2: (Int, Int) =>
113113 t2
114114 case _ =>
115115 throw("fail to cast into (Int, Int)")
116116 }
117117
118118
119119 func getVotingPower (userAddrStrOrEmpty) = {
120120 let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_")
121121 func adder (acc,item) = (acc + parseIntValue(item))
122122
123123 let totalPower = {
124124 let $l = props
125125 let $s = size($l)
126126 let $acc0 = 0
127127 func $f0_1 ($a,$i) = if (($i >= $s))
128128 then $a
129129 else adder($a, $l[$i])
130130
131131 func $f0_2 ($a,$i) = if (($i >= $s))
132132 then $a
133133 else throw("List size exceeds 6")
134134
135135 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6)
136136 }
137137 let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0)
138138 [totalPower, usersPower]
139139 }
140140
141141
142142 func fixedPoint (val,decimals) = {
143143 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
144144 let lowPart = toString((val % tenPow))
145145 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
146146 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
147147 }
148148
149149
150+let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000
151+
150152 func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil))
151153
152154
153155 func claimAcresInternal (addr,acresAmount,lastClaimTime) = {
154156 let deltaTime = (lastBlock.timestamp - lastClaimTime)
155157 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
156158 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
157159 let gotUsdt = max([0, canGetUsdt])
158160 (gotUsdt * USDT2ACRES_MULTIPLIER)
159161 }
160162
161163
162164 func claimInternal (addr,acresAmount,lastClaimTime) = {
163165 let deltaTime = (lastBlock.timestamp - lastClaimTime)
164166 if ((0 > deltaTime))
165167 then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp)))
166168 else {
167169 let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8))
168170 let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil))
169171 let gotUsdt = if ((0 >= canGetUsdt))
170172 then 0
171173 else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1
172174 (gotUsdt * USDT2ACRES_MULTIPLIER)
173175 }
174176 }
175177
176178
177179 func mergeLocked (oldAmount,oldETA,newAmount,newETA) = {
178180 let now = lastBlock.timestamp
179181 let dt1 = max([0, (oldETA - now)])
180182 let dt2 = max([0, (newETA - now)])
181183 let sum = (oldAmount + newAmount)
182184 let dt = if ((sum == 0))
183185 then 0
184186 else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum))
185187 (now + dt)
186188 }
187189
188190
189191 @Callable(i)
190192 func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this))
191193 then throw("Permission denied")
192194 else if (isDefined(getBinary(acresAssetIdKey)))
193195 then throw("Already initialized")
194196 else {
195197 let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces)
196198 let issuedAmount = (MILLION6 - (nftAcres * MULT8))
197199 let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0)
198200 let assetId = calculateAssetId(issue)
199201 [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)]
200202 }
201203
202204
203205
204206 @Callable(i)
205-func stakeAcres () = {
206- let prologResult = prolog()
207- if ((prologResult == prologResult))
208- then {
209- let address = toString(i.caller)
210- if ((size(i.payments) != 1))
211- then throw("exactly 1 payment must be attached")
212- else {
213- let pmt = i.payments[0]
214- let amt = pmt.amount
215- if (if (!(isDefined(pmt.assetId)))
216- then true
217- else (value(pmt.assetId) != acresAssetId))
218- then throw("ACRES payments only!")
219- else {
220- let timeKey = keyAcresStakedTimeByUser(address)
221- let amountKey = keyAcresStakedAmountByUser(address)
222- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
223- let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
224- let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
225- let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
226- $Tuple2(((((if ((claimedAcres == 0))
227- then nil
228- else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
229- }
230- }
231- }
232- else throw("Strict value is not equal to itself.")
233- }
207+func stakeAcres () = if ((i.caller != this))
208+ then throw("Temporarily disabled during promo action")
209+ else {
210+ let prologResult = prolog()
211+ if ((prologResult == prologResult))
212+ then {
213+ let address = toString(i.caller)
214+ if ((size(i.payments) != 1))
215+ then throw("exactly 1 payment must be attached")
216+ else {
217+ let pmt = i.payments[0]
218+ let amt = pmt.amount
219+ if (if (!(isDefined(pmt.assetId)))
220+ then true
221+ else (value(pmt.assetId) != acresAssetId))
222+ then throw("ACRES payments only!")
223+ else {
224+ let timeKey = keyAcresStakedTimeByUser(address)
225+ let amountKey = keyAcresStakedAmountByUser(address)
226+ let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
227+ let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
228+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
229+ let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
230+ $Tuple2(((((if ((claimedAcres == 0))
231+ then nil
232+ else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult))
233+ }
234+ }
235+ }
236+ else throw("Strict value is not equal to itself.")
237+ }
234238
235239
236240
237241 @Callable(i)
238242 func unstakeAcres (amount) = {
239243 let prologResult = prolog()
240244 if ((prologResult == prologResult))
241245 then if ((0 >= amount))
242246 then throw("Amount should be positive")
243247 else {
244248 let address = toString(i.caller)
245249 if ((size(i.payments) != 0))
246250 then throw("No payments required")
247251 else {
248252 let timeKey = keyAcresStakedTimeByUser(address)
249253 let amountKey = keyAcresStakedAmountByUser(address)
250254 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
251255 if ((amount > oldAcresAmount))
252256 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
253257 else {
254258 let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0)
255259 let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0)
256260 let now = lastBlock.timestamp
257261 let unstakableAmount = (oldAcresAmount - lockedAmount)
258262 if (if ((lockedETA > now))
259263 then (amount > unstakableAmount)
260264 else false)
261265 then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA)))
262266 else {
263267 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
264268 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
265269 let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0))
266270 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult))
267271 }
268272 }
269273 }
270274 }
275+ else throw("Strict value is not equal to itself.")
276+ }
277+
278+
279+
280+@Callable(i)
281+func stakeAcresLocked () = {
282+ let prologResult = prolog()
283+ if ((prologResult == prologResult))
284+ then {
285+ let address = toString(i.caller)
286+ if ((size(i.payments) != 1))
287+ then throw("exactly 1 payment must be attached")
288+ else {
289+ let pmt = i.payments[0]
290+ let amt = pmt.amount
291+ if (if (!(isDefined(pmt.assetId)))
292+ then true
293+ else (value(pmt.assetId) != acresAssetId))
294+ then throw("ACRES payments only!")
295+ else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt))
296+ then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES"))
297+ else {
298+ let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
299+ if ((wlgResult == wlgResult))
300+ then {
301+ let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil)
302+ $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult))
303+ }
304+ else throw("Strict value is not equal to itself.")
305+ }
306+ }
307+ }
271308 else throw("Strict value is not equal to itself.")
272309 }
273310
274311
275312
276313 @Callable(i)
277314 func buyAcres () = {
278315 let prologResult = prolog()
279316 if ((prologResult == prologResult))
280317 then {
281318 let address = toString(i.caller)
282319 if ((size(i.payments) != 1))
283320 then throw("exactly 1 payment must be attached")
284321 else {
285322 let pmt = i.payments[0]
286323 let amt = pmt.amount
287324 if (if (!(isDefined(pmt.assetId)))
288325 then true
289326 else (value(pmt.assetId) != usdtAssetId))
290327 then throw("USDT payments only!")
291328 else if ((MULT6 > amt))
292329 then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT"))
293330 else {
294331 let acresAmount = (amt * USDT2ACRES_MULTIPLIER)
295332 let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil))
296333 $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult))
297334 }
298335 }
299336 }
300337 else throw("Strict value is not equal to itself.")
301338 }
302339
303340
304341
305342 @Callable(i)
306343 func sendAcres (addr,amount) = if ((i.caller != economyContract))
307344 then throw("Permission denied")
308345 else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount)
309346
310347
311348
312349 @Callable(i)
313350 func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this))
314351 then (i.caller != restContract)
315352 else false)
316353 then throw("Permission denied")
317354 else {
318355 let now = lastBlock.timestamp
319356 let timeKey = keyAcresStakedTimeByUser(addr)
320357 let amountKey = keyAcresStakedAmountByUser(addr)
321358 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
322359 let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0)
323360 let oldTime = valueOrElse(getInteger(timeKey), now)
324361 let etaKey = keyAcresLockedEtaByUser(addr)
325362 let lockedAmountKey = keyAcresLockedAmountByUser(addr)
326363 let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0)
327364 let oldLockedETA = valueOrElse(getInteger(etaKey), 0)
328365 let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS)))
329366 $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount)
330367 }
331368
332369
333370
334371 @Callable(i)
335372 func burnAcres (amount) = if ((i.caller != stakingContract))
336373 then throw("Permission denied")
337374 else {
338375 let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount)
339376 if ((0 > amountLeft))
340377 then throw("Attempt to burn more ACRES, than exists")
341378 else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount)
342379 }
343380
344381
345382
346383 @Callable(i)
347384 func claimAcres () = {
348385 let prologResult = prolog()
349386 if ((prologResult == prologResult))
350387 then {
351388 let address = toString(i.caller)
352389 if ((size(i.payments) != 0))
353390 then throw("No payments required")
354391 else {
355392 let timeKey = keyAcresStakedTimeByUser(address)
356393 let amountKey = keyAcresStakedAmountByUser(address)
357394 let acresAmount = valueOrElse(getInteger(amountKey), 0)
358395 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
359396 let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0))
360397 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult))
361398 }
362399 }
363400 else throw("Strict value is not equal to itself.")
364401 }
365402
366403
367404
368405 @Callable(i)
369406 func claimAcresREADONLY (address) = {
370407 let timeKey = keyAcresStakedTimeByUser(address)
371408 let amountKey = keyAcresStakedAmountByUser(address)
372409 let acresAmount = valueOrElse(getInteger(amountKey), 0)
373410 let lastTime = valueOrElse(getInteger(timeKey), 0)
374411 let claimedAcres = claimAcresInternal(address, acresAmount, lastTime)
375412 $Tuple2(nil, [claimedAcres, lastTime])
376413 }
377414
378415

github/deemru/w8io/169f3d6 
46.58 ms