tx · 466abnDDzXoaujQ9XYrdQ9f4BnXDSkkWyCUSpdmVPBGp 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy: -0.01500000 Waves 2023.06.21 14:30 [2632347] smart account 3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy > SELF 0.00000000 Waves
{ "type": 13, "id": "466abnDDzXoaujQ9XYrdQ9f4BnXDSkkWyCUSpdmVPBGp", "fee": 1500000, "feeAssetId": null, "timestamp": 1687347054246, "version": 2, "chainId": 84, "sender": "3N7HtrKeFFLz5oy6PfGv1Lg3GwPk4gCPdGy", "senderPublicKey": "FsR18761ZAsUqsTd7TK3XmR6bhihs1UXVmpHYxz5JzQ1", "proofs": [ "29ThddyMmPSfaBxCtXNhMYUc4aTansTkGQXcEYSrNneAseRczyAXZp8iwgDGaG3xF1oXgxTAiheaaH2Su3A2Lg2g" ], "script": "base64:BgIZCAISBQoDCAgIEgASABIAEgMKAQgSAwoBCJMBAAVjaGFpbgkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkdEFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAIBAVcFByRtYXRjaDABIITaerIIAz9O0bvKju6Lk7zJgt0LXfoHlqjUI/moD/+5AwkAAAIBAVQFByRtYXRjaDABIFWx2J9yh4Lv5eNbjawFq2XemkOhLxa7BfMat4el8cUYCQACAQINVW5rbm93biBjaGFpbgAVZGVmYXVsdFJlc3RBZGRyZXNzU3RyBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAiMzUFFDdXZGYnZoNExrUFVucm5VMXozam5iQTFwOW0zV05odgMJAAACAQFUBQckbWF0Y2gwAiMzTXVta0dHenRDS0FYcFdEcXhrZGRvZnFYU1VicVFrdlNKeQkAAgECDVVua25vd24gY2hhaW4AEUluZnJhVXBncmFkZUNvc3RTBAckbWF0Y2gwBQVjaGFpbgMJAAACAQFXBQckbWF0Y2gwAIDIr6AlAwkAAAIBAVQFByRtYX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QYWlkVG90YWxLZXkJAGQCCQELdmFsdWVPckVsc2UCCQCfCAEFGXN0YWtlcnNBbW91bnRQYWlkVG90YWxLZXkAAAUKdXNlckFtb3VudAkAzAgCCQEMSW50ZWdlckVudHJ5AgUUc3Rha2Vyc0Ftb3VudExlZnRLZXkJAGUCBQ9hbW91bnRMZWZ0VG90YWwFCnVzZXJBbW91bnQJAMwIAgkBDEludGVnZXJFbnRyeQIFFGxhc3RNYXJrZXRpbmdUaW1lS2V5BQNub3cJAMwIAgkBDEludGVnZXJFbnRyeQIFD2xhc3RUZWFtVGltZUtleQUDbm93CQDMCAIJAQxJbnRlZ2VyRW50cnkCBRVsYXN0QWN0aXZpdGllc1RpbWVLZXkFA25vdwkAzAgCCQEMSW50ZWdlckVudHJ5AgULdXNlclRpbWVLZXkFA25vdwUDbmlsBQxwcm9sb2dSZXN1bHQBaQELb25TdGFrZUxhbmQBBGFkZHIDCQECIT0CCAUBaQZjYWxsZXIFD3N0YWtpbmdDb250cmFjdAkAAgECEVBlcm1pc3Npb24gZGVuaWVkCQCUCgIJAMwIAgkBDEludGVnZXJFbnRyeQIJARhrZXlMYXN0Q2xhaW1lZFRpbWVCeVVzZXIBBQRhZGRyCAUJbGFzdEJsb2NrCXRpbWVzdGFtcAUDbmlsCAUJbGFzdEJsb2NrCXRpbWVzdGFtcAFpAQ1vblVuc3Rha2VMYW5kAQRhZGRyAwkBAiE9AggFAWkGY2FsbGVyBQ9zdGFraW5nQ29udHJhY3QJAAIBAhFQZXJtaXNzaW9uIGRlbmllZAkAlAoCCQDMCAIJAQtEZWxldGVFbnRyeQEJARhrZXlMYXN0Q2xhaW1lZFRpbWVCeVVzZXIBBQRhZGRyBQNuaWwAAABc68pp", "height": 2632347, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EzSzww8dnq91LsQU6U4E6YKet1JSnCsbBML4KAYcgyzA Next: Cyb8hCxo8i4m7RVwPD9uzviw4WkWkshEPUimvLtD2Fmv Diff:
Old | New | Differences | |
---|---|---|---|
577 | 577 | } | |
578 | 578 | ||
579 | 579 | ||
580 | + | ||
581 | + | @Callable(i) | |
582 | + | func onStakeLand (addr) = if ((i.caller != stakingContract)) | |
583 | + | then throw("Permission denied") | |
584 | + | else $Tuple2([IntegerEntry(keyLastClaimedTimeByUser(addr), lastBlock.timestamp)], lastBlock.timestamp) | |
585 | + | ||
586 | + | ||
587 | + | ||
588 | + | @Callable(i) | |
589 | + | func onUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
590 | + | then throw("Permission denied") | |
591 | + | else $Tuple2([DeleteEntry(keyLastClaimedTimeByUser(addr))], 0) | |
592 | + | ||
593 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let chain = take(drop(this.bytes, 1), 1) | |
5 | 5 | ||
6 | 6 | let usdtAssetId = match chain { | |
7 | 7 | case _ => | |
8 | 8 | if ((base58'2W' == $match0)) | |
9 | 9 | then base58'9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi' | |
10 | 10 | else if ((base58'2T' == $match0)) | |
11 | 11 | then base58'6mWwf9mZBjVgkC54idpyaZLQfAosD914wT8fGf2iiY63' | |
12 | 12 | else throw("Unknown chain") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | let defaultRestAddressStr = match chain { | |
16 | 16 | case _ => | |
17 | 17 | if ((base58'2W' == $match0)) | |
18 | 18 | then "3PQCuvFbvh4LkPUnrnU1z3jnbA1p9m3WNhv" | |
19 | 19 | else if ((base58'2T' == $match0)) | |
20 | 20 | then "3MumkGGztCKAXpWDqxkddofqXSUbqQkvSJy" | |
21 | 21 | else throw("Unknown chain") | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | let InfraUpgradeCostS = match chain { | |
25 | 25 | case _ => | |
26 | 26 | if ((base58'2W' == $match0)) | |
27 | 27 | then 10000000000 | |
28 | 28 | else if ((base58'2T' == $match0)) | |
29 | 29 | then 100000000 | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | let SEP = "__" | |
34 | 34 | ||
35 | 35 | let MULT6 = 1000000 | |
36 | 36 | ||
37 | 37 | let MULT7 = 10000000 | |
38 | 38 | ||
39 | 39 | let MULT8 = 100000000 | |
40 | 40 | ||
41 | 41 | let MULT10 = 10000000000 | |
42 | 42 | ||
43 | 43 | let LANDPREFIX = "LAND" | |
44 | 44 | ||
45 | 45 | let DUCKPREFIX = "DUCK" | |
46 | 46 | ||
47 | 47 | let ARTPRESALE = "PRESALE" | |
48 | 48 | ||
49 | 49 | let NUMRES = 6 | |
50 | 50 | ||
51 | 51 | let SSIZE = 25 | |
52 | 52 | ||
53 | 53 | let MSIZE = 100 | |
54 | 54 | ||
55 | 55 | let LSIZE = 225 | |
56 | 56 | ||
57 | 57 | let XLSIZE = 400 | |
58 | 58 | ||
59 | 59 | let XXLSIZE = 625 | |
60 | 60 | ||
61 | 61 | let DAILYRESBYPIECE = 3456000 | |
62 | 62 | ||
63 | 63 | let DAYMILLIS = 86400000 | |
64 | 64 | ||
65 | 65 | let WHMULTIPLIER = 10000000000 | |
66 | 66 | ||
67 | 67 | let DEFAULTLOCATION = "Africa_F_Africa" | |
68 | 68 | ||
69 | 69 | let RESOURCEPRICEMIN = 39637 | |
70 | 70 | ||
71 | 71 | let ESMAXPACKAGES = 3 | |
72 | 72 | ||
73 | 73 | let ESBUYCOEF = 4 | |
74 | 74 | ||
75 | 75 | let ESSELLCOEF = 10 | |
76 | 76 | ||
77 | 77 | let MAXHP = 100 | |
78 | 78 | ||
79 | 79 | let resTypes = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"] | |
80 | 80 | ||
81 | 81 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
82 | 82 | ||
83 | 83 | let prodTypes = ["First Aid Kit L1", "First Aid Kit L2", "First Aid Kit L3", "Backpack L1", "Backpack L2", "Backpack L3", "Food Ration L1", "Food Ration L2", "Food Ration L3", "Jet Pack L1", "Jet Pack L2", "Jet Pack L3", "Shield L1", "Shield L2", "Shield L3"] | |
84 | 84 | ||
85 | 85 | let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
86 | 86 | ||
87 | 87 | let productionMatrix = ["1_1_1_2_2_5_1_10_0", "2_2_2_4_4_10_1_10_0", "3_3_3_6_6_15_1_10_0", "2_5_5_2_7_5_2_100_1", "4_10_10_4_14_10_2_100_1", "6_15_15_6_21_15_2_100_1", "1_1_1_1_1_8_1_10_2", "2_2_2_2_2_16_1_10_2", "3_3_3_3_3_24_1_10_2", "9_9_1_5_5_1_5_100_3", "18_18_2_10_10_2_5_100_3", "27_27_3_15_15_3_5_100_3", "2_2_1_2_2_2_1_10_4", "4_4_2_4_4_4_1_10_4", "6_6_3_6_6_6_1_10_4"] | |
88 | 88 | ||
89 | 89 | let contIdxAmericas = 0 | |
90 | 90 | ||
91 | 91 | let contIdxEurope = 1 | |
92 | 92 | ||
93 | 93 | let contIdxAsia = 2 | |
94 | 94 | ||
95 | 95 | let contIdxAfrica = 3 | |
96 | 96 | ||
97 | 97 | let contIdxOceania = 4 | |
98 | 98 | ||
99 | 99 | let recipeIdxFuel = 0 | |
100 | 100 | ||
101 | 101 | let recipeIdxMetal = 1 | |
102 | 102 | ||
103 | 103 | let recipeIdxPlank = 2 | |
104 | 104 | ||
105 | 105 | let recipeIdxGlass = 3 | |
106 | 106 | ||
107 | 107 | let recipeIdxPlastic = 4 | |
108 | 108 | ||
109 | 109 | let recipeIdxProtein = 5 | |
110 | 110 | ||
111 | 111 | let recipeIdxWeight = 6 | |
112 | 112 | ||
113 | 113 | let recipeIdxPacksize = 7 | |
114 | 114 | ||
115 | 115 | let recipeIdxContinent = 8 | |
116 | 116 | ||
117 | 117 | let recLandNum = 0 | |
118 | 118 | ||
119 | 119 | let recLandSize = 1 | |
120 | 120 | ||
121 | 121 | let recTerrains = 2 | |
122 | 122 | ||
123 | 123 | let recContinent = 3 | |
124 | 124 | ||
125 | 125 | let whIdxLevels = 0 | |
126 | 126 | ||
127 | 127 | let whIdxRes = 1 | |
128 | 128 | ||
129 | 129 | let whIdxMat = 2 | |
130 | 130 | ||
131 | 131 | let whIdxProd = 3 | |
132 | 132 | ||
133 | 133 | let whIdxLOFT = 4 | |
134 | 134 | ||
135 | 135 | let volLocked = 0 | |
136 | 136 | ||
137 | 137 | let volOccupied = 1 | |
138 | 138 | ||
139 | 139 | let volFree = 2 | |
140 | 140 | ||
141 | 141 | let volTotal = 3 | |
142 | 142 | ||
143 | 143 | let bpIdxLevel = 0 | |
144 | 144 | ||
145 | 145 | let bpIdxRes = 1 | |
146 | 146 | ||
147 | 147 | let bpIdxMat = 2 | |
148 | 148 | ||
149 | 149 | let bpIdxProd = 3 | |
150 | 150 | ||
151 | 151 | func getPkgSize (prodIdx) = parseIntValue(split(productionMatrix[prodIdx], "_")[recipeIdxPacksize]) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getStringOrFail (address,key) = valueOrErrorMessage(getString(address, key), makeString(["mandatory ", toString(address), ".", key, " is not defined"], "")) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getIntOrElse (key,defaultVal) = valueOrElse(getInteger(this, key), defaultVal) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | let IdxCfgStakingDapp = 1 | |
161 | 161 | ||
162 | 162 | let IdxCfgEconomyDapp = 2 | |
163 | 163 | ||
164 | 164 | let IdxCfgGovernanceDapp = 3 | |
165 | 165 | ||
166 | 166 | let IdxCfgWlgDapp = 4 | |
167 | 167 | ||
168 | 168 | func keyRestCfg () = "%s__restConfig" | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func keyRestAddress () = "%s__restAddr" | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func readRestCfgOrFail (rest) = split_4C(getStringOrFail(rest, keyRestCfg()), SEP) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func getContractAddressOrFail (restCfg,idx) = valueOrErrorMessage(addressFromString(restCfg[idx]), ("Rest cfg doesn't contain address at index " + toString(idx))) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | let restContract = addressFromStringValue(valueOrElse(getString(this, keyRestAddress()), defaultRestAddressStr)) | |
181 | 181 | ||
182 | 182 | let restCfg = readRestCfgOrFail(restContract) | |
183 | 183 | ||
184 | 184 | let stakingContract = getContractAddressOrFail(restCfg, IdxCfgStakingDapp) | |
185 | 185 | ||
186 | 186 | let economyContract = getContractAddressOrFail(restCfg, IdxCfgEconomyDapp) | |
187 | 187 | ||
188 | 188 | let govContract = getContractAddressOrFail(restCfg, IdxCfgGovernanceDapp) | |
189 | 189 | ||
190 | 190 | let wlgContract = getContractAddressOrFail(restCfg, IdxCfgWlgDapp) | |
191 | 191 | ||
192 | 192 | func keyLastTxIdByUser (addr) = ("lastTxIdByUser_" + addr) | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | func keyLandAssetIdToCustomName (assetId) = ("landCustomNameByAssetId_" + assetId) | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId) | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | func keyLandArtStatusByTypeAndAssetId (type,assetId) = makeString(["landArtStatus", type, assetId], "_") | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func keyWarehouseByLand (landAssetId) = ("wareHouse_" + landAssetId) | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func keyStakedLandsByOwner (ownerAddr) = ("stakedLandsByOwner_" + ownerAddr) | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func keyStakedPiecesByOwner (ownerAddr) = ("stakedPiecesByOwner_" + ownerAddr) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func keyDuckAssetIdToCustomName (assetId) = ("duckCustomNameByAssetId_" + assetId) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func keyAddressToCustomName (addr) = ("accountCustomNameByAddr_" + addr) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func keyAddressRefBy (addr) = ("accRefBy_" + addr) | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func keyAddressReferrals (addr) = ("accReferrals_" + addr) | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
235 | 235 | ||
236 | 236 | ||
237 | 237 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
238 | 238 | ||
239 | 239 | ||
240 | 240 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
244 | 244 | ||
245 | 245 | ||
246 | 246 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
247 | 247 | ||
248 | 248 | ||
249 | 249 | func keyResProportions () = "resTypesProportions" | |
250 | 250 | ||
251 | 251 | ||
252 | 252 | func keyBlocked () = "contractsBlocked" | |
253 | 253 | ||
254 | 254 | ||
255 | 255 | func keyUserGwlReleaseTime (userAddr) = ("%s%s__userGwlReleaseTime__" + userAddr) | |
256 | 256 | ||
257 | 257 | ||
258 | 258 | func keyOrderByLand (landAssetId) = ("landOrder_" + landAssetId) | |
259 | 259 | ||
260 | 260 | ||
261 | 261 | func keyEsWarehouse () = "emergencyWarehouseProducts" | |
262 | 262 | ||
263 | 263 | ||
264 | 264 | let locIdxContinent = 0 | |
265 | 265 | ||
266 | 266 | let locIdxType = 1 | |
267 | 267 | ||
268 | 268 | let locIdxId = 2 | |
269 | 269 | ||
270 | 270 | func asString (v) = match v { | |
271 | 271 | case s: String => | |
272 | 272 | s | |
273 | 273 | case _ => | |
274 | 274 | throw("fail to cast into String") | |
275 | 275 | } | |
276 | 276 | ||
277 | 277 | ||
278 | 278 | func asInt (v) = match v { | |
279 | 279 | case n: Int => | |
280 | 280 | n | |
281 | 281 | case _ => | |
282 | 282 | throw("fail to cast into Int") | |
283 | 283 | } | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func asAnyList (v) = match v { | |
287 | 287 | case l: List[Any] => | |
288 | 288 | l | |
289 | 289 | case _ => | |
290 | 290 | throw("fail to cast into List[Any]") | |
291 | 291 | } | |
292 | 292 | ||
293 | 293 | ||
294 | 294 | func asBoolean (v) = match v { | |
295 | 295 | case s: Boolean => | |
296 | 296 | s | |
297 | 297 | case _ => | |
298 | 298 | throw("fail to cast into Boolean") | |
299 | 299 | } | |
300 | 300 | ||
301 | 301 | ||
302 | 302 | func numPiecesBySize (landSize) = match landSize { | |
303 | 303 | case _ => | |
304 | 304 | if (("S" == $match0)) | |
305 | 305 | then SSIZE | |
306 | 306 | else if (("M" == $match0)) | |
307 | 307 | then MSIZE | |
308 | 308 | else if (("L" == $match0)) | |
309 | 309 | then LSIZE | |
310 | 310 | else if (("XL" == $match0)) | |
311 | 311 | then XLSIZE | |
312 | 312 | else if (("XXL" == $match0)) | |
313 | 313 | then XXLSIZE | |
314 | 314 | else throw("Unknown land size") | |
315 | 315 | } | |
316 | 316 | ||
317 | 317 | ||
318 | 318 | let IdxEffTotal = 0 | |
319 | 319 | ||
320 | 320 | let IdxEffUser = 1 | |
321 | 321 | ||
322 | 322 | func getVotingPower (userAddrStrOrEmpty) = { | |
323 | 323 | let props = split(valueOrElse(getString(stakingContract, keyResProportions()), "0_0_0_0_0_0"), "_") | |
324 | 324 | func adder (acc,item) = (acc + parseIntValue(item)) | |
325 | 325 | ||
326 | 326 | let totalPower = { | |
327 | 327 | let $l = props | |
328 | 328 | let $s = size($l) | |
329 | 329 | let $acc0 = 0 | |
330 | 330 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
331 | 331 | then $a | |
332 | 332 | else adder($a, $l[$i]) | |
333 | 333 | ||
334 | 334 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
335 | 335 | then $a | |
336 | 336 | else throw("List size exceeds 6") | |
337 | 337 | ||
338 | 338 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
339 | 339 | } | |
340 | 340 | let usersPower = if ((userAddrStrOrEmpty == "")) | |
341 | 341 | then 0 | |
342 | 342 | else { | |
343 | 343 | let landsStr = getString(stakingContract, keyStakedLandsByOwner(userAddrStrOrEmpty)) | |
344 | 344 | let lands = if (isDefined(landsStr)) | |
345 | 345 | then split_51C(value(landsStr), "_") | |
346 | 346 | else nil | |
347 | 347 | func oneLand (acc,landAssetId) = { | |
348 | 348 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
349 | 349 | let landSize = split(asset.description, "_")[recLandSize] | |
350 | 350 | (acc + numPiecesBySize(landSize)) | |
351 | 351 | } | |
352 | 352 | ||
353 | 353 | let $l = lands | |
354 | 354 | let $s = size($l) | |
355 | 355 | let $acc0 = 0 | |
356 | 356 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
357 | 357 | then $a | |
358 | 358 | else oneLand($a, $l[$i]) | |
359 | 359 | ||
360 | 360 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
361 | 361 | then $a | |
362 | 362 | else throw("List size exceeds 100") | |
363 | 363 | ||
364 | 364 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_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) | |
365 | 365 | } | |
366 | 366 | [totalPower, usersPower] | |
367 | 367 | } | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | func getRecipeMaterials (recipe) = { | |
371 | 371 | func addMat (ac,j) = (ac + parseIntValue(recipe[j])) | |
372 | 372 | ||
373 | 373 | let $l = [0, 1, 2, 3, 4, 5] | |
374 | 374 | let $s = size($l) | |
375 | 375 | let $acc0 = 0 | |
376 | 376 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
377 | 377 | then $a | |
378 | 378 | else addMat($a, $l[$i]) | |
379 | 379 | ||
380 | 380 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
381 | 381 | then $a | |
382 | 382 | else throw("List size exceeds 6") | |
383 | 383 | ||
384 | 384 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
385 | 385 | } | |
386 | 386 | ||
387 | 387 | ||
388 | 388 | let MULT14 = 100000000000000 | |
389 | 389 | ||
390 | 390 | let MARKETINGSHARE = 100000 | |
391 | 391 | ||
392 | 392 | let TEAMSHARE = 200000 | |
393 | 393 | ||
394 | 394 | let ACTIVITYSHARE = 100000 | |
395 | 395 | ||
396 | 396 | let PLAYERSHARE = 400000 | |
397 | 397 | ||
398 | 398 | let YEARMILLIS = 31557600000 | |
399 | 399 | ||
400 | 400 | let WEEKMILLIS = 604800000 | |
401 | 401 | ||
402 | 402 | let MAXPERIOD = 156 | |
403 | 403 | ||
404 | 404 | let TENMINUTESMILLIS = 600000 | |
405 | 405 | ||
406 | 406 | let A6 = 100000000 | |
407 | 407 | ||
408 | 408 | let B8 = 50000000 | |
409 | 409 | ||
410 | 410 | let wlgAssetIdKey = "wlg_assetId" | |
411 | 411 | ||
412 | 412 | let wlgIssueTimeKey = "wlg_issueTime" | |
413 | 413 | ||
414 | 414 | let wlgIssuedAmountKey = "wlg_issuedAmount" | |
415 | 415 | ||
416 | 416 | let marketingAddrKey = "marketingAddr" | |
417 | 417 | ||
418 | 418 | let teamAddrKey = "teamAddr" | |
419 | 419 | ||
420 | 420 | let lastMarketingTimeKey = "lastClaimedTime_marketing" | |
421 | 421 | ||
422 | 422 | let lastTeamTimeKey = "lastClaimedTime_team" | |
423 | 423 | ||
424 | 424 | let lastActivitiesTimeKey = "lastClaimedTime_activities" | |
425 | 425 | ||
426 | 426 | func keyLastClaimedTimeByUser (addr) = ("lastClaimedTimeUser_" + addr) | |
427 | 427 | ||
428 | 428 | ||
429 | 429 | func keyLastArbTimeByUser (addr) = ("lastArbTimeUser_" + addr) | |
430 | 430 | ||
431 | 431 | ||
432 | 432 | let stakersAmountLeftKey = "stakersAmountLeft" | |
433 | 433 | ||
434 | 434 | let stakersAmountPaidTotalKey = "stakersAmountPaidTotal" | |
435 | 435 | ||
436 | 436 | func keyStakersAmountPaidUser (addr) = ("stakersAmountPaidUser_" + addr) | |
437 | 437 | ||
438 | 438 | ||
439 | 439 | let idxWlgAmount = 0 | |
440 | 440 | ||
441 | 441 | let idxWlgPrice = 1 | |
442 | 442 | ||
443 | 443 | let idxWlgFunds = 2 | |
444 | 444 | ||
445 | 445 | let wlgAssetId = valueOrErrorMessage(getBinary(wlgAssetIdKey), "Not initialized yet") | |
446 | 446 | ||
447 | 447 | func prolog () = if (valueOrElse(getBoolean(stakingContract, keyBlocked()), false)) | |
448 | 448 | then throw("Contracts are under maintenance") | |
449 | 449 | else asInt(invoke(stakingContract, "saveLastTx", nil, nil)) | |
450 | 450 | ||
451 | 451 | ||
452 | 452 | func getWlgStats () = { | |
453 | 453 | let issuedAmount = valueOrErrorMessage(getInteger(wlgIssuedAmountKey), "WLGOLD is not issued yet") | |
454 | 454 | let funds = ((assetBalance(economyContract, usdtAssetId) + assetBalance(restContract, usdtAssetId)) + assetBalance(wlgContract, usdtAssetId)) | |
455 | 455 | [issuedAmount, fraction(funds, MULT8, issuedAmount), funds] | |
456 | 456 | } | |
457 | 457 | ||
458 | 458 | ||
459 | 459 | func getSwapLimit (addr) = { | |
460 | 460 | let lastTime = valueOrElse(getInteger(keyLastArbTimeByUser(addr)), 0) | |
461 | 461 | let now = lastBlock.timestamp | |
462 | 462 | if ((TENMINUTESMILLIS > (now - lastTime))) | |
463 | 463 | then throw("Arbitrages are possible once a 10 minutes") | |
464 | 464 | else { | |
465 | 465 | let pieces = getVotingPower(addr)[IdxEffUser] | |
466 | 466 | let pow8 = pow(pieces, 0, B8, 8, 8, CEILING) | |
467 | 467 | fraction(A6, pow8, MULT8) | |
468 | 468 | } | |
469 | 469 | } | |
470 | 470 | ||
471 | 471 | ||
472 | 472 | @Callable(i) | |
473 | 473 | func constructorV1 (restAddr,marketingAddr,teamAddr) = if ((i.caller != this)) | |
474 | 474 | then throw("Permission denied") | |
475 | 475 | else if (isDefined(getBinary(wlgAssetIdKey))) | |
476 | 476 | then throw("Already initialized") | |
477 | 477 | else { | |
478 | 478 | let issuedAmount = MULT14 | |
479 | 479 | let issue = Issue("WLGOLD", "WavesLands Gold investment token", issuedAmount, 8, true, unit, 0) | |
480 | 480 | let assetId = calculateAssetId(issue) | |
481 | 481 | [issue, IntegerEntry(wlgIssueTimeKey, lastBlock.timestamp), IntegerEntry(wlgIssuedAmountKey, issuedAmount), IntegerEntry(stakersAmountPaidTotalKey, 0), IntegerEntry(stakersAmountLeftKey, fraction(MULT14, PLAYERSHARE, MULT6)), BinaryEntry(wlgAssetIdKey, assetId), StringEntry(keyRestAddress(), restAddr), StringEntry(marketingAddrKey, marketingAddr), StringEntry(teamAddrKey, teamAddr)] | |
482 | 482 | } | |
483 | 483 | ||
484 | 484 | ||
485 | 485 | ||
486 | 486 | @Callable(i) | |
487 | 487 | func buyWlg () = { | |
488 | 488 | let prologResult = prolog() | |
489 | 489 | if ((size(i.payments) != 1)) | |
490 | 490 | then throw("exactly 1 payment must be attached") | |
491 | 491 | else { | |
492 | 492 | let pmt = i.payments[0] | |
493 | 493 | let usdtAmt = pmt.amount | |
494 | 494 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
495 | 495 | if ((pmtAssetId != usdtAssetId)) | |
496 | 496 | then throw("USDT payments only!") | |
497 | 497 | else { | |
498 | 498 | let caller = i.caller | |
499 | 499 | let addr = toString(caller) | |
500 | 500 | let maxUsdt = getSwapLimit(addr) | |
501 | 501 | if ((usdtAmt > maxUsdt)) | |
502 | 502 | then throw((("You can spend max " + toString(maxUsdt)) + " USDT")) | |
503 | 503 | else { | |
504 | 504 | let curStats = getWlgStats() | |
505 | 505 | let curAmount = curStats[idxWlgAmount] | |
506 | 506 | let buyPrice = fraction(curStats[idxWlgPrice], 6, 5) | |
507 | 507 | let wlgAmount = fraction(usdtAmt, MULT8, buyPrice) | |
508 | 508 | let reissued = fraction(usdtAmt, curAmount, (curStats[idxWlgFunds] - usdtAmt)) | |
509 | 509 | $Tuple2([Reissue(wlgAssetId, reissued, true), IntegerEntry(wlgIssuedAmountKey, (curAmount + reissued)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(caller, wlgAmount, wlgAssetId)], prologResult) | |
510 | 510 | } | |
511 | 511 | } | |
512 | 512 | } | |
513 | 513 | } | |
514 | 514 | ||
515 | 515 | ||
516 | 516 | ||
517 | 517 | @Callable(i) | |
518 | 518 | func sellWlg () = { | |
519 | 519 | let prologResult = prolog() | |
520 | 520 | if ((size(i.payments) != 1)) | |
521 | 521 | then throw("exactly 1 payment must be attached") | |
522 | 522 | else { | |
523 | 523 | let pmt = i.payments[0] | |
524 | 524 | let wlgAmt = pmt.amount | |
525 | 525 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
526 | 526 | if ((pmtAssetId != wlgAssetId)) | |
527 | 527 | then throw("WLGOLD payments only!") | |
528 | 528 | else { | |
529 | 529 | let caller = i.caller | |
530 | 530 | let addr = toString(caller) | |
531 | 531 | let maxUsdt = getSwapLimit(addr) | |
532 | 532 | let curStats = getWlgStats() | |
533 | 533 | let curAmount = (curStats[idxWlgAmount] - wlgAmt) | |
534 | 534 | let sellPrice = fraction(curStats[idxWlgPrice], 4, 5) | |
535 | 535 | let usdtAmount = fraction(wlgAmt, sellPrice, MULT8) | |
536 | 536 | if ((usdtAmount > maxUsdt)) | |
537 | 537 | then throw((("You can get max " + toString(maxUsdt)) + " USDT")) | |
538 | 538 | else { | |
539 | 539 | let burned = fraction(usdtAmount, curAmount, curStats[idxWlgFunds]) | |
540 | 540 | $Tuple2([Burn(wlgAssetId, burned), IntegerEntry(wlgIssuedAmountKey, (curAmount - burned)), IntegerEntry(keyLastArbTimeByUser(addr), lastBlock.timestamp), ScriptTransfer(caller, usdtAmount, usdtAssetId)], prologResult) | |
541 | 541 | } | |
542 | 542 | } | |
543 | 543 | } | |
544 | 544 | } | |
545 | 545 | ||
546 | 546 | ||
547 | 547 | ||
548 | 548 | @Callable(i) | |
549 | 549 | func claim () = { | |
550 | 550 | let prologResult = prolog() | |
551 | 551 | let caller = i.caller | |
552 | 552 | let callerAddr = toString(caller) | |
553 | 553 | let now = lastBlock.timestamp | |
554 | 554 | let issueTime = valueOrErrorMessage(getInteger(wlgIssueTimeKey), "Not initialized") | |
555 | 555 | let lastMarketingTime = valueOrElse(getInteger(lastMarketingTimeKey), issueTime) | |
556 | 556 | let marketingAddr = addressFromStringValue(value(getString(marketingAddrKey))) | |
557 | 557 | let marketingAmount = fraction(fraction(MULT14, MARKETINGSHARE, MULT6), (now - lastMarketingTime), YEARMILLIS) | |
558 | 558 | let lastTeamTime = valueOrElse(getInteger(lastTeamTimeKey), issueTime) | |
559 | 559 | let teamAddr = addressFromStringValue(value(getString(teamAddrKey))) | |
560 | 560 | let teamAmount = fraction(fraction(MULT14, TEAMSHARE, MULT6), (now - lastTeamTime), (3 * YEARMILLIS)) | |
561 | 561 | let lastActivitiesTime = valueOrElse(getInteger(lastActivitiesTimeKey), issueTime) | |
562 | 562 | let actAmount = fraction(fraction(MULT14, ACTIVITYSHARE, MULT6), (now - lastActivitiesTime), (3 * YEARMILLIS)) | |
563 | 563 | let curPeriod = ((now - issueTime) / WEEKMILLIS) | |
564 | 564 | if ((curPeriod > (MAXPERIOD / 2))) | |
565 | 565 | then throw("Please modify contract for next 1.5 years, according to stats") | |
566 | 566 | else { | |
567 | 567 | let eff = getVotingPower(callerAddr) | |
568 | 568 | let totalPieces = eff[IdxEffTotal] | |
569 | 569 | let amountLeftTotal = valueOrElse(getInteger(stakersAmountLeftKey), 0) | |
570 | 570 | let curPeriodDistribution = fraction(amountLeftTotal, (2 * totalPieces), (totalPieces + (max([100000, totalPieces]) * (MAXPERIOD - curPeriod)))) | |
571 | 571 | let userTimeKey = keyLastClaimedTimeByUser(callerAddr) | |
572 | 572 | let lastUserTime = valueOrElse(getInteger(userTimeKey), issueTime) | |
573 | 573 | let userAmount = fraction(fraction(curPeriodDistribution, eff[IdxEffUser], totalPieces), (now - lastUserTime), (3 * YEARMILLIS)) | |
574 | 574 | let userKey = keyStakersAmountPaidUser(callerAddr) | |
575 | 575 | $Tuple2([ScriptTransfer(marketingAddr, marketingAmount, wlgAssetId), ScriptTransfer(teamAddr, teamAmount, wlgAssetId), ScriptTransfer(restContract, actAmount, wlgAssetId), ScriptTransfer(caller, userAmount, wlgAssetId), IntegerEntry(userKey, (valueOrElse(getInteger(userKey), 0) + userAmount)), IntegerEntry(stakersAmountPaidTotalKey, (valueOrElse(getInteger(stakersAmountPaidTotalKey), 0) + userAmount)), IntegerEntry(stakersAmountLeftKey, (amountLeftTotal - userAmount)), IntegerEntry(lastMarketingTimeKey, now), IntegerEntry(lastTeamTimeKey, now), IntegerEntry(lastActivitiesTimeKey, now), IntegerEntry(userTimeKey, now)], prologResult) | |
576 | 576 | } | |
577 | 577 | } | |
578 | 578 | ||
579 | 579 | ||
580 | + | ||
581 | + | @Callable(i) | |
582 | + | func onStakeLand (addr) = if ((i.caller != stakingContract)) | |
583 | + | then throw("Permission denied") | |
584 | + | else $Tuple2([IntegerEntry(keyLastClaimedTimeByUser(addr), lastBlock.timestamp)], lastBlock.timestamp) | |
585 | + | ||
586 | + | ||
587 | + | ||
588 | + | @Callable(i) | |
589 | + | func onUnstakeLand (addr) = if ((i.caller != stakingContract)) | |
590 | + | then throw("Permission denied") | |
591 | + | else $Tuple2([DeleteEntry(keyLastClaimedTimeByUser(addr))], 0) | |
592 | + | ||
593 | + |
github/deemru/w8io/fabc49c 60.93 ms ◑