tx · FQmE36qNwo3eacM5XEnJRiL3NK8U3FRYCrnBo23SdLbD 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg: -0.01400000 Waves 2023.11.19 21:55 [2850660] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves
{ "type": 13, "id": "FQmE36qNwo3eacM5XEnJRiL3NK8U3FRYCrnBo23SdLbD", "fee": 1400000, "feeAssetId": null, "timestamp": 1700420183450, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "3G7LENruAbswpH9UvZYoHD7eYgHnbarwLd4jxZDEfrAa7xtbjPNkFGGXTcAniWbJ9KawXz594z7jk2uMfXDbk8fJ" ], "script": "base64:BgIsCAISBAoCCAESABIDCgEBEgASABIECgIIARIFCgMIAQESAwoBARIAEgMKAQg1AAhNSUxMSU9ONgCAgOmDsd4WAAlEQVlNSUxMSVMAgLiZKQEaa2V5QWNyZXNTdGFrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNTdGFrZWRBbW91bnRCeVVzZXJfBQRhZGRyARprZXlBY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcgEEYWRkcgkArAICAhhhY3Jlc0xvY2tlZEFtb3VudEJ5VXNlcl8FBGFkZHIBF2tleUFjcmVzTG9ja2VkRXRhQnlVc2VyAQRhZGRyCQCsAgICFWFjcmVzTG9ja2VkRXRhQnlVc2VyXwUEYWRkcgATYWNyZXNTdGFrZWRUb3RhbEtleQIWYWNyZXNTdGFrZWRBbW91bnRUb3RhbAAKeHBOZXdTTGFuZADAlrECAA9EQUlMWVJFU0JZUElFQ0UAgPjSAQAVVVNEVDJBQ1JFU19NVUxUSVBMSUVSAAoABWNoYWluCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2R0QXNzZ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FRpbWVCeVVzZXIBBQdhZGRyZXNzBAlhbW91bnRLZXkJARprZXlBY3Jlc1N0YWtlZEFtb3VudEJ5VXNlcgEFB2FkZHJlc3MEC2FjcmVzQW1vdW50CQELdmFsdWVPckVsc2UCCQCfCAEFCWFtb3VudEtleQAABAhsYXN0VGltZQkBC3ZhbHVlT3JFbHNlAgkAnwgBBQd0aW1lS2V5AAAEDGNsYWltZWRBY3JlcwkBEmNsYWltQWNyZXNJbnRlcm5hbAMFB2FkZHJlc3MFC2FjcmVzQW1vdW50BQhsYXN0VGltZQkAlAoCBQNuaWwJAMwIAgUMY2xhaW1lZEFjcmVzCQDMCAIFCGxhc3RUaW1lBQNuaWwA4i0E3g==", "height": 2850660, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: E2JN3F1oqYzoP5pTv4TtpwMPbvRbYFbCHmniF6ijiSig Next: 2gMXPUhHd9EYANm6KQ5hd9dVFQniBYQFjfNBWHurPhUq Diff:
Old | New | Differences | |
---|---|---|---|
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | + | func padL (val,len) = { | |
151 | + | let valS = toString(val) | |
152 | + | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
153 | + | (zeroes + valS) | |
154 | + | } | |
155 | + | ||
156 | + | ||
150 | 157 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
158 | + | ||
159 | + | let BLACKLISTED1 = "3P2NGX4Q5nge1MCauwQW5aqYLdkccSGj1Ep_3P2xFAHW9yhyNohYozWd4HFhEXZu3bsNSoR_3P2yKaZ2gvn9Xe5tti81a7P9LZhHgjvToV9_3P37zQ3cf2ecu55RmJqEiGSivdzN9avt3m9_3P4az6dtzsvGCWFAxa94UdevKzXyEwxEiFG_3P4kZU6X3TTLFcSUe55JSy8BySqitcPgMBz_3P5hCxBEh3NgNizZhNBreyBSqtbhJYLkKPD_3P7HLvucy11yxyMJUwjzXFHHKMEDwi1EwfC_3P8JuaqH9PTQAv8D5HBGgQfKauLTYt2NQft_3P9gTDB4rtDEVbpX3asU63H4Zinh2EnTmZE_3P9iN3qrtfJicUVy7amZeVsetVD3vUMk8be_3PCa2BsAa6JBLirszQfV5r9fJrujfhwtwfP_3PD3i4XN8KtygcFx4ry5M7UGqdfH8VYvtRT_3PDEMnnJNc2kx9cPEmvVvhXUr8SvhANKhsa_3PDGE9tKQizaeZFeDDq5aYSv89nwYbfirpZ_3PDMKQTCrUPZECVXEJJ8m1sHtutSu1naSf1_3PGh2Qu6Yvx8GTCRRVNvBUVZLdaidYSaxo5_3PKkmAtbSK5D2hQdo1RfEg8eXyMbDcRUc92_3PLMnbxzssP8W8E8XjJ1RLBBg8UZL8Cz3P2_3PMuxo4PCAox9s4a7R1eszh4iqqu8gS7jHv_3PNrMtEQChw87WZU1JAJ7aGHykCa8TjnDNK_3PPuBXfWoBy3EEory7c7vgi9Usjka7o5tBj_3PQwyeyEhT4Y6aGAL6tg73aQWJtV1zRt3nR_3PRGDShuMGb84MJtTJvtTg8qDfswkYWcm3e" | |
160 | + | ||
161 | + | let PROMO1_AMOUNT = 4970178 | |
162 | + | ||
163 | + | let PROMO_2_START_TIMESTAMP = match chain { | |
164 | + | case _ => | |
165 | + | if ((base58'2W' == $match0)) | |
166 | + | then 1700524800000 | |
167 | + | else if ((base58'2T' == $match0)) | |
168 | + | then 1700420400000 | |
169 | + | else throw("Unknown chain") | |
170 | + | } | |
171 | + | ||
172 | + | let PROMO_2_END_TIMESTAMP = match chain { | |
173 | + | case _ => | |
174 | + | if ((base58'2W' == $match0)) | |
175 | + | then 1701043199999 | |
176 | + | else if ((base58'2T' == $match0)) | |
177 | + | then 1700496000000 | |
178 | + | else throw("Unknown chain") | |
179 | + | } | |
180 | + | ||
181 | + | let promo2MapKey = "promo2Map" | |
182 | + | ||
183 | + | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
184 | + | ||
151 | 185 | ||
152 | 186 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
153 | 187 | ||
258 | 292 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
259 | 293 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
260 | 294 | let now = lastBlock.timestamp | |
261 | - | let unstakableAmount = (oldAcresAmount - lockedAmount) | |
295 | + | let unstakableAmount = if (isBlacklistedPromo1(address)) | |
296 | + | then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT) | |
297 | + | else (oldAcresAmount - lockedAmount) | |
262 | 298 | if (if ((lockedETA > now)) | |
263 | 299 | then (amount > unstakableAmount) | |
264 | 300 | else false) | |
295 | 331 | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
296 | 332 | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
297 | 333 | else { | |
298 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
299 | - | if ((wlgResult == wlgResult)) | |
300 | - | then { | |
301 | - | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
302 | - | $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult)) | |
303 | - | } | |
304 | - | else throw("Strict value is not equal to itself.") | |
334 | + | let now = lastBlock.timestamp | |
335 | + | if ((PROMO_2_START_TIMESTAMP > now)) | |
336 | + | then throw("Promo2 is not started yet") | |
337 | + | else if ((now > PROMO_2_END_TIMESTAMP)) | |
338 | + | then throw("Promo2 is already finished") | |
339 | + | else { | |
340 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
341 | + | if ((wlgResult == wlgResult)) | |
342 | + | then { | |
343 | + | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
344 | + | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
345 | + | let newMap2 = if (contains(promo2Map, address)) | |
346 | + | then { | |
347 | + | let parts = split_51C(promo2Map, address) | |
348 | + | let oldAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
349 | + | ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15)) | |
350 | + | } | |
351 | + | else { | |
352 | + | let finalPart = ((address + ":") + padL(amt, 14)) | |
353 | + | if ((promo2Map == "")) | |
354 | + | then finalPart | |
355 | + | else ((promo2Map + "_") + finalPart) | |
356 | + | } | |
357 | + | $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult)) | |
358 | + | } | |
359 | + | else throw("Strict value is not equal to itself.") | |
360 | + | } | |
305 | 361 | } | |
306 | 362 | } | |
307 | 363 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MILLION6 = 100000000000000 | |
5 | 5 | ||
6 | 6 | let DAYMILLIS = 86400000 | |
7 | 7 | ||
8 | 8 | func keyAcresStakedAmountByUser (addr) = ("acresStakedAmountByUser_" + addr) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | func keyAcresLockedAmountByUser (addr) = ("acresLockedAmountByUser_" + addr) | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func keyAcresLockedEtaByUser (addr) = ("acresLockedEtaByUser_" + addr) | |
15 | 15 | ||
16 | 16 | ||
17 | 17 | let acresStakedTotalKey = "acresStakedAmountTotal" | |
18 | 18 | ||
19 | 19 | let xpNewSLand = 5000000 | |
20 | 20 | ||
21 | 21 | let DAILYRESBYPIECE = 3456000 | |
22 | 22 | ||
23 | 23 | let USDT2ACRES_MULTIPLIER = 10 | |
24 | 24 | ||
25 | 25 | let chain = take(drop(this.bytes, 1), 1) | |
26 | 26 | ||
27 | 27 | let usdtAssetId = match chain { | |
28 | 28 | case _ => | |
29 | 29 | if ((base58'2W' == $match0)) | |
30 | 30 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
31 | 31 | else if ((base58'2T' == $match0)) | |
32 | 32 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
33 | 33 | else throw("Unknown chain") | |
34 | 34 | } | |
35 | 35 | ||
36 | 36 | let defaultRestAddressStr = match chain { | |
37 | 37 | case _ => | |
38 | 38 | if ((base58'2W' == $match0)) | |
39 | 39 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
40 | 40 | else if ((base58'2T' == $match0)) | |
41 | 41 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
42 | 42 | else throw("Unknown chain") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | let SEP = "__" | |
46 | 46 | ||
47 | 47 | let MULT6 = 1000000 | |
48 | 48 | ||
49 | 49 | let MULT8 = 100000000 | |
50 | 50 | ||
51 | 51 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | let IdxCfgStakingDapp = 1 | |
55 | 55 | ||
56 | 56 | let IdxCfgEconomyDapp = 2 | |
57 | 57 | ||
58 | 58 | let IdxCfgWlgDapp = 4 | |
59 | 59 | ||
60 | 60 | let IdxCfgAcresDapp = 8 | |
61 | 61 | ||
62 | 62 | func keyRestCfg () = "%s__restConfig" | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | func keyRestAddress () = "%s__restAddr" | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
69 | 69 | ||
70 | 70 | ||
71 | 71 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
75 | 75 | ||
76 | 76 | let restCfg = readRestCfgOrFail(restContract) | |
77 | 77 | ||
78 | 78 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
79 | 79 | ||
80 | 80 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
81 | 81 | ||
82 | 82 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
83 | 83 | ||
84 | 84 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
85 | 85 | ||
86 | 86 | let acresIssuedAmountKey = "acresIssuedAmount" | |
87 | 87 | ||
88 | 88 | let acresAssetIdKey = "acresAssetId" | |
89 | 89 | ||
90 | 90 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
91 | 91 | ||
92 | 92 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | let IdxEffTotal = 0 | |
96 | 96 | ||
97 | 97 | func keyResProportions () = "resTypesProportions" | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func asInt (v) = match v { | |
104 | 104 | case n: Int => | |
105 | 105 | n | |
106 | 106 | case _ => | |
107 | 107 | throw("fail to cast into Int") | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func asTwoIntsTuple (val) = match val { | |
112 | 112 | case t2: (Int, Int) => | |
113 | 113 | t2 | |
114 | 114 | case _ => | |
115 | 115 | throw("fail to cast into (Int, Int)") | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getVotingPower (userAddrStrOrEmpty) = { | |
120 | 120 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
121 | 121 | func adder (acc,item) = (acc + parseIntValue(item)) | |
122 | 122 | ||
123 | 123 | let totalPower = { | |
124 | 124 | let $l = props | |
125 | 125 | let $s = size($l) | |
126 | 126 | let $acc0 = 0 | |
127 | 127 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
128 | 128 | then $a | |
129 | 129 | else adder($a, $l[$i]) | |
130 | 130 | ||
131 | 131 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
132 | 132 | then $a | |
133 | 133 | else throw("List size exceeds 6") | |
134 | 134 | ||
135 | 135 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
136 | 136 | } | |
137 | 137 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
138 | 138 | [totalPower, usersPower] | |
139 | 139 | } | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func fixedPoint (val,decimals) = { | |
143 | 143 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
144 | 144 | let lowPart = toString((val % tenPow)) | |
145 | 145 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
146 | 146 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | + | func padL (val,len) = { | |
151 | + | let valS = toString(val) | |
152 | + | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
153 | + | (zeroes + valS) | |
154 | + | } | |
155 | + | ||
156 | + | ||
150 | 157 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
158 | + | ||
159 | + | let BLACKLISTED1 = "3P2NGX4Q5nge1MCauwQW5aqYLdkccSGj1Ep_3P2xFAHW9yhyNohYozWd4HFhEXZu3bsNSoR_3P2yKaZ2gvn9Xe5tti81a7P9LZhHgjvToV9_3P37zQ3cf2ecu55RmJqEiGSivdzN9avt3m9_3P4az6dtzsvGCWFAxa94UdevKzXyEwxEiFG_3P4kZU6X3TTLFcSUe55JSy8BySqitcPgMBz_3P5hCxBEh3NgNizZhNBreyBSqtbhJYLkKPD_3P7HLvucy11yxyMJUwjzXFHHKMEDwi1EwfC_3P8JuaqH9PTQAv8D5HBGgQfKauLTYt2NQft_3P9gTDB4rtDEVbpX3asU63H4Zinh2EnTmZE_3P9iN3qrtfJicUVy7amZeVsetVD3vUMk8be_3PCa2BsAa6JBLirszQfV5r9fJrujfhwtwfP_3PD3i4XN8KtygcFx4ry5M7UGqdfH8VYvtRT_3PDEMnnJNc2kx9cPEmvVvhXUr8SvhANKhsa_3PDGE9tKQizaeZFeDDq5aYSv89nwYbfirpZ_3PDMKQTCrUPZECVXEJJ8m1sHtutSu1naSf1_3PGh2Qu6Yvx8GTCRRVNvBUVZLdaidYSaxo5_3PKkmAtbSK5D2hQdo1RfEg8eXyMbDcRUc92_3PLMnbxzssP8W8E8XjJ1RLBBg8UZL8Cz3P2_3PMuxo4PCAox9s4a7R1eszh4iqqu8gS7jHv_3PNrMtEQChw87WZU1JAJ7aGHykCa8TjnDNK_3PPuBXfWoBy3EEory7c7vgi9Usjka7o5tBj_3PQwyeyEhT4Y6aGAL6tg73aQWJtV1zRt3nR_3PRGDShuMGb84MJtTJvtTg8qDfswkYWcm3e" | |
160 | + | ||
161 | + | let PROMO1_AMOUNT = 4970178 | |
162 | + | ||
163 | + | let PROMO_2_START_TIMESTAMP = match chain { | |
164 | + | case _ => | |
165 | + | if ((base58'2W' == $match0)) | |
166 | + | then 1700524800000 | |
167 | + | else if ((base58'2T' == $match0)) | |
168 | + | then 1700420400000 | |
169 | + | else throw("Unknown chain") | |
170 | + | } | |
171 | + | ||
172 | + | let PROMO_2_END_TIMESTAMP = match chain { | |
173 | + | case _ => | |
174 | + | if ((base58'2W' == $match0)) | |
175 | + | then 1701043199999 | |
176 | + | else if ((base58'2T' == $match0)) | |
177 | + | then 1700496000000 | |
178 | + | else throw("Unknown chain") | |
179 | + | } | |
180 | + | ||
181 | + | let promo2MapKey = "promo2Map" | |
182 | + | ||
183 | + | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
184 | + | ||
151 | 185 | ||
152 | 186 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
153 | 187 | ||
154 | 188 | ||
155 | 189 | func claimAcresInternal (addr,acresAmount,lastClaimTime) = { | |
156 | 190 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
157 | 191 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
158 | 192 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
159 | 193 | let gotUsdt = max([0, canGetUsdt]) | |
160 | 194 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
161 | 195 | } | |
162 | 196 | ||
163 | 197 | ||
164 | 198 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
165 | 199 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
166 | 200 | if ((0 > deltaTime)) | |
167 | 201 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
168 | 202 | else { | |
169 | 203 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
170 | 204 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
171 | 205 | let gotUsdt = if ((0 >= canGetUsdt)) | |
172 | 206 | then 0 | |
173 | 207 | else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
174 | 208 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
175 | 209 | } | |
176 | 210 | } | |
177 | 211 | ||
178 | 212 | ||
179 | 213 | func mergeLocked (oldAmount,oldETA,newAmount,newETA) = { | |
180 | 214 | let now = lastBlock.timestamp | |
181 | 215 | let dt1 = max([0, (oldETA - now)]) | |
182 | 216 | let dt2 = max([0, (newETA - now)]) | |
183 | 217 | let sum = (oldAmount + newAmount) | |
184 | 218 | let dt = if ((sum == 0)) | |
185 | 219 | then 0 | |
186 | 220 | else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum)) | |
187 | 221 | (now + dt) | |
188 | 222 | } | |
189 | 223 | ||
190 | 224 | ||
191 | 225 | @Callable(i) | |
192 | 226 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
193 | 227 | then throw("Permission denied") | |
194 | 228 | else if (isDefined(getBinary(acresAssetIdKey))) | |
195 | 229 | then throw("Already initialized") | |
196 | 230 | else { | |
197 | 231 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
198 | 232 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
199 | 233 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
200 | 234 | let assetId = calculateAssetId(issue) | |
201 | 235 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
202 | 236 | } | |
203 | 237 | ||
204 | 238 | ||
205 | 239 | ||
206 | 240 | @Callable(i) | |
207 | 241 | func stakeAcres () = if ((i.caller != this)) | |
208 | 242 | then throw("Temporarily disabled during promo action") | |
209 | 243 | else { | |
210 | 244 | let prologResult = prolog() | |
211 | 245 | if ((prologResult == prologResult)) | |
212 | 246 | then { | |
213 | 247 | let address = toString(i.caller) | |
214 | 248 | if ((size(i.payments) != 1)) | |
215 | 249 | then throw("exactly 1 payment must be attached") | |
216 | 250 | else { | |
217 | 251 | let pmt = i.payments[0] | |
218 | 252 | let amt = pmt.amount | |
219 | 253 | if (if (!(isDefined(pmt.assetId))) | |
220 | 254 | then true | |
221 | 255 | else (value(pmt.assetId) != acresAssetId)) | |
222 | 256 | then throw("ACRES payments only!") | |
223 | 257 | else { | |
224 | 258 | let timeKey = keyAcresStakedTimeByUser(address) | |
225 | 259 | let amountKey = keyAcresStakedAmountByUser(address) | |
226 | 260 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
227 | 261 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
228 | 262 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
229 | 263 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
230 | 264 | $Tuple2(((((if ((claimedAcres == 0)) | |
231 | 265 | then nil | |
232 | 266 | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
233 | 267 | } | |
234 | 268 | } | |
235 | 269 | } | |
236 | 270 | else throw("Strict value is not equal to itself.") | |
237 | 271 | } | |
238 | 272 | ||
239 | 273 | ||
240 | 274 | ||
241 | 275 | @Callable(i) | |
242 | 276 | func unstakeAcres (amount) = { | |
243 | 277 | let prologResult = prolog() | |
244 | 278 | if ((prologResult == prologResult)) | |
245 | 279 | then if ((0 >= amount)) | |
246 | 280 | then throw("Amount should be positive") | |
247 | 281 | else { | |
248 | 282 | let address = toString(i.caller) | |
249 | 283 | if ((size(i.payments) != 0)) | |
250 | 284 | then throw("No payments required") | |
251 | 285 | else { | |
252 | 286 | let timeKey = keyAcresStakedTimeByUser(address) | |
253 | 287 | let amountKey = keyAcresStakedAmountByUser(address) | |
254 | 288 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
255 | 289 | if ((amount > oldAcresAmount)) | |
256 | 290 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
257 | 291 | else { | |
258 | 292 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
259 | 293 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
260 | 294 | let now = lastBlock.timestamp | |
261 | - | let unstakableAmount = (oldAcresAmount - lockedAmount) | |
295 | + | let unstakableAmount = if (isBlacklistedPromo1(address)) | |
296 | + | then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT) | |
297 | + | else (oldAcresAmount - lockedAmount) | |
262 | 298 | if (if ((lockedETA > now)) | |
263 | 299 | then (amount > unstakableAmount) | |
264 | 300 | else false) | |
265 | 301 | then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA))) | |
266 | 302 | else { | |
267 | 303 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
268 | 304 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
269 | 305 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
270 | 306 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
271 | 307 | } | |
272 | 308 | } | |
273 | 309 | } | |
274 | 310 | } | |
275 | 311 | else throw("Strict value is not equal to itself.") | |
276 | 312 | } | |
277 | 313 | ||
278 | 314 | ||
279 | 315 | ||
280 | 316 | @Callable(i) | |
281 | 317 | func stakeAcresLocked () = { | |
282 | 318 | let prologResult = prolog() | |
283 | 319 | if ((prologResult == prologResult)) | |
284 | 320 | then { | |
285 | 321 | let address = toString(i.caller) | |
286 | 322 | if ((size(i.payments) != 1)) | |
287 | 323 | then throw("exactly 1 payment must be attached") | |
288 | 324 | else { | |
289 | 325 | let pmt = i.payments[0] | |
290 | 326 | let amt = pmt.amount | |
291 | 327 | if (if (!(isDefined(pmt.assetId))) | |
292 | 328 | then true | |
293 | 329 | else (value(pmt.assetId) != acresAssetId)) | |
294 | 330 | then throw("ACRES payments only!") | |
295 | 331 | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
296 | 332 | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
297 | 333 | else { | |
298 | - | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
299 | - | if ((wlgResult == wlgResult)) | |
300 | - | then { | |
301 | - | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
302 | - | $Tuple2(nil, $Tuple3(prologResult, wlgResult, stakeResult)) | |
303 | - | } | |
304 | - | else throw("Strict value is not equal to itself.") | |
334 | + | let now = lastBlock.timestamp | |
335 | + | if ((PROMO_2_START_TIMESTAMP > now)) | |
336 | + | then throw("Promo2 is not started yet") | |
337 | + | else if ((now > PROMO_2_END_TIMESTAMP)) | |
338 | + | then throw("Promo2 is already finished") | |
339 | + | else { | |
340 | + | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
341 | + | if ((wlgResult == wlgResult)) | |
342 | + | then { | |
343 | + | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
344 | + | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
345 | + | let newMap2 = if (contains(promo2Map, address)) | |
346 | + | then { | |
347 | + | let parts = split_51C(promo2Map, address) | |
348 | + | let oldAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
349 | + | ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15)) | |
350 | + | } | |
351 | + | else { | |
352 | + | let finalPart = ((address + ":") + padL(amt, 14)) | |
353 | + | if ((promo2Map == "")) | |
354 | + | then finalPart | |
355 | + | else ((promo2Map + "_") + finalPart) | |
356 | + | } | |
357 | + | $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult)) | |
358 | + | } | |
359 | + | else throw("Strict value is not equal to itself.") | |
360 | + | } | |
305 | 361 | } | |
306 | 362 | } | |
307 | 363 | } | |
308 | 364 | else throw("Strict value is not equal to itself.") | |
309 | 365 | } | |
310 | 366 | ||
311 | 367 | ||
312 | 368 | ||
313 | 369 | @Callable(i) | |
314 | 370 | func buyAcres () = { | |
315 | 371 | let prologResult = prolog() | |
316 | 372 | if ((prologResult == prologResult)) | |
317 | 373 | then { | |
318 | 374 | let address = toString(i.caller) | |
319 | 375 | if ((size(i.payments) != 1)) | |
320 | 376 | then throw("exactly 1 payment must be attached") | |
321 | 377 | else { | |
322 | 378 | let pmt = i.payments[0] | |
323 | 379 | let amt = pmt.amount | |
324 | 380 | if (if (!(isDefined(pmt.assetId))) | |
325 | 381 | then true | |
326 | 382 | else (value(pmt.assetId) != usdtAssetId)) | |
327 | 383 | then throw("USDT payments only!") | |
328 | 384 | else if ((MULT6 > amt)) | |
329 | 385 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
330 | 386 | else { | |
331 | 387 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
332 | 388 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
333 | 389 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
334 | 390 | } | |
335 | 391 | } | |
336 | 392 | } | |
337 | 393 | else throw("Strict value is not equal to itself.") | |
338 | 394 | } | |
339 | 395 | ||
340 | 396 | ||
341 | 397 | ||
342 | 398 | @Callable(i) | |
343 | 399 | func sendAcres (addr,amount) = if ((i.caller != economyContract)) | |
344 | 400 | then throw("Permission denied") | |
345 | 401 | else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount) | |
346 | 402 | ||
347 | 403 | ||
348 | 404 | ||
349 | 405 | @Callable(i) | |
350 | 406 | func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this)) | |
351 | 407 | then (i.caller != restContract) | |
352 | 408 | else false) | |
353 | 409 | then throw("Permission denied") | |
354 | 410 | else { | |
355 | 411 | let now = lastBlock.timestamp | |
356 | 412 | let timeKey = keyAcresStakedTimeByUser(addr) | |
357 | 413 | let amountKey = keyAcresStakedAmountByUser(addr) | |
358 | 414 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
359 | 415 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
360 | 416 | let oldTime = valueOrElse(getInteger(timeKey), now) | |
361 | 417 | let etaKey = keyAcresLockedEtaByUser(addr) | |
362 | 418 | let lockedAmountKey = keyAcresLockedAmountByUser(addr) | |
363 | 419 | let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0) | |
364 | 420 | let oldLockedETA = valueOrElse(getInteger(etaKey), 0) | |
365 | 421 | let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS))) | |
366 | 422 | $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount) | |
367 | 423 | } | |
368 | 424 | ||
369 | 425 | ||
370 | 426 | ||
371 | 427 | @Callable(i) | |
372 | 428 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
373 | 429 | then throw("Permission denied") | |
374 | 430 | else { | |
375 | 431 | let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount) | |
376 | 432 | if ((0 > amountLeft)) | |
377 | 433 | then throw("Attempt to burn more ACRES, than exists") | |
378 | 434 | else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount) | |
379 | 435 | } | |
380 | 436 | ||
381 | 437 | ||
382 | 438 | ||
383 | 439 | @Callable(i) | |
384 | 440 | func claimAcres () = { | |
385 | 441 | let prologResult = prolog() | |
386 | 442 | if ((prologResult == prologResult)) | |
387 | 443 | then { | |
388 | 444 | let address = toString(i.caller) | |
389 | 445 | if ((size(i.payments) != 0)) | |
390 | 446 | then throw("No payments required") | |
391 | 447 | else { | |
392 | 448 | let timeKey = keyAcresStakedTimeByUser(address) | |
393 | 449 | let amountKey = keyAcresStakedAmountByUser(address) | |
394 | 450 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
395 | 451 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
396 | 452 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
397 | 453 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
398 | 454 | } | |
399 | 455 | } | |
400 | 456 | else throw("Strict value is not equal to itself.") | |
401 | 457 | } | |
402 | 458 | ||
403 | 459 | ||
404 | 460 | ||
405 | 461 | @Callable(i) | |
406 | 462 | func claimAcresREADONLY (address) = { | |
407 | 463 | let timeKey = keyAcresStakedTimeByUser(address) | |
408 | 464 | let amountKey = keyAcresStakedAmountByUser(address) | |
409 | 465 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
410 | 466 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
411 | 467 | let claimedAcres = claimAcresInternal(address, acresAmount, lastTime) | |
412 | 468 | $Tuple2(nil, [claimedAcres, lastTime]) | |
413 | 469 | } | |
414 | 470 | ||
415 | 471 |
github/deemru/w8io/026f985 65.28 ms ◑