tx · 46NMsgGPqSZnJPP8ALBKddGu6wi288Q3axN2hs8iuHwc 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.02500000 Waves 2024.11.25 15:14 [3386928] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "46NMsgGPqSZnJPP8ALBKddGu6wi288Q3axN2hs8iuHwc", "fee": 2500000, "feeAssetId": null, "timestamp": 1732536899083, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "58oAsEer9QuxkwKSeQRdsDkvuiKHHcoBneW4Sov6zJo7A8DKPUickk7JAaHZKW7caJYosutPayiX7HMiURiKVoXf" ], "script": "base64:BgJECAISABIECgIICBIDCgEEEgMKAQESABIAEgMKAQESABIECgIIARIAEgMKAQgSAwoBCBIECgIIARIECgIIARIAEgMKAQhaAANTRVACAl9fAAVNVUxUNgDAhD0ABU1VTFQ3AICt4gQABU1VTFQ4AIDC1y8ACkRBWV9NSUxMSVMAgLiZKQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoAE09ORV9QRVJDRU5UX0RJVklTT1IAZAAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC1dFRUtfQkxPQ0tTBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAOBOAwkAAAIBAVQFByRtYXRjaDAAtAEJAAIBAg1Vbmtub3duIGNoYWluAAt1c2R0QXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgEBVwUHJG1hdGNoMAEghNp6sggDP07Ru8qO7ouTvMmC3Qtd+geWqNQj+agP/7kDCQAAAgEBVAUHJG1hdGNoMAEgVbHYn3KHgu/l41uNrAWrZd6aQ6EvFrsF8xq3h6XxxRgJAAIBAg1Vbmtub3duIGNoYWluABZ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kAnwgBCQETa2V5VXNlckFya05mdE51bWJlcgEFBGFkZHIAAAQNJHQwMjI3NjAyMjg0NAkBGXN0YWtlVW5zdGFrZUFjcmVzSW50ZXJuYWwDAAAFBGFkZHIJAQEtAQUNQVJLX05GVF9CT05VUwQHYWN0aW9ucwgFDSR0MDIyNzYwMjI4NDQCXzEEEHdsZ0NsYWltZWRBbW91bnQIBQ0kdDAyMjc2MDIyODQ0Al8yCQCUCgIJAM4IAgkAzQgCCQDNCAIJAM0IAgUHYWN0aW9ucwUKbGlzdEFjdGlvbgkBDEludGVnZXJFbnRyeQIJARNrZXlVc2VyQXJrTmZ0TnVtYmVyAQUEYWRkcgkAZQIFDGFya05mdE51bWJlcgABCQELRGVsZXRlRW50cnkBCQEea2V5U3Rha2VkVGltZUJ5QXNzZXRJZEFuZE93bmVyAgkA2AQBBQdhc3NldElkBQRhZGRyBQ1wcm9sb2dBY3Rpb25zBRB3bGdDbGFpbWVkQW1vdW50AKq2tJ4=", "height": 3386928, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 69ijjqwnaVAFbMg3p2DPdCsmaPxyrwckkiXVT62PFWmv Next: 2C6DWP1ZvbN5KeNym6RcL48zZpGVBp7DutgdY6PzTHk9 Diff:
Old | New | Differences | |
---|---|---|---|
16 | 16 | let ONE_PERCENT_DIVISOR = 100 | |
17 | 17 | ||
18 | 18 | let chain = take(drop(this.bytes, 1), 1) | |
19 | + | ||
20 | + | let WEEK_BLOCKS = match chain { | |
21 | + | case _ => | |
22 | + | if ((base58'2W' == $match0)) | |
23 | + | then 10080 | |
24 | + | else if ((base58'2T' == $match0)) | |
25 | + | then 180 | |
26 | + | else throw("Unknown chain") | |
27 | + | } | |
19 | 28 | ||
20 | 29 | let usdtAssetId = match chain { | |
21 | 30 | case _ => | |
110 | 119 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
111 | 120 | ||
112 | 121 | ||
122 | + | func keyStakedTimeByAssetIdAndOwner (assetId,addr) = ((("st_" + assetId) + "_") + addr) | |
123 | + | ||
124 | + | ||
125 | + | func keyStakedNFTsByOwner (ownerAddr) = ("stakedNFTsByOwner_" + ownerAddr) | |
126 | + | ||
127 | + | ||
113 | 128 | func asInt (v) = match v { | |
114 | 129 | case n: Int => | |
115 | 130 | n | |
158 | 173 | } | |
159 | 174 | ||
160 | 175 | ||
176 | + | let M6_ = 1000000 | |
177 | + | ||
161 | 178 | let M8_ = 100000000 | |
162 | - | ||
163 | - | let WEEK_BLOCKS = 10080 | |
164 | 179 | ||
165 | 180 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
166 | 181 | ||
177 | 192 | let totalFarmingPowerKey = "totalFarmingPower" | |
178 | 193 | ||
179 | 194 | let IdxDtx3PercConversion = 0 | |
195 | + | ||
196 | + | let MAX_WL_NFTS = 3 | |
197 | + | ||
198 | + | let MAX_ARK_NFTS = 1 | |
199 | + | ||
200 | + | let ARK_NFT_BONUS = 5000 | |
201 | + | ||
202 | + | let MAX_NFTS_STAKED_BY_USER = 4 | |
203 | + | ||
204 | + | let keyNftTotalIssued = "nftTotalIssued" | |
205 | + | ||
206 | + | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
207 | + | ||
208 | + | ||
209 | + | func keyUserWlNftNumber (addr) = ("userWlNftNumber_" + addr) | |
210 | + | ||
211 | + | ||
212 | + | func keyUserArkNftNumber (addr) = ("userArkNftNumber_" + addr) | |
213 | + | ||
214 | + | ||
215 | + | func keyUserFullBonus (addr) = ("userFullBonus_" + addr) | |
216 | + | ||
180 | 217 | ||
181 | 218 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
182 | 219 | ||
204 | 241 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
205 | 242 | ||
206 | 243 | ||
207 | - | let keyNftTotalIssued = "nftTotalIssued" | |
208 | - | ||
209 | - | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
244 | + | func getFarmingPowerByAcresAndBonus (acres,bonus6) = { | |
245 | + | let notBonused = getFarmingPowerByAcres(acres) | |
246 | + | $Tuple2(fraction(notBonused, (M6_ + bonus6), M6_), notBonused) | |
247 | + | } | |
210 | 248 | ||
211 | 249 | ||
212 | 250 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
216 | 254 | ||
217 | 255 | let keyLastLimitLeft = "lastLimitLeft" | |
218 | 256 | ||
219 | - | 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\"}"] | |
257 | + | let nftDescriptions = [", \"collection\": \"Digging tools\", \"name\": \"Gold shovel\", \"description\": \"Reward for early birds\", \"rare\": \"Promo\", \"bonus\": 3, \"bonusType\": \"FarmPower\"}", ", \"collection\": \"Digging tools\", \"name\": \"Pickaxe\", \"description\": \"Increases FarmPower\", \"rare\": \"Common\", \"bonus\": 1, \"bonusType\": \"FarmPower\"}"] | |
220 | 258 | ||
221 | 259 | let nftNames = ["SHOVEL-P3", "PICKAXE-C1"] | |
222 | 260 | ||
263 | 301 | } | |
264 | 302 | ||
265 | 303 | ||
266 | - | func stakeUnstakeAcresInternal (amt,address) = { | |
267 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
268 | - | if ((wlgResult == wlgResult)) | |
269 | - | then { | |
270 | - | let now = lastBlock.timestamp | |
271 | - | let timeKey = keyAcresStakedTimeByUser(address) | |
272 | - | let amountKey = keyAcresStakedAmtByUser(address) | |
273 | - | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
274 | - | if (if ((0 > amt)) | |
275 | - | then (0 > (oldAcresAmount + amt)) | |
276 | - | else false) | |
277 | - | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
278 | - | else { | |
279 | - | let newAcresAmount = (oldAcresAmount + amt) | |
280 | - | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
281 | - | let userFpKey = keyFarmingPowerByUser(address) | |
282 | - | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
283 | - | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
284 | - | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
285 | - | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
286 | - | } | |
287 | - | } | |
288 | - | else throw("Strict value is not equal to itself.") | |
289 | - | } | |
304 | + | func stakeUnstakeAcresInternal (amt,address,bonusDelta) = if (if ((amt == 0)) | |
305 | + | then (bonusDelta == 0) | |
306 | + | else false) | |
307 | + | then throw("Nothing to do") | |
308 | + | else { | |
309 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
310 | + | if ((wlgResult == wlgResult)) | |
311 | + | then { | |
312 | + | let now = lastBlock.timestamp | |
313 | + | let timeKey = keyAcresStakedTimeByUser(address) | |
314 | + | let amountKey = keyAcresStakedAmtByUser(address) | |
315 | + | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
316 | + | if (if ((0 > amt)) | |
317 | + | then (0 > (oldAcresAmount + amt)) | |
318 | + | else false) | |
319 | + | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
320 | + | else { | |
321 | + | let newAcresAmount = (oldAcresAmount + amt) | |
322 | + | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
323 | + | let userFpKey = keyFarmingPowerByUser(address) | |
324 | + | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
325 | + | let bonusKey = keyUserFullBonus(address) | |
326 | + | let oldBonus = valueOrElse(getInteger(acres2Contract, bonusKey), 0) | |
327 | + | if (if ((0 > bonusDelta)) | |
328 | + | then (0 > (oldBonus + bonusDelta)) | |
329 | + | else false) | |
330 | + | then throw((((("You have only " + fixedPoint(oldBonus, 4)) + "% bonus, and tried to unstake ") + fixedPoint(-(bonusDelta), 4)) + "%")) | |
331 | + | else { | |
332 | + | let $t054285527 = getFarmingPowerByAcresAndBonus(newAcresAmount, (oldBonus + bonusDelta)) | |
333 | + | let newBonusedFp = $t054285527._1 | |
334 | + | let ignored = $t054285527._2 | |
335 | + | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
336 | + | let acresActions = if ((amt == 0)) | |
337 | + | then nil | |
338 | + | else [IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))] | |
339 | + | $Tuple2(((((acresActions :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(userFpKey, newBonusedFp)) :+ IntegerEntry(totalFarmingPowerKey, ((oldTotalFp + newBonusedFp) - oldFp))) :+ IntegerEntry(bonusKey, (oldBonus + bonusDelta))), wlgResult) | |
340 | + | } | |
341 | + | } | |
342 | + | } | |
343 | + | else throw("Strict value is not equal to itself.") | |
344 | + | } | |
290 | 345 | ||
291 | 346 | ||
292 | 347 | func getWlgPrice (usdtBalanceCorrection) = { | |
311 | 366 | let limitLeftUsdt = min([currentLimit, defaultLimit]) | |
312 | 367 | $Tuple2(IntegerEntry(keyLastAcresSellTime, now), limitLeftUsdt) | |
313 | 368 | } | |
369 | + | ||
370 | + | ||
371 | + | let arkOracle = addressFromStringValue("3PJgZ6AK1WVCpdCmEZpesHmaKvrQDdXG5og") | |
372 | + | ||
373 | + | let incubator = valueOrElse(getString(arkOracle, "static_incubatorAddress"), "") | |
374 | + | ||
375 | + | let breeder = valueOrElse(getString(arkOracle, "static_breederAddress"), "") | |
376 | + | ||
377 | + | let turtleIncubator = valueOrElse(getString(arkOracle, "static_turtleIncubatorAddress"), "") | |
378 | + | ||
379 | + | let turtleBreeder = valueOrElse(getString(arkOracle, "static_turtleBreederAddress"), "") | |
380 | + | ||
381 | + | let canineIncubator = valueOrElse(getString(arkOracle, "static_canineIncubatorAddress"), "") | |
382 | + | ||
383 | + | let canineBreeder = valueOrElse(getString(arkOracle, "static_canineBreederAddress"), "") | |
384 | + | ||
385 | + | let felineIncubator = valueOrElse(getString(arkOracle, "static_felineIncubatorAddress"), "") | |
386 | + | ||
387 | + | let felineBreeder = valueOrElse(getString(arkOracle, "static_felineBreederAddress"), "") | |
388 | + | ||
389 | + | let mutantBreeder = valueOrElse(getString(arkOracle, "static_mutantIncubatorAddress"), "") | |
390 | + | ||
391 | + | func isArkimalIssued (nfo) = { | |
392 | + | let issuer = toString(nfo.issuer) | |
393 | + | if (if (if (if (if (if (if (if ((issuer == incubator)) | |
394 | + | then true | |
395 | + | else (issuer == breeder)) | |
396 | + | then true | |
397 | + | else (issuer == turtleIncubator)) | |
398 | + | then true | |
399 | + | else (issuer == turtleBreeder)) | |
400 | + | then true | |
401 | + | else (issuer == canineIncubator)) | |
402 | + | then true | |
403 | + | else (issuer == canineBreeder)) | |
404 | + | then true | |
405 | + | else (issuer == felineIncubator)) | |
406 | + | then true | |
407 | + | else (issuer == felineBreeder)) | |
408 | + | then nfo.name | |
409 | + | else if ((issuer == mutantBreeder)) | |
410 | + | then nfo.description | |
411 | + | else "" | |
412 | + | } | |
413 | + | ||
414 | + | ||
415 | + | func bonusByDescription (descr) = if (!(contains(descr, "\"bonusType\": \"FarmPower\""))) | |
416 | + | then throw("NFT is not supported yet") | |
417 | + | else { | |
418 | + | let bonusStr = split_4C(split_4C(descr, "\"bonus\":")[1], ",")[0] | |
419 | + | (parseIntValue(drop(bonusStr, (valueOrElse(lastIndexOf(bonusStr, " "), -1) + 1))) * 10000) | |
420 | + | } | |
314 | 421 | ||
315 | 422 | ||
316 | 423 | @Callable(i) | |
351 | 458 | if ((arbReleaseTime > lastBlock.timestamp)) | |
352 | 459 | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
353 | 460 | else { | |
354 | - | let $ | |
355 | - | let actions = $ | |
356 | - | let wlgClaimedAmount = $ | |
461 | + | let $t01102411104 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
462 | + | let actions = $t01102411104._1 | |
463 | + | let wlgClaimedAmount = $t01102411104._2 | |
357 | 464 | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
358 | 465 | } | |
359 | 466 | } | |
376 | 483 | else (value(pmt.assetId) != acresAssetId)) | |
377 | 484 | then throw("ACRES payments only!") | |
378 | 485 | else { | |
379 | - | let $ | |
380 | - | let actions = $ | |
381 | - | let wlgClaimedAmount = $ | |
486 | + | let $t01155511631 = stakeUnstakeAcresInternal(amt, address, 0) | |
487 | + | let actions = $t01155511631._1 | |
488 | + | let wlgClaimedAmount = $t01155511631._2 | |
382 | 489 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
383 | 490 | } | |
384 | 491 | } | |
442 | 549 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
443 | 550 | else { | |
444 | 551 | let addr = toString(i.caller) | |
445 | - | let $ | |
446 | - | let limitAction = $ | |
447 | - | let maxUsdt = $ | |
552 | + | let $t01348813536 = getSwapLimitAcres() | |
553 | + | let limitAction = $t01348813536._1 | |
554 | + | let maxUsdt = $t01348813536._2 | |
448 | 555 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
449 | 556 | if ((acresAmount > maxAcres)) | |
450 | 557 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
460 | 567 | ||
461 | 568 | @Callable(i) | |
462 | 569 | func sellAcresREADONLY (address,acresAmount) = { | |
463 | - | let $ | |
464 | - | let limitAction = $ | |
465 | - | let maxUsdt = $ | |
570 | + | let $t01403214080 = getSwapLimitAcres() | |
571 | + | let limitAction = $t01403214080._1 | |
572 | + | let maxUsdt = $t01403214080._2 | |
466 | 573 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
467 | 574 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
468 | 575 | } | |
514 | 621 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
515 | 622 | if ((req == req)) | |
516 | 623 | then { | |
517 | - | let $ | |
518 | - | let nftActions = $ | |
519 | - | let nftAssetId = $ | |
624 | + | let $t01595216032 = issueNFTinternal(IdxDtx3PercConversion, i.caller) | |
625 | + | let nftActions = $t01595216032._1 | |
626 | + | let nftAssetId = $t01595216032._2 | |
520 | 627 | $Tuple5(rr._1, rr._2, rr._3, rr._4, nftActions) | |
521 | 628 | } | |
522 | 629 | else throw("Strict value is not equal to itself.") | |
528 | 635 | let duckResult = if ((duckAssetId != "")) | |
529 | 636 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
530 | 637 | else $Tuple3(0, 0, 0) | |
531 | - | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
638 | + | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address, 0) | |
532 | 639 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
533 | 640 | } | |
534 | 641 | } | |
571 | 678 | @Callable(i) | |
572 | 679 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
573 | 680 | then throw("Permission denied") | |
574 | - | else stakeUnstakeAcresInternal(i.payments[0].amount, addr) | |
681 | + | else stakeUnstakeAcresInternal(i.payments[0].amount, addr, 0) | |
575 | 682 | ||
576 | 683 | ||
577 | 684 | ||
582 | 689 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
583 | 690 | let userFpKey = keyFarmingPowerByUser(address) | |
584 | 691 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
585 | - | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
692 | + | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(address)), 0) | |
693 | + | let $t01819718284 = getFarmingPowerByAcresAndBonus(newAcresAmount, userBonus) | |
694 | + | let newBonusedFp = $t01819718284._1 | |
695 | + | let ignored = $t01819718284._2 | |
586 | 696 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
587 | - | let newTotalFp = ((oldTotalFp - oldFp) | |
588 | - | $Tuple2(nil, [oldFp, | |
697 | + | let newTotalFp = ((oldTotalFp + newBonusedFp) - oldFp) | |
698 | + | $Tuple2(nil, [oldFp, newBonusedFp, oldTotalFp, newTotalFp]) | |
589 | 699 | } | |
590 | 700 | ||
591 | 701 | ||
596 | 706 | else issueNFTinternal(nftIndex, addressFromStringValue(forAddress)) | |
597 | 707 | ||
598 | 708 | ||
709 | + | ||
710 | + | @Callable(i) | |
711 | + | func stakeNFT () = { | |
712 | + | let prologActions = prolog(i) | |
713 | + | if ((size(i.payments) != 1)) | |
714 | + | then throw("Exactly one payment required") | |
715 | + | else { | |
716 | + | let pmt = value(i.payments[0]) | |
717 | + | if ((pmt.amount != 1)) | |
718 | + | then throw("NFT token should be attached as payment") | |
719 | + | else { | |
720 | + | let assetId = value(pmt.assetId) | |
721 | + | let asset = value(assetInfo(assetId)) | |
722 | + | let assetIdStr = toBase58String(assetId) | |
723 | + | let addr = toString(i.caller) | |
724 | + | let nftsKey = keyStakedNFTsByOwner(addr) | |
725 | + | let nftsStr = getString(nftsKey) | |
726 | + | let nfts = if (isDefined(nftsStr)) | |
727 | + | then split_4C(value(nftsStr), "_") | |
728 | + | else nil | |
729 | + | if (containsElement(nfts, assetIdStr)) | |
730 | + | then throw(("Your staked lands already contain " + assetIdStr)) | |
731 | + | else if ((size(nfts) >= MAX_NFTS_STAKED_BY_USER)) | |
732 | + | then throw((("Your already staked max (" + toString(MAX_NFTS_STAKED_BY_USER)) + ") NFTs")) | |
733 | + | else { | |
734 | + | let listAction = StringEntry(nftsKey, makeString_2C((nfts :+ assetIdStr), "_")) | |
735 | + | let isWL = (asset.issuer == this) | |
736 | + | if (isWL) | |
737 | + | then { | |
738 | + | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
739 | + | if ((wlNftNumber >= MAX_WL_NFTS)) | |
740 | + | then throw((("You can stake max " + toString(MAX_WL_NFTS)) + " of WavesLands NFTs")) | |
741 | + | else { | |
742 | + | let bonusVal = bonusByDescription(value(asset.description)) | |
743 | + | let $t02005220130 = stakeUnstakeAcresInternal(0, addr, bonusVal) | |
744 | + | let actions = $t02005220130._1 | |
745 | + | let wlgClaimedAmount = $t02005220130._2 | |
746 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber + 1))) :+ IntegerEntry(keyStakedTimeByAssetIdAndOwner(assetIdStr, addr), lastBlock.timestamp)) ++ prologActions), wlgClaimedAmount) | |
747 | + | } | |
748 | + | } | |
749 | + | else { | |
750 | + | let arkimalName = isArkimalIssued(asset) | |
751 | + | if ((arkimalName == "")) | |
752 | + | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
753 | + | else { | |
754 | + | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
755 | + | if ((arkNftNumber >= MAX_ARK_NFTS)) | |
756 | + | then throw((("You can stake max " + toString(MAX_ARK_NFTS)) + " of Arkimals NFTs")) | |
757 | + | else { | |
758 | + | let $t02077220855 = stakeUnstakeAcresInternal(0, addr, ARK_NFT_BONUS) | |
759 | + | let actions = $t02077220855._1 | |
760 | + | let wlgClaimedAmount = $t02077220855._2 | |
761 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber + 1))) :+ IntegerEntry(keyStakedTimeByAssetIdAndOwner(assetIdStr, addr), lastBlock.timestamp)) ++ prologActions), wlgClaimedAmount) | |
762 | + | } | |
763 | + | } | |
764 | + | } | |
765 | + | } | |
766 | + | } | |
767 | + | } | |
768 | + | } | |
769 | + | ||
770 | + | ||
771 | + | ||
772 | + | @Callable(i) | |
773 | + | func unstakeNFT (assetIdStr) = { | |
774 | + | let prologActions = prolog(i) | |
775 | + | if ((size(i.payments) != 0)) | |
776 | + | then throw("No payments required") | |
777 | + | else { | |
778 | + | let assetId = fromBase58String(assetIdStr) | |
779 | + | let addr = toString(i.caller) | |
780 | + | let asset = value(assetInfo(assetId)) | |
781 | + | let timeKey = keyStakedTimeByAssetIdAndOwner(assetIdStr, addr) | |
782 | + | if (!(isDefined(getInteger(timeKey)))) | |
783 | + | then throw((("NFT " + asset.name) + " is not staked by you")) | |
784 | + | else { | |
785 | + | let nftsKey = keyStakedNFTsByOwner(addr) | |
786 | + | let nfts = split_4C(valueOrElse(getString(nftsKey), ""), "_") | |
787 | + | let idx = indexOf(nfts, assetIdStr) | |
788 | + | if (!(isDefined(idx))) | |
789 | + | then throw(("Your staked NFTs don't contain " + assetIdStr)) | |
790 | + | else { | |
791 | + | let listAction = if ((size(nfts) > 1)) | |
792 | + | then StringEntry(nftsKey, makeString_2C(removeByIndex(nfts, value(idx)), "_")) | |
793 | + | else DeleteEntry(nftsKey) | |
794 | + | let isWL = (asset.issuer == this) | |
795 | + | if (isWL) | |
796 | + | then { | |
797 | + | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
798 | + | let bonusVal = bonusByDescription(value(asset.description)) | |
799 | + | let $t02216822247 = stakeUnstakeAcresInternal(0, addr, -(bonusVal)) | |
800 | + | let actions = $t02216822247._1 | |
801 | + | let wlgClaimedAmount = $t02216822247._2 | |
802 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) ++ prologActions), wlgClaimedAmount) | |
803 | + | } | |
804 | + | else { | |
805 | + | let arkimalName = isArkimalIssued(asset) | |
806 | + | if ((arkimalName == "")) | |
807 | + | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
808 | + | else { | |
809 | + | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
810 | + | let $t02276022844 = stakeUnstakeAcresInternal(0, addr, -(ARK_NFT_BONUS)) | |
811 | + | let actions = $t02276022844._1 | |
812 | + | let wlgClaimedAmount = $t02276022844._2 | |
813 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) ++ prologActions), wlgClaimedAmount) | |
814 | + | } | |
815 | + | } | |
816 | + | } | |
817 | + | } | |
818 | + | } | |
819 | + | } | |
820 | + | ||
821 | + |
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 | + | ||
20 | + | let WEEK_BLOCKS = match chain { | |
21 | + | case _ => | |
22 | + | if ((base58'2W' == $match0)) | |
23 | + | then 10080 | |
24 | + | else if ((base58'2T' == $match0)) | |
25 | + | then 180 | |
26 | + | else throw("Unknown chain") | |
27 | + | } | |
19 | 28 | ||
20 | 29 | let usdtAssetId = match chain { | |
21 | 30 | case _ => | |
22 | 31 | if ((base58'2W' == $match0)) | |
23 | 32 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
24 | 33 | else if ((base58'2T' == $match0)) | |
25 | 34 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
26 | 35 | else throw("Unknown chain") | |
27 | 36 | } | |
28 | 37 | ||
29 | 38 | let defaultRest2AddressStr = match chain { | |
30 | 39 | case _ => | |
31 | 40 | if ((base58'2W' == $match0)) | |
32 | 41 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
33 | 42 | else if ((base58'2T' == $match0)) | |
34 | 43 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
35 | 44 | else throw("Unknown chain") | |
36 | 45 | } | |
37 | 46 | ||
38 | 47 | let arbitrageDelay = match chain { | |
39 | 48 | case _ => | |
40 | 49 | if ((base58'2W' == $match0)) | |
41 | 50 | then DAY_MILLIS | |
42 | 51 | else if ((base58'2T' == $match0)) | |
43 | 52 | then 60000 | |
44 | 53 | else throw("Unknown chain") | |
45 | 54 | } | |
46 | 55 | ||
47 | 56 | let oldStakingContractStr = match chain { | |
48 | 57 | case _ => | |
49 | 58 | if ((base58'2W' == $match0)) | |
50 | 59 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
51 | 60 | else if ((base58'2T' == $match0)) | |
52 | 61 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
53 | 62 | else throw("Unknown chain") | |
54 | 63 | } | |
55 | 64 | ||
56 | 65 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
57 | 66 | ||
58 | 67 | ||
59 | 68 | let IdxCfgAcres2Dapp = 1 | |
60 | 69 | ||
61 | 70 | let IdxCfgWlgDapp = 2 | |
62 | 71 | ||
63 | 72 | let IdxCfgInvestFundDapp = 5 | |
64 | 73 | ||
65 | 74 | func keyRestCfg () = "%s__restConfig" | |
66 | 75 | ||
67 | 76 | ||
68 | 77 | func keyRest2Address () = "%s__rest2Addr" | |
69 | 78 | ||
70 | 79 | ||
71 | 80 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
72 | 81 | ||
73 | 82 | ||
74 | 83 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
75 | 84 | ||
76 | 85 | ||
77 | 86 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
78 | 87 | ||
79 | 88 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
80 | 89 | ||
81 | 90 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
82 | 91 | ||
83 | 92 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
84 | 93 | ||
85 | 94 | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
86 | 95 | ||
87 | 96 | let oldAcresContractKey = "oldAcresContract" | |
88 | 97 | ||
89 | 98 | func keyBlocked () = "contractsBlocked" | |
90 | 99 | ||
91 | 100 | ||
92 | 101 | func keyLastWeekTxIdByUser (addr) = ("lastWeekTxIdByUser_" + addr) | |
93 | 102 | ||
94 | 103 | ||
95 | 104 | func keyCurWeekTxIdByUser (addr) = ("curWeekTxIdByUser_" + addr) | |
96 | 105 | ||
97 | 106 | ||
98 | 107 | let acresIssuedAmountKey = "acresIssuedAmount" | |
99 | 108 | ||
100 | 109 | let acresAssetIdKey = "acresAssetId" | |
101 | 110 | ||
102 | 111 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
103 | 112 | ||
104 | 113 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
105 | 114 | ||
106 | 115 | ||
107 | 116 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
108 | 117 | ||
109 | 118 | ||
110 | 119 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
111 | 120 | ||
112 | 121 | ||
122 | + | func keyStakedTimeByAssetIdAndOwner (assetId,addr) = ((("st_" + assetId) + "_") + addr) | |
123 | + | ||
124 | + | ||
125 | + | func keyStakedNFTsByOwner (ownerAddr) = ("stakedNFTsByOwner_" + ownerAddr) | |
126 | + | ||
127 | + | ||
113 | 128 | func asInt (v) = match v { | |
114 | 129 | case n: Int => | |
115 | 130 | n | |
116 | 131 | case _ => | |
117 | 132 | throw("fail to cast into Int") | |
118 | 133 | } | |
119 | 134 | ||
120 | 135 | ||
121 | 136 | func asTuple5Ints (val) = match val { | |
122 | 137 | case t: (Int, Int, Int, Int, Int) => | |
123 | 138 | t | |
124 | 139 | case _ => | |
125 | 140 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
126 | 141 | } | |
127 | 142 | ||
128 | 143 | ||
129 | 144 | func asTuple4Ints (val) = match val { | |
130 | 145 | case t: (Int, Int, Int, Int) => | |
131 | 146 | t | |
132 | 147 | case _ => | |
133 | 148 | throw("fail to cast into (Int, Int, Int, Int)") | |
134 | 149 | } | |
135 | 150 | ||
136 | 151 | ||
137 | 152 | func asTuple3Ints (val) = match val { | |
138 | 153 | case t: (Int, Int, Int) => | |
139 | 154 | t | |
140 | 155 | case _ => | |
141 | 156 | throw("fail to cast into (Int, Int, Int)") | |
142 | 157 | } | |
143 | 158 | ||
144 | 159 | ||
145 | 160 | func asTuple2Ints (val) = match val { | |
146 | 161 | case t: (Int, Int) => | |
147 | 162 | t | |
148 | 163 | case _ => | |
149 | 164 | throw("fail to cast into (Int, Int)") | |
150 | 165 | } | |
151 | 166 | ||
152 | 167 | ||
153 | 168 | func fixedPoint (val,decimals) = { | |
154 | 169 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
155 | 170 | let lowPart = toString((val % tenPow)) | |
156 | 171 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
157 | 172 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
158 | 173 | } | |
159 | 174 | ||
160 | 175 | ||
176 | + | let M6_ = 1000000 | |
177 | + | ||
161 | 178 | let M8_ = 100000000 | |
162 | - | ||
163 | - | let WEEK_BLOCKS = 10080 | |
164 | 179 | ||
165 | 180 | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
166 | 181 | ||
167 | 182 | let zbIssuedAmtKey = "zbill_issuedAmount" | |
168 | 183 | ||
169 | 184 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
170 | 185 | ||
171 | 186 | ||
172 | 187 | func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr) | |
173 | 188 | ||
174 | 189 | ||
175 | 190 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
176 | 191 | ||
177 | 192 | let totalFarmingPowerKey = "totalFarmingPower" | |
178 | 193 | ||
179 | 194 | let IdxDtx3PercConversion = 0 | |
195 | + | ||
196 | + | let MAX_WL_NFTS = 3 | |
197 | + | ||
198 | + | let MAX_ARK_NFTS = 1 | |
199 | + | ||
200 | + | let ARK_NFT_BONUS = 5000 | |
201 | + | ||
202 | + | let MAX_NFTS_STAKED_BY_USER = 4 | |
203 | + | ||
204 | + | let keyNftTotalIssued = "nftTotalIssued" | |
205 | + | ||
206 | + | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
207 | + | ||
208 | + | ||
209 | + | func keyUserWlNftNumber (addr) = ("userWlNftNumber_" + addr) | |
210 | + | ||
211 | + | ||
212 | + | func keyUserArkNftNumber (addr) = ("userArkNftNumber_" + addr) | |
213 | + | ||
214 | + | ||
215 | + | func keyUserFullBonus (addr) = ("userFullBonus_" + addr) | |
216 | + | ||
180 | 217 | ||
181 | 218 | let levelAcres = [0, 10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
182 | 219 | ||
183 | 220 | func getLevelByAcres (acres) = { | |
184 | 221 | let acr = ((acres + 99999999) / M8_) | |
185 | 222 | func checker (acc,item) = if ((item >= acr)) | |
186 | 223 | then acc | |
187 | 224 | else (acc + 1) | |
188 | 225 | ||
189 | 226 | let $l = levelAcres | |
190 | 227 | let $s = size($l) | |
191 | 228 | let $acc0 = 0 | |
192 | 229 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
193 | 230 | then $a | |
194 | 231 | else checker($a, $l[$i]) | |
195 | 232 | ||
196 | 233 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
197 | 234 | then $a | |
198 | 235 | else throw("List size exceeds 10") | |
199 | 236 | ||
200 | 237 | $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) | |
201 | 238 | } | |
202 | 239 | ||
203 | 240 | ||
204 | 241 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
205 | 242 | ||
206 | 243 | ||
207 | - | let keyNftTotalIssued = "nftTotalIssued" | |
208 | - | ||
209 | - | func keyNftNumberByAssetId (assetId) = ("nftNumberByAssetId_" + assetId) | |
244 | + | func getFarmingPowerByAcresAndBonus (acres,bonus6) = { | |
245 | + | let notBonused = getFarmingPowerByAcres(acres) | |
246 | + | $Tuple2(fraction(notBonused, (M6_ + bonus6), M6_), notBonused) | |
247 | + | } | |
210 | 248 | ||
211 | 249 | ||
212 | 250 | func keyLastWlgTradeTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
213 | 251 | ||
214 | 252 | ||
215 | 253 | let keyLastAcresSellTime = "lastAcresSellTime" | |
216 | 254 | ||
217 | 255 | let keyLastLimitLeft = "lastLimitLeft" | |
218 | 256 | ||
219 | - | 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\"}"] | |
257 | + | let nftDescriptions = [", \"collection\": \"Digging tools\", \"name\": \"Gold shovel\", \"description\": \"Reward for early birds\", \"rare\": \"Promo\", \"bonus\": 3, \"bonusType\": \"FarmPower\"}", ", \"collection\": \"Digging tools\", \"name\": \"Pickaxe\", \"description\": \"Increases FarmPower\", \"rare\": \"Common\", \"bonus\": 1, \"bonusType\": \"FarmPower\"}"] | |
220 | 258 | ||
221 | 259 | let nftNames = ["SHOVEL-P3", "PICKAXE-C1"] | |
222 | 260 | ||
223 | 261 | let contentKeys = ["contentShovelP3", "contentPickaxeC1"] | |
224 | 262 | ||
225 | 263 | let URL = "\"url\": \"https://waveslands.com\", " | |
226 | 264 | ||
227 | 265 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
228 | 266 | then valueOrElse(getBoolean(keyBlocked()), false) | |
229 | 267 | else false) | |
230 | 268 | then throw("Contracts are under maintenance") | |
231 | 269 | else { | |
232 | 270 | let addr = toString(i.originCaller) | |
233 | 271 | let week = (height / WEEK_BLOCKS) | |
234 | 272 | let lastWeekTxIdByUser = getString(keyLastWeekTxIdByUser(addr)) | |
235 | 273 | let txId = toBase58String(i.transactionId) | |
236 | 274 | let wtx = ((toString(week) + "_") + txId) | |
237 | 275 | if (isDefined(lastWeekTxIdByUser)) | |
238 | 276 | then { | |
239 | 277 | let lastWeekTx = split(value(lastWeekTxIdByUser), "_") | |
240 | 278 | if ((lastWeekTx[0] == toString(week))) | |
241 | 279 | then [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
242 | 280 | else if ((lastWeekTx[0] == toString((week - 1)))) | |
243 | 281 | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
244 | 282 | else { | |
245 | 283 | let curWeekTxIdByUser = getStringValue(keyLastWeekTxIdByUser(addr)) | |
246 | 284 | let curWeekTx = split(curWeekTxIdByUser, "_") | |
247 | 285 | if ((curWeekTx[0] == toString(week))) | |
248 | 286 | then [StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
249 | 287 | else [StringEntry(keyLastWeekTxIdByUser(addr), curWeekTxIdByUser), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
250 | 288 | } | |
251 | 289 | } | |
252 | 290 | else [StringEntry(keyLastWeekTxIdByUser(addr), wtx), StringEntry(keyCurWeekTxIdByUser(addr), wtx)] | |
253 | 291 | } | |
254 | 292 | ||
255 | 293 | ||
256 | 294 | func issueNFTinternal (nftIndex,addr) = if ((nftIndex >= size(contentKeys))) | |
257 | 295 | then throw("nftIndex out of bounds") | |
258 | 296 | else { | |
259 | 297 | let nftSerial = (valueOrElse(getInteger(keyNftTotalIssued), -1) + 1) | |
260 | 298 | let issue = Issue(nftNames[nftIndex], (((((("{" + URL) + "\"contentKey\": \"") + contentKeys[nftIndex]) + "\", \"number\": ") + toString(nftSerial)) + nftDescriptions[nftIndex]), 1, 0, false) | |
261 | 299 | let nftAssetId = calculateAssetId(issue) | |
262 | 300 | $Tuple2([issue, IntegerEntry(keyNftTotalIssued, nftSerial), IntegerEntry(keyNftNumberByAssetId(toBase58String(nftAssetId)), nftSerial), ScriptTransfer(addr, 1, nftAssetId)], nftAssetId) | |
263 | 301 | } | |
264 | 302 | ||
265 | 303 | ||
266 | - | func stakeUnstakeAcresInternal (amt,address) = { | |
267 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
268 | - | if ((wlgResult == wlgResult)) | |
269 | - | then { | |
270 | - | let now = lastBlock.timestamp | |
271 | - | let timeKey = keyAcresStakedTimeByUser(address) | |
272 | - | let amountKey = keyAcresStakedAmtByUser(address) | |
273 | - | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
274 | - | if (if ((0 > amt)) | |
275 | - | then (0 > (oldAcresAmount + amt)) | |
276 | - | else false) | |
277 | - | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
278 | - | else { | |
279 | - | let newAcresAmount = (oldAcresAmount + amt) | |
280 | - | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
281 | - | let userFpKey = keyFarmingPowerByUser(address) | |
282 | - | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
283 | - | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
284 | - | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
285 | - | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
286 | - | } | |
287 | - | } | |
288 | - | else throw("Strict value is not equal to itself.") | |
289 | - | } | |
304 | + | func stakeUnstakeAcresInternal (amt,address,bonusDelta) = if (if ((amt == 0)) | |
305 | + | then (bonusDelta == 0) | |
306 | + | else false) | |
307 | + | then throw("Nothing to do") | |
308 | + | else { | |
309 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
310 | + | if ((wlgResult == wlgResult)) | |
311 | + | then { | |
312 | + | let now = lastBlock.timestamp | |
313 | + | let timeKey = keyAcresStakedTimeByUser(address) | |
314 | + | let amountKey = keyAcresStakedAmtByUser(address) | |
315 | + | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
316 | + | if (if ((0 > amt)) | |
317 | + | then (0 > (oldAcresAmount + amt)) | |
318 | + | else false) | |
319 | + | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(-(amt), 8))) | |
320 | + | else { | |
321 | + | let newAcresAmount = (oldAcresAmount + amt) | |
322 | + | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
323 | + | let userFpKey = keyFarmingPowerByUser(address) | |
324 | + | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
325 | + | let bonusKey = keyUserFullBonus(address) | |
326 | + | let oldBonus = valueOrElse(getInteger(acres2Contract, bonusKey), 0) | |
327 | + | if (if ((0 > bonusDelta)) | |
328 | + | then (0 > (oldBonus + bonusDelta)) | |
329 | + | else false) | |
330 | + | then throw((((("You have only " + fixedPoint(oldBonus, 4)) + "% bonus, and tried to unstake ") + fixedPoint(-(bonusDelta), 4)) + "%")) | |
331 | + | else { | |
332 | + | let $t054285527 = getFarmingPowerByAcresAndBonus(newAcresAmount, (oldBonus + bonusDelta)) | |
333 | + | let newBonusedFp = $t054285527._1 | |
334 | + | let ignored = $t054285527._2 | |
335 | + | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
336 | + | let acresActions = if ((amt == 0)) | |
337 | + | then nil | |
338 | + | else [IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt))] | |
339 | + | $Tuple2(((((acresActions :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(userFpKey, newBonusedFp)) :+ IntegerEntry(totalFarmingPowerKey, ((oldTotalFp + newBonusedFp) - oldFp))) :+ IntegerEntry(bonusKey, (oldBonus + bonusDelta))), wlgResult) | |
340 | + | } | |
341 | + | } | |
342 | + | } | |
343 | + | else throw("Strict value is not equal to itself.") | |
344 | + | } | |
290 | 345 | ||
291 | 346 | ||
292 | 347 | func getWlgPrice (usdtBalanceCorrection) = { | |
293 | 348 | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
294 | 349 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
295 | 350 | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
296 | 351 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
297 | 352 | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
298 | 353 | fraction(totalFundsUsd, MULT8, issuedAmount) | |
299 | 354 | } | |
300 | 355 | ||
301 | 356 | ||
302 | 357 | func getSwapLimitAcres () = { | |
303 | 358 | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
304 | 359 | let acres2Usd = assetBalance(this, usdtAssetId) | |
305 | 360 | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
306 | 361 | let defaultLimit = (((acres2Usd + wlgUsd) + investFundTotal) / ONE_PERCENT_DIVISOR) | |
307 | 362 | let lastLimitLeft = valueOrElse(getInteger(keyLastLimitLeft), defaultLimit) | |
308 | 363 | let lastTime = valueOrElse(getInteger(keyLastAcresSellTime), 0) | |
309 | 364 | let now = lastBlock.timestamp | |
310 | 365 | let currentLimit = (lastLimitLeft + fraction(defaultLimit, (now - lastTime), DAY_MILLIS)) | |
311 | 366 | let limitLeftUsdt = min([currentLimit, defaultLimit]) | |
312 | 367 | $Tuple2(IntegerEntry(keyLastAcresSellTime, now), limitLeftUsdt) | |
313 | 368 | } | |
369 | + | ||
370 | + | ||
371 | + | let arkOracle = addressFromStringValue("3PJgZ6AK1WVCpdCmEZpesHmaKvrQDdXG5og") | |
372 | + | ||
373 | + | let incubator = valueOrElse(getString(arkOracle, "static_incubatorAddress"), "") | |
374 | + | ||
375 | + | let breeder = valueOrElse(getString(arkOracle, "static_breederAddress"), "") | |
376 | + | ||
377 | + | let turtleIncubator = valueOrElse(getString(arkOracle, "static_turtleIncubatorAddress"), "") | |
378 | + | ||
379 | + | let turtleBreeder = valueOrElse(getString(arkOracle, "static_turtleBreederAddress"), "") | |
380 | + | ||
381 | + | let canineIncubator = valueOrElse(getString(arkOracle, "static_canineIncubatorAddress"), "") | |
382 | + | ||
383 | + | let canineBreeder = valueOrElse(getString(arkOracle, "static_canineBreederAddress"), "") | |
384 | + | ||
385 | + | let felineIncubator = valueOrElse(getString(arkOracle, "static_felineIncubatorAddress"), "") | |
386 | + | ||
387 | + | let felineBreeder = valueOrElse(getString(arkOracle, "static_felineBreederAddress"), "") | |
388 | + | ||
389 | + | let mutantBreeder = valueOrElse(getString(arkOracle, "static_mutantIncubatorAddress"), "") | |
390 | + | ||
391 | + | func isArkimalIssued (nfo) = { | |
392 | + | let issuer = toString(nfo.issuer) | |
393 | + | if (if (if (if (if (if (if (if ((issuer == incubator)) | |
394 | + | then true | |
395 | + | else (issuer == breeder)) | |
396 | + | then true | |
397 | + | else (issuer == turtleIncubator)) | |
398 | + | then true | |
399 | + | else (issuer == turtleBreeder)) | |
400 | + | then true | |
401 | + | else (issuer == canineIncubator)) | |
402 | + | then true | |
403 | + | else (issuer == canineBreeder)) | |
404 | + | then true | |
405 | + | else (issuer == felineIncubator)) | |
406 | + | then true | |
407 | + | else (issuer == felineBreeder)) | |
408 | + | then nfo.name | |
409 | + | else if ((issuer == mutantBreeder)) | |
410 | + | then nfo.description | |
411 | + | else "" | |
412 | + | } | |
413 | + | ||
414 | + | ||
415 | + | func bonusByDescription (descr) = if (!(contains(descr, "\"bonusType\": \"FarmPower\""))) | |
416 | + | then throw("NFT is not supported yet") | |
417 | + | else { | |
418 | + | let bonusStr = split_4C(split_4C(descr, "\"bonus\":")[1], ",")[0] | |
419 | + | (parseIntValue(drop(bonusStr, (valueOrElse(lastIndexOf(bonusStr, " "), -1) + 1))) * 10000) | |
420 | + | } | |
314 | 421 | ||
315 | 422 | ||
316 | 423 | @Callable(i) | |
317 | 424 | func saveLastTx () = if (!(containsElement([wlgContract], i.caller))) | |
318 | 425 | then throw("Access denied") | |
319 | 426 | else $Tuple2(prolog(i), 42) | |
320 | 427 | ||
321 | 428 | ||
322 | 429 | ||
323 | 430 | @Callable(i) | |
324 | 431 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
325 | 432 | then throw("Permission denied") | |
326 | 433 | else { | |
327 | 434 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
328 | 435 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
329 | 436 | } | |
330 | 437 | ||
331 | 438 | ||
332 | 439 | ||
333 | 440 | @Callable(i) | |
334 | 441 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
335 | 442 | then throw("permission denied") | |
336 | 443 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
337 | 444 | ||
338 | 445 | ||
339 | 446 | ||
340 | 447 | @Callable(i) | |
341 | 448 | func unstakeAcres (amount) = { | |
342 | 449 | let prologActions = prolog(i) | |
343 | 450 | if ((0 >= amount)) | |
344 | 451 | then throw("Amount should be positive") | |
345 | 452 | else { | |
346 | 453 | let address = toString(i.caller) | |
347 | 454 | if ((size(i.payments) != 0)) | |
348 | 455 | then throw("No payments required") | |
349 | 456 | else { | |
350 | 457 | let arbReleaseTime = (valueOrElse(getInteger(wlgContract, keyLastWlgTradeTimeByUser(address)), 0) + arbitrageDelay) | |
351 | 458 | if ((arbReleaseTime > lastBlock.timestamp)) | |
352 | 459 | then throw(("You traded some WLGOLD, cannot unstake until " + toString(arbReleaseTime))) | |
353 | 460 | else { | |
354 | - | let $ | |
355 | - | let actions = $ | |
356 | - | let wlgClaimedAmount = $ | |
461 | + | let $t01102411104 = stakeUnstakeAcresInternal(-(amount), address, 0) | |
462 | + | let actions = $t01102411104._1 | |
463 | + | let wlgClaimedAmount = $t01102411104._2 | |
357 | 464 | $Tuple2(((actions :+ ScriptTransfer(i.caller, amount, acresAssetId)) ++ prologActions), wlgClaimedAmount) | |
358 | 465 | } | |
359 | 466 | } | |
360 | 467 | } | |
361 | 468 | } | |
362 | 469 | ||
363 | 470 | ||
364 | 471 | ||
365 | 472 | @Callable(i) | |
366 | 473 | func stakeAcres () = { | |
367 | 474 | let prologActions = prolog(i) | |
368 | 475 | let address = toString(i.caller) | |
369 | 476 | if ((size(i.payments) != 1)) | |
370 | 477 | then throw("exactly 1 payment must be attached") | |
371 | 478 | else { | |
372 | 479 | let pmt = i.payments[0] | |
373 | 480 | let amt = pmt.amount | |
374 | 481 | if (if (!(isDefined(pmt.assetId))) | |
375 | 482 | then true | |
376 | 483 | else (value(pmt.assetId) != acresAssetId)) | |
377 | 484 | then throw("ACRES payments only!") | |
378 | 485 | else { | |
379 | - | let $ | |
380 | - | let actions = $ | |
381 | - | let wlgClaimedAmount = $ | |
486 | + | let $t01155511631 = stakeUnstakeAcresInternal(amt, address, 0) | |
487 | + | let actions = $t01155511631._1 | |
488 | + | let wlgClaimedAmount = $t01155511631._2 | |
382 | 489 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
383 | 490 | } | |
384 | 491 | } | |
385 | 492 | } | |
386 | 493 | ||
387 | 494 | ||
388 | 495 | ||
389 | 496 | @Callable(i) | |
390 | 497 | func buyAcres () = { | |
391 | 498 | let prologActions = prolog(i) | |
392 | 499 | if ((size(i.payments) != 1)) | |
393 | 500 | then throw("exactly 1 payment must be attached") | |
394 | 501 | else { | |
395 | 502 | let pmt = i.payments[0] | |
396 | 503 | let usdtAmount = pmt.amount | |
397 | 504 | if (if (!(isDefined(pmt.assetId))) | |
398 | 505 | then true | |
399 | 506 | else (value(pmt.assetId) != usdtAssetId)) | |
400 | 507 | then throw("USDT payments only!") | |
401 | 508 | else if ((MULT6 > usdtAmount)) | |
402 | 509 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
403 | 510 | else { | |
404 | 511 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
405 | 512 | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
406 | 513 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
407 | 514 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
408 | 515 | if ((req == req)) | |
409 | 516 | then { | |
410 | 517 | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
411 | 518 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
412 | 519 | } | |
413 | 520 | else throw("Strict value is not equal to itself.") | |
414 | 521 | } | |
415 | 522 | } | |
416 | 523 | } | |
417 | 524 | ||
418 | 525 | ||
419 | 526 | ||
420 | 527 | @Callable(i) | |
421 | 528 | func buyAcresREADONLY (usdtAmount) = { | |
422 | 529 | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
423 | 530 | let wlgToBurn = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
424 | 531 | $Tuple2(nil, [acresAmount, MULT6, acresAmount, wlgToBurn]) | |
425 | 532 | } | |
426 | 533 | ||
427 | 534 | ||
428 | 535 | ||
429 | 536 | @Callable(i) | |
430 | 537 | func sellAcres () = { | |
431 | 538 | let prologActions = prolog(i) | |
432 | 539 | if ((size(i.payments) != 1)) | |
433 | 540 | then throw("exactly 1 payment must be attached") | |
434 | 541 | else { | |
435 | 542 | let pmt = i.payments[0] | |
436 | 543 | let acresAmount = pmt.amount | |
437 | 544 | if (if (!(isDefined(pmt.assetId))) | |
438 | 545 | then true | |
439 | 546 | else (value(pmt.assetId) != acresAssetId)) | |
440 | 547 | then throw("ACRES payments only!") | |
441 | 548 | else if ((MULT7 > acresAmount)) | |
442 | 549 | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
443 | 550 | else { | |
444 | 551 | let addr = toString(i.caller) | |
445 | - | let $ | |
446 | - | let limitAction = $ | |
447 | - | let maxUsdt = $ | |
552 | + | let $t01348813536 = getSwapLimitAcres() | |
553 | + | let limitAction = $t01348813536._1 | |
554 | + | let maxUsdt = $t01348813536._2 | |
448 | 555 | let maxAcres = (maxUsdt * USDT2ACRES_MULTIPLIER) | |
449 | 556 | if ((acresAmount > maxAcres)) | |
450 | 557 | then throw((("You can sell max " + fixedPoint(maxAcres, 8)) + " ACRES")) | |
451 | 558 | else { | |
452 | 559 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
453 | 560 | $Tuple2(([limitAction, IntegerEntry(keyLastLimitLeft, (maxUsdt - usdtAmount)), ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
454 | 561 | } | |
455 | 562 | } | |
456 | 563 | } | |
457 | 564 | } | |
458 | 565 | ||
459 | 566 | ||
460 | 567 | ||
461 | 568 | @Callable(i) | |
462 | 569 | func sellAcresREADONLY (address,acresAmount) = { | |
463 | - | let $ | |
464 | - | let limitAction = $ | |
465 | - | let maxUsdt = $ | |
570 | + | let $t01403214080 = getSwapLimitAcres() | |
571 | + | let limitAction = $t01403214080._1 | |
572 | + | let maxUsdt = $t01403214080._2 | |
466 | 573 | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
467 | 574 | $Tuple2(nil, [usdtAmount, MULT7, (maxUsdt * USDT2ACRES_MULTIPLIER), 0]) | |
468 | 575 | } | |
469 | 576 | ||
470 | 577 | ||
471 | 578 | ||
472 | 579 | @Callable(i) | |
473 | 580 | func convertOldStakes () = if ((i.caller != this)) | |
474 | 581 | then throw("Temporarily disabled") | |
475 | 582 | else { | |
476 | 583 | let address = toString(i.caller) | |
477 | 584 | if ((size(i.payments) != 0)) | |
478 | 585 | then throw("No payments required") | |
479 | 586 | else { | |
480 | 587 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
481 | 588 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
482 | 589 | let gotAcres0 = if ((amount > 0)) | |
483 | 590 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
484 | 591 | else $Tuple2(0, 0) | |
485 | 592 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
486 | 593 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
487 | 594 | let landsResult = if (isDefined(landsStr)) | |
488 | 595 | then { | |
489 | 596 | let lands = split_51C(value(landsStr), "_") | |
490 | 597 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
491 | 598 | then throw("landAssetId is required") | |
492 | 599 | else { | |
493 | 600 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
494 | 601 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
495 | 602 | } | |
496 | 603 | ||
497 | 604 | let rr = { | |
498 | 605 | let $l = lands | |
499 | 606 | let $s = size($l) | |
500 | 607 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
501 | 608 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
502 | 609 | then $a | |
503 | 610 | else oneLand($a, $l[$i]) | |
504 | 611 | ||
505 | 612 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
506 | 613 | then $a | |
507 | 614 | else throw("List size exceeds 100") | |
508 | 615 | ||
509 | 616 | $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) | |
510 | 617 | } | |
511 | 618 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
512 | 619 | if ((finalize == finalize)) | |
513 | 620 | then { | |
514 | 621 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
515 | 622 | if ((req == req)) | |
516 | 623 | then { | |
517 | - | let $ | |
518 | - | let nftActions = $ | |
519 | - | let nftAssetId = $ | |
624 | + | let $t01595216032 = issueNFTinternal(IdxDtx3PercConversion, i.caller) | |
625 | + | let nftActions = $t01595216032._1 | |
626 | + | let nftAssetId = $t01595216032._2 | |
520 | 627 | $Tuple5(rr._1, rr._2, rr._3, rr._4, nftActions) | |
521 | 628 | } | |
522 | 629 | else throw("Strict value is not equal to itself.") | |
523 | 630 | } | |
524 | 631 | else throw("Strict value is not equal to itself.") | |
525 | 632 | } | |
526 | 633 | else $Tuple5(0, 0, 0, 0, nil) | |
527 | 634 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
528 | 635 | let duckResult = if ((duckAssetId != "")) | |
529 | 636 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
530 | 637 | else $Tuple3(0, 0, 0) | |
531 | - | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
638 | + | let x = stakeUnstakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address, 0) | |
532 | 639 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
533 | 640 | } | |
534 | 641 | } | |
535 | 642 | ||
536 | 643 | ||
537 | 644 | ||
538 | 645 | @Callable(i) | |
539 | 646 | func unstakeLandsREADONLY (address) = { | |
540 | 647 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
541 | 648 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
542 | 649 | let landsResult = if (isDefined(landsStr)) | |
543 | 650 | then { | |
544 | 651 | let lands = split_51C(value(landsStr), "_") | |
545 | 652 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
546 | 653 | then throw("landAssetId is required") | |
547 | 654 | else { | |
548 | 655 | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
549 | 656 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
550 | 657 | } | |
551 | 658 | ||
552 | 659 | let $l = lands | |
553 | 660 | let $s = size($l) | |
554 | 661 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
555 | 662 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
556 | 663 | then $a | |
557 | 664 | else oneLand($a, $l[$i]) | |
558 | 665 | ||
559 | 666 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
560 | 667 | then $a | |
561 | 668 | else throw("List size exceeds 100") | |
562 | 669 | ||
563 | 670 | $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) | |
564 | 671 | } | |
565 | 672 | else $Tuple4(0, 0, 0, 0) | |
566 | 673 | $Tuple2(nil, landsResult) | |
567 | 674 | } | |
568 | 675 | ||
569 | 676 | ||
570 | 677 | ||
571 | 678 | @Callable(i) | |
572 | 679 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
573 | 680 | then throw("Permission denied") | |
574 | - | else stakeUnstakeAcresInternal(i.payments[0].amount, addr) | |
681 | + | else stakeUnstakeAcresInternal(i.payments[0].amount, addr, 0) | |
575 | 682 | ||
576 | 683 | ||
577 | 684 | ||
578 | 685 | @Callable(i) | |
579 | 686 | func simulateStakeAcresREADONLY (address,addedAmount) = { | |
580 | 687 | let amountKey = keyAcresStakedAmtByUser(address) | |
581 | 688 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + addedAmount) | |
582 | 689 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
583 | 690 | let userFpKey = keyFarmingPowerByUser(address) | |
584 | 691 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
585 | - | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
692 | + | let userBonus = valueOrElse(getInteger(acres2Contract, keyUserFullBonus(address)), 0) | |
693 | + | let $t01819718284 = getFarmingPowerByAcresAndBonus(newAcresAmount, userBonus) | |
694 | + | let newBonusedFp = $t01819718284._1 | |
695 | + | let ignored = $t01819718284._2 | |
586 | 696 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
587 | - | let newTotalFp = ((oldTotalFp - oldFp) | |
588 | - | $Tuple2(nil, [oldFp, | |
697 | + | let newTotalFp = ((oldTotalFp + newBonusedFp) - oldFp) | |
698 | + | $Tuple2(nil, [oldFp, newBonusedFp, oldTotalFp, newTotalFp]) | |
589 | 699 | } | |
590 | 700 | ||
591 | 701 | ||
592 | 702 | ||
593 | 703 | @Callable(i) | |
594 | 704 | func issueNFT (forAddress,nftIndex) = if ((i.caller != wlgContract)) | |
595 | 705 | then throw("Permission denied") | |
596 | 706 | else issueNFTinternal(nftIndex, addressFromStringValue(forAddress)) | |
597 | 707 | ||
598 | 708 | ||
709 | + | ||
710 | + | @Callable(i) | |
711 | + | func stakeNFT () = { | |
712 | + | let prologActions = prolog(i) | |
713 | + | if ((size(i.payments) != 1)) | |
714 | + | then throw("Exactly one payment required") | |
715 | + | else { | |
716 | + | let pmt = value(i.payments[0]) | |
717 | + | if ((pmt.amount != 1)) | |
718 | + | then throw("NFT token should be attached as payment") | |
719 | + | else { | |
720 | + | let assetId = value(pmt.assetId) | |
721 | + | let asset = value(assetInfo(assetId)) | |
722 | + | let assetIdStr = toBase58String(assetId) | |
723 | + | let addr = toString(i.caller) | |
724 | + | let nftsKey = keyStakedNFTsByOwner(addr) | |
725 | + | let nftsStr = getString(nftsKey) | |
726 | + | let nfts = if (isDefined(nftsStr)) | |
727 | + | then split_4C(value(nftsStr), "_") | |
728 | + | else nil | |
729 | + | if (containsElement(nfts, assetIdStr)) | |
730 | + | then throw(("Your staked lands already contain " + assetIdStr)) | |
731 | + | else if ((size(nfts) >= MAX_NFTS_STAKED_BY_USER)) | |
732 | + | then throw((("Your already staked max (" + toString(MAX_NFTS_STAKED_BY_USER)) + ") NFTs")) | |
733 | + | else { | |
734 | + | let listAction = StringEntry(nftsKey, makeString_2C((nfts :+ assetIdStr), "_")) | |
735 | + | let isWL = (asset.issuer == this) | |
736 | + | if (isWL) | |
737 | + | then { | |
738 | + | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
739 | + | if ((wlNftNumber >= MAX_WL_NFTS)) | |
740 | + | then throw((("You can stake max " + toString(MAX_WL_NFTS)) + " of WavesLands NFTs")) | |
741 | + | else { | |
742 | + | let bonusVal = bonusByDescription(value(asset.description)) | |
743 | + | let $t02005220130 = stakeUnstakeAcresInternal(0, addr, bonusVal) | |
744 | + | let actions = $t02005220130._1 | |
745 | + | let wlgClaimedAmount = $t02005220130._2 | |
746 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber + 1))) :+ IntegerEntry(keyStakedTimeByAssetIdAndOwner(assetIdStr, addr), lastBlock.timestamp)) ++ prologActions), wlgClaimedAmount) | |
747 | + | } | |
748 | + | } | |
749 | + | else { | |
750 | + | let arkimalName = isArkimalIssued(asset) | |
751 | + | if ((arkimalName == "")) | |
752 | + | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
753 | + | else { | |
754 | + | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
755 | + | if ((arkNftNumber >= MAX_ARK_NFTS)) | |
756 | + | then throw((("You can stake max " + toString(MAX_ARK_NFTS)) + " of Arkimals NFTs")) | |
757 | + | else { | |
758 | + | let $t02077220855 = stakeUnstakeAcresInternal(0, addr, ARK_NFT_BONUS) | |
759 | + | let actions = $t02077220855._1 | |
760 | + | let wlgClaimedAmount = $t02077220855._2 | |
761 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber + 1))) :+ IntegerEntry(keyStakedTimeByAssetIdAndOwner(assetIdStr, addr), lastBlock.timestamp)) ++ prologActions), wlgClaimedAmount) | |
762 | + | } | |
763 | + | } | |
764 | + | } | |
765 | + | } | |
766 | + | } | |
767 | + | } | |
768 | + | } | |
769 | + | ||
770 | + | ||
771 | + | ||
772 | + | @Callable(i) | |
773 | + | func unstakeNFT (assetIdStr) = { | |
774 | + | let prologActions = prolog(i) | |
775 | + | if ((size(i.payments) != 0)) | |
776 | + | then throw("No payments required") | |
777 | + | else { | |
778 | + | let assetId = fromBase58String(assetIdStr) | |
779 | + | let addr = toString(i.caller) | |
780 | + | let asset = value(assetInfo(assetId)) | |
781 | + | let timeKey = keyStakedTimeByAssetIdAndOwner(assetIdStr, addr) | |
782 | + | if (!(isDefined(getInteger(timeKey)))) | |
783 | + | then throw((("NFT " + asset.name) + " is not staked by you")) | |
784 | + | else { | |
785 | + | let nftsKey = keyStakedNFTsByOwner(addr) | |
786 | + | let nfts = split_4C(valueOrElse(getString(nftsKey), ""), "_") | |
787 | + | let idx = indexOf(nfts, assetIdStr) | |
788 | + | if (!(isDefined(idx))) | |
789 | + | then throw(("Your staked NFTs don't contain " + assetIdStr)) | |
790 | + | else { | |
791 | + | let listAction = if ((size(nfts) > 1)) | |
792 | + | then StringEntry(nftsKey, makeString_2C(removeByIndex(nfts, value(idx)), "_")) | |
793 | + | else DeleteEntry(nftsKey) | |
794 | + | let isWL = (asset.issuer == this) | |
795 | + | if (isWL) | |
796 | + | then { | |
797 | + | let wlNftNumber = valueOrElse(getInteger(keyUserWlNftNumber(addr)), 0) | |
798 | + | let bonusVal = bonusByDescription(value(asset.description)) | |
799 | + | let $t02216822247 = stakeUnstakeAcresInternal(0, addr, -(bonusVal)) | |
800 | + | let actions = $t02216822247._1 | |
801 | + | let wlgClaimedAmount = $t02216822247._2 | |
802 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserWlNftNumber(addr), (wlNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) ++ prologActions), wlgClaimedAmount) | |
803 | + | } | |
804 | + | else { | |
805 | + | let arkimalName = isArkimalIssued(asset) | |
806 | + | if ((arkimalName == "")) | |
807 | + | then throw("Only WavesLands and Arkimals NFT tokens are accepted") | |
808 | + | else { | |
809 | + | let arkNftNumber = valueOrElse(getInteger(keyUserArkNftNumber(addr)), 0) | |
810 | + | let $t02276022844 = stakeUnstakeAcresInternal(0, addr, -(ARK_NFT_BONUS)) | |
811 | + | let actions = $t02276022844._1 | |
812 | + | let wlgClaimedAmount = $t02276022844._2 | |
813 | + | $Tuple2(((((actions :+ listAction) :+ IntegerEntry(keyUserArkNftNumber(addr), (arkNftNumber - 1))) :+ DeleteEntry(keyStakedTimeByAssetIdAndOwner(toBase58String(assetId), addr))) ++ prologActions), wlgClaimedAmount) | |
814 | + | } | |
815 | + | } | |
816 | + | } | |
817 | + | } | |
818 | + | } | |
819 | + | } | |
820 | + | ||
821 | + |
github/deemru/w8io/026f985 581.69 ms ◑