tx · 6S6WPYt6hPANHCPzTeRSQJC1KxobjcrtxwqZf8WzMgSQ 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg: -0.02000000 Waves 2023.11.27 22:28 [2862234] smart account 3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg > SELF 0.00000000 Waves
{ "type": 13, "id": "6S6WPYt6hPANHCPzTeRSQJC1KxobjcrtxwqZf8WzMgSQ", "fee": 2000000, "feeAssetId": null, "timestamp": 1701113362536, "version": 2, "chainId": 84, "sender": "3N7dQeENwSgKPp9Ki4aEHhRWWKVjn1DE9Qg", "senderPublicKey": "5BN6FQeKuMm2XJYToUZvbBX4UELGpE3Z47P4q6sP46PG", "proofs": [ "4Tyv4aYmjXyg2AhpvTheCAZw8uBG6BwqJigMAptd75VHRRU5BPE2fBQ125BdnTgJCbeDnCsTXaNEcTZQQLR8EneK" ], "script": "base64:BgI2CAISBAoCCAESAwoBARIAEgASBAoCCAESBQoDCAEBEgMKAQESABIDCgEIEgASAwoBARIDCgEBQQAITUlMTElPTjYAgIDpg7HeFgAJREFZTUlMTElTAIC4mSkBGmtleUFjcmVzU3Rha2VkQW1vdW50QnlVc2VyAQRhZGRyCQCsAgICGGFjcmVzU3Rha2VkQW1vdW50QnlVc2VyXwUEYWRkcgEaa2V5QWNyZXNMb2NrZWRBbW91bnRCeVVzZXIBBGFkZHIJAKwCAgIYYWNyZXNMb2NrZWRBbW91bnRCeVVzZXJfBQRhZGRyARdrZXlBY3Jlc0xvY2tlZEV0YUJ5VXNlcgEEYWRkcgkArAICAhVhY3Jlc0xvY2tlZEV0YUJ5VXNlcl8FBGFkZHIAE2FjcmVzU3Rha2VkVG90YWxLZXkCFmFjcmVzU3Rha2VkQW1vdW50VG90YWwACnhwTmV3U0xhbmQAwJaxAgAPREFJTFlSRVNCWVBJRUNFAID40gEAFVVTRFQyQUNSRVNfTVVMVElQTElFUgAKARprZXlJc0F3YXJkZWRCeVByb21vQW5kVXNlcgIHcHJvbW9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2mDVwnej Next: BZ2LsFFSnNda7cdDdLG4BFaK3HsjvToJG4eF1AjkUbYw Diff:
Old | New | Differences | |
---|---|---|---|
581 | 581 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
582 | 582 | let salt = i.transactionId | |
583 | 583 | let promo2Map = valueOrElse(getString(keyPromo2MapForRound(roundId)), "") | |
584 | - | func singleDraw (ac,j) = if ((j > promo2NumPrizesPerRound[(roundId - 1)])) | |
584 | + | func singleDraw (ac,j) = if ((j >= promo2NumPrizesPerRound[(roundId - 1)])) | |
585 | 585 | then ac | |
586 | 586 | else { | |
587 | 587 | let rand = getRandomNumber(ac._1, ac._2, entropy) |
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 | func keyIsAwardedByPromoAndUser (promoId,addr) = makeString(["%s%d%s__isAwardedByPromoAndUser", toString(promoId), addr], "__") | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func keyTicketsTotalByPromo (promoId) = ("%s%d__ticketsTotalByPromo__" + toString(promoId)) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func keyTicketsTotalByPromoAndRound (promoId,roundId) = makeString(["%s%d%d__ticketsTotalByPromoAndRound", toString(promoId), toString(roundId)], "__") | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | let chain = take(drop(this.bytes, 1), 1) | |
35 | 35 | ||
36 | 36 | let usdtAssetId = match chain { | |
37 | 37 | case _ => | |
38 | 38 | if ((base58'2W' == $match0)) | |
39 | 39 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
40 | 40 | else if ((base58'2T' == $match0)) | |
41 | 41 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
42 | 42 | else throw("Unknown chain") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | let defaultRestAddressStr = match chain { | |
46 | 46 | case _ => | |
47 | 47 | if ((base58'2W' == $match0)) | |
48 | 48 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
49 | 49 | else if ((base58'2T' == $match0)) | |
50 | 50 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
51 | 51 | else throw("Unknown chain") | |
52 | 52 | } | |
53 | 53 | ||
54 | 54 | let promo2MapKey = "promo2Map" | |
55 | 55 | ||
56 | 56 | func keyPromo2MapForRound (roundId) = ("promo2MapForRound__" + toString(roundId)) | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | let SEP = "__" | |
60 | 60 | ||
61 | 61 | let MULT6 = 1000000 | |
62 | 62 | ||
63 | 63 | let MULT8 = 100000000 | |
64 | 64 | ||
65 | 65 | let ITER20 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19] | |
66 | 66 | ||
67 | 67 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let IdxCfgStakingDapp = 1 | |
71 | 71 | ||
72 | 72 | let IdxCfgEconomyDapp = 2 | |
73 | 73 | ||
74 | 74 | let IdxCfgWlgDapp = 4 | |
75 | 75 | ||
76 | 76 | let IdxCfgAcresDapp = 8 | |
77 | 77 | ||
78 | 78 | func keyRestCfg () = "%s__restConfig" | |
79 | 79 | ||
80 | 80 | ||
81 | 81 | func keyRestAddress () = "%s__restAddr" | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
85 | 85 | ||
86 | 86 | ||
87 | 87 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
91 | 91 | ||
92 | 92 | let restCfg = readRestCfgOrFail(restContract) | |
93 | 93 | ||
94 | 94 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
95 | 95 | ||
96 | 96 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
97 | 97 | ||
98 | 98 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
99 | 99 | ||
100 | 100 | let acresContract = getContractAddressOrFail(restCfg, IdxCfgAcresDapp) | |
101 | 101 | ||
102 | 102 | let acresIssuedAmountKey = "acresIssuedAmount" | |
103 | 103 | ||
104 | 104 | let acresAssetIdKey = "acresAssetId" | |
105 | 105 | ||
106 | 106 | let acresAssetId = valueOrErrorMessage(getBinary(acresContract, acresAssetIdKey), "ACRES is not issued yet") | |
107 | 107 | ||
108 | 108 | func keyAcresStakedTimeByUser (addr) = ("acresStakedTimeByUser_" + addr) | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | let IdxEffTotal = 0 | |
112 | 112 | ||
113 | 113 | let randomDelay = 2 | |
114 | 114 | ||
115 | 115 | func keyCommit (address) = ("finishBlockFor_" + address) | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func keyResProportions () = "resTypesProportions" | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func asInt (v) = match v { | |
125 | 125 | case n: Int => | |
126 | 126 | n | |
127 | 127 | case _ => | |
128 | 128 | throw("fail to cast into Int") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func asTwoIntsTuple (val) = match val { | |
133 | 133 | case t2: (Int, Int) => | |
134 | 134 | t2 | |
135 | 135 | case _ => | |
136 | 136 | throw("fail to cast into (Int, Int)") | |
137 | 137 | } | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func getVotingPower (userAddrStrOrEmpty) = { | |
144 | 144 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
145 | 145 | func adder (acc,item) = (acc + parseIntValue(item)) | |
146 | 146 | ||
147 | 147 | let totalPower = { | |
148 | 148 | let $l = props | |
149 | 149 | let $s = size($l) | |
150 | 150 | let $acc0 = 0 | |
151 | 151 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
152 | 152 | then $a | |
153 | 153 | else adder($a, $l[$i]) | |
154 | 154 | ||
155 | 155 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
156 | 156 | then $a | |
157 | 157 | else throw("List size exceeds 6") | |
158 | 158 | ||
159 | 159 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
160 | 160 | } | |
161 | 161 | let usersPower = valueOrElse(getInteger(stakingContract, keyStakedPiecesByOwner(userAddrStrOrEmpty)), 0) | |
162 | 162 | [totalPower, usersPower] | |
163 | 163 | } | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func fixedPoint (val,decimals) = { | |
167 | 167 | let tenPow = pow(10, 0, decimals, 0, 0, DOWN) | |
168 | 168 | let lowPart = toString((val % tenPow)) | |
169 | 169 | let zeroes = drop(toString(tenPow), (1 + size(lowPart))) | |
170 | 170 | (((toString((val / tenPow)) + ".") + zeroes) + lowPart) | |
171 | 171 | } | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func padL (val,len) = { | |
175 | 175 | let valS = toString(val) | |
176 | 176 | let zeroes = drop(toString(pow(10, 0, (len - size(valS)), 0, 0, DOWN)), 1) | |
177 | 177 | (zeroes + valS) | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | func getRandomNumber (maxValue,salt,entropy) = if ((0 >= maxValue)) | |
182 | 182 | then throw("maxValue should be > 0") | |
183 | 183 | else { | |
184 | 184 | let randomHash = sha256((salt + entropy)) | |
185 | 185 | (toInt(randomHash) % maxValue) | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | let MIN_ACRES_AMOUNT_DURING_PROMO = 10000000 | |
190 | 190 | ||
191 | 191 | 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" | |
192 | 192 | ||
193 | 193 | let PROMO1_AMOUNT = 4970178 | |
194 | 194 | ||
195 | 195 | let PROMO_2_START_TIMESTAMP = match chain { | |
196 | 196 | case _ => | |
197 | 197 | if ((base58'2W' == $match0)) | |
198 | 198 | then 1700524800000 | |
199 | 199 | else if ((base58'2T' == $match0)) | |
200 | 200 | then 1700420400000 | |
201 | 201 | else throw("Unknown chain") | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | let PROMO_2_END_TIMESTAMP = match chain { | |
205 | 205 | case _ => | |
206 | 206 | if ((base58'2W' == $match0)) | |
207 | 207 | then 1701043199999 | |
208 | 208 | else if ((base58'2T' == $match0)) | |
209 | 209 | then 1700496000000 | |
210 | 210 | else throw("Unknown chain") | |
211 | 211 | } | |
212 | 212 | ||
213 | 213 | let PROMO_2_DISTRIBUTION_FUND = 1000000000 | |
214 | 214 | ||
215 | 215 | let promo2NumPrizesPerRound = [1, 3, 5, 20] | |
216 | 216 | ||
217 | 217 | let promo2AwardPerRound = [500000000, 200000000, 100000000, 20000000] | |
218 | 218 | ||
219 | 219 | func isBlacklistedPromo1 (addr) = contains(BLACKLISTED1, addr) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func prolog () = asInt(reentrantInvoke(stakingContract, "saveLastTx", nil, nil)) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func claimAcresInternal (addr,acresAmount,lastClaimTime) = { | |
226 | 226 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
227 | 227 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
228 | 228 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
229 | 229 | let gotUsdt = max([0, canGetUsdt]) | |
230 | 230 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func claimInternal (addr,acresAmount,lastClaimTime) = { | |
235 | 235 | let deltaTime = (lastBlock.timestamp - lastClaimTime) | |
236 | 236 | if ((0 > deltaTime)) | |
237 | 237 | then throw(((("Saved timestamp is in future, saved = " + toString(lastClaimTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
238 | 238 | else { | |
239 | 239 | let availRes = fraction(deltaTime, (DAILYRESBYPIECE * acresAmount), (DAYMILLIS * MULT8)) | |
240 | 240 | let canGetUsdt = asInt(invoke(economyContract, "sellResourcesWorldREADONLY", [availRes], nil)) | |
241 | 241 | let gotUsdt = if ((0 >= canGetUsdt)) | |
242 | 242 | then 0 | |
243 | 243 | else asTwoIntsTuple(invoke(economyContract, "sellResourcesWorld", [addr, availRes], nil))._1 | |
244 | 244 | (gotUsdt * USDT2ACRES_MULTIPLIER) | |
245 | 245 | } | |
246 | 246 | } | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | func mergeLocked (oldAmount,oldETA,newAmount,newETA) = { | |
250 | 250 | let now = lastBlock.timestamp | |
251 | 251 | let dt1 = max([0, (oldETA - now)]) | |
252 | 252 | let dt2 = max([0, (newETA - now)]) | |
253 | 253 | let sum = (oldAmount + newAmount) | |
254 | 254 | let dt = if ((sum == 0)) | |
255 | 255 | then 0 | |
256 | 256 | else (fraction(dt1, oldAmount, sum) + fraction(dt2, newAmount, sum)) | |
257 | 257 | (now + dt) | |
258 | 258 | } | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | @Callable(i) | |
262 | 262 | func constructorV1 (restAddr,unstakedPieces) = if ((i.caller != this)) | |
263 | 263 | then throw("Permission denied") | |
264 | 264 | else if (isDefined(getBinary(acresAssetIdKey))) | |
265 | 265 | then throw("Already initialized") | |
266 | 266 | else { | |
267 | 267 | let nftAcres = (getVotingPower("")[IdxEffTotal] + unstakedPieces) | |
268 | 268 | let issuedAmount = (MILLION6 - (nftAcres * MULT8)) | |
269 | 269 | let issue = Issue("ACRES", "WavesLands land acres investment token", issuedAmount, 8, false, unit, 0) | |
270 | 270 | let assetId = calculateAssetId(issue) | |
271 | 271 | [issue, IntegerEntry(acresIssuedAmountKey, issuedAmount), BinaryEntry(acresAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr)] | |
272 | 272 | } | |
273 | 273 | ||
274 | 274 | ||
275 | 275 | ||
276 | 276 | @Callable(i) | |
277 | 277 | func unstakeAcres (amount) = { | |
278 | 278 | let prologResult = prolog() | |
279 | 279 | if ((prologResult == prologResult)) | |
280 | 280 | then if ((0 >= amount)) | |
281 | 281 | then throw("Amount should be positive") | |
282 | 282 | else { | |
283 | 283 | let address = toString(i.caller) | |
284 | 284 | if ((size(i.payments) != 0)) | |
285 | 285 | then throw("No payments required") | |
286 | 286 | else { | |
287 | 287 | let timeKey = keyAcresStakedTimeByUser(address) | |
288 | 288 | let amountKey = keyAcresStakedAmountByUser(address) | |
289 | 289 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
290 | 290 | if ((amount > oldAcresAmount)) | |
291 | 291 | then throw(((("You have only " + fixedPoint(oldAcresAmount, 8)) + " ACRES staked, tried to unstake ") + fixedPoint(amount, 8))) | |
292 | 292 | else { | |
293 | 293 | let lockedAmount = valueOrElse(getInteger(keyAcresLockedAmountByUser(address)), 0) | |
294 | 294 | let lockedETA = valueOrElse(getInteger(keyAcresLockedEtaByUser(address)), 0) | |
295 | 295 | let now = lastBlock.timestamp | |
296 | 296 | if (if ((now >= PROMO_2_START_TIMESTAMP)) | |
297 | 297 | then (PROMO_2_END_TIMESTAMP >= now) | |
298 | 298 | else false) | |
299 | 299 | then throw("You cannot unstake ACRES during Promo2") | |
300 | 300 | else { | |
301 | 301 | let unstakableAmount = if (isBlacklistedPromo1(address)) | |
302 | 302 | then ((oldAcresAmount - lockedAmount) - PROMO1_AMOUNT) | |
303 | 303 | else (oldAcresAmount - lockedAmount) | |
304 | 304 | if (if ((lockedETA > now)) | |
305 | 305 | then (amount > unstakableAmount) | |
306 | 306 | else false) | |
307 | 307 | then throw(((("Only " + fixedPoint(unstakableAmount, 8)) + " ACRES can be unstaked now, wait until ") + toString(lockedETA))) | |
308 | 308 | else { | |
309 | 309 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
310 | 310 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
311 | 311 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
312 | 312 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(amountKey, (oldAcresAmount - amount)), IntegerEntry(acresStakedTotalKey, (oldTotal - amount)), ScriptTransfer(i.caller, (amount + claimedAcres), acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
313 | 313 | } | |
314 | 314 | } | |
315 | 315 | } | |
316 | 316 | } | |
317 | 317 | } | |
318 | 318 | else throw("Strict value is not equal to itself.") | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | ||
323 | 323 | @Callable(i) | |
324 | 324 | func stakeAcres () = { | |
325 | 325 | let prologResult = prolog() | |
326 | 326 | if ((prologResult == prologResult)) | |
327 | 327 | then { | |
328 | 328 | let address = toString(i.caller) | |
329 | 329 | if ((size(i.payments) != 1)) | |
330 | 330 | then throw("exactly 1 payment must be attached") | |
331 | 331 | else { | |
332 | 332 | let pmt = i.payments[0] | |
333 | 333 | let amt = pmt.amount | |
334 | 334 | if (if (!(isDefined(pmt.assetId))) | |
335 | 335 | then true | |
336 | 336 | else (value(pmt.assetId) != acresAssetId)) | |
337 | 337 | then throw("ACRES payments only!") | |
338 | 338 | else { | |
339 | 339 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
340 | 340 | if ((wlgResult == wlgResult)) | |
341 | 341 | then { | |
342 | 342 | let now = lastBlock.timestamp | |
343 | 343 | if (if ((PROMO_2_START_TIMESTAMP > now)) | |
344 | 344 | then true | |
345 | 345 | else (now > PROMO_2_END_TIMESTAMP)) | |
346 | 346 | then { | |
347 | 347 | let timeKey = keyAcresStakedTimeByUser(address) | |
348 | 348 | let amountKey = keyAcresStakedAmountByUser(address) | |
349 | 349 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
350 | 350 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
351 | 351 | let claimedAcres = claimInternal(address, oldAcresAmount, valueOrElse(getInteger(timeKey), 0)) | |
352 | 352 | $Tuple2(((((if ((claimedAcres == 0)) | |
353 | 353 | then nil | |
354 | 354 | else [ScriptTransfer(i.caller, claimedAcres, acresAssetId)]) :+ IntegerEntry(timeKey, lastBlock.timestamp)) :+ IntegerEntry(amountKey, (oldAcresAmount + amt))) :+ IntegerEntry(acresStakedTotalKey, (oldTotal + amt))), $Tuple2(prologResult, wlgResult)) | |
355 | 355 | } | |
356 | 356 | else if ((MIN_ACRES_AMOUNT_DURING_PROMO > amt)) | |
357 | 357 | then throw((("Min staked amount during promo action should be at least " + fixedPoint(MIN_ACRES_AMOUNT_DURING_PROMO, 8)) + " ACRES")) | |
358 | 358 | else { | |
359 | 359 | let stakeResult = invoke(this, "sendLockedAcres", [address, amt, 30], nil) | |
360 | 360 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
361 | 361 | let newMap2 = if (contains(promo2Map, address)) | |
362 | 362 | then { | |
363 | 363 | let parts = split_51C(promo2Map, address) | |
364 | 364 | let oldAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
365 | 365 | ((((parts[0] + address) + ":") + padL((oldAmount + amt), 14)) + drop(parts[1], 15)) | |
366 | 366 | } | |
367 | 367 | else { | |
368 | 368 | let finalPart = ((address + ":") + padL(amt, 14)) | |
369 | 369 | if ((promo2Map == "")) | |
370 | 370 | then finalPart | |
371 | 371 | else ((promo2Map + "_") + finalPart) | |
372 | 372 | } | |
373 | 373 | $Tuple2([StringEntry(promo2MapKey, newMap2)], $Tuple3(prologResult, wlgResult, stakeResult)) | |
374 | 374 | } | |
375 | 375 | } | |
376 | 376 | else throw("Strict value is not equal to itself.") | |
377 | 377 | } | |
378 | 378 | } | |
379 | 379 | } | |
380 | 380 | else throw("Strict value is not equal to itself.") | |
381 | 381 | } | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | ||
385 | 385 | @Callable(i) | |
386 | 386 | func buyAcres () = { | |
387 | 387 | let prologResult = prolog() | |
388 | 388 | if ((prologResult == prologResult)) | |
389 | 389 | then { | |
390 | 390 | let address = toString(i.caller) | |
391 | 391 | if ((size(i.payments) != 1)) | |
392 | 392 | then throw("exactly 1 payment must be attached") | |
393 | 393 | else { | |
394 | 394 | let pmt = i.payments[0] | |
395 | 395 | let amt = pmt.amount | |
396 | 396 | if (if (!(isDefined(pmt.assetId))) | |
397 | 397 | then true | |
398 | 398 | else (value(pmt.assetId) != usdtAssetId)) | |
399 | 399 | then throw("USDT payments only!") | |
400 | 400 | else if ((MULT6 > amt)) | |
401 | 401 | then throw((("Min payment should be " + fixedPoint(MULT6, 6)) + " USDT")) | |
402 | 402 | else { | |
403 | 403 | let acresAmount = (amt * USDT2ACRES_MULTIPLIER) | |
404 | 404 | let accStatsResult = asInt(invoke(stakingContract, "updateAccStats", [address, fraction(xpNewSLand, acresAmount, (25 * MULT8))], nil)) | |
405 | 405 | $Tuple2([ScriptTransfer(economyContract, amt, usdtAssetId), ScriptTransfer(i.caller, acresAmount, acresAssetId)], $Tuple2(prologResult, accStatsResult)) | |
406 | 406 | } | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | else throw("Strict value is not equal to itself.") | |
410 | 410 | } | |
411 | 411 | ||
412 | 412 | ||
413 | 413 | ||
414 | 414 | @Callable(i) | |
415 | 415 | func sendAcres (addr,amount) = if ((i.caller != economyContract)) | |
416 | 416 | then throw("Permission denied") | |
417 | 417 | else $Tuple2([ScriptTransfer(addressFromStringValue(addr), amount, acresAssetId)], amount) | |
418 | 418 | ||
419 | 419 | ||
420 | 420 | ||
421 | 421 | @Callable(i) | |
422 | 422 | func sendLockedAcres (addr,amount,lockDays) = if (if ((i.caller != this)) | |
423 | 423 | then (i.caller != restContract) | |
424 | 424 | else false) | |
425 | 425 | then throw("Permission denied") | |
426 | 426 | else { | |
427 | 427 | let now = lastBlock.timestamp | |
428 | 428 | let timeKey = keyAcresStakedTimeByUser(addr) | |
429 | 429 | let amountKey = keyAcresStakedAmountByUser(addr) | |
430 | 430 | let oldAcresAmount = valueOrElse(getInteger(amountKey), 0) | |
431 | 431 | let oldTotal = valueOrElse(getInteger(acresStakedTotalKey), 0) | |
432 | 432 | let oldTime = valueOrElse(getInteger(timeKey), now) | |
433 | 433 | let etaKey = keyAcresLockedEtaByUser(addr) | |
434 | 434 | let lockedAmountKey = keyAcresLockedAmountByUser(addr) | |
435 | 435 | let oldLockedAmount = valueOrElse(getInteger(lockedAmountKey), 0) | |
436 | 436 | let oldLockedETA = valueOrElse(getInteger(etaKey), 0) | |
437 | 437 | let mergedETA = mergeLocked(oldLockedAmount, oldLockedETA, amount, (now + (lockDays * DAYMILLIS))) | |
438 | 438 | $Tuple2([IntegerEntry(timeKey, oldTime), IntegerEntry(amountKey, (oldAcresAmount + amount)), IntegerEntry(acresStakedTotalKey, (oldTotal + amount)), IntegerEntry(etaKey, mergedETA), IntegerEntry(lockedAmountKey, (oldLockedAmount + amount))], amount) | |
439 | 439 | } | |
440 | 440 | ||
441 | 441 | ||
442 | 442 | ||
443 | 443 | @Callable(i) | |
444 | 444 | func burnAcres (amount) = if ((i.caller != stakingContract)) | |
445 | 445 | then throw("Permission denied") | |
446 | 446 | else { | |
447 | 447 | let amountLeft = (valueOrElse(getInteger(acresIssuedAmountKey), 0) - amount) | |
448 | 448 | if ((0 > amountLeft)) | |
449 | 449 | then throw("Attempt to burn more ACRES, than exists") | |
450 | 450 | else $Tuple2([Burn(acresAssetId, amount), IntegerEntry(acresIssuedAmountKey, amountLeft)], amount) | |
451 | 451 | } | |
452 | 452 | ||
453 | 453 | ||
454 | 454 | ||
455 | 455 | @Callable(i) | |
456 | 456 | func claimAcres () = { | |
457 | 457 | let prologResult = prolog() | |
458 | 458 | if ((prologResult == prologResult)) | |
459 | 459 | then { | |
460 | 460 | let address = toString(i.caller) | |
461 | 461 | if ((size(i.payments) != 0)) | |
462 | 462 | then throw("No payments required") | |
463 | 463 | else { | |
464 | 464 | let timeKey = keyAcresStakedTimeByUser(address) | |
465 | 465 | let amountKey = keyAcresStakedAmountByUser(address) | |
466 | 466 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
467 | 467 | let wlgResult = invoke(wlgContract, "onStakeUnstakeLand", [address], nil) | |
468 | 468 | let claimedAcres = claimInternal(address, acresAmount, valueOrElse(getInteger(timeKey), 0)) | |
469 | 469 | $Tuple2([IntegerEntry(timeKey, lastBlock.timestamp), ScriptTransfer(i.caller, claimedAcres, acresAssetId)], $Tuple2(prologResult, wlgResult)) | |
470 | 470 | } | |
471 | 471 | } | |
472 | 472 | else throw("Strict value is not equal to itself.") | |
473 | 473 | } | |
474 | 474 | ||
475 | 475 | ||
476 | 476 | ||
477 | 477 | @Callable(i) | |
478 | 478 | func claimAcresREADONLY (address) = { | |
479 | 479 | let timeKey = keyAcresStakedTimeByUser(address) | |
480 | 480 | let amountKey = keyAcresStakedAmountByUser(address) | |
481 | 481 | let acresAmount = valueOrElse(getInteger(amountKey), 0) | |
482 | 482 | let lastTime = valueOrElse(getInteger(timeKey), 0) | |
483 | 483 | let claimedAcres = claimAcresInternal(address, acresAmount, lastTime) | |
484 | 484 | $Tuple2(nil, [claimedAcres, lastTime]) | |
485 | 485 | } | |
486 | 486 | ||
487 | 487 | ||
488 | 488 | ||
489 | 489 | @Callable(i) | |
490 | 490 | func claimPromo2 () = { | |
491 | 491 | let prologResult = prolog() | |
492 | 492 | if ((prologResult == prologResult)) | |
493 | 493 | then { | |
494 | 494 | let address = toString(i.caller) | |
495 | 495 | if ((size(i.payments) != 0)) | |
496 | 496 | then throw("No payments required") | |
497 | 497 | else { | |
498 | 498 | let now = lastBlock.timestamp | |
499 | 499 | if ((PROMO_2_END_TIMESTAMP > now)) | |
500 | 500 | then throw("Promo 2 is not over yet") | |
501 | 501 | else { | |
502 | 502 | let awardedKey = keyIsAwardedByPromoAndUser(2, address) | |
503 | 503 | if (valueOrElse(getBoolean(awardedKey), false)) | |
504 | 504 | then throw((("Your wallet " + address) + " is already awarded in promo 2")) | |
505 | 505 | else { | |
506 | 506 | let promo2Map = valueOrElse(getString(promo2MapKey), "") | |
507 | 507 | if (!(contains(promo2Map, address))) | |
508 | 508 | then throw("You are not participant of promo 2") | |
509 | 509 | else { | |
510 | 510 | let parts = split_51C(promo2Map, address) | |
511 | 511 | let acresAmount = parseIntValue(take(drop(parts[1], 1), 14)) | |
512 | 512 | let tickets = (acresAmount / MIN_ACRES_AMOUNT_DURING_PROMO) | |
513 | 513 | let totalTikets = valueOrElse(getInteger(keyTicketsTotalByPromo(2)), 0) | |
514 | 514 | let $t01235812798 = if ((totalTikets == 0)) | |
515 | 515 | then { | |
516 | 516 | func countTickets (acc,el) = (acc + (parseIntValue(split(el, ":")[1]) / MIN_ACRES_AMOUNT_DURING_PROMO)) | |
517 | 517 | ||
518 | 518 | let ticketsCount = { | |
519 | 519 | let $l = split_51C(promo2Map, "_") | |
520 | 520 | let $s = size($l) | |
521 | 521 | let $acc0 = 0 | |
522 | 522 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
523 | 523 | then $a | |
524 | 524 | else countTickets($a, $l[$i]) | |
525 | 525 | ||
526 | 526 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
527 | 527 | then $a | |
528 | 528 | else throw("List size exceeds 50") | |
529 | 529 | ||
530 | 530 | $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($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) | |
531 | 531 | } | |
532 | 532 | $Tuple2([IntegerEntry(keyTicketsTotalByPromo(2), ticketsCount), IntegerEntry(keyTicketsTotalByPromoAndRound(2, 1), ticketsCount)], ticketsCount) | |
533 | 533 | } | |
534 | 534 | else $Tuple2(nil, totalTikets) | |
535 | 535 | let ticketsActions = $t01235812798._1 | |
536 | 536 | let totalCount = $t01235812798._2 | |
537 | 537 | let award = fraction(PROMO_2_DISTRIBUTION_FUND, tickets, totalCount) | |
538 | 538 | let stakeResult = invoke(this, "sendLockedAcres", [address, award, 30], nil) | |
539 | 539 | $Tuple2(((ticketsActions :+ BooleanEntry(awardedKey, true)) :+ StringEntry(keyPromo2MapForRound(1), promo2Map)), stakeResult) | |
540 | 540 | } | |
541 | 541 | } | |
542 | 542 | } | |
543 | 543 | } | |
544 | 544 | } | |
545 | 545 | else throw("Strict value is not equal to itself.") | |
546 | 546 | } | |
547 | 547 | ||
548 | 548 | ||
549 | 549 | ||
550 | 550 | @Callable(i) | |
551 | 551 | func commitForPromo2Round (roundId) = if ((i.caller != this)) | |
552 | 552 | then throw("Permission denied") | |
553 | 553 | else if (if ((1 > roundId)) | |
554 | 554 | then true | |
555 | 555 | else (roundId > 4)) | |
556 | 556 | then throw(("Invalid roundId: " + toString(roundId))) | |
557 | 557 | else { | |
558 | 558 | let finishBlock = (height + randomDelay) | |
559 | 559 | $Tuple2([IntegerEntry(keyCommit(("2_" + toString(roundId))), finishBlock)], finishBlock) | |
560 | 560 | } | |
561 | 561 | ||
562 | 562 | ||
563 | 563 | ||
564 | 564 | @Callable(i) | |
565 | 565 | func drawPromo2Round (roundId) = if ((i.caller != this)) | |
566 | 566 | then throw("Permission denied") | |
567 | 567 | else if (if ((1 > roundId)) | |
568 | 568 | then true | |
569 | 569 | else (roundId > 4)) | |
570 | 570 | then throw(("Invalid roundId: " + toString(roundId))) | |
571 | 571 | else { | |
572 | 572 | let finishKey = keyCommit(("2_" + toString(roundId))) | |
573 | 573 | let finishBlock = valueOrErrorMessage(getInteger(finishKey), (("You have to commitForPromo2Round(" + toString(roundId)) + ") first!")) | |
574 | 574 | if ((finishBlock > height)) | |
575 | 575 | then throw((((("Random number is not ready yet, wait until height = " + toString(finishBlock)) + " (current height = ") + toString(height)) + ")")) | |
576 | 576 | else { | |
577 | 577 | let maxValue = valueOrElse(getInteger(keyTicketsTotalByPromoAndRound(2, roundId)), 0) | |
578 | 578 | if ((maxValue == 0)) | |
579 | 579 | then throw("Please call claimPromo2() at least once") | |
580 | 580 | else { | |
581 | 581 | let entropy = value(value(blockInfoByHeight(finishBlock)).vrf) | |
582 | 582 | let salt = i.transactionId | |
583 | 583 | let promo2Map = valueOrElse(getString(keyPromo2MapForRound(roundId)), "") | |
584 | - | func singleDraw (ac,j) = if ((j > promo2NumPrizesPerRound[(roundId - 1)])) | |
584 | + | func singleDraw (ac,j) = if ((j >= promo2NumPrizesPerRound[(roundId - 1)])) | |
585 | 585 | then ac | |
586 | 586 | else { | |
587 | 587 | let rand = getRandomNumber(ac._1, ac._2, entropy) | |
588 | 588 | let promo2List = if ((ac._3 == "")) | |
589 | 589 | then nil | |
590 | 590 | else split_51C(ac._3, "_") | |
591 | 591 | func countTickets (acc,el) = { | |
592 | 592 | let parts = split(el, ":") | |
593 | 593 | let addr = parts[0] | |
594 | 594 | let tickets = (parseIntValue(parts[1]) / MIN_ACRES_AMOUNT_DURING_PROMO) | |
595 | 595 | let newTotal = (acc._1 + tickets) | |
596 | 596 | if (if ((acc._3 == "")) | |
597 | 597 | then (newTotal > rand) | |
598 | 598 | else false) | |
599 | 599 | then $Tuple3(newTotal, tickets, addr) | |
600 | 600 | else $Tuple3(newTotal, acc._2, acc._3) | |
601 | 601 | } | |
602 | 602 | ||
603 | 603 | let r = { | |
604 | 604 | let $l = promo2List | |
605 | 605 | let $s = size($l) | |
606 | 606 | let $acc0 = $Tuple3(0, 0, "") | |
607 | 607 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
608 | 608 | then $a | |
609 | 609 | else countTickets($a, $l[$i]) | |
610 | 610 | ||
611 | 611 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
612 | 612 | then $a | |
613 | 613 | else throw("List size exceeds 50") | |
614 | 614 | ||
615 | 615 | $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($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) | |
616 | 616 | } | |
617 | 617 | let winner = r._3 | |
618 | 618 | if ((winner == "")) | |
619 | 619 | then throw("no winner") | |
620 | 620 | else { | |
621 | 621 | let mapParts = split_51C(ac._3, winner) | |
622 | 622 | let newMap = if ((mapParts[0] == "")) | |
623 | 623 | then drop(mapParts[1], 16) | |
624 | 624 | else (dropRight(mapParts[0], 1) + drop(mapParts[1], 15)) | |
625 | 625 | let stakeResult = invoke(this, "sendLockedAcres", [winner, promo2AwardPerRound[(roundId - 1)], 30], nil) | |
626 | 626 | $Tuple4((ac._1 - r._2), fromBase58String(getStringValue(stakingContract, keyLastTxIdByUser(winner))), newMap, (ac._4 :+ stakeResult)) | |
627 | 627 | } | |
628 | 628 | } | |
629 | 629 | ||
630 | 630 | let draws = { | |
631 | 631 | let $l = ITER20 | |
632 | 632 | let $s = size($l) | |
633 | 633 | let $acc0 = $Tuple4(maxValue, i.transactionId, promo2Map, nil) | |
634 | 634 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
635 | 635 | then $a | |
636 | 636 | else singleDraw($a, $l[$i]) | |
637 | 637 | ||
638 | 638 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
639 | 639 | then $a | |
640 | 640 | else throw("List size exceeds 20") | |
641 | 641 | ||
642 | 642 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
643 | 643 | } | |
644 | 644 | $Tuple2([DeleteEntry(finishKey), StringEntry(keyPromo2MapForRound((roundId + 1)), draws._3), IntegerEntry(keyTicketsTotalByPromoAndRound(2, (roundId + 1)), draws._1)], draws._4) | |
645 | 645 | } | |
646 | 646 | } | |
647 | 647 | } | |
648 | 648 | ||
649 | 649 |
github/deemru/w8io/026f985 66.48 ms ◑