tx · CdR8auZXQXnYMwGAbRf5TZgdv75sot9i6DWd56wQYCtG 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh: -0.01500000 Waves 2024.10.01 19:06 [3308009] smart account 3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh > SELF 0.00000000 Waves
{ "type": 13, "id": "CdR8auZXQXnYMwGAbRf5TZgdv75sot9i6DWd56wQYCtG", "fee": 1500000, "feeAssetId": null, "timestamp": 1727798805952, "version": 2, "chainId": 84, "sender": "3NBPx1Fciu3JQNEGZ21jSnTdutLNGGBUSXh", "senderPublicKey": "3QtfC1XbLZXdeawMDeSERy9vvjUmj1XYd2GFmrvx7pWQ", "proofs": [ "2GtSkV3PbDttwNHCZvMWnUGRdgzFCmWM3SJQFEac4KML8QPRoLAsZDRohohr2pp6eVsf4cPqNjC7FPdbtvhHHUJi" ], "script": "base64:BgIwCAISBAoCCAgSBAoCCAESAwoBBBIDCgEBEgASABIAEgASAwoBCBIDCgEIEgQKAggBMgADU0VQAgJfXwAFTVVMVDYAwIQ9AAVNVUxUNwCAreIEAAVNVUxUOACAwtcvABVVU0RUMkFDUkVTX01VTFRJUExJRVIACgAFY2hhaW4JAMkBAgkAygECCAUEdGhpcwVieXRlcwABAAEAC3VzZHRBc3NldElkBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwASCE2nqyCAM/TtG7yo7ui5O8yYLdC136B5ao1CP5qA//uQMJAAACAQFUBQckbWF0Y2gwASBVsdifcoeC7+XjW42sBatl3ppDoS8WuwXzGreHpfHFGAkAAgECDVVua25vd24gY2hhaW4AFmRlZmF1bHRSZXN0MkFkZHJlc3NTdHIEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDACIzNQRndZdGE4YmlFejMxenBlRmU1REpLOHdFNXRyU3BRVkY4AwkAAAIBAVQFByRtYXRjaDACIzNON1V1WWFyNjI2NFA1OEZCaFZXS1BRQWg0WXVhMmhnbmd2CQACAQINVW5rb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FjawEEYWRkcgMJAQIhPQIIBQFpBmNhbGxlcgkBEUBleHRyTmF0aXZlKDEwNjIpAQUVb2xkU3Rha2luZ0NvbnRyYWN0U3RyCQACAQIRUGVybWlzc2lvbiBkZW5pZWQJARJzdGFrZUFjcmVzSW50ZXJuYWwCCAkAkQMCCAUBaQhwYXltZW50cwAABmFtb3VudAUEYWRkcgFpARpzaW11bGF0ZVN0YWtlQWNyZXNSRUFET05MWQIHYWRkcmVzcwZhbW91bnQECWFtb3VudEtleQkBF2tleUFjcmVzU3Rha2VkQW10QnlVc2VyAQUHYWRkcmVzcwQObmV3QWNyZXNBbW91bnQJAGQCCQELdmFsdWVPckVsc2UCCQCfCAEFCWFtb3VudEtleQAABQZhbW91bnQECG9sZFRvdGFsCQELdmFsdWVPckVsc2UCCQCfCAEFEmFjcmVzU3Rha2RUb3RhbEtleQAABAl1c2VyRnBLZXkJARVrZXlGYXJtaW5nUG93ZXJCeVVzZXIBBQdhZGRyZXNzBAVvbGRGcAkBC3ZhbHVlT3JFbHNlAgkAnwgBBQl1c2VyRnBLZXkAAAQFbmV3RnAJARZnZXRGYXJtaW5nUG93ZXJCeUFjcmVzAQUObmV3QWNyZXNBbW91bnQECm9sZFRvdGFsRnAJAQt2YWx1ZU9yRWxzZQIJAJ8IAQUUdG90YWxGYXJtaW5nUG93ZXJLZXkAAAQKbmV3VG90YWxGcAkAZAIJAGUCBQpvbGRUb3RhbEZwBQVvbGRGcAUFbmV3RnAJAJQKAgUDbmlsCQDMCAIFBW9sZEZwCQDMCAIFBW5ld0ZwCQDMCAIFCm9sZFRvdGFsRnAJAMwIAgUKbmV3VG90YWxGcAUDbmlsABiT5JY=", "height": 3308009, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AATwCftzGi2MLdfy2M5sgNXtbYs6WUDfaLBUFJzBtUYN Next: H99cya7v6CCzaG2qqKHQzx7RbN2zk57C6wLgeZWR8n4f Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT7 = 10000000 | |
9 | + | ||
6 | 10 | let MULT8 = 100000000 | |
7 | 11 | ||
8 | - | let | |
12 | + | let USDT2ACRES_MULTIPLIER = 10 | |
9 | 13 | ||
10 | 14 | let chain = take(drop(this.bytes, 1), 1) | |
15 | + | ||
16 | + | let usdtAssetId = match chain { | |
17 | + | case _ => | |
18 | + | if ((base58'2W' == $match0)) | |
19 | + | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
20 | + | else if ((base58'2T' == $match0)) | |
21 | + | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
22 | + | else throw("Unknown chain") | |
23 | + | } | |
11 | 24 | ||
12 | 25 | let defaultRest2AddressStr = match chain { | |
13 | 26 | case _ => | |
34 | 47 | ||
35 | 48 | let IdxCfgWlgDapp = 2 | |
36 | 49 | ||
50 | + | let IdxCfgInvestFundDapp = 5 | |
51 | + | ||
37 | 52 | func keyRestCfg () = "%s__restConfig" | |
38 | 53 | ||
39 | 54 | ||
54 | 69 | ||
55 | 70 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
56 | 71 | ||
72 | + | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
73 | + | ||
57 | 74 | let oldAcresContractKey = "oldAcresContract" | |
58 | 75 | ||
59 | 76 | func keyBlocked () = "contractsBlocked" | |
61 | 78 | ||
62 | 79 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
63 | 80 | ||
64 | - | ||
65 | - | let wlgAssetIdKey = "wlg_assetId" | |
66 | - | ||
67 | - | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
68 | 81 | ||
69 | 82 | let acresIssuedAmountKey = "acresIssuedAmount" | |
70 | 83 | ||
131 | 144 | ||
132 | 145 | let M8_ = 100000000 | |
133 | 146 | ||
147 | + | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
148 | + | ||
149 | + | let zbIssuedAmtKey = "zbill_issuedAmount" | |
150 | + | ||
134 | 151 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
135 | 152 | ||
136 | 153 | ||
193 | 210 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
194 | 211 | } | |
195 | 212 | else throw("Strict value is not equal to itself.") | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | func getWlgPrice (usdtBalanceCorrection) = { | |
217 | + | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
218 | + | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
219 | + | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
220 | + | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
221 | + | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
222 | + | fraction(totalFundsUsd, MULT8, issuedAmount) | |
196 | 223 | } | |
197 | 224 | ||
198 | 225 | ||
265 | 292 | else (value(pmt.assetId) != acresAssetId)) | |
266 | 293 | then throw("ACRES payments only!") | |
267 | 294 | else { | |
268 | - | let $ | |
269 | - | let actions = $ | |
270 | - | let wlgClaimedAmount = $ | |
295 | + | let $t045094575 = stakeAcresInternal(amt, address) | |
296 | + | let actions = $t045094575._1 | |
297 | + | let wlgClaimedAmount = $t045094575._2 | |
271 | 298 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
272 | 299 | } | |
273 | 300 | } | |
278 | 305 | @Callable(i) | |
279 | 306 | func buyAcres () = { | |
280 | 307 | let prologActions = prolog(i) | |
281 | - | let address = toString(i.caller) | |
282 | 308 | if ((size(i.payments) != 1)) | |
283 | 309 | then throw("exactly 1 payment must be attached") | |
284 | 310 | else { | |
285 | 311 | let pmt = i.payments[0] | |
286 | - | let | |
312 | + | let usdtAmount = pmt.amount | |
287 | 313 | if (if (!(isDefined(pmt.assetId))) | |
288 | 314 | then true | |
289 | - | else (value(pmt.assetId) != | |
290 | - | then throw(" | |
291 | - | else if (( | |
292 | - | then throw((("Min payment should be " + fixedPoint( | |
315 | + | else (value(pmt.assetId) != usdtAssetId)) | |
316 | + | then throw("USDT payments only!") | |
317 | + | else if ((MULT6 > usdtAmount)) | |
318 | + | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
293 | 319 | else { | |
294 | - | let acresAmount = (amt / WLG2ACRES_DIVISOR) | |
320 | + | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
321 | + | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
295 | 322 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
296 | 323 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
297 | 324 | if ((req == req)) | |
298 | 325 | then { | |
299 | - | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", | |
326 | + | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
300 | 327 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
301 | 328 | } | |
302 | 329 | else throw("Strict value is not equal to itself.") | |
330 | + | } | |
331 | + | } | |
332 | + | } | |
333 | + | ||
334 | + | ||
335 | + | ||
336 | + | @Callable(i) | |
337 | + | func sellAcres () = { | |
338 | + | let prologActions = prolog(i) | |
339 | + | if ((size(i.payments) != 1)) | |
340 | + | then throw("exactly 1 payment must be attached") | |
341 | + | else { | |
342 | + | let pmt = i.payments[0] | |
343 | + | let acresAmount = pmt.amount | |
344 | + | if (if (!(isDefined(pmt.assetId))) | |
345 | + | then true | |
346 | + | else (value(pmt.assetId) != acresAssetId)) | |
347 | + | then throw("ACRES payments only!") | |
348 | + | else if ((MULT7 > acresAmount)) | |
349 | + | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
350 | + | else { | |
351 | + | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
352 | + | $Tuple2(([ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
303 | 353 | } | |
304 | 354 | } | |
305 | 355 | } | |
407 | 457 | else stakeAcresInternal(i.payments[0].amount, addr) | |
408 | 458 | ||
409 | 459 | ||
460 | + | ||
461 | + | @Callable(i) | |
462 | + | func simulateStakeAcresREADONLY (address,amount) = { | |
463 | + | let amountKey = keyAcresStakedAmtByUser(address) | |
464 | + | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amount) | |
465 | + | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
466 | + | let userFpKey = keyFarmingPowerByUser(address) | |
467 | + | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
468 | + | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
469 | + | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
470 | + | let newTotalFp = ((oldTotalFp - oldFp) + newFp) | |
471 | + | $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp]) | |
472 | + | } | |
473 | + | ||
474 | + |
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 | + | let MULT6 = 1000000 | |
7 | + | ||
8 | + | let MULT7 = 10000000 | |
9 | + | ||
6 | 10 | let MULT8 = 100000000 | |
7 | 11 | ||
8 | - | let | |
12 | + | let USDT2ACRES_MULTIPLIER = 10 | |
9 | 13 | ||
10 | 14 | let chain = take(drop(this.bytes, 1), 1) | |
15 | + | ||
16 | + | let usdtAssetId = match chain { | |
17 | + | case _ => | |
18 | + | if ((base58'2W' == $match0)) | |
19 | + | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
20 | + | else if ((base58'2T' == $match0)) | |
21 | + | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
22 | + | else throw("Unknown chain") | |
23 | + | } | |
11 | 24 | ||
12 | 25 | let defaultRest2AddressStr = match chain { | |
13 | 26 | case _ => | |
14 | 27 | if ((base58'2W' == $match0)) | |
15 | 28 | then "3PFwYta8biEz31zpeFe5DJK8wE5trSpQVF8" | |
16 | 29 | else if ((base58'2T' == $match0)) | |
17 | 30 | then "3N7UuYar6264P58FBhVWKPQAh4Yua2hgngv" | |
18 | 31 | else throw("Unknown chain") | |
19 | 32 | } | |
20 | 33 | ||
21 | 34 | let oldStakingContractStr = match chain { | |
22 | 35 | case _ => | |
23 | 36 | if ((base58'2W' == $match0)) | |
24 | 37 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
25 | 38 | else if ((base58'2T' == $match0)) | |
26 | 39 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
27 | 40 | else throw("Unknown chain") | |
28 | 41 | } | |
29 | 42 | ||
30 | 43 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
31 | 44 | ||
32 | 45 | ||
33 | 46 | let IdxCfgAcres2Dapp = 1 | |
34 | 47 | ||
35 | 48 | let IdxCfgWlgDapp = 2 | |
36 | 49 | ||
50 | + | let IdxCfgInvestFundDapp = 5 | |
51 | + | ||
37 | 52 | func keyRestCfg () = "%s__restConfig" | |
38 | 53 | ||
39 | 54 | ||
40 | 55 | func keyRest2Address () = "%s__rest2Addr" | |
41 | 56 | ||
42 | 57 | ||
43 | 58 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
44 | 59 | ||
45 | 60 | ||
46 | 61 | func getContractAddressOrFail (rest2Cfg,idx) = valueOrErrorMessage(addressFromString(rest2Cfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
47 | 62 | ||
48 | 63 | ||
49 | 64 | let rest2Contract = addressFromStringValue(valueOrElse(getString(this, keyRest2Address()), defaultRest2AddressStr)) | |
50 | 65 | ||
51 | 66 | let rest2Cfg = readRestCfgOrFail(rest2Contract) | |
52 | 67 | ||
53 | 68 | let acres2Contract = getContractAddressOrFail(rest2Cfg, IdxCfgAcres2Dapp) | |
54 | 69 | ||
55 | 70 | let wlgContract = getContractAddressOrFail(rest2Cfg, IdxCfgWlgDapp) | |
56 | 71 | ||
72 | + | let investFundContract = getContractAddressOrFail(rest2Cfg, IdxCfgInvestFundDapp) | |
73 | + | ||
57 | 74 | let oldAcresContractKey = "oldAcresContract" | |
58 | 75 | ||
59 | 76 | func keyBlocked () = "contractsBlocked" | |
60 | 77 | ||
61 | 78 | ||
62 | 79 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
63 | 80 | ||
64 | - | ||
65 | - | let wlgAssetIdKey = "wlg_assetId" | |
66 | - | ||
67 | - | let wlgAssetId = valueOrErrorMessage(getBinary(wlgContract, wlgAssetIdKey), "WLGOLD is not issued yet") | |
68 | 81 | ||
69 | 82 | let acresIssuedAmountKey = "acresIssuedAmount" | |
70 | 83 | ||
71 | 84 | let acresAssetIdKey = "acresAssetId" | |
72 | 85 | ||
73 | 86 | let acresAssetId = valueOrErrorMessage(getBinary(acres2Contract, acresAssetIdKey), "ACRES is not issued yet") | |
74 | 87 | ||
75 | 88 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
76 | 89 | ||
77 | 90 | ||
78 | 91 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
79 | 92 | ||
80 | 93 | ||
81 | 94 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
82 | 95 | ||
83 | 96 | ||
84 | 97 | func asInt (v) = match v { | |
85 | 98 | case n: Int => | |
86 | 99 | n | |
87 | 100 | case _ => | |
88 | 101 | throw("fail to cast into Int") | |
89 | 102 | } | |
90 | 103 | ||
91 | 104 | ||
92 | 105 | func asTuple5Ints (val) = match val { | |
93 | 106 | case t: (Int, Int, Int, Int, Int) => | |
94 | 107 | t | |
95 | 108 | case _ => | |
96 | 109 | throw("fail to cast into (Int, Int, Int, Int, Int)") | |
97 | 110 | } | |
98 | 111 | ||
99 | 112 | ||
100 | 113 | func asTuple4Ints (val) = match val { | |
101 | 114 | case t: (Int, Int, Int, Int) => | |
102 | 115 | t | |
103 | 116 | case _ => | |
104 | 117 | throw("fail to cast into (Int, Int, Int, Int)") | |
105 | 118 | } | |
106 | 119 | ||
107 | 120 | ||
108 | 121 | func asTuple3Ints (val) = match val { | |
109 | 122 | case t: (Int, Int, Int) => | |
110 | 123 | t | |
111 | 124 | case _ => | |
112 | 125 | throw("fail to cast into (Int, Int, Int)") | |
113 | 126 | } | |
114 | 127 | ||
115 | 128 | ||
116 | 129 | func asTuple2Ints (val) = match val { | |
117 | 130 | case t: (Int, Int) => | |
118 | 131 | t | |
119 | 132 | case _ => | |
120 | 133 | throw("fail to cast into (Int, Int)") | |
121 | 134 | } | |
122 | 135 | ||
123 | 136 | ||
124 | 137 | func fixedPoint (val,decimals) = { | |
125 | 138 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
126 | 139 | let lowPart = toString((val % tenPow)) | |
127 | 140 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
128 | 141 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
129 | 142 | } | |
130 | 143 | ||
131 | 144 | ||
132 | 145 | let M8_ = 100000000 | |
133 | 146 | ||
147 | + | let wlgIssuedAmtKey = "wlg_issuedAmount" | |
148 | + | ||
149 | + | let zbIssuedAmtKey = "zbill_issuedAmount" | |
150 | + | ||
134 | 151 | func keyAcresStakedAmtByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
135 | 152 | ||
136 | 153 | ||
137 | 154 | func keyFarmingPowerByUser (addr) = ("farmingPowerByUser_" + addr) | |
138 | 155 | ||
139 | 156 | ||
140 | 157 | let acresStakdTotalKey = "acresStakedAmountTotal" | |
141 | 158 | ||
142 | 159 | let totalFarmingPowerKey = "totalFarmingPower" | |
143 | 160 | ||
144 | 161 | let levels = [10, 20, 40, 80, 150, 250, 400, 700, 1000] | |
145 | 162 | ||
146 | 163 | func getLevelByAcres (acres) = { | |
147 | 164 | let acr = (acres / M8_) | |
148 | 165 | func checker (acc,item) = if ((item > acr)) | |
149 | 166 | then acc | |
150 | 167 | else (acc + 1) | |
151 | 168 | ||
152 | 169 | let idx = { | |
153 | 170 | let $l = levels | |
154 | 171 | let $s = size($l) | |
155 | 172 | let $acc0 = 0 | |
156 | 173 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
157 | 174 | then $a | |
158 | 175 | else checker($a, $l[$i]) | |
159 | 176 | ||
160 | 177 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
161 | 178 | then $a | |
162 | 179 | else throw("List size exceeds 10") | |
163 | 180 | ||
164 | 181 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
165 | 182 | } | |
166 | 183 | (idx + 1) | |
167 | 184 | } | |
168 | 185 | ||
169 | 186 | ||
170 | 187 | func getFarmingPowerByAcres (acres) = ((acres * 20) * (getLevelByAcres(acres) + 4)) | |
171 | 188 | ||
172 | 189 | ||
173 | 190 | func prolog (i) = if (if ((i.originCaller != rest2Contract)) | |
174 | 191 | then valueOrElse(getBoolean(keyBlocked()), false) | |
175 | 192 | else false) | |
176 | 193 | then throw("Contracts are under maintenance") | |
177 | 194 | else [StringEntry(keyLastTxIdByUser(toString(i.originCaller)), toBase58String(i.transactionId))] | |
178 | 195 | ||
179 | 196 | ||
180 | 197 | func stakeAcresInternal (amt,address) = { | |
181 | 198 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
182 | 199 | if ((wlgResult == wlgResult)) | |
183 | 200 | then { | |
184 | 201 | let now = lastBlock.timestamp | |
185 | 202 | let timeKey = keyAcresStakedTimeByUser(address) | |
186 | 203 | let amountKey = keyAcresStakedAmtByUser(address) | |
187 | 204 | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amt) | |
188 | 205 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
189 | 206 | let userFpKey = keyFarmingPowerByUser(address) | |
190 | 207 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
191 | 208 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
192 | 209 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
193 | 210 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, newAcresAmount), IntegerEntry(acresStakdTotalKey, (oldTotal + amt)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp))], wlgResult) | |
194 | 211 | } | |
195 | 212 | else throw("Strict value is not equal to itself.") | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | func getWlgPrice (usdtBalanceCorrection) = { | |
217 | + | let issuedAmount = valueOrErrorMessage(getInteger(wlgContract, wlgIssuedAmtKey), "WLGOLD is not issued yet") | |
218 | + | let wlgUsd = assetBalance(wlgContract, usdtAssetId) | |
219 | + | let acres2Usd = (assetBalance(acres2Contract, usdtAssetId) - usdtBalanceCorrection) | |
220 | + | let investFundTotal = (assetBalance(investFundContract, usdtAssetId) + valueOrElse(getInteger(investFundContract, zbIssuedAmtKey), 0)) | |
221 | + | let totalFundsUsd = ((acres2Usd + wlgUsd) + investFundTotal) | |
222 | + | fraction(totalFundsUsd, MULT8, issuedAmount) | |
196 | 223 | } | |
197 | 224 | ||
198 | 225 | ||
199 | 226 | @Callable(i) | |
200 | 227 | func constructorV1 (rest2Addr,oldAcrContract) = if ((i.caller != this)) | |
201 | 228 | then throw("Permission denied") | |
202 | 229 | else { | |
203 | 230 | let oldAcrContAddr = addressFromStringValue(oldAcrContract) | |
204 | 231 | [IntegerEntry(acresIssuedAmountKey, getIntegerValue(oldAcrContAddr, acresIssuedAmountKey)), BinaryEntry(acresAssetIdKey, getBinaryValue(oldAcrContAddr, acresAssetIdKey)), StringEntry(keyRest2Address(), rest2Addr), StringEntry(oldAcresContractKey, oldAcrContract)] | |
205 | 232 | } | |
206 | 233 | ||
207 | 234 | ||
208 | 235 | ||
209 | 236 | @Callable(i) | |
210 | 237 | func saveInteger (key,amount) = if ((i.caller != this)) | |
211 | 238 | then throw("saveInteger is not public method") | |
212 | 239 | else [IntegerEntry(key, amount)] | |
213 | 240 | ||
214 | 241 | ||
215 | 242 | ||
216 | 243 | @Callable(i) | |
217 | 244 | func setBlocked (isBlocked) = if ((i.caller != this)) | |
218 | 245 | then throw("permission denied") | |
219 | 246 | else [BooleanEntry(keyBlocked(), isBlocked)] | |
220 | 247 | ||
221 | 248 | ||
222 | 249 | ||
223 | 250 | @Callable(i) | |
224 | 251 | func unstakeAcres (amount) = { | |
225 | 252 | let prologActions = prolog(i) | |
226 | 253 | if ((0 >= amount)) | |
227 | 254 | then throw("Amount should be positive") | |
228 | 255 | else { | |
229 | 256 | let address = toString(i.caller) | |
230 | 257 | if ((size(i.payments) != 0)) | |
231 | 258 | then throw("No payments required") | |
232 | 259 | else { | |
233 | 260 | let timeKey = keyAcresStakedTimeByUser(address) | |
234 | 261 | let amountKey = keyAcresStakedAmtByUser(address) | |
235 | 262 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
236 | 263 | if ((amount > oldAcresAmount)) | |
237 | 264 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
238 | 265 | else { | |
239 | 266 | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
240 | 267 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
241 | 268 | let newAcresAmount = (oldAcresAmount - amount) | |
242 | 269 | let userFpKey = keyFarmingPowerByUser(address) | |
243 | 270 | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
244 | 271 | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
245 | 272 | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
246 | 273 | $Tuple2(([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakdTotalKey, (oldTotal - amount)), IntegerEntry(userFpKey, newFp), IntegerEntry(totalFarmingPowerKey, ((oldTotalFp - oldFp) + newFp)), ScriptTransfer(i.caller, amount, acresAssetId)] ++ prologActions), wlgResult) | |
247 | 274 | } | |
248 | 275 | } | |
249 | 276 | } | |
250 | 277 | } | |
251 | 278 | ||
252 | 279 | ||
253 | 280 | ||
254 | 281 | @Callable(i) | |
255 | 282 | func stakeAcres () = { | |
256 | 283 | let prologActions = prolog(i) | |
257 | 284 | let address = toString(i.caller) | |
258 | 285 | if ((size(i.payments) != 1)) | |
259 | 286 | then throw("exactly 1 payment must be attached") | |
260 | 287 | else { | |
261 | 288 | let pmt = i.payments[0] | |
262 | 289 | let amt = pmt.amount | |
263 | 290 | if (if (!(isDefined(pmt.assetId))) | |
264 | 291 | then true | |
265 | 292 | else (value(pmt.assetId) != acresAssetId)) | |
266 | 293 | then throw("ACRES payments only!") | |
267 | 294 | else { | |
268 | - | let $ | |
269 | - | let actions = $ | |
270 | - | let wlgClaimedAmount = $ | |
295 | + | let $t045094575 = stakeAcresInternal(amt, address) | |
296 | + | let actions = $t045094575._1 | |
297 | + | let wlgClaimedAmount = $t045094575._2 | |
271 | 298 | $Tuple2((actions ++ prologActions), wlgClaimedAmount) | |
272 | 299 | } | |
273 | 300 | } | |
274 | 301 | } | |
275 | 302 | ||
276 | 303 | ||
277 | 304 | ||
278 | 305 | @Callable(i) | |
279 | 306 | func buyAcres () = { | |
280 | 307 | let prologActions = prolog(i) | |
281 | - | let address = toString(i.caller) | |
282 | 308 | if ((size(i.payments) != 1)) | |
283 | 309 | then throw("exactly 1 payment must be attached") | |
284 | 310 | else { | |
285 | 311 | let pmt = i.payments[0] | |
286 | - | let | |
312 | + | let usdtAmount = pmt.amount | |
287 | 313 | if (if (!(isDefined(pmt.assetId))) | |
288 | 314 | then true | |
289 | - | else (value(pmt.assetId) != | |
290 | - | then throw(" | |
291 | - | else if (( | |
292 | - | then throw((("Min payment should be " + fixedPoint( | |
315 | + | else (value(pmt.assetId) != usdtAssetId)) | |
316 | + | then throw("USDT payments only!") | |
317 | + | else if ((MULT6 > usdtAmount)) | |
318 | + | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
293 | 319 | else { | |
294 | - | let acresAmount = (amt / WLG2ACRES_DIVISOR) | |
320 | + | let acresAmount = (usdtAmount * USDT2ACRES_MULTIPLIER) | |
321 | + | let wlgAmount = fraction(usdtAmount, MULT8, getWlgPrice(usdtAmount)) | |
295 | 322 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
296 | 323 | let req = invoke(oldAcresAddress, "requestAcresCallback", [acresAmount], nil) | |
297 | 324 | if ((req == req)) | |
298 | 325 | then { | |
299 | - | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", | |
326 | + | let wlgRemain = asInt(invoke(wlgContract, "burnWlgold", [wlgAmount], nil)) | |
300 | 327 | $Tuple2(([ScriptTransfer(i.caller, acresAmount, acresAssetId)] ++ prologActions), wlgRemain) | |
301 | 328 | } | |
302 | 329 | else throw("Strict value is not equal to itself.") | |
330 | + | } | |
331 | + | } | |
332 | + | } | |
333 | + | ||
334 | + | ||
335 | + | ||
336 | + | @Callable(i) | |
337 | + | func sellAcres () = { | |
338 | + | let prologActions = prolog(i) | |
339 | + | if ((size(i.payments) != 1)) | |
340 | + | then throw("exactly 1 payment must be attached") | |
341 | + | else { | |
342 | + | let pmt = i.payments[0] | |
343 | + | let acresAmount = pmt.amount | |
344 | + | if (if (!(isDefined(pmt.assetId))) | |
345 | + | then true | |
346 | + | else (value(pmt.assetId) != acresAssetId)) | |
347 | + | then throw("ACRES payments only!") | |
348 | + | else if ((MULT7 > acresAmount)) | |
349 | + | then throw((("Min payment should be " + fixedPoint(MULT7, 8)) + " ACRES")) | |
350 | + | else { | |
351 | + | let usdtAmount = ((acresAmount / USDT2ACRES_MULTIPLIER) / 2) | |
352 | + | $Tuple2(([ScriptTransfer(i.caller, usdtAmount, usdtAssetId)] ++ prologActions), usdtAmount) | |
303 | 353 | } | |
304 | 354 | } | |
305 | 355 | } | |
306 | 356 | ||
307 | 357 | ||
308 | 358 | ||
309 | 359 | @Callable(i) | |
310 | 360 | func convertOldStakes () = { | |
311 | 361 | let address = toString(i.caller) | |
312 | 362 | if ((size(i.payments) != 0)) | |
313 | 363 | then throw("No payments required") | |
314 | 364 | else { | |
315 | 365 | let oldAcresAddress = addressFromStringValue(getStringValue(oldAcresContractKey)) | |
316 | 366 | let amount = valueOrElse(getInteger(oldAcresAddress, keyAcresStakedAmtByUser(address)), 0) | |
317 | 367 | let gotAcres0 = if ((amount > 0)) | |
318 | 368 | then asTuple2Ints(invoke(oldAcresAddress, "unstakeAcresCallback", [amount, address], nil)) | |
319 | 369 | else $Tuple2(0, 0) | |
320 | 370 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
321 | 371 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
322 | 372 | let landsResult = if (isDefined(landsStr)) | |
323 | 373 | then { | |
324 | 374 | let lands = split_51C(value(landsStr), "_") | |
325 | 375 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
326 | 376 | then throw("landAssetId is required") | |
327 | 377 | else { | |
328 | 378 | let r = asTuple5Ints(invoke(oldStakingAddress, "unstakeLandCallback", [landAssetId, address], nil)) | |
329 | 379 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
330 | 380 | } | |
331 | 381 | ||
332 | 382 | let rr = { | |
333 | 383 | let $l = lands | |
334 | 384 | let $s = size($l) | |
335 | 385 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
336 | 386 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
337 | 387 | then $a | |
338 | 388 | else oneLand($a, $l[$i]) | |
339 | 389 | ||
340 | 390 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
341 | 391 | then $a | |
342 | 392 | else throw("List size exceeds 100") | |
343 | 393 | ||
344 | 394 | $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) | |
345 | 395 | } | |
346 | 396 | let finalize = invoke(oldStakingAddress, "unstakeLandsFinalizeCallback", [address], nil) | |
347 | 397 | if ((finalize == finalize)) | |
348 | 398 | then { | |
349 | 399 | let req = invoke(oldAcresAddress, "requestAcresCallback", [(((rr._1 + rr._2) + rr._3) + rr._4)], nil) | |
350 | 400 | if ((req == req)) | |
351 | 401 | then { | |
352 | 402 | let issue = Issue("FPOWER10", "FarmingPower +10% NFT for WavesLands game", 1, 0, false) | |
353 | 403 | $Tuple5(rr._1, rr._2, rr._3, rr._4, [issue, ScriptTransfer(i.caller, 1, calculateAssetId(issue))]) | |
354 | 404 | } | |
355 | 405 | else throw("Strict value is not equal to itself.") | |
356 | 406 | } | |
357 | 407 | else throw("Strict value is not equal to itself.") | |
358 | 408 | } | |
359 | 409 | else $Tuple5(0, 0, 0, 0, nil) | |
360 | 410 | let duckAssetId = valueOrElse(getString(oldStakingAddress, keyStakedDuckByOwner(address)), "") | |
361 | 411 | let duckResult = if ((duckAssetId != "")) | |
362 | 412 | then asTuple3Ints(invoke(oldStakingAddress, "unstakeDuckCallback", [duckAssetId, address], nil)) | |
363 | 413 | else $Tuple3(0, 0, 0) | |
364 | 414 | let x = stakeAcresInternal((((((((gotAcres0._1 + landsResult._1) + landsResult._2) + landsResult._3) + landsResult._4) + duckResult._1) + duckResult._2) + duckResult._3), address) | |
365 | 415 | $Tuple2((landsResult._5 ++ x._1), x._2) | |
366 | 416 | } | |
367 | 417 | } | |
368 | 418 | ||
369 | 419 | ||
370 | 420 | ||
371 | 421 | @Callable(i) | |
372 | 422 | func unstakeLandsREADONLY (address) = { | |
373 | 423 | let oldStakingAddress = addressFromStringValue(oldStakingContractStr) | |
374 | 424 | let landsStr = getString(oldStakingAddress, keyStakedLandsByOwner(address)) | |
375 | 425 | let landsResult = if (isDefined(landsStr)) | |
376 | 426 | then { | |
377 | 427 | let lands = split_51C(value(landsStr), "_") | |
378 | 428 | func oneLand (acc,landAssetId) = if ((landAssetId == "")) | |
379 | 429 | then throw("landAssetId is required") | |
380 | 430 | else { | |
381 | 431 | let r = asTuple4Ints(invoke(oldStakingAddress, "unstakeLandREADONLY", [landAssetId, address], nil)) | |
382 | 432 | $Tuple4((acc._1 + r._1), (acc._2 + r._2), (acc._3 + r._3), (acc._4 + r._4)) | |
383 | 433 | } | |
384 | 434 | ||
385 | 435 | let $l = lands | |
386 | 436 | let $s = size($l) | |
387 | 437 | let $acc0 = $Tuple4(0, 0, 0, 0) | |
388 | 438 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
389 | 439 | then $a | |
390 | 440 | else oneLand($a, $l[$i]) | |
391 | 441 | ||
392 | 442 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
393 | 443 | then $a | |
394 | 444 | else throw("List size exceeds 100") | |
395 | 445 | ||
396 | 446 | $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) | |
397 | 447 | } | |
398 | 448 | else $Tuple4(0, 0, 0, 0) | |
399 | 449 | $Tuple2(nil, landsResult) | |
400 | 450 | } | |
401 | 451 | ||
402 | 452 | ||
403 | 453 | ||
404 | 454 | @Callable(i) | |
405 | 455 | func stakeAcresCallback (addr) = if ((i.caller != addressFromStringValue(oldStakingContractStr))) | |
406 | 456 | then throw("Permission denied") | |
407 | 457 | else stakeAcresInternal(i.payments[0].amount, addr) | |
408 | 458 | ||
409 | 459 | ||
460 | + | ||
461 | + | @Callable(i) | |
462 | + | func simulateStakeAcresREADONLY (address,amount) = { | |
463 | + | let amountKey = keyAcresStakedAmtByUser(address) | |
464 | + | let newAcresAmount = (valueOrElse(getInteger(amountKey), 0) + amount) | |
465 | + | let oldTotal = valueOrElse(getInteger(acresStakdTotalKey), 0) | |
466 | + | let userFpKey = keyFarmingPowerByUser(address) | |
467 | + | let oldFp = valueOrElse(getInteger(userFpKey), 0) | |
468 | + | let newFp = getFarmingPowerByAcres(newAcresAmount) | |
469 | + | let oldTotalFp = valueOrElse(getInteger(totalFarmingPowerKey), 0) | |
470 | + | let newTotalFp = ((oldTotalFp - oldFp) + newFp) | |
471 | + | $Tuple2(nil, [oldFp, newFp, oldTotalFp, newTotalFp]) | |
472 | + | } | |
473 | + | ||
474 | + |
github/deemru/w8io/026f985 74.89 ms ◑