tx · EAb2VRaotmCe9EYZtDqibgkXBDWcTfkg1YMvoKaNfTo1 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.01100000 Waves 2024.09.12 19:58 [3280688] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "EAb2VRaotmCe9EYZtDqibgkXBDWcTfkg1YMvoKaNfTo1", "fee": 1100000, "feeAssetId": null, "timestamp": 1726160338311, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "4oT4uHWqpoVTQZLTWSzABpFiFaeRQYMVHSvcSRwhbTsTQZ2vyswaM2R6XqQqZvoZwj8MhUTxvMViKFywLSmwSpyx" ], "script": "base64:BgIjCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgMKAQgmAANTRVACAl9fAAVNVUxUOACAwtcvABRXTEcyQUNSRVNfTVVMVElQTElFUgDIAQAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5rbm93biBjaGFpbgAVb2xkU3Rha2luZ0NvbnRyYWN0U3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUExuY1h0UzFVODNENmNRYkZEM0g4ckJIUExnenhTRktaMQMJAAACAQFUBQckbWF0Y2gwAiMzTkRDeUJHNXE4NUp1YVJpaWdVZUV0YWlueWpDUVQzWHBabQkAAgECDVVua25vd24gY2hhaW4BD2dld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WNjMAAAAAEAAgADAAQABQAGAAcACAAJAAoACwAMAA0ADgAPABAAEQASABMAFAAVABYAFwAYABkAGgAbABwAHQAeAB8AIAAhACIAIwAkACUAJgAnACgAKQAqACsALAAtAC4ALwAwADEAMgAzADQANQA2ADcAOAA5ADoAOwA8AD0APgA/AEAAQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBgAGEAYgBjAGQJAJYKBAAAAAAAAAAACQCUCgIFA25pbAULbGFuZHNSZXN1bHQAypZN0A==", "height": 3280688, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9o6RQBmnKktY7PVY2spYEQLrsLeLGRdjUASy1UbziKmJ Next: 2SFwhzQcmyifc9R4pTxhQE7gxp823tV6Exq8LGtGxndX Diff:
Old | New | Differences | |
---|---|---|---|
94 | 94 | t | |
95 | 95 | case _ => | |
96 | 96 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | func asTuple4Ints (val) = match val { | |
101 | + | case t: (Int, Int, Int, Int) => | |
102 | + | t | |
103 | + | case _ => | |
104 | + | throw("fail to cast into (Int, Int, Int, Int)") | |
97 | 105 | } | |
98 | 106 | ||
99 | 107 | ||
310 | 318 | ||
311 | 319 | ||
312 | 320 | @Callable(i) | |
313 | - | func convertOldStakesREADONLY () = $Tuple2(nil, 0) | |
321 | + | func unstakeLandsREADONLY (address) = { | |
322 | + | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
323 | + | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
324 | + | let landsResult = if (isDefined(landsStr)) | |
325 | + | then { | |
326 | + | let lands = split_51C(value(landsStr), "_") | |
327 | + | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
328 | + | then throw("landAssetId is required") | |
329 | + | else { | |
330 | + | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
331 | + | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
332 | + | } | |
333 | + | ||
334 | + | let $l = lands | |
335 | + | let $s = size($l) | |
336 | + | let $acc0 = $Tuple4(0, 0, 0, 0) | |
337 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
338 | + | then $a | |
339 | + | else oneLand($a, $l[$i]) | |
340 | + | ||
341 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
342 | + | then $a | |
343 | + | else throw("List size exceeds 100") | |
344 | + | ||
345 | + | $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) | |
346 | + | } | |
347 | + | else $Tuple4(0, 0, 0, 0) | |
348 | + | $Tuple2(nil, landsResult) | |
349 | + | } | |
314 | 350 | ||
315 | 351 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | 7 | ||
8 | 8 | let WLG2ACRES_MULTIPLIER = 200 | |
9 | 9 | ||
10 | 10 | let chain = take(drop(this.bytes, 1), 1) | |
11 | 11 | ||
12 | 12 | let defaultRest2AddressStr = match chain { | |
13 | 13 | case _ => | |
14 | 14 | if ((base58'2W' == $match0)) | |
15 | 15 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
16 | 16 | else if ((base58'2T' == $match0)) | |
17 | 17 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
18 | 18 | else throw("Unknown chain") | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | let oldStakingContractStr = match chain { | |
22 | 22 | case _ => | |
23 | 23 | if ((base58'2W' == $match0)) | |
24 | 24 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
25 | 25 | else if ((base58'2T' == $match0)) | |
26 | 26 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
27 | 27 | else throw("Unknown chain") | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | let IdxCfgAcres2Dapp = 1 | |
34 | 34 | ||
35 | 35 | let IdxCfgWlgDapp = 2 | |
36 | 36 | ||
37 | 37 | func keyRestCfg () = "%s__restConfig" | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyRest2Address () = "%s__rest2Addr" | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
50 | 50 | ||
51 | 51 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
52 | 52 | ||
53 | 53 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
54 | 54 | ||
55 | 55 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
56 | 56 | ||
57 | 57 | let oldAcresContractKey = "oldAcresContract" | |
58 | 58 | ||
59 | 59 | func keyBlocked () = "contractsBlocked" | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | let wlgAssetIdKey = "wlg_assetId" | |
66 | 66 | ||
67 | 67 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
68 | 68 | ||
69 | 69 | let acresIssuedAmountKey = "acresIssuedAmount" | |
70 | 70 | ||
71 | 71 | let acresAssetIdKey = "acresAssetId" | |
72 | 72 | ||
73 | 73 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
74 | 74 | ||
75 | 75 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func asInt (v) = match v { | |
85 | 85 | case n: Int => | |
86 | 86 | n | |
87 | 87 | case _ => | |
88 | 88 | throw("fail to cast into Int") | |
89 | 89 | } | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func asTuple5Ints (val) = match val { | |
93 | 93 | case t: (Int, Int, Int, Int, Int) => | |
94 | 94 | t | |
95 | 95 | case _ => | |
96 | 96 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | func asTuple4Ints (val) = match val { | |
101 | + | case t: (Int, Int, Int, Int) => | |
102 | + | t | |
103 | + | case _ => | |
104 | + | throw("fail to cast into (Int, Int, Int, Int)") | |
97 | 105 | } | |
98 | 106 | ||
99 | 107 | ||
100 | 108 | func asTuple3Ints (val) = match val { | |
101 | 109 | case t: (Int, Int, Int) => | |
102 | 110 | t | |
103 | 111 | case _ => | |
104 | 112 | throw("fail to cast into (Int, Int, Int)") | |
105 | 113 | } | |
106 | 114 | ||
107 | 115 | ||
108 | 116 | func asTuple2Ints (val) = match val { | |
109 | 117 | case t: (Int, Int) => | |
110 | 118 | t._1 | |
111 | 119 | case _ => | |
112 | 120 | throw("fail to cast into (Int, Int)") | |
113 | 121 | } | |
114 | 122 | ||
115 | 123 | ||
116 | 124 | func fixedPoint (val,decimals) = { | |
117 | 125 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
118 | 126 | let lowPart = toString((val % tenPow)) | |
119 | 127 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
120 | 128 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
121 | 129 | } | |
122 | 130 | ||
123 | 131 | ||
124 | 132 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
125 | 133 | ||
126 | 134 | ||
127 | 135 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
128 | 136 | ||
129 | 137 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
130 | 138 | then valueOrElse(getBoolean(keyBlocked()), false) | |
131 | 139 | else false) | |
132 | 140 | then throw("Contracts are under maintenance") | |
133 | 141 | else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))] | |
134 | 142 | ||
135 | 143 | ||
136 | 144 | func stakeAcresInternal (amt,address) = { | |
137 | 145 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
138 | 146 | if ((wlgResult == wlgResult)) | |
139 | 147 | then { | |
140 | 148 | let now = lastBlock.timestamp | |
141 | 149 | let timeKey = keyAcresStakedTimeByUser(address) | |
142 | 150 | let amountKey = keyAcresStakedAmtByUser(address) | |
143 | 151 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
144 | 152 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
145 | 153 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount + amt)), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))], wlgResult) | |
146 | 154 | } | |
147 | 155 | else throw("Strict value is not equal to itself.") | |
148 | 156 | } | |
149 | 157 | ||
150 | 158 | ||
151 | 159 | @Callable(i) | |
152 | 160 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
153 | 161 | then throw("Permission denied") | |
154 | 162 | else { | |
155 | 163 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
156 | 164 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
157 | 165 | } | |
158 | 166 | ||
159 | 167 | ||
160 | 168 | ||
161 | 169 | @Callable(i) | |
162 | 170 | func saveInteger (key,amount) = if ((i.caller != this)) | |
163 | 171 | then throw("saveInteger is not public method") | |
164 | 172 | else [IntegerEntry(key, amount)] | |
165 | 173 | ||
166 | 174 | ||
167 | 175 | ||
168 | 176 | @Callable(i) | |
169 | 177 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
170 | 178 | then throw("permission denied") | |
171 | 179 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
172 | 180 | ||
173 | 181 | ||
174 | 182 | ||
175 | 183 | @Callable(i) | |
176 | 184 | func unstakeAcres (amount) = { | |
177 | 185 | let prologActions = prolog(i) | |
178 | 186 | if ((0 >= amount)) | |
179 | 187 | then throw("Amount should be positive") | |
180 | 188 | else { | |
181 | 189 | let address = toString(i.caller) | |
182 | 190 | if ((size(i.payments) != 0)) | |
183 | 191 | then throw("No payments required") | |
184 | 192 | else { | |
185 | 193 | let timeKey = keyAcresStakedTimeByUser(address) | |
186 | 194 | let amountKey = keyAcresStakedAmtByUser(address) | |
187 | 195 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
188 | 196 | if ((amount > oldAcresAmount)) | |
189 | 197 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
190 | 198 | else { | |
191 | 199 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
192 | 200 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
193 | 201 | $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult) | |
194 | 202 | } | |
195 | 203 | } | |
196 | 204 | } | |
197 | 205 | } | |
198 | 206 | ||
199 | 207 | ||
200 | 208 | ||
201 | 209 | @Callable(i) | |
202 | 210 | func stakeAcres () = { | |
203 | 211 | let prologActions = prolog(i) | |
204 | 212 | let address = toString(i.caller) | |
205 | 213 | if ((size(i.payments) != 1)) | |
206 | 214 | then throw("exactly 1 payment must be attached") | |
207 | 215 | else { | |
208 | 216 | let pmt = i.payments[0] | |
209 | 217 | let amt = pmt.amount | |
210 | 218 | if (if (!(isDefined(pmt.assetId))) | |
211 | 219 | then true | |
212 | 220 | else (value(pmt.assetId) != acresAssetId)) | |
213 | 221 | then throw("ACRES payments only!") | |
214 | 222 | else { | |
215 | 223 | let $t031333199 = stakeAcresInternal(amt, address) | |
216 | 224 | let actions = $t031333199._1 | |
217 | 225 | let wlgClaimedAmount = $t031333199._2 | |
218 | 226 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
219 | 227 | } | |
220 | 228 | } | |
221 | 229 | } | |
222 | 230 | ||
223 | 231 | ||
224 | 232 | ||
225 | 233 | @Callable(i) | |
226 | 234 | func buyAcres () = { | |
227 | 235 | let prologActions = prolog(i) | |
228 | 236 | let address = toString(i.caller) | |
229 | 237 | if ((size(i.payments) != 1)) | |
230 | 238 | then throw("exactly 1 payment must be attached") | |
231 | 239 | else { | |
232 | 240 | let pmt = i.payments[0] | |
233 | 241 | let amt = pmt.amount | |
234 | 242 | if (if (!(isDefined(pmt.assetId))) | |
235 | 243 | then true | |
236 | 244 | else (value(pmt.assetId) != wlgAssetId)) | |
237 | 245 | then throw("WLGOLD payments only!") | |
238 | 246 | else if ((MULT8 > amt)) | |
239 | 247 | then throw((("Min payment should be " + fixedPoint(MULT8, 8)) + " WLGOLD")) | |
240 | 248 | else { | |
241 | 249 | let acresAmount = (amt * WLG2ACRES_MULTIPLIER) | |
242 | 250 | let wlgRemain = asInt(invoke(acres2Contract, "burnWlgold", nil, [AttachedPayment(wlgAssetId, amt)])) | |
243 | 251 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
244 | 252 | } | |
245 | 253 | } | |
246 | 254 | } | |
247 | 255 | ||
248 | 256 | ||
249 | 257 | ||
250 | 258 | @Callable(i) | |
251 | 259 | func convertOldStakes () = { | |
252 | 260 | let address = toString(i.caller) | |
253 | 261 | if ((size(i.payments) != 0)) | |
254 | 262 | then throw("No payments required") | |
255 | 263 | else { | |
256 | 264 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
257 | 265 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
258 | 266 | let gotAcres0 = if ((amount > 0)) | |
259 | 267 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
260 | 268 | else 0 | |
261 | 269 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
262 | 270 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
263 | 271 | let landsResult = if (isDefined(landsStr)) | |
264 | 272 | then { | |
265 | 273 | let lands = split_51C(value(landsStr), "_") | |
266 | 274 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
267 | 275 | then throw("landAssetId is required") | |
268 | 276 | else { | |
269 | 277 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
270 | 278 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
271 | 279 | } | |
272 | 280 | ||
273 | 281 | let rr = { | |
274 | 282 | let $l = lands | |
275 | 283 | let $s = size($l) | |
276 | 284 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
277 | 285 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
278 | 286 | then $a | |
279 | 287 | else oneLand($a, $l[$i]) | |
280 | 288 | ||
281 | 289 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
282 | 290 | then $a | |
283 | 291 | else throw("List size exceeds 100") | |
284 | 292 | ||
285 | 293 | $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) | |
286 | 294 | } | |
287 | 295 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
288 | 296 | if ((finalize == finalize)) | |
289 | 297 | then { | |
290 | 298 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4), address], nil) | |
291 | 299 | if ((req == req)) | |
292 | 300 | then { | |
293 | 301 | let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false) | |
294 | 302 | $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))]) | |
295 | 303 | } | |
296 | 304 | else throw("Strict value is not equal to itself.") | |
297 | 305 | } | |
298 | 306 | else throw("Strict value is not equal to itself.") | |
299 | 307 | } | |
300 | 308 | else $Tuple5(0, 0, 0, 0, nil) | |
301 | 309 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
302 | 310 | let duckResult = if ((duckAssetId != "")) | |
303 | 311 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
304 | 312 | else $Tuple3(0, 0, 0) | |
305 | 313 | let x = stakeAcresInternal((((((((gotAcres0 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
306 | 314 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
307 | 315 | } | |
308 | 316 | } | |
309 | 317 | ||
310 | 318 | ||
311 | 319 | ||
312 | 320 | @Callable(i) | |
313 | - | func convertOldStakesREADONLY () = $Tuple2(nil, 0) | |
321 | + | func unstakeLandsREADONLY (address) = { | |
322 | + | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
323 | + | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
324 | + | let landsResult = if (isDefined(landsStr)) | |
325 | + | then { | |
326 | + | let lands = split_51C(value(landsStr), "_") | |
327 | + | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
328 | + | then throw("landAssetId is required") | |
329 | + | else { | |
330 | + | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
331 | + | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
332 | + | } | |
333 | + | ||
334 | + | let $l = lands | |
335 | + | let $s = size($l) | |
336 | + | let $acc0 = $Tuple4(0, 0, 0, 0) | |
337 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
338 | + | then $a | |
339 | + | else oneLand($a, $l[$i]) | |
340 | + | ||
341 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
342 | + | then $a | |
343 | + | else throw("List size exceeds 100") | |
344 | + | ||
345 | + | $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) | |
346 | + | } | |
347 | + | else $Tuple4(0, 0, 0, 0) | |
348 | + | $Tuple2(nil, landsResult) | |
349 | + | } | |
314 | 350 | ||
315 | 351 |
github/deemru/w8io/026f985 52.57 ms ◑