tx · 3paaK7hWixdLRkKk2eiTRBE8vf6JMZ8AudVeszJV51mx 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.01800000 Waves 2024.11.22 16:58 [3382763] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "3paaK7hWixdLRkKk2eiTRBE8vf6JMZ8AudVeszJV51mx", "fee": 1800000, "feeAssetId": null, "timestamp": 1732283941093, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "3gnHWjb2zehZxgKLiWLGuwdvqYRVHZw5mRSaxT4Uq9ZLFzgS1GHmoK3EXaH5iu2mWgDbLKCcpGTqSatauvGStNTF" ], "script": "base64:BgI9CAISABIECgIICBIDCgEEEgMKAQESABIAEgMKAQESABIECgIIARIAEgMKAQgSAwoBCBIECgIIARIECgIIAUIAA1NFUAICX18ABU1VTFQ2AMCEPQAFTVVMVDcAgK3iBAAFTVVMVDgAgMLXLwAKREFZX01JTExJUwCAuJkpABVVU0RUMkFDUkVTX01VTFRJUExJRVIACgATT05FX1BFUkNFTlRfRElWSVNPUgBkAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAWZGVmYXVsdFJlc3QyQWRkcmVzc1N0cgQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAIjM1BGd1l0YThiaUV6MzF6cGVGZTVESks4d0U1dHJTcFFWRjgDCQAAAgE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FWtleUZhcm1pbmdQb3dlckJ5VXNlcgEFB2FkZHJlc3MEBW9sZEZwCQELdmFsdWVPckVsc2UCCQCfCAEFCXVzZXJGcEtleQAABAVuZXdGcAkBFmdldEZhcm1pbmdQb3dlckJ5QWNyZXMBBQ5uZXdBY3Jlc0Ftb3VudAQKb2xkVG90YWxGcAkBC3ZhbHVlT3JFbHNlAgkAnwgBBRR0b3RhbEZhcm1pbmdQb3dlcktleQAABApuZXdUb3RhbEZwCQBkAgkAZQIFCm9sZFRvdGFsRnAFBW9sZEZwBQVuZXdGcAkAlAoCBQNuaWwJAMwIAgUFb2xkRnAJAMwIAgUFbmV3RnAJAMwIAgUKb2xkVG90YWxGcAkAzAgCBQpuZXdUb3RhbEZwBQNuaWwBaQEIaXNzdWVORlQCCmZvckFkZHJlc3MIbmZ0SW5kZXgDCQECIT0CCAUBaQZjYWxsZXIFC3dsZ0NvbnRyYWN0CQACAQIRUGVybWlzc2lvbiBkZW5pZWQJARBpc3N1ZU5GVGludGVybmFsAgUIbmZ0SW5kZXgJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCmZvckFkZHJlc3MAMeAvIw==", "height": 3382763, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: b9pot6JkR7Qxo98BvwKAy32KiVhCG3eC6i34CPByJuF Next: Hr2KEJ7XcawRiWrsfsnDxKjocAURw7wixBjzGyXyfAsH Diff:
Old | New | Differences | |
---|---|---|---|
89 | 89 | func keyBlocked () = "contractsBlocked" | |
90 | 90 | ||
91 | 91 | ||
92 | - | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
92 | + | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
93 | + | ||
94 | + | ||
95 | + | func keyCurWeekTxIdByUser (addr) = ("curWeekTxIdByUser_" + addr) | |
93 | 96 | ||
94 | 97 | ||
95 | 98 | let acresIssuedAmountKey = "acresIssuedAmount" | |
157 | 160 | ||
158 | 161 | let M8_ = 100000000 | |
159 | 162 | ||
163 | + | let WEEK_BLOCKS = 10080 | |
164 | + | ||
160 | 165 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
161 | 166 | ||
162 | 167 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
199 | 204 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
200 | 205 | ||
201 | 206 | ||
207 | + | let keyNftTotalIssued = "nftTotalIssued" | |
208 | + | ||
209 | + | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
210 | + | ||
211 | + | ||
202 | 212 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
203 | 213 | ||
204 | 214 | ||
211 | 221 | if ((base58'2W' == $match0)) | |
212 | 222 | then nil | |
213 | 223 | else if ((base58'2T' == $match0)) | |
214 | - | then | |
224 | + | then ["Cy1b1cu6E5Vx67Mo2wvWi2pvJzT28exsb81maoyYPmvu", "6GEyPU5H2giZahjKnUfZ4djSMacEhSWswVp23Xr8B7wy"] | |
215 | 225 | else throw("Unknown chain") | |
216 | 226 | } | |
217 | 227 | ||
218 | - | let nftDescriptions = [" | |
228 | + | let nftDescriptions = ["{\"name\": \"Gold shovel\", \"description\": \"Reward for early birds\", \"rare\": \"Promo\", \"bonus\": 3, \"bonusType\": \"FarmPower\"}", "{\"name\": \"Pickaxe\", \"description\": \"Increases FarmPower\", \"rare\": \"Common\", \"bonus\": 1, \"bonusType\": \"FarmPower\"}"] | |
219 | 229 | ||
220 | - | let nftNames = [" | |
230 | + | let nftNames = ["SHOVEL-P3", "PICKAXE-C1"] | |
221 | 231 | ||
222 | 232 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
223 | 233 | then valueOrElse(getBoolean(keyBlocked()), false) | |
224 | 234 | else false) | |
225 | 235 | then throw("Contracts are under maintenance") | |
226 | - | else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))] | |
236 | + | else { | |
237 | + | let addr = toString(i.originCaller) | |
238 | + | let week = (height / WEEK_BLOCKS) | |
239 | + | let lastWeekTxIdByUser = getString(keyLastWeekTxIdByUser(addr)) | |
240 | + | let txId = toBase58String(i.transactionId) | |
241 | + | let wtx = ((toString(week) + "_") + txId) | |
242 | + | if (isDefined(lastWeekTxIdByUser)) | |
243 | + | then { | |
244 | + | let lastWeekTx = split(value(lastWeekTxIdByUser), "_") | |
245 | + | if ((lastWeekTx[0] == toString(week))) | |
246 | + | then [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
247 | + | else if ((lastWeekTx[0] == toString((week - 1)))) | |
248 | + | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
249 | + | else { | |
250 | + | let curWeekTxIdByUser = getStringValue(keyLastWeekTxIdByUser(addr)) | |
251 | + | let curWeekTx = split(curWeekTxIdByUser, "_") | |
252 | + | if ((curWeekTx[0] == toString(week))) | |
253 | + | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
254 | + | else [StringEntry(keyLastWeekTxIdByUser(addr), curWeekTxIdByUser), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
255 | + | } | |
256 | + | } | |
257 | + | else [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
258 | + | } | |
227 | 259 | ||
228 | 260 | ||
229 | - | func issueNFTinternal (nftIndex) = if ((nftIndex >= size(dtxArray))) | |
261 | + | func issueNFTinternal (nftIndex,addr) = if ((nftIndex >= size(dtxArray))) | |
230 | 262 | then throw("nftIndex out of bounds") | |
231 | 263 | else { | |
232 | - | let issue = Issue(nftNames[nftIndex], ((dtxArray[nftIndex] + SEP) + nftDescriptions[nftIndex]), 1, 0, false) | |
233 | - | $Tuple2(issue, calculateAssetId(issue)) | |
264 | + | let nftSerial = (valueOrElse(getInteger(keyNftTotalIssued), -1) + 1) | |
265 | + | let issue = Issue(nftNames[nftIndex], makeString_2C([dtxArray[nftIndex], toString(nftSerial), nftDescriptions[nftIndex]], SEP), 1, 0, false) | |
266 | + | let nftAssetId = calculateAssetId(issue) | |
267 | + | $Tuple2([issue, IntegerEntry(keyNftTotalIssued, nftSerial), IntegerEntry(keyNftNumberByAssetId(toBase58String(nftAssetId)), nftSerial), ScriptTransfer(addr, 1, nftAssetId)], nftAssetId) | |
234 | 268 | } | |
235 | 269 | ||
236 | 270 | ||
322 | 356 | if ((arbReleaseTime > lastBlock.timestamp)) | |
323 | 357 | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
324 | 358 | else { | |
325 | - | let $ | |
326 | - | let actions = $ | |
327 | - | let wlgClaimedAmount = $ | |
359 | + | let $t074337510 = stakeUnstakeAcresInternal(-(amount), address) | |
360 | + | let actions = $t074337510._1 | |
361 | + | let wlgClaimedAmount = $t074337510._2 | |
328 | 362 | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
329 | 363 | } | |
330 | 364 | } | |
347 | 381 | else (value(pmt.assetId) != acresAssetId)) | |
348 | 382 | then throw("ACRES payments only!") | |
349 | 383 | else { | |
350 | - | let $ | |
351 | - | let actions = $ | |
352 | - | let wlgClaimedAmount = $ | |
384 | + | let $t079618034 = stakeUnstakeAcresInternal(amt, address) | |
385 | + | let actions = $t079618034._1 | |
386 | + | let wlgClaimedAmount = $t079618034._2 | |
353 | 387 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
354 | 388 | } | |
355 | 389 | } | |
413 | 447 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
414 | 448 | else { | |
415 | 449 | let addr = toString(i.caller) | |
416 | - | let $ | |
417 | - | let limitAction = $ | |
418 | - | let maxUsdt = $ | |
450 | + | let $t098919939 = getSwapLimitAcres() | |
451 | + | let limitAction = $t098919939._1 | |
452 | + | let maxUsdt = $t098919939._2 | |
419 | 453 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
420 | 454 | if ((acresAmount > maxAcres)) | |
421 | 455 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
431 | 465 | ||
432 | 466 | @Callable(i) | |
433 | 467 | func sellAcresREADONLY (address,acresAmount) = { | |
434 | - | let $ | |
435 | - | let limitAction = $ | |
436 | - | let maxUsdt = $ | |
468 | + | let $t01043510483 = getSwapLimitAcres() | |
469 | + | let limitAction = $t01043510483._1 | |
470 | + | let maxUsdt = $t01043510483._2 | |
437 | 471 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
438 | 472 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
439 | 473 | } | |
485 | 519 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
486 | 520 | if ((req == req)) | |
487 | 521 | then { | |
488 | - | let $ | |
489 | - | let | |
490 | - | let nftAssetId = $ | |
491 | - | $Tuple5(rr._1, rr._2, rr._3, rr._4, | |
522 | + | let $t01235512435 = issueNFTinternal(IdxDtx3PercConversion, i.caller) | |
523 | + | let nftActions = $t01235512435._1 | |
524 | + | let nftAssetId = $t01235512435._2 | |
525 | + | $Tuple5(rr._1, rr._2, rr._3, rr._4, nftActions) | |
492 | 526 | } | |
493 | 527 | else throw("Strict value is not equal to itself.") | |
494 | 528 | } | |
564 | 598 | @Callable(i) | |
565 | 599 | func issueNFT (forAddress,nftIndex) = if ((i.caller != wlgContract)) | |
566 | 600 | then throw("Permission denied") | |
567 | - | else { | |
568 | - | let $t01276912821 = issueNFTinternal(nftIndex) | |
569 | - | let issue = $t01276912821._1 | |
570 | - | let nftAssetId = $t01276912821._2 | |
571 | - | $Tuple2([issue, ScriptTransfer(addressFromStringValue(forAddress), 1, nftAssetId)], nftAssetId) | |
572 | - | } | |
601 | + | else issueNFTinternal(nftIndex, addressFromStringValue(forAddress)) | |
573 | 602 | ||
574 | 603 |
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 MULT6 = 1000000 | |
7 | 7 | ||
8 | 8 | let MULT7 = 10000000 | |
9 | 9 | ||
10 | 10 | let MULT8 = 100000000 | |
11 | 11 | ||
12 | 12 | let DAY_MILLIS = 86400000 | |
13 | 13 | ||
14 | 14 | let USDT2ACRES_MULTIPLIER = 10 | |
15 | 15 | ||
16 | 16 | let ONE_PERCENT_DIVISOR = 100 | |
17 | 17 | ||
18 | 18 | let chain = take(drop(this.bytes, 1), 1) | |
19 | 19 | ||
20 | 20 | let usdtAssetId = match chain { | |
21 | 21 | case _ => | |
22 | 22 | if ((base58'2W' == $match0)) | |
23 | 23 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
24 | 24 | else if ((base58'2T' == $match0)) | |
25 | 25 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
26 | 26 | else throw("Unknown chain") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | let defaultRest2AddressStr = match chain { | |
30 | 30 | case _ => | |
31 | 31 | if ((base58'2W' == $match0)) | |
32 | 32 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
33 | 33 | else if ((base58'2T' == $match0)) | |
34 | 34 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
35 | 35 | else throw("Unknown chain") | |
36 | 36 | } | |
37 | 37 | ||
38 | 38 | let arbitrageDelay = match chain { | |
39 | 39 | case _ => | |
40 | 40 | if ((base58'2W' == $match0)) | |
41 | 41 | then DAY_MILLIS | |
42 | 42 | else if ((base58'2T' == $match0)) | |
43 | 43 | then 60000 | |
44 | 44 | else throw("Unknown chain") | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | let oldStakingContractStr = match chain { | |
48 | 48 | case _ => | |
49 | 49 | if ((base58'2W' == $match0)) | |
50 | 50 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
51 | 51 | else if ((base58'2T' == $match0)) | |
52 | 52 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
53 | 53 | else throw("Unknown chain") | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | let IdxCfgAcres2Dapp = 1 | |
60 | 60 | ||
61 | 61 | let IdxCfgWlgDapp = 2 | |
62 | 62 | ||
63 | 63 | let IdxCfgInvestFundDapp = 5 | |
64 | 64 | ||
65 | 65 | func keyRestCfg () = "%s__restConfig" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func keyRest2Address () = "%s__rest2Addr" | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
78 | 78 | ||
79 | 79 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
80 | 80 | ||
81 | 81 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
82 | 82 | ||
83 | 83 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
84 | 84 | ||
85 | 85 | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
86 | 86 | ||
87 | 87 | let oldAcresContractKey = "oldAcresContract" | |
88 | 88 | ||
89 | 89 | func keyBlocked () = "contractsBlocked" | |
90 | 90 | ||
91 | 91 | ||
92 | - | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
92 | + | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
93 | + | ||
94 | + | ||
95 | + | func keyCurWeekTxIdByUser (addr) = ("curWeekTxIdByUser_" + addr) | |
93 | 96 | ||
94 | 97 | ||
95 | 98 | let acresIssuedAmountKey = "acresIssuedAmount" | |
96 | 99 | ||
97 | 100 | let acresAssetIdKey = "acresAssetId" | |
98 | 101 | ||
99 | 102 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
100 | 103 | ||
101 | 104 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
102 | 105 | ||
103 | 106 | ||
104 | 107 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
105 | 108 | ||
106 | 109 | ||
107 | 110 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
108 | 111 | ||
109 | 112 | ||
110 | 113 | func asInt (v) = match v { | |
111 | 114 | case n: Int => | |
112 | 115 | n | |
113 | 116 | case _ => | |
114 | 117 | throw("fail to cast into Int") | |
115 | 118 | } | |
116 | 119 | ||
117 | 120 | ||
118 | 121 | func asTuple5Ints (val) = match val { | |
119 | 122 | case t: (Int, Int, Int, Int, Int) => | |
120 | 123 | t | |
121 | 124 | case _ => | |
122 | 125 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
123 | 126 | } | |
124 | 127 | ||
125 | 128 | ||
126 | 129 | func asTuple4Ints (val) = match val { | |
127 | 130 | case t: (Int, Int, Int, Int) => | |
128 | 131 | t | |
129 | 132 | case _ => | |
130 | 133 | throw("fail to cast into (Int, Int, Int, Int)") | |
131 | 134 | } | |
132 | 135 | ||
133 | 136 | ||
134 | 137 | func asTuple3Ints (val) = match val { | |
135 | 138 | case t: (Int, Int, Int) => | |
136 | 139 | t | |
137 | 140 | case _ => | |
138 | 141 | throw("fail to cast into (Int, Int, Int)") | |
139 | 142 | } | |
140 | 143 | ||
141 | 144 | ||
142 | 145 | func asTuple2Ints (val) = match val { | |
143 | 146 | case t: (Int, Int) => | |
144 | 147 | t | |
145 | 148 | case _ => | |
146 | 149 | throw("fail to cast into (Int, Int)") | |
147 | 150 | } | |
148 | 151 | ||
149 | 152 | ||
150 | 153 | func fixedPoint (val,decimals) = { | |
151 | 154 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
152 | 155 | let lowPart = toString((val % tenPow)) | |
153 | 156 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
154 | 157 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
155 | 158 | } | |
156 | 159 | ||
157 | 160 | ||
158 | 161 | let M8_ = 100000000 | |
159 | 162 | ||
163 | + | let WEEK_BLOCKS = 10080 | |
164 | + | ||
160 | 165 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
161 | 166 | ||
162 | 167 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
163 | 168 | ||
164 | 169 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
165 | 170 | ||
166 | 171 | ||
167 | 172 | func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr) | |
168 | 173 | ||
169 | 174 | ||
170 | 175 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
171 | 176 | ||
172 | 177 | let totalFarmingPowerKey = "totalFarmingPower" | |
173 | 178 | ||
174 | 179 | let IdxDtx3PercConversion = 0 | |
175 | 180 | ||
176 | 181 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
177 | 182 | ||
178 | 183 | func getLevelByAcres (acres) = { | |
179 | 184 | let acr = ((acres + 99999999) / M8_) | |
180 | 185 | func checker (acc,item) = if ((item >= acr)) | |
181 | 186 | then acc | |
182 | 187 | else (acc + 1) | |
183 | 188 | ||
184 | 189 | let $l = levelAcres | |
185 | 190 | let $s = size($l) | |
186 | 191 | let $acc0 = 0 | |
187 | 192 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
188 | 193 | then $a | |
189 | 194 | else checker($a, $l[$i]) | |
190 | 195 | ||
191 | 196 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
192 | 197 | then $a | |
193 | 198 | else throw("List size exceeds 10") | |
194 | 199 | ||
195 | 200 | $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) | |
196 | 201 | } | |
197 | 202 | ||
198 | 203 | ||
199 | 204 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
200 | 205 | ||
201 | 206 | ||
207 | + | let keyNftTotalIssued = "nftTotalIssued" | |
208 | + | ||
209 | + | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
210 | + | ||
211 | + | ||
202 | 212 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
203 | 213 | ||
204 | 214 | ||
205 | 215 | let keyLastAcresSellTime = "lastAcresSellTime" | |
206 | 216 | ||
207 | 217 | let keyLastLimitLeft = "lastLimitLeft" | |
208 | 218 | ||
209 | 219 | let dtxArray = match chain { | |
210 | 220 | case _ => | |
211 | 221 | if ((base58'2W' == $match0)) | |
212 | 222 | then nil | |
213 | 223 | else if ((base58'2T' == $match0)) | |
214 | - | then | |
224 | + | then ["Cy1b1cu6E5Vx67Mo2wvWi2pvJzT28exsb81maoyYPmvu", "6GEyPU5H2giZahjKnUfZ4djSMacEhSWswVp23Xr8B7wy"] | |
215 | 225 | else throw("Unknown chain") | |
216 | 226 | } | |
217 | 227 | ||
218 | - | let nftDescriptions = [" | |
228 | + | let nftDescriptions = ["{\"name\": \"Gold shovel\", \"description\": \"Reward for early birds\", \"rare\": \"Promo\", \"bonus\": 3, \"bonusType\": \"FarmPower\"}", "{\"name\": \"Pickaxe\", \"description\": \"Increases FarmPower\", \"rare\": \"Common\", \"bonus\": 1, \"bonusType\": \"FarmPower\"}"] | |
219 | 229 | ||
220 | - | let nftNames = [" | |
230 | + | let nftNames = ["SHOVEL-P3", "PICKAXE-C1"] | |
221 | 231 | ||
222 | 232 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
223 | 233 | then valueOrElse(getBoolean(keyBlocked()), false) | |
224 | 234 | else false) | |
225 | 235 | then throw("Contracts are under maintenance") | |
226 | - | else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))] | |
236 | + | else { | |
237 | + | let addr = toString(i.originCaller) | |
238 | + | let week = (height / WEEK_BLOCKS) | |
239 | + | let lastWeekTxIdByUser = getString(keyLastWeekTxIdByUser(addr)) | |
240 | + | let txId = toBase58String(i.transactionId) | |
241 | + | let wtx = ((toString(week) + "_") + txId) | |
242 | + | if (isDefined(lastWeekTxIdByUser)) | |
243 | + | then { | |
244 | + | let lastWeekTx = split(value(lastWeekTxIdByUser), "_") | |
245 | + | if ((lastWeekTx[0] == toString(week))) | |
246 | + | then [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
247 | + | else if ((lastWeekTx[0] == toString((week - 1)))) | |
248 | + | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
249 | + | else { | |
250 | + | let curWeekTxIdByUser = getStringValue(keyLastWeekTxIdByUser(addr)) | |
251 | + | let curWeekTx = split(curWeekTxIdByUser, "_") | |
252 | + | if ((curWeekTx[0] == toString(week))) | |
253 | + | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
254 | + | else [StringEntry(keyLastWeekTxIdByUser(addr), curWeekTxIdByUser), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
255 | + | } | |
256 | + | } | |
257 | + | else [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
258 | + | } | |
227 | 259 | ||
228 | 260 | ||
229 | - | func issueNFTinternal (nftIndex) = if ((nftIndex >= size(dtxArray))) | |
261 | + | func issueNFTinternal (nftIndex,addr) = if ((nftIndex >= size(dtxArray))) | |
230 | 262 | then throw("nftIndex out of bounds") | |
231 | 263 | else { | |
232 | - | let issue = Issue(nftNames[nftIndex], ((dtxArray[nftIndex] + SEP) + nftDescriptions[nftIndex]), 1, 0, false) | |
233 | - | $Tuple2(issue, calculateAssetId(issue)) | |
264 | + | let nftSerial = (valueOrElse(getInteger(keyNftTotalIssued), -1) + 1) | |
265 | + | let issue = Issue(nftNames[nftIndex], makeString_2C([dtxArray[nftIndex], toString(nftSerial), nftDescriptions[nftIndex]], SEP), 1, 0, false) | |
266 | + | let nftAssetId = calculateAssetId(issue) | |
267 | + | $Tuple2([issue, IntegerEntry(keyNftTotalIssued, nftSerial), IntegerEntry(keyNftNumberByAssetId(toBase58String(nftAssetId)), nftSerial), ScriptTransfer(addr, 1, nftAssetId)], nftAssetId) | |
234 | 268 | } | |
235 | 269 | ||
236 | 270 | ||
237 | 271 | func stakeUnstakeAcresInternal (amt,address) = { | |
238 | 272 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
239 | 273 | if ((wlgResult == wlgResult)) | |
240 | 274 | then { | |
241 | 275 | let now = lastBlock.timestamp | |
242 | 276 | let timeKey = keyAcresStakedTimeByUser(address) | |
243 | 277 | let amountKey = keyAcresStakedAmtByUser(address) | |
244 | 278 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
245 | 279 | if (if ((0 > amt)) | |
246 | 280 | then (0 > (oldAcresAmount + amt)) | |
247 | 281 | else false) | |
248 | 282 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
249 | 283 | else { | |
250 | 284 | let newAcresAmount = (oldAcresAmount + amt) | |
251 | 285 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
252 | 286 | let userFpKey = keyFarmingPowerByUser(address) | |
253 | 287 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
254 | 288 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
255 | 289 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
256 | 290 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
257 | 291 | } | |
258 | 292 | } | |
259 | 293 | else throw("Strict value is not equal to itself.") | |
260 | 294 | } | |
261 | 295 | ||
262 | 296 | ||
263 | 297 | func getWlgPrice (usdtBalanceCorrection) = { | |
264 | 298 | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
265 | 299 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
266 | 300 | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
267 | 301 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
268 | 302 | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
269 | 303 | fraction(totalFundsUsd, MULT8, issuedAmount) | |
270 | 304 | } | |
271 | 305 | ||
272 | 306 | ||
273 | 307 | func getSwapLimitAcres () = { | |
274 | 308 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
275 | 309 | let acres2Usd = assetBalance(this, usdtAssetId) | |
276 | 310 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
277 | 311 | let defaultLimit = (((acres2Usd + wlgUsd) + investFundTotal) / ONE_PERCENT_DIVISOR) | |
278 | 312 | let lastLimitLeft = valueOrElse(getInteger(keyLastLimitLeft), defaultLimit) | |
279 | 313 | let lastTime = valueOrElse(getInteger(keyLastAcresSellTime), 0) | |
280 | 314 | let now = lastBlock.timestamp | |
281 | 315 | let currentLimit = (lastLimitLeft + fraction(defaultLimit, (now - lastTime), DAY_MILLIS)) | |
282 | 316 | let limitLeftUsdt = min([currentLimit, defaultLimit]) | |
283 | 317 | $Tuple2(IntegerEntry(keyLastAcresSellTime, now), limitLeftUsdt) | |
284 | 318 | } | |
285 | 319 | ||
286 | 320 | ||
287 | 321 | @Callable(i) | |
288 | 322 | func saveLastTx () = if (!(containsElement([wlgContract], i.caller))) | |
289 | 323 | then throw("Access denied") | |
290 | 324 | else $Tuple2(prolog(i), 42) | |
291 | 325 | ||
292 | 326 | ||
293 | 327 | ||
294 | 328 | @Callable(i) | |
295 | 329 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
296 | 330 | then throw("Permission denied") | |
297 | 331 | else { | |
298 | 332 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
299 | 333 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
300 | 334 | } | |
301 | 335 | ||
302 | 336 | ||
303 | 337 | ||
304 | 338 | @Callable(i) | |
305 | 339 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
306 | 340 | then throw("permission denied") | |
307 | 341 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
308 | 342 | ||
309 | 343 | ||
310 | 344 | ||
311 | 345 | @Callable(i) | |
312 | 346 | func unstakeAcres (amount) = { | |
313 | 347 | let prologActions = prolog(i) | |
314 | 348 | if ((0 >= amount)) | |
315 | 349 | then throw("Amount should be positive") | |
316 | 350 | else { | |
317 | 351 | let address = toString(i.caller) | |
318 | 352 | if ((size(i.payments) != 0)) | |
319 | 353 | then throw("No payments required") | |
320 | 354 | else { | |
321 | 355 | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
322 | 356 | if ((arbReleaseTime > lastBlock.timestamp)) | |
323 | 357 | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
324 | 358 | else { | |
325 | - | let $ | |
326 | - | let actions = $ | |
327 | - | let wlgClaimedAmount = $ | |
359 | + | let $t074337510 = stakeUnstakeAcresInternal(-(amount), address) | |
360 | + | let actions = $t074337510._1 | |
361 | + | let wlgClaimedAmount = $t074337510._2 | |
328 | 362 | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
329 | 363 | } | |
330 | 364 | } | |
331 | 365 | } | |
332 | 366 | } | |
333 | 367 | ||
334 | 368 | ||
335 | 369 | ||
336 | 370 | @Callable(i) | |
337 | 371 | func stakeAcres () = { | |
338 | 372 | let prologActions = prolog(i) | |
339 | 373 | let address = toString(i.caller) | |
340 | 374 | if ((size(i.payments) != 1)) | |
341 | 375 | then throw("exactly 1 payment must be attached") | |
342 | 376 | else { | |
343 | 377 | let pmt = i.payments[0] | |
344 | 378 | let amt = pmt.amount | |
345 | 379 | if (if (!(isDefined(pmt.assetId))) | |
346 | 380 | then true | |
347 | 381 | else (value(pmt.assetId) != acresAssetId)) | |
348 | 382 | then throw("ACRES payments only!") | |
349 | 383 | else { | |
350 | - | let $ | |
351 | - | let actions = $ | |
352 | - | let wlgClaimedAmount = $ | |
384 | + | let $t079618034 = stakeUnstakeAcresInternal(amt, address) | |
385 | + | let actions = $t079618034._1 | |
386 | + | let wlgClaimedAmount = $t079618034._2 | |
353 | 387 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
354 | 388 | } | |
355 | 389 | } | |
356 | 390 | } | |
357 | 391 | ||
358 | 392 | ||
359 | 393 | ||
360 | 394 | @Callable(i) | |
361 | 395 | func buyAcres () = { | |
362 | 396 | let prologActions = prolog(i) | |
363 | 397 | if ((size(i.payments) != 1)) | |
364 | 398 | then throw("exactly 1 payment must be attached") | |
365 | 399 | else { | |
366 | 400 | let pmt = i.payments[0] | |
367 | 401 | let usdtAmount = pmt.amount | |
368 | 402 | if (if (!(isDefined(pmt.assetId))) | |
369 | 403 | then true | |
370 | 404 | else (value(pmt.assetId) != usdtAssetId)) | |
371 | 405 | then throw("USDT payments only!") | |
372 | 406 | else if ((MULT6 > usdtAmount)) | |
373 | 407 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
374 | 408 | else { | |
375 | 409 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
376 | 410 | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
377 | 411 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
378 | 412 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
379 | 413 | if ((req == req)) | |
380 | 414 | then { | |
381 | 415 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
382 | 416 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
383 | 417 | } | |
384 | 418 | else throw("Strict value is not equal to itself.") | |
385 | 419 | } | |
386 | 420 | } | |
387 | 421 | } | |
388 | 422 | ||
389 | 423 | ||
390 | 424 | ||
391 | 425 | @Callable(i) | |
392 | 426 | func buyAcresREADONLY (usdtAmount) = { | |
393 | 427 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
394 | 428 | let wlgToBurn = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
395 | 429 | $Tuple2(nil, [acresAmount, MULT6, acresAmount, wlgToBurn]) | |
396 | 430 | } | |
397 | 431 | ||
398 | 432 | ||
399 | 433 | ||
400 | 434 | @Callable(i) | |
401 | 435 | func sellAcres () = { | |
402 | 436 | let prologActions = prolog(i) | |
403 | 437 | if ((size(i.payments) != 1)) | |
404 | 438 | then throw("exactly 1 payment must be attached") | |
405 | 439 | else { | |
406 | 440 | let pmt = i.payments[0] | |
407 | 441 | let acresAmount = pmt.amount | |
408 | 442 | if (if (!(isDefined(pmt.assetId))) | |
409 | 443 | then true | |
410 | 444 | else (value(pmt.assetId) != acresAssetId)) | |
411 | 445 | then throw("ACRES payments only!") | |
412 | 446 | else if ((MULT7 > acresAmount)) | |
413 | 447 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
414 | 448 | else { | |
415 | 449 | let addr = toString(i.caller) | |
416 | - | let $ | |
417 | - | let limitAction = $ | |
418 | - | let maxUsdt = $ | |
450 | + | let $t098919939 = getSwapLimitAcres() | |
451 | + | let limitAction = $t098919939._1 | |
452 | + | let maxUsdt = $t098919939._2 | |
419 | 453 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
420 | 454 | if ((acresAmount > maxAcres)) | |
421 | 455 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
422 | 456 | else { | |
423 | 457 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
424 | 458 | $Tuple2(([limitAction, IntegerEntry(keyLastLimitLeft, (maxUsdt - usdtAmount)), ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
425 | 459 | } | |
426 | 460 | } | |
427 | 461 | } | |
428 | 462 | } | |
429 | 463 | ||
430 | 464 | ||
431 | 465 | ||
432 | 466 | @Callable(i) | |
433 | 467 | func sellAcresREADONLY (address,acresAmount) = { | |
434 | - | let $ | |
435 | - | let limitAction = $ | |
436 | - | let maxUsdt = $ | |
468 | + | let $t01043510483 = getSwapLimitAcres() | |
469 | + | let limitAction = $t01043510483._1 | |
470 | + | let maxUsdt = $t01043510483._2 | |
437 | 471 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
438 | 472 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
439 | 473 | } | |
440 | 474 | ||
441 | 475 | ||
442 | 476 | ||
443 | 477 | @Callable(i) | |
444 | 478 | func convertOldStakes () = if ((i.caller != this)) | |
445 | 479 | then throw("Temporarily disabled") | |
446 | 480 | else { | |
447 | 481 | let address = toString(i.caller) | |
448 | 482 | if ((size(i.payments) != 0)) | |
449 | 483 | then throw("No payments required") | |
450 | 484 | else { | |
451 | 485 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
452 | 486 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
453 | 487 | let gotAcres0 = if ((amount > 0)) | |
454 | 488 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
455 | 489 | else $Tuple2(0, 0) | |
456 | 490 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
457 | 491 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
458 | 492 | let landsResult = if (isDefined(landsStr)) | |
459 | 493 | then { | |
460 | 494 | let lands = split_51C(value(landsStr), "_") | |
461 | 495 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
462 | 496 | then throw("landAssetId is required") | |
463 | 497 | else { | |
464 | 498 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
465 | 499 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
466 | 500 | } | |
467 | 501 | ||
468 | 502 | let rr = { | |
469 | 503 | let $l = lands | |
470 | 504 | let $s = size($l) | |
471 | 505 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
472 | 506 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
473 | 507 | then $a | |
474 | 508 | else oneLand($a, $l[$i]) | |
475 | 509 | ||
476 | 510 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
477 | 511 | then $a | |
478 | 512 | else throw("List size exceeds 100") | |
479 | 513 | ||
480 | 514 | $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) | |
481 | 515 | } | |
482 | 516 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
483 | 517 | if ((finalize == finalize)) | |
484 | 518 | then { | |
485 | 519 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
486 | 520 | if ((req == req)) | |
487 | 521 | then { | |
488 | - | let $ | |
489 | - | let | |
490 | - | let nftAssetId = $ | |
491 | - | $Tuple5(rr._1, rr._2, rr._3, rr._4, | |
522 | + | let $t01235512435 = issueNFTinternal(IdxDtx3PercConversion, i.caller) | |
523 | + | let nftActions = $t01235512435._1 | |
524 | + | let nftAssetId = $t01235512435._2 | |
525 | + | $Tuple5(rr._1, rr._2, rr._3, rr._4, nftActions) | |
492 | 526 | } | |
493 | 527 | else throw("Strict value is not equal to itself.") | |
494 | 528 | } | |
495 | 529 | else throw("Strict value is not equal to itself.") | |
496 | 530 | } | |
497 | 531 | else $Tuple5(0, 0, 0, 0, nil) | |
498 | 532 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
499 | 533 | let duckResult = if ((duckAssetId != "")) | |
500 | 534 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
501 | 535 | else $Tuple3(0, 0, 0) | |
502 | 536 | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
503 | 537 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
504 | 538 | } | |
505 | 539 | } | |
506 | 540 | ||
507 | 541 | ||
508 | 542 | ||
509 | 543 | @Callable(i) | |
510 | 544 | func unstakeLandsREADONLY (address) = { | |
511 | 545 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
512 | 546 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
513 | 547 | let landsResult = if (isDefined(landsStr)) | |
514 | 548 | then { | |
515 | 549 | let lands = split_51C(value(landsStr), "_") | |
516 | 550 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
517 | 551 | then throw("landAssetId is required") | |
518 | 552 | else { | |
519 | 553 | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
520 | 554 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
521 | 555 | } | |
522 | 556 | ||
523 | 557 | let $l = lands | |
524 | 558 | let $s = size($l) | |
525 | 559 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
526 | 560 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
527 | 561 | then $a | |
528 | 562 | else oneLand($a, $l[$i]) | |
529 | 563 | ||
530 | 564 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
531 | 565 | then $a | |
532 | 566 | else throw("List size exceeds 100") | |
533 | 567 | ||
534 | 568 | $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) | |
535 | 569 | } | |
536 | 570 | else $Tuple4(0, 0, 0, 0) | |
537 | 571 | $Tuple2(nil, landsResult) | |
538 | 572 | } | |
539 | 573 | ||
540 | 574 | ||
541 | 575 | ||
542 | 576 | @Callable(i) | |
543 | 577 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
544 | 578 | then throw("Permission denied") | |
545 | 579 | else stakeUnstakeAcresInternal(i.payments[0].amount, addr) | |
546 | 580 | ||
547 | 581 | ||
548 | 582 | ||
549 | 583 | @Callable(i) | |
550 | 584 | func simulateStakeAcresREADONLY (address,addedAmount) = { | |
551 | 585 | let amountKey = keyAcresStakedAmtByUser(address) | |
552 | 586 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + addedAmount) | |
553 | 587 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
554 | 588 | let userFpKey = keyFarmingPowerByUser(address) | |
555 | 589 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
556 | 590 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
557 | 591 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
558 | 592 | let newTotalFp = ((oldTotalFp - oldFp) + newFp) | |
559 | 593 | $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp]) | |
560 | 594 | } | |
561 | 595 | ||
562 | 596 | ||
563 | 597 | ||
564 | 598 | @Callable(i) | |
565 | 599 | func issueNFT (forAddress,nftIndex) = if ((i.caller != wlgContract)) | |
566 | 600 | then throw("Permission denied") | |
567 | - | else { | |
568 | - | let $t01276912821 = issueNFTinternal(nftIndex) | |
569 | - | let issue = $t01276912821._1 | |
570 | - | let nftAssetId = $t01276912821._2 | |
571 | - | $Tuple2([issue, ScriptTransfer(addressFromStringValue(forAddress), 1, nftAssetId)], nftAssetId) | |
572 | - | } | |
601 | + | else issueNFTinternal(nftIndex, addressFromStringValue(forAddress)) | |
573 | 602 | ||
574 | 603 |
github/deemru/w8io/026f985 69.25 ms ◑