tx · AwAPsXvM7a85MJqvyhaKeQHETwBc2HPFhuCgSFMBFdyU

3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh:  -0.01300000 Waves

2024.09.13 17:18 [3281976] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves

{ "type": 13, "id": "AwAPsXvM7a85MJqvyhaKeQHETwBc2HPFhuCgSFMBFdyU", "fee": 1300000, "feeAssetId": null, "timestamp": 1726237135039, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "Q2XsvZQXJkLhwDWakejKqvxV5TpAVwWSBRNnMtpcfUawAL6E3fKvKTdr9zDgro1YR3nfwKR7pam73zx5KpfEgFN" ], "script": "base64:BgIjCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgMKAQgsAANTRVACAl9fAAVNVUxUOACAwtcvABRXTEcyQUNSRVNfTVVMVElQTElFUgDIAQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5rbm93biBjaGFpbgAVb2xkU3Rha2luZ0NvbnRyYWN0U3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUExuY1h0UzFVODNENmNRYkZEM0g4ckJIUExnenhTRktaMQMJAAACAQFUBQckbWF0Y2gwAiMzTkRDeUJHNXE4NUp1YVJpaWdVZUV0YWlueWpDUVQzWHBabQkAAgECDVVua25vd24gY2hhaW4BD2dldFN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3ADgAOQA6ADsAPAA9AD4APwBAAEEAQgBDAEQARQBGAEcASABJAEoASwBMAE0ATgBPAFAAUQBSAFMAVABVAFYAVwBYAFkAWgBbAFwAXQBeAF8AYABhAGIAYwBkCQCWCgQAAAAAAAAAAAkAlAoCBQNuaWwFC2xhbmRzUmVzdWx0AFyjVdA=", "height": 3281976, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3ZvBNMGscMe4p9anH7ECxscfYEsvpKUBvE7UwtAAEy7T Next: AN5TD7JJW2AcHcCQAkeTMG1jeMxXvyBsod7zqmfkna8e Diff:
OldNewDifferences
238238 else {
239239 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
240240 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
241- $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult)
241+ let newAcresAmount = (oldAcresAmount - amount)
242+ let userFpKey = keyFarmingPowerByUser(address)
243+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
244+ let newFp = getFarmingPowerByAcres(newAcresAmount)
245+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
246+ $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult)
242247 }
243248 }
244249 }
260265 else (value(pmt.assetId) != acresAssetId))
261266 then throw("ACRES payments only!")
262267 else {
263- let $t034623528 = stakeAcresInternal(amt, address)
264- let actions = $t034623528._1
265- let wlgClaimedAmount = $t034623528._2
268+ let $t038353901 = stakeAcresInternal(amt, address)
269+ let actions = $t038353901._1
270+ let wlgClaimedAmount = $t038353901._2
266271 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
267272 }
268273 }
335340 let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil)
336341 if ((finalize == finalize))
337342 then {
338- let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4), address], nil)
343+ let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil)
339344 if ((req == req))
340345 then {
341346 let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false)
350355 let duckResult = if ((duckAssetId != ""))
351356 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil))
352357 else $Tuple3(0, 0, 0)
353- let x = stakeAcresInternal(((((((((gotAcres0._1 + gotAcres0._2) + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
358+ let x = stakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
354359 $Tuple2((landsResult._5 ++ x._1), x._2)
355360 }
356361 }
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
132132 let M8_ = 100000000
133133
134134 func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr)
135135
136136
137137 func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr)
138138
139139
140140 let acresStakdTotalKey = "acresStakedAmountTotal"
141141
142142 let totalFarmingPowerKey = "totalFarmingPower"
143143
144144 let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000]
145145
146146 func getLevelByAcres (acres) = {
147147 let acr = (acres / M8_)
148148 func checker (acc,item) = if ((item > acr))
149149 then acc
150150 else (acc + 1)
151151
152152 let idx = {
153153 let $l = levels
154154 let $s = size($l)
155155 let $acc0 = 0
156156 func $f0_1 ($a,$i) = if (($i >= $s))
157157 then $a
158158 else checker($a, $l[$i])
159159
160160 func $f0_2 ($a,$i) = if (($i >= $s))
161161 then $a
162162 else throw("List size exceeds 10")
163163
164164 $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)
165165 }
166166 (idx + 1)
167167 }
168168
169169
170170 func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4))
171171
172172
173173 func prolog (i) = if (if ((i.originCaller != rest2Contract))
174174 then valueOrElse(getBoolean(keyBlocked()), false)
175175 else false)
176176 then throw("Contracts are under maintenance")
177177 else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))]
178178
179179
180180 func stakeAcresInternal (amt,address) = {
181181 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
182182 if ((wlgResult == wlgResult))
183183 then {
184184 let now = lastBlock.timestamp
185185 let timeKey = keyAcresStakedTimeByUser(address)
186186 let amountKey = keyAcresStakedAmtByUser(address)
187187 let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt)
188188 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
189189 let userFpKey = keyFarmingPowerByUser(address)
190190 let oldFp = valueOrElse(getInteger(userFpKey), 0)
191191 let newFp = getFarmingPowerByAcres(newAcresAmount)
192192 let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
193193 $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult)
194194 }
195195 else throw("Strict value is not equal to itself.")
196196 }
197197
198198
199199 @Callable(i)
200200 func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this))
201201 then throw("Permission denied")
202202 else {
203203 let oldAcrContAddr = addressFromStringValue(oldAcrContract)
204204 [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)]
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func saveInteger (key,amount) = if ((i.caller != this))
211211 then throw("saveInteger is not public method")
212212 else [IntegerEntry(key, amount)]
213213
214214
215215
216216 @Callable(i)
217217 func setBlocked (isBlocked) = if ((i.caller != this))
218218 then throw("permission denied")
219219 else [BooleanEntry(keyBlocked(), isBlocked)]
220220
221221
222222
223223 @Callable(i)
224224 func unstakeAcres (amount) = {
225225 let prologActions = prolog(i)
226226 if ((0 >= amount))
227227 then throw("Amount should be positive")
228228 else {
229229 let address = toString(i.caller)
230230 if ((size(i.payments) != 0))
231231 then throw("No payments required")
232232 else {
233233 let timeKey = keyAcresStakedTimeByUser(address)
234234 let amountKey = keyAcresStakedAmtByUser(address)
235235 let oldAcresAmount = valueOrElse(getInteger(amountKey), 0)
236236 if ((amount > oldAcresAmount))
237237 then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8)))
238238 else {
239239 let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0)
240240 let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil)
241- $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult)
241+ let newAcresAmount = (oldAcresAmount - amount)
242+ let userFpKey = keyFarmingPowerByUser(address)
243+ let oldFp = valueOrElse(getInteger(userFpKey), 0)
244+ let newFp = getFarmingPowerByAcres(newAcresAmount)
245+ let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0)
246+ $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult)
242247 }
243248 }
244249 }
245250 }
246251
247252
248253
249254 @Callable(i)
250255 func stakeAcres () = {
251256 let prologActions = prolog(i)
252257 let address = toString(i.caller)
253258 if ((size(i.payments) != 1))
254259 then throw("exactly 1 payment must be attached")
255260 else {
256261 let pmt = i.payments[0]
257262 let amt = pmt.amount
258263 if (if (!(isDefined(pmt.assetId)))
259264 then true
260265 else (value(pmt.assetId) != acresAssetId))
261266 then throw("ACRES payments only!")
262267 else {
263- let $t034623528 = stakeAcresInternal(amt, address)
264- let actions = $t034623528._1
265- let wlgClaimedAmount = $t034623528._2
268+ let $t038353901 = stakeAcresInternal(amt, address)
269+ let actions = $t038353901._1
270+ let wlgClaimedAmount = $t038353901._2
266271 $Tuple2((actions ++ prologActions), wlgClaimedAmount)
267272 }
268273 }
269274 }
270275
271276
272277
273278 @Callable(i)
274279 func buyAcres () = {
275280 let prologActions = prolog(i)
276281 let address = toString(i.caller)
277282 if ((size(i.payments) != 1))
278283 then throw("exactly 1 payment must be attached")
279284 else {
280285 let pmt = i.payments[0]
281286 let amt = pmt.amount
282287 if (if (!(isDefined(pmt.assetId)))
283288 then true
284289 else (value(pmt.assetId) != wlgAssetId))
285290 then throw("WLGOLD payments only!")
286291 else if ((MULT8 > amt))
287292 then throw((("Min payment should be " + fixedPoint(MULT8, 8)) + " WLGOLD"))
288293 else {
289294 let acresAmount = (amt * WLG2ACRES_MULTIPLIER)
290295 let wlgRemain = asInt(invoke(acres2Contract, "burnWlgold", nil, [AttachedPayment(wlgAssetId, amt)]))
291296 $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain)
292297 }
293298 }
294299 }
295300
296301
297302
298303 @Callable(i)
299304 func convertOldStakes () = {
300305 let address = toString(i.caller)
301306 if ((size(i.payments) != 0))
302307 then throw("No payments required")
303308 else {
304309 let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey))
305310 let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0)
306311 let gotAcres0 = if ((amount > 0))
307312 then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil))
308313 else $Tuple2(0, 0)
309314 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
310315 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
311316 let landsResult = if (isDefined(landsStr))
312317 then {
313318 let lands = split_51C(value(landsStr), "_")
314319 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
315320 then throw("landAssetId is required")
316321 else {
317322 let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil))
318323 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
319324 }
320325
321326 let rr = {
322327 let $l = lands
323328 let $s = size($l)
324329 let $acc0 = $Tuple4(0, 0, 0, 0)
325330 func $f0_1 ($a,$i) = if (($i >= $s))
326331 then $a
327332 else oneLand($a, $l[$i])
328333
329334 func $f0_2 ($a,$i) = if (($i >= $s))
330335 then $a
331336 else throw("List size exceeds 100")
332337
333338 $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)
334339 }
335340 let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil)
336341 if ((finalize == finalize))
337342 then {
338- let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4), address], nil)
343+ let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil)
339344 if ((req == req))
340345 then {
341346 let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false)
342347 $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))])
343348 }
344349 else throw("Strict value is not equal to itself.")
345350 }
346351 else throw("Strict value is not equal to itself.")
347352 }
348353 else $Tuple5(0, 0, 0, 0, nil)
349354 let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "")
350355 let duckResult = if ((duckAssetId != ""))
351356 then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil))
352357 else $Tuple3(0, 0, 0)
353- let x = stakeAcresInternal(((((((((gotAcres0._1 + gotAcres0._2) + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
358+ let x = stakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address)
354359 $Tuple2((landsResult._5 ++ x._1), x._2)
355360 }
356361 }
357362
358363
359364
360365 @Callable(i)
361366 func unstakeLandsREADONLY (address) = {
362367 let oldStakingAddress = addressFromStringValue(oldStakingContractStr)
363368 let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address))
364369 let landsResult = if (isDefined(landsStr))
365370 then {
366371 let lands = split_51C(value(landsStr), "_")
367372 func oneLand (acc,landAssetId) = if ((landAssetId == ""))
368373 then throw("landAssetId is required")
369374 else {
370375 let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil))
371376 $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4))
372377 }
373378
374379 let $l = lands
375380 let $s = size($l)
376381 let $acc0 = $Tuple4(0, 0, 0, 0)
377382 func $f0_1 ($a,$i) = if (($i >= $s))
378383 then $a
379384 else oneLand($a, $l[$i])
380385
381386 func $f0_2 ($a,$i) = if (($i >= $s))
382387 then $a
383388 else throw("List size exceeds 100")
384389
385390 $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)
386391 }
387392 else $Tuple4(0, 0, 0, 0)
388393 $Tuple2(nil, landsResult)
389394 }
390395
391396

github/deemru/w8io/026f985 
49.46 ms