tx · 3ZvBNMGscMe4p9anH7ECxscfYEsvpKUBvE7UwtAAEy7T

3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh:  -0.01200000 Waves

2024.09.12 22:00 [3280812] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves

{ "type": 13, "id": "3ZvBNMGscMe4p9anH7ECxscfYEsvpKUBvE7UwtAAEy7T", "fee": 1200000, "feeAssetId": null, "timestamp": 1726167648344, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "5fPtzCpt26U3NzbUm23uP4x5Uia4TEeHGkAk5hTamYEd2z6yuAFRUAJPtBKJ95NMprabHzGEtVFt8d4hMXojKFBT" ], "script": "base64:BgIjCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgMKAQgsAANTRVACAl9fAAVNVUxUOACAwtcvABRXTEcyQUNSRVNfTVVMVElQTElFUgDIAQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5rbm93biBjaGFpbgAVb2xkU3Rha2luZ0NvbnRyYWN0U3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUExuY1h0UzFVODNENmNRYkZEM0g4ckJIUExnenhTRktaMQMJAAACAQFUBQckbWF0Y2gwAiMzTkRDeUJHNXE4NUp1YVJpaWdVZUV0YWlueWpDUVQzWHBabQkAAgECDVVua25vd24gY2hhaW4BD2dldF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QIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIJAQUkZjBfMQIFBSRhY2MwAAAAAQACAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA7ADwAPQA+AD8AQABBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGAAYQBiAGMAZAkAlgoEAAAAAAAAAAAJAJQKAgUDbmlsBQtsYW5kc1Jlc3VsdAB60REz", "height": 3280812, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2SFwhzQcmyifc9R4pTxhQE7gxp823tV6Exq8LGtGxndX Next: AwAPsXvM7a85MJqvyhaKeQHETwBc2HPFhuCgSFMBFdyU Diff:
OldNewDifferences
129129 }
130130
131131
132+let M8_ = 100000000
133+
132134 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
133135
134136
137+func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr)
138+
139+
135140 let acresStakdTotalKey = "acresStakedAmountTotal"
141+
142+let totalFarmingPowerKey = "totalFarmingPower"
143+
144+let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
145+
146+func getLevelByAcres (acres) = {
147+ let acr = (acres / M8_)
148+ func checker (acc,item) = if ((item > acr))
149+ then acc
150+ else (acc + 1)
151+
152+ let idx = {
153+ let $l = levels
154+ let $s = size($l)
155+ let $acc0 = 0
156+ func $f0_1 ($a,$i) = if (($i >= $s))
157+ then $a
158+ else checker($a, $l[$i])
159+
160+ func $f0_2 ($a,$i) = if (($i >= $s))
161+ then $a
162+ else throw("List size exceeds 10")
163+
164+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
165+ }
166+ (idx + 1)
167+ }
168+
169+
170+func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
171+
136172
137173 func prolog (i) = if (if ((i.originCaller != rest2Contract))
138174 then valueOrElse(getBoolean(keyBlocked()), false)
148184 let now = lastBlock.timestamp
149185 let timeKey = keyAcresStakedTimeByUser(address)
150186 let amountKey = keyAcresStakedAmtByUser(address)
151- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
187+ let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt)
152188 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
153- $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount + amt)), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))], wlgResult)
189+ let userFpKey = keyFarmingPowerByUser(address)
190+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
191+ let newFp = getFarmingPowerByAcres(newAcresAmount)
192+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
193+ $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult)
154194 }
155195 else throw("Strict value is not equal to itself.")
156196 }
220260 else (value(pmt.assetId) != acresAssetId))
221261 then throw("ACRES payments only!")
222262 else {
223- let $t031333199 = stakeAcresInternal(amt, address)
224- let actions = $t031333199._1
225- let wlgClaimedAmount = $t031333199._2
263+ let $t034623528 = stakeAcresInternal(amt, address)
264+ let actions = $t034623528._1
265+ let wlgClaimedAmount = $t034623528._2
226266 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
227267 }
228268 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let MULT8 = 100000000
77
88 let WLG2ACRES_MULTIPLIER = 200
99
1010 let chain = take(drop(this.bytes, 1), 1)
1111
1212 let defaultRest2AddressStr = match chain {
1313 case _ =>
1414 if ((base58'2W' == $match0))
1515 then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8"
1616 else if ((base58'2T' == $match0))
1717 then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv"
1818 else throw("Unknown chain")
1919 }
2020
2121 let oldStakingContractStr = match chain {
2222 case _ =>
2323 if ((base58'2W' == $match0))
2424 then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1"
2525 else if ((base58'2T' == $match0))
2626 then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm"
2727 else throw("Unknown chain")
2828 }
2929
3030 func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], ""))
3131
3232
3333 let IdxCfgAcres2Dapp = 1
3434
3535 let IdxCfgWlgDapp = 2
3636
3737 func keyRestCfg () = "%s__restConfig"
3838
3939
4040 func keyRest2Address () = "%s__rest2Addr"
4141
4242
4343 func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP)
4444
4545
4646 func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx)))
4747
4848
4949 let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr))
5050
5151 let rest2Cfg = readRestCfgOrFail(rest2Contract)
5252
5353 let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp)
5454
5555 let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp)
5656
5757 let oldAcresContractKey = "oldAcresContract"
5858
5959 func keyBlocked () = "contractsBlocked"
6060
6161
6262 func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr)
6363
6464
6565 let wlgAssetIdKey = "wlg_assetId"
6666
6767 let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet")
6868
6969 let acresIssuedAmountKey = "acresIssuedAmount"
7070
7171 let acresAssetIdKey = "acresAssetId"
7272
7373 let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet")
7474
7575 func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr)
7676
7777
7878 func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr)
7979
8080
8181 func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr)
8282
8383
8484 func asInt (v) = match v {
8585 case n: Int =>
8686 n
8787 case _ =>
8888 throw("fail to cast into Int")
8989 }
9090
9191
9292 func asTuple5Ints (val) = match val {
9393 case t: (Int, Int, Int, Int, Int) =>
9494 t
9595 case _ =>
9696 throw("fail to cast into (Int, Int, Int, Int, Int)")
9797 }
9898
9999
100100 func asTuple4Ints (val) = match val {
101101 case t: (Int, Int, Int, Int) =>
102102 t
103103 case _ =>
104104 throw("fail to cast into (Int, Int, Int, Int)")
105105 }
106106
107107
108108 func asTuple3Ints (val) = match val {
109109 case t: (Int, Int, Int) =>
110110 t
111111 case _ =>
112112 throw("fail to cast into (Int, Int, Int)")
113113 }
114114
115115
116116 func asTuple2Ints (val) = match val {
117117 case t: (Int, Int) =>
118118 t
119119 case _ =>
120120 throw("fail to cast into (Int, Int)")
121121 }
122122
123123
124124 func fixedPoint (val,decimals) = {
125125 let tenPow = pow(10, 0, decimals, 0, 0, DOWN)
126126 let lowPart = toString((val % tenPow))
127127 let zeroes = drop(toString(tenPow), (1 + size(lowPart)))
128128 (((toString((val / tenPow)) + ".") + zeroes) + lowPart)
129129 }
130130
131131
132+let M8_ = 100000000
133+
132134 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
133135
134136
137+func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr)
138+
139+
135140 let acresStakdTotalKey = "acresStakedAmountTotal"
141+
142+let totalFarmingPowerKey = "totalFarmingPower"
143+
144+let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
145+
146+func getLevelByAcres (acres) = {
147+ let acr = (acres / M8_)
148+ func checker (acc,item) = if ((item > acr))
149+ then acc
150+ else (acc + 1)
151+
152+ let idx = {
153+ let $l = levels
154+ let $s = size($l)
155+ let $acc0 = 0
156+ func $f0_1 ($a,$i) = if (($i >= $s))
157+ then $a
158+ else checker($a, $l[$i])
159+
160+ func $f0_2 ($a,$i) = if (($i >= $s))
161+ then $a
162+ else throw("List size exceeds 10")
163+
164+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10)
165+ }
166+ (idx + 1)
167+ }
168+
169+
170+func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
171+
136172
137173 func prolog (i) = if (if ((i.originCaller != rest2Contract))
138174 then valueOrElse(getBoolean(keyBlocked()), false)
139175 else false)
140176 then throw("Contracts are under maintenance")
141177 else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))]
142178
143179
144180 func stakeAcresInternal (amt,address) = {
145181 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
146182 if ((wlgResult == wlgResult))
147183 then {
148184 let now = lastBlock.timestamp
149185 let timeKey = keyAcresStakedTimeByUser(address)
150186 let amountKey = keyAcresStakedAmtByUser(address)
151- let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
187+ let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt)
152188 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
153- $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount + amt)), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))], wlgResult)
189+ let userFpKey = keyFarmingPowerByUser(address)
190+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
191+ let newFp = getFarmingPowerByAcres(newAcresAmount)
192+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
193+ $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult)
154194 }
155195 else throw("Strict value is not equal to itself.")
156196 }
157197
158198
159199 @Callable(i)
160200 func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this))
161201 then throw("Permission denied")
162202 else {
163203 let oldAcrContAddr = addressFromStringValue(oldAcrContract)
164204 [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)]
165205 }
166206
167207
168208
169209 @Callable(i)
170210 func saveInteger (key,amount) = if ((i.caller != this))
171211 then throw("saveInteger is not public method")
172212 else [IntegerEntry(key, amount)]
173213
174214
175215
176216 @Callable(i)
177217 func setBlocked (isBlocked) = if ((i.caller != this))
178218 then throw("permission denied")
179219 else [BooleanEntry(keyBlocked(), isBlocked)]
180220
181221
182222
183223 @Callable(i)
184224 func unstakeAcres (amount) = {
185225 let prologActions = prolog(i)
186226 if ((0 >= amount))
187227 then throw("Amount should be positive")
188228 else {
189229 let address = toString(i.caller)
190230 if ((size(i.payments) != 0))
191231 then throw("No payments required")
192232 else {
193233 let timeKey = keyAcresStakedTimeByUser(address)
194234 let amountKey = keyAcresStakedAmtByUser(address)
195235 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
196236 if ((amount > oldAcresAmount))
197237 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
198238 else {
199239 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
200240 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
201241 $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult)
202242 }
203243 }
204244 }
205245 }
206246
207247
208248
209249 @Callable(i)
210250 func stakeAcres () = {
211251 let prologActions = prolog(i)
212252 let address = toString(i.caller)
213253 if ((size(i.payments) != 1))
214254 then throw("exactly 1 payment must be attached")
215255 else {
216256 let pmt = i.payments[0]
217257 let amt = pmt.amount
218258 if (if (!(isDefined(pmt.assetId)))
219259 then true
220260 else (value(pmt.assetId) != acresAssetId))
221261 then throw("ACRES payments only!")
222262 else {
223- let $t031333199 = stakeAcresInternal(amt, address)
224- let actions = $t031333199._1
225- let wlgClaimedAmount = $t031333199._2
263+ let $t034623528 = stakeAcresInternal(amt, address)
264+ let actions = $t034623528._1
265+ let wlgClaimedAmount = $t034623528._2
226266 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
227267 }
228268 }
229269 }
230270
231271
232272
233273 @Callable(i)
234274 func buyAcres () = {
235275 let prologActions = prolog(i)
236276 let address = toString(i.caller)
237277 if ((size(i.payments) != 1))
238278 then throw("exactly 1 payment must be attached")
239279 else {
240280 let pmt = i.payments[0]
241281 let amt = pmt.amount
242282 if (if (!(isDefined(pmt.assetId)))
243283 then true
244284 else (value(pmt.assetId) != wlgAssetId))
245285 then throw("WLGOLD payments only!")
246286 else if ((MULT8 > amt))
247287 then throw((("Min payment should be " + fixedPoint(MULT8, 8)) + " WLGOLD"))
248288 else {
249289 let acresAmount = (amt * WLG2ACRES_MULTIPLIER)
250290 let wlgRemain = asInt(invoke(acres2Contract, "burnWlgold", nil, [AttachedPayment(wlgAssetId, amt)]))
251291 $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain)
252292 }
253293 }
254294 }
255295
256296
257297
258298 @Callable(i)
259299 func convertOldStakes () = {
260300 let address = toString(i.caller)
261301 if ((size(i.payments) != 0))
262302 then throw("No payments required")
263303 else {
264304 let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
265305 let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0)
266306 let gotAcres0 = if ((amount > 0))
267307 then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil))
268308 else $Tuple2(0, 0)
269309 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
270310 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
271311 let landsResult = if (isDefined(landsStr))
272312 then {
273313 let lands = split_51C(value(landsStr), "_")
274314 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
275315 then throw("landAssetId is required")
276316 else {
277317 let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil))
278318 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
279319 }
280320
281321 let rr = {
282322 let $l = lands
283323 let $s = size($l)
284324 let $acc0 = $Tuple4(0, 0, 0, 0)
285325 func $f0_1 ($a,$i) = if (($i >= $s))
286326 then $a
287327 else oneLand($a, $l[$i])
288328
289329 func $f0_2 ($a,$i) = if (($i >= $s))
290330 then $a
291331 else throw("List size exceeds 100")
292332
293333 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_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)
294334 }
295335 let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil)
296336 if ((finalize == finalize))
297337 then {
298338 let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4), address], nil)
299339 if ((req == req))
300340 then {
301341 let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false)
302342 $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))])
303343 }
304344 else throw("Strict value is not equal to itself.")
305345 }
306346 else throw("Strict value is not equal to itself.")
307347 }
308348 else $Tuple5(0, 0, 0, 0, nil)
309349 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "")
310350 let duckResult = if ((duckAssetId != ""))
311351 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil))
312352 else $Tuple3(0, 0, 0)
313353 let x = stakeAcresInternal(((((((((gotAcres0._1 + gotAcres0._2) + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
314354 $Tuple2((landsResult._5 ++ x._1), x._2)
315355 }
316356 }
317357
318358
319359
320360 @Callable(i)
321361 func unstakeLandsREADONLY (address) = {
322362 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
323363 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
324364 let landsResult = if (isDefined(landsStr))
325365 then {
326366 let lands = split_51C(value(landsStr), "_")
327367 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
328368 then throw("landAssetId is required")
329369 else {
330370 let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil))
331371 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
332372 }
333373
334374 let $l = lands
335375 let $s = size($l)
336376 let $acc0 = $Tuple4(0, 0, 0, 0)
337377 func $f0_1 ($a,$i) = if (($i >= $s))
338378 then $a
339379 else oneLand($a, $l[$i])
340380
341381 func $f0_2 ($a,$i) = if (($i >= $s))
342382 then $a
343383 else throw("List size exceeds 100")
344384
345385 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_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)
346386 }
347387 else $Tuple4(0, 0, 0, 0)
348388 $Tuple2(nil, landsResult)
349389 }
350390
351391

github/deemru/w8io/026f985 
56.22 ms