tx · B2WvBBewuyAuWfpZ9GxoG5bjbm73RWJdx3SK5jMRJT9w 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm: -0.02300000 Waves 2023.01.02 22:19 [2387758] smart account 3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm > SELF 0.00000000 Waves
{ "type": 13, "id": "B2WvBBewuyAuWfpZ9GxoG5bjbm73RWJdx3SK5jMRJT9w", "fee": 2300000, "feeAssetId": null, "timestamp": 1672687136413, "version": 2, "chainId": 84, "sender": "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm", "senderPublicKey": "EVooykMNV691Venwp1dHUTBd7KWequzUcda57Wd3LQEX", "proofs": [ "24G82uwtjiJfLHXvNKDE8vJLwAPZ4qCHERwJQJv2vc4oZaRQFgdqnqFd2xiis3HJh2FdLuqufUSiQ3KdzLm2HMyy" ], "script": "base64:BgJECAISABIDCgEIEgASAwoBCBIECgIBCBIECgICAhIECgIBCBIECgIBARIECgIICBIECgICAhIECgICAhIDCgEIEgMKAQhDAAVjaGFpbgkAsAkBCQDJAQIJAMoBAggFBHRoaXMFYnl0ZXMAAQABAAt1c2RuQXNzZXRJZAQHJG1hdGNoMAUFY2hhaW4DCQAAAgIBVwUHJG1hdGNoMAEgtiYpwwT1zlORpA5LdSQvZIxRsfrfr1QpvUjSHSqyqtEDCQAAAgIBVAUHJG1hdGNoMAEg93bq9/eDymXbbhPuAjvPWCmVqcHRjfJL2mzYHWKAyN4JAAIBAg1Vbmtub3duIGNoYWluAA1pbmN1YmF0b3JBZGRyBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwCQERQGV4dHJOYXRpdmUoMTA2MikBAiMzUEVrdFZ1eDJSaGNoU042M0RzRG80YjRtejRRcXpLU2VEdgMJAAACAgFUBQckbWF0Y2gwBQR0aGlzCQACAQINVW5rbm93biBjaGFpbgALYnJlZWRlckFkZHIEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDAJARFAZXh0ck5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V0SWQBBQtsYW5kQXNzZXRJZAAAAAEEBWFzc2V0CQEFdmFsdWUBCQDsBwEJANkEAQULbGFuZEFzc2V0SWQEAWQJALUJAggFBWFzc2V0C2Rlc2NyaXB0aW9uAgFfBARjb3N0CQBrAwUVSW5mcmFVcGdyYWRlQ29zdFNVc2RuCQBoAgkBD251bVBpZWNlc0J5U2l6ZQEJAJEDAgUBZAULcmVjTGFuZFNpemUFCG5ld0xldmVsABkDCQECIT0CCAUDcG10BmFtb3VudAUEY29zdAkAAgEJAKwCAgIbUGF5bWVudCBhdHRhY2hlZCBzaG91bGQgYmUgCQCkAwEFBGNvc3QJAQ11cEluZnJhQ29tbW9uAwcIBQFpBmNhbGxlcgULbGFuZEFzc2V0SWQAViKDug==", "height": 2387758, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 589bqNKuZsPSNiJQ9yD3vUx6YSxhbvqiu7rqCNGkx2d5 Next: 1W7obizLaGvWBdXZfEaubk2K6eiBT59GaidPXP8kUwC Diff:
Old | New | Differences | |
---|---|---|---|
62 | 62 | let InfraUpgradeCostS = match chain { | |
63 | 63 | case _ => | |
64 | 64 | if (("W" == $match0)) | |
65 | - | then | |
65 | + | then 18921595217 | |
66 | 66 | else if (("T" == $match0)) | |
67 | - | then | |
67 | + | then 189215952 | |
68 | 68 | else throw("Unknown chain") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | let InfraUpgradeCostSUsdn = match chain { | |
72 | 72 | case _ => | |
73 | 73 | if (("W" == $match0)) | |
74 | - | then | |
74 | + | then 120000000 | |
75 | 75 | else if (("T" == $match0)) | |
76 | - | then | |
76 | + | then 1200000 | |
77 | 77 | else throw("Unknown chain") | |
78 | 78 | } | |
79 | 79 | ||
470 | 470 | let bpKey = keyBackpackByDuck(duckAssetId) | |
471 | 471 | let currentPack = getBackpack(bpKey) | |
472 | 472 | let mList = split(currentPack[bpIdxMat], "_") | |
473 | - | let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, pieces, 25)), "_") | |
473 | + | let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_") | |
474 | 474 | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
475 | 475 | let deltaTime = (lastBlock.timestamp - savedTime) | |
476 | 476 | if ((0 > deltaTime)) | |
805 | 805 | if ((pmt.assetId != usdnAssetId)) | |
806 | 806 | then throw("Allowed USDN payment only!") | |
807 | 807 | else { | |
808 | + | let newLevel = (valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) + 1) | |
808 | 809 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
809 | 810 | let d = split(asset.description, "_") | |
810 | - | let cost = fraction(InfraUpgradeCostSUsdn, numPiecesBySize(d[recLandSize]), 25) | |
811 | + | let cost = fraction(InfraUpgradeCostSUsdn, (numPiecesBySize(d[recLandSize]) * newLevel), 25) | |
811 | 812 | if ((pmt.amount != cost)) | |
812 | 813 | then throw(("Payment attached should be " + toString(cost))) | |
813 | 814 | else upInfraCommon(false, i.caller, landAssetId) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let chain = toUtf8String(take(drop(this.bytes, 1), 1)) | |
5 | 5 | ||
6 | 6 | let usdnAssetId = match chain { | |
7 | 7 | case _ => | |
8 | 8 | if (("W" == $match0)) | |
9 | 9 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
10 | 10 | else if (("T" == $match0)) | |
11 | 11 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
12 | 12 | else throw("Unknown chain") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | let incubatorAddr = match chain { | |
16 | 16 | case _ => | |
17 | 17 | if (("W" == $match0)) | |
18 | 18 | then addressFromStringValue("3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv") | |
19 | 19 | else if (("T" == $match0)) | |
20 | 20 | then this | |
21 | 21 | else throw("Unknown chain") | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | let breederAddr = match chain { | |
25 | 25 | case _ => | |
26 | 26 | if (("W" == $match0)) | |
27 | 27 | then addressFromStringValue("3PDVuU45H7Eh5dmtNbnRNRStGwULA7NY6Hb") | |
28 | 28 | else if (("T" == $match0)) | |
29 | 29 | then this | |
30 | 30 | else throw("Unknown chain") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | let economyAddr = match chain { | |
34 | 34 | case _ => | |
35 | 35 | if (("W" == $match0)) | |
36 | 36 | then addressFromStringValue("3P2sk1KncSxRaZs8b4CWGPw2jkvvav74u4D") | |
37 | 37 | else if (("T" == $match0)) | |
38 | 38 | then addressFromStringValue("3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep") | |
39 | 39 | else throw("Unknown chain") | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | let pub = base58'6LfPuKJjLgekmncBhMg2LZyMTNVzZBccXR28ySXm9uXD' | |
43 | 43 | ||
44 | 44 | let HEALCOST = 10000 | |
45 | 45 | ||
46 | 46 | let LANDPREFIX = "LAND" | |
47 | 47 | ||
48 | 48 | let DUCKPREFIX = "DUCK" | |
49 | 49 | ||
50 | 50 | let DEFAULTLOCATION = "Africa_F_Africa" | |
51 | 51 | ||
52 | 52 | let NUMRES = 6 | |
53 | 53 | ||
54 | 54 | let DAILYRESBYPIECE = 3456000 | |
55 | 55 | ||
56 | 56 | let DAYMILLIS = 86400000 | |
57 | 57 | ||
58 | 58 | let FIVEMINUTESMILLIS = 300000 | |
59 | 59 | ||
60 | 60 | let RESOURCEPRICEMIN = 158549 | |
61 | 61 | ||
62 | 62 | let InfraUpgradeCostS = match chain { | |
63 | 63 | case _ => | |
64 | 64 | if (("W" == $match0)) | |
65 | - | then | |
65 | + | then 18921595217 | |
66 | 66 | else if (("T" == $match0)) | |
67 | - | then | |
67 | + | then 189215952 | |
68 | 68 | else throw("Unknown chain") | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 | let InfraUpgradeCostSUsdn = match chain { | |
72 | 72 | case _ => | |
73 | 73 | if (("W" == $match0)) | |
74 | - | then | |
74 | + | then 120000000 | |
75 | 75 | else if (("T" == $match0)) | |
76 | - | then | |
76 | + | then 1200000 | |
77 | 77 | else throw("Unknown chain") | |
78 | 78 | } | |
79 | 79 | ||
80 | 80 | let EXPMATERIALS = match chain { | |
81 | 81 | case _ => | |
82 | 82 | if (("W" == $match0)) | |
83 | 83 | then 157679960139 | |
84 | 84 | else if (("T" == $match0)) | |
85 | 85 | then 1576799601 | |
86 | 86 | else throw("Unknown chain") | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | let EXPUSDN = match chain { | |
90 | 90 | case _ => | |
91 | 91 | if (("W" == $match0)) | |
92 | 92 | then 1000000000 | |
93 | 93 | else if (("T" == $match0)) | |
94 | 94 | then 10000000 | |
95 | 95 | else throw("Unknown chain") | |
96 | 96 | } | |
97 | 97 | ||
98 | 98 | let MULT6 = 1000000 | |
99 | 99 | ||
100 | 100 | let FIVEX = toBigInt(5) | |
101 | 101 | ||
102 | 102 | let TWENTYX = toBigInt(20) | |
103 | 103 | ||
104 | 104 | let TWENTY2X = toBigInt((20 * 20)) | |
105 | 105 | ||
106 | 106 | let TWENTY3X = toBigInt(((20 * 20) * 20)) | |
107 | 107 | ||
108 | 108 | let TWENTY4X = toBigInt((((20 * 20) * 20) * 20)) | |
109 | 109 | ||
110 | 110 | let TWENTY5X = toBigInt(((((20 * 20) * 20) * 20) * 20)) | |
111 | 111 | ||
112 | 112 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
113 | 113 | ||
114 | 114 | let continents = ["Asia", "Europe", "Americas", "Oceania", "Africa"] | |
115 | 115 | ||
116 | 116 | func keyNextFreeLandNum () = "nextLandNum" | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func keyLandToAssetId (landNum) = ("landToAsset_" + landNum) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func keyNftName (landNum,landSize) = ((LANDPREFIX + landNum) + landSize) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func keyLandAssetIdToOwner (assetId) = ("nftOwner_" + assetId) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func keyDuckIdToOwner (assetId) = ("duckOwner_" + assetId) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func keyStakedTimeByAssetId (assetId) = ("stakedTime_" + assetId) | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func keyInfraLevelByAssetId (assetId) = ("infraLevel_" + assetId) | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | func keyStakedTimeByTypeAssetIdAndOwner (nftType,assetId,ownerAddr) = ((((("stakedTimeByTypeAssetIdAndOwner_" + nftType) + "_") + assetId) + "_") + ownerAddr) | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | func keyLandNumToOwner (landNum) = ("landOwner_" + landNum) | |
144 | 144 | ||
145 | 145 | ||
146 | 146 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func keyDuckHealth (duckAssetId) = ("duckHealth_" + duckAssetId) | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func keyResProportions () = "resTypesProportions" | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | let recLandNum = 0 | |
159 | 159 | ||
160 | 160 | let recLandSize = 1 | |
161 | 161 | ||
162 | 162 | let recTerrains = 2 | |
163 | 163 | ||
164 | 164 | let recContinent = 3 | |
165 | 165 | ||
166 | 166 | let locIdxContinent = 0 | |
167 | 167 | ||
168 | 168 | let locIdxType = 1 | |
169 | 169 | ||
170 | 170 | let locIdxId = 2 | |
171 | 171 | ||
172 | 172 | let bpIdxLevel = 0 | |
173 | 173 | ||
174 | 174 | let bpIdxRes = 1 | |
175 | 175 | ||
176 | 176 | let bpIdxMat = 2 | |
177 | 177 | ||
178 | 178 | let bpIdxProd = 3 | |
179 | 179 | ||
180 | 180 | func asString (v) = match v { | |
181 | 181 | case s: String => | |
182 | 182 | s | |
183 | 183 | case _ => | |
184 | 184 | throw("fail to cast into String") | |
185 | 185 | } | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func getNeededMaterials (total) = { | |
189 | 189 | let props = split(value(getString(keyResProportions())), "_") | |
190 | 190 | if ((size(props) != NUMRES)) | |
191 | 191 | then throw("Wrong proportions data") | |
192 | 192 | else { | |
193 | 193 | let r = [parseIntValue(props[0]), parseIntValue(props[1]), parseIntValue(props[2]), parseIntValue(props[3]), parseIntValue(props[4]), parseIntValue(props[5])] | |
194 | 194 | let sum = (((((r[0] + r[1]) + r[2]) + r[3]) + r[4]) + r[5]) | |
195 | 195 | if ((0 >= sum)) | |
196 | 196 | then throw("No lands staked") | |
197 | 197 | else { | |
198 | 198 | let norm6 = fraction(total, MULT6, sum) | |
199 | 199 | func normalizer (acc,elem) = (acc :+ fraction(elem, norm6, MULT6)) | |
200 | 200 | ||
201 | 201 | let $l = r | |
202 | 202 | let $s = size($l) | |
203 | 203 | let $acc0 = nil | |
204 | 204 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
205 | 205 | then $a | |
206 | 206 | else normalizer($a, $l[$i]) | |
207 | 207 | ||
208 | 208 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
209 | 209 | then $a | |
210 | 210 | else throw("List size exceeds 6") | |
211 | 211 | ||
212 | 212 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
213 | 213 | } | |
214 | 214 | } | |
215 | 215 | } | |
216 | 216 | ||
217 | 217 | ||
218 | 218 | func subtractMaterials (shouldUseMat,has,totalNeed) = { | |
219 | 219 | let need = getNeededMaterials(totalNeed) | |
220 | 220 | func subtractor (acc,idx) = { | |
221 | 221 | let result = (parseIntValue(has[idx]) - need[idx]) | |
222 | 222 | if ((0 > result)) | |
223 | 223 | then throw(((((("Not enough material idx=" + toString(idx)) + ", you have ") + has[idx]) + ", but need ") + toString(need[idx]))) | |
224 | 224 | else (acc :+ toString(result)) | |
225 | 225 | } | |
226 | 226 | ||
227 | 227 | if (shouldUseMat) | |
228 | 228 | then { | |
229 | 229 | let $l = [0, 1, 2, 3, 4, 5] | |
230 | 230 | let $s = size($l) | |
231 | 231 | let $acc0 = nil | |
232 | 232 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
233 | 233 | then $a | |
234 | 234 | else subtractor($a, $l[$i]) | |
235 | 235 | ||
236 | 236 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
237 | 237 | then $a | |
238 | 238 | else throw("List size exceeds 6") | |
239 | 239 | ||
240 | 240 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
241 | 241 | } | |
242 | 242 | else has | |
243 | 243 | } | |
244 | 244 | ||
245 | 245 | ||
246 | 246 | func updateProportions (terrainCounts,landSizeIndex,sign) = { | |
247 | 247 | let props = split(valueOrElse(getString(keyResProportions()), "0_0_0_0_0_0"), "_") | |
248 | 248 | if ((size(props) != NUMRES)) | |
249 | 249 | then throw("Wrong proportions data") | |
250 | 250 | else { | |
251 | 251 | func updater (acc,i) = { | |
252 | 252 | let result = (parseIntValue(props[i]) + ((sign * terrainCounts[i]) * landSizeIndex)) | |
253 | 253 | if ((0 > result)) | |
254 | 254 | then throw(((((((("Panic! Pieces of type=" + toString(i)) + ", sign=") + toString(sign)) + ", terrainCounts[i]=") + toString(terrainCounts[i])) + ", landSizeIndex=") + toString(landSizeIndex))) | |
255 | 255 | else (acc :+ toString(result)) | |
256 | 256 | } | |
257 | 257 | ||
258 | 258 | let r = { | |
259 | 259 | let $l = [0, 1, 2, 3, 4, 5] | |
260 | 260 | let $s = size($l) | |
261 | 261 | let $acc0 = nil | |
262 | 262 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
263 | 263 | then $a | |
264 | 264 | else updater($a, $l[$i]) | |
265 | 265 | ||
266 | 266 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
267 | 267 | then $a | |
268 | 268 | else throw("List size exceeds 6") | |
269 | 269 | ||
270 | 270 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
271 | 271 | } | |
272 | 272 | makeString(r, "_") | |
273 | 273 | } | |
274 | 274 | } | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func countTerrains (terrains) = [(size(split(terrains, "A")) - 1), (size(split(terrains, "B")) - 1), (size(split(terrains, "C")) - 1), (size(split(terrains, "D")) - 1), (size(split(terrains, "E")) - 1), (size(split(terrains, "F")) - 1)] | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func numPiecesBySize (landSize) = match landSize { | |
281 | 281 | case _ => | |
282 | 282 | if (("S" == $match0)) | |
283 | 283 | then 25 | |
284 | 284 | else if (("M" == $match0)) | |
285 | 285 | then 100 | |
286 | 286 | else if (("L" == $match0)) | |
287 | 287 | then 225 | |
288 | 288 | else if (("XL" == $match0)) | |
289 | 289 | then 400 | |
290 | 290 | else if (("XXL" == $match0)) | |
291 | 291 | then 625 | |
292 | 292 | else throw("Unknown land size") | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | func subOneInList (aList,idx,amount) = { | |
297 | 297 | func subber (acc,i) = (acc :+ (if ((i == idx)) | |
298 | 298 | then toString((parseIntValue(aList[i]) - amount)) | |
299 | 299 | else aList[i])) | |
300 | 300 | ||
301 | 301 | let r = { | |
302 | 302 | let $l = [0, 1, 2, 3, 4, 5] | |
303 | 303 | let $s = size($l) | |
304 | 304 | let $acc0 = nil | |
305 | 305 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
306 | 306 | then $a | |
307 | 307 | else subber($a, $l[$i]) | |
308 | 308 | ||
309 | 309 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
310 | 310 | then $a | |
311 | 311 | else throw("List size exceeds 6") | |
312 | 312 | ||
313 | 313 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
314 | 314 | } | |
315 | 315 | makeString(r, "_") | |
316 | 316 | } | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func addRes (currentRes,terrainCounts,deltaTime,landSizeIndex) = { | |
320 | 320 | func adder (acc,i) = { | |
321 | 321 | let resOfType = ((fraction(deltaTime, DAILYRESBYPIECE, DAYMILLIS) * terrainCounts[i]) * landSizeIndex) | |
322 | 322 | (acc :+ toString((parseIntValue(currentRes[i]) + resOfType))) | |
323 | 323 | } | |
324 | 324 | ||
325 | 325 | let r = { | |
326 | 326 | let $l = [0, 1, 2, 3, 4, 5] | |
327 | 327 | let $s = size($l) | |
328 | 328 | let $acc0 = nil | |
329 | 329 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
330 | 330 | then $a | |
331 | 331 | else adder($a, $l[$i]) | |
332 | 332 | ||
333 | 333 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
334 | 334 | then $a | |
335 | 335 | else throw("List size exceeds 6") | |
336 | 336 | ||
337 | 337 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
338 | 338 | } | |
339 | 339 | makeString(r, "_") | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func abs (x) = if ((x >= toBigInt(0))) | |
344 | 344 | then x | |
345 | 345 | else -(x) | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | let freq = [[1, 4, 9, 10, 15], [5, 8, 13, 14, 15], [6, 9, 14, 15, 16], [4, 7, 8, 13, 18], [1, 6, 7, 15, 19]] | |
349 | 349 | ||
350 | 350 | func genChar (n,freqs) = { | |
351 | 351 | let rem = toInt((n % TWENTYX)) | |
352 | 352 | let letter = if ((freqs[0] > rem)) | |
353 | 353 | then "A" | |
354 | 354 | else if ((freqs[1] > rem)) | |
355 | 355 | then "B" | |
356 | 356 | else if ((freqs[2] > rem)) | |
357 | 357 | then "C" | |
358 | 358 | else if ((freqs[3] > rem)) | |
359 | 359 | then "D" | |
360 | 360 | else if ((freqs[4] > rem)) | |
361 | 361 | then "E" | |
362 | 362 | else "F" | |
363 | 363 | letter | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func getBackpack (bpKey) = { | |
368 | 368 | let p = split(valueOrElse(getString(bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
369 | 369 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
370 | 370 | then p[bpIdxRes] | |
371 | 371 | else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES)) | |
372 | 372 | then p[bpIdxMat] | |
373 | 373 | else "0_0_0_0_0_0", p[bpIdxProd]] | |
374 | 374 | } | |
375 | 375 | ||
376 | 376 | ||
377 | 377 | func expeditionCommon (shouldUseMat,caller,txId,message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
378 | 378 | then throw("signature does not match") | |
379 | 379 | else { | |
380 | 380 | let parts = split(toUtf8String(message), ";") | |
381 | 381 | let hp = split(split(parts[0], "|")[0], "_") | |
382 | 382 | let curHP = parseIntValue(hp[0]) | |
383 | 383 | let newHP = parseIntValue(hp[1]) | |
384 | 384 | let locAndTime = split(parts[1], ":") | |
385 | 385 | let targetLocation = split(locAndTime[0], "_") | |
386 | 386 | if ((targetLocation[1] != "E")) | |
387 | 387 | then throw("expedition target location type should be E") | |
388 | 388 | else { | |
389 | 389 | let time = parseIntValue(locAndTime[1]) | |
390 | 390 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
391 | 391 | then true | |
392 | 392 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
393 | 393 | then throw("signature outdated") | |
394 | 394 | else { | |
395 | 395 | let userAddr = toString(caller) | |
396 | 396 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(userAddr)), "You don't have a duck staked") | |
397 | 397 | let keyHealth = keyDuckHealth(duckAssetId) | |
398 | 398 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
399 | 399 | if ((oldFromState != curHP)) | |
400 | 400 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
401 | 401 | else if ((0 >= curHP)) | |
402 | 402 | then throw("You can't fly with zero health") | |
403 | 403 | else if ((0 >= newHP)) | |
404 | 404 | then throw("Your duck health is zero, expedition failed") | |
405 | 405 | else { | |
406 | 406 | let bpKey = keyBackpackByDuck(duckAssetId) | |
407 | 407 | let currentPack = getBackpack(bpKey) | |
408 | 408 | let mList = split(currentPack[bpIdxMat], "_") | |
409 | 409 | let newMat = makeString(subtractMaterials(shouldUseMat, mList, EXPMATERIALS), "_") | |
410 | 410 | let bigNum = abs(toBigInt(txId)) | |
411 | 411 | let freeNum = valueOrElse(getInteger(keyNextFreeLandNum()), 501) | |
412 | 412 | let landNum = toString(freeNum) | |
413 | 413 | let continentIdx = toInt((bigNum % FIVEX)) | |
414 | 414 | let f = freq[continentIdx] | |
415 | 415 | func terrainGenerator (acc,elem) = $Tuple2((((((acc._1 + genChar(acc._2, f)) + genChar((acc._2 / TWENTYX), f)) + genChar((acc._2 / TWENTY2X), f)) + genChar((acc._2 / TWENTY3X), f)) + genChar((acc._2 / TWENTY4X), f)), (acc._2 / TWENTY5X)) | |
416 | 416 | ||
417 | 417 | let t = { | |
418 | 418 | let $l = [1, 2, 3, 4, 5] | |
419 | 419 | let $s = size($l) | |
420 | 420 | let $acc0 = $Tuple2("", (bigNum / FIVEX)) | |
421 | 421 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
422 | 422 | then $a | |
423 | 423 | else terrainGenerator($a, $l[$i]) | |
424 | 424 | ||
425 | 425 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
426 | 426 | then $a | |
427 | 427 | else throw("List size exceeds 5") | |
428 | 428 | ||
429 | 429 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
430 | 430 | } | |
431 | 431 | let continent = continents[continentIdx] | |
432 | 432 | let issue = Issue(keyNftName(landNum, "S"), makeString([landNum, "S", t._1, continent], "_"), 1, 0, false) | |
433 | 433 | let assetId = calculateAssetId(issue) | |
434 | 434 | let id = toBase58String(assetId) | |
435 | 435 | $Tuple2([IntegerEntry(keyNextFreeLandNum(), (freeNum + 1)), issue, StringEntry(keyLandToAssetId(landNum), id), StringEntry(keyLandAssetIdToOwner(id), userAddr), StringEntry(keyLandNumToOwner(landNum), userAddr), IntegerEntry(keyInfraLevelByAssetId(id), 0), ScriptTransfer(caller, 1, assetId), StringEntry(keyDuckLocation(duckAssetId), makeString([continent, "L", id], "_")), IntegerEntry(keyHealth, newHP), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))], unit) | |
436 | 436 | } | |
437 | 437 | } | |
438 | 438 | } | |
439 | 439 | } | |
440 | 440 | ||
441 | 441 | ||
442 | 442 | func upInfraCommon (shouldUseMat,caller,landAssetId) = { | |
443 | 443 | let addr = toString(caller) | |
444 | 444 | let infraKey = keyInfraLevelByAssetId(landAssetId) | |
445 | 445 | let curLevel = valueOrElse(getInteger(infraKey), 0) | |
446 | 446 | if ((curLevel >= 3)) | |
447 | 447 | then throw("Currently max infrastructure level = 3") | |
448 | 448 | else { | |
449 | 449 | let newLevel = (curLevel + 1) | |
450 | 450 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
451 | 451 | if (!(contains(asset.name, LANDPREFIX))) | |
452 | 452 | then throw((("NFT " + LANDPREFIX) + " token should be passed as param")) | |
453 | 453 | else { | |
454 | 454 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
455 | 455 | let owner = getStringValue(keyLandAssetIdToOwner(landAssetId)) | |
456 | 456 | if ((owner != addr)) | |
457 | 457 | then throw((LANDPREFIX + " is not yours")) | |
458 | 458 | else { | |
459 | 459 | let d = split(asset.description, "_") | |
460 | 460 | let landSize = d[recLandSize] | |
461 | 461 | let pieces = numPiecesBySize(landSize) | |
462 | 462 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked") | |
463 | 463 | let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION) | |
464 | 464 | let loc = split(value(curLocation), "_") | |
465 | 465 | if ((loc[locIdxType] != "L")) | |
466 | 466 | then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L")) | |
467 | 467 | else if ((loc[locIdxId] != landAssetId)) | |
468 | 468 | then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId)) | |
469 | 469 | else { | |
470 | 470 | let bpKey = keyBackpackByDuck(duckAssetId) | |
471 | 471 | let currentPack = getBackpack(bpKey) | |
472 | 472 | let mList = split(currentPack[bpIdxMat], "_") | |
473 | - | let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, pieces, 25)), "_") | |
473 | + | let newMat = makeString(subtractMaterials(shouldUseMat, mList, fraction(InfraUpgradeCostS, (pieces * newLevel), 25)), "_") | |
474 | 474 | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
475 | 475 | let deltaTime = (lastBlock.timestamp - savedTime) | |
476 | 476 | if ((0 > deltaTime)) | |
477 | 477 | then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
478 | 478 | else { | |
479 | 479 | let availRes = (fraction(deltaTime, DAILYRESBYPIECE, DAYMILLIS) * pieces) | |
480 | 480 | let newRes = asString(invoke(this, "claimRes", [availRes, landAssetId], nil)) | |
481 | 481 | $Tuple2([IntegerEntry(infraKey, newLevel), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], newRes, newMat, currentPack[bpIdxProd]], ":"))], newLevel) | |
482 | 482 | } | |
483 | 483 | } | |
484 | 484 | } | |
485 | 485 | } | |
486 | 486 | } | |
487 | 487 | } | |
488 | 488 | ||
489 | 489 | ||
490 | 490 | @Callable(i) | |
491 | 491 | func stakeLand () = { | |
492 | 492 | let pmt = value(i.payments[0]) | |
493 | 493 | let assetId = value(pmt.assetId) | |
494 | 494 | let address = toString(i.caller) | |
495 | 495 | if ((pmt.amount != 1)) | |
496 | 496 | then throw((("NFT " + LANDPREFIX) + " token should be attached as payment")) | |
497 | 497 | else { | |
498 | 498 | let asset = value(assetInfo(assetId)) | |
499 | 499 | if ((asset.issuer != this)) | |
500 | 500 | then throw("Unknown issuer of token") | |
501 | 501 | else if (!(contains(asset.name, LANDPREFIX))) | |
502 | 502 | then throw((("Only NFT " + LANDPREFIX) + " tokens are accepted")) | |
503 | 503 | else { | |
504 | 504 | let landNumSize = drop(asset.name, 4) | |
505 | 505 | let landNum = if (contains(landNumSize, "XXL")) | |
506 | 506 | then dropRight(landNumSize, 3) | |
507 | 507 | else if (contains(landNumSize, "XL")) | |
508 | 508 | then dropRight(landNumSize, 2) | |
509 | 509 | else dropRight(landNumSize, 1) | |
510 | 510 | if (!(isDefined(parseInt(landNum)))) | |
511 | 511 | then throw(("Cannot parse land number from " + asset.name)) | |
512 | 512 | else { | |
513 | 513 | let timeKey = keyStakedTimeByAssetId(toBase58String(assetId)) | |
514 | 514 | if (isDefined(getInteger(timeKey))) | |
515 | 515 | then throw((("NFT " + asset.name) + " is already staked")) | |
516 | 516 | else { | |
517 | 517 | let d = split(asset.description, "_") | |
518 | 518 | let terrainCounts = countTerrains(d[recTerrains]) | |
519 | 519 | let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), 1) | |
520 | 520 | [IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyLandAssetIdToOwner(toBase58String(assetId)), address), StringEntry(keyLandNumToOwner(landNum), address), StringEntry(keyResProportions(), props)] | |
521 | 521 | } | |
522 | 522 | } | |
523 | 523 | } | |
524 | 524 | } | |
525 | 525 | } | |
526 | 526 | ||
527 | 527 | ||
528 | 528 | ||
529 | 529 | @Callable(i) | |
530 | 530 | func unstakeLand (landAssetId) = if ((size(i.payments) != 0)) | |
531 | 531 | then throw("unstake doesn't require any payments") | |
532 | 532 | else { | |
533 | 533 | let assetId = fromBase58String(landAssetId) | |
534 | 534 | let address = toString(i.caller) | |
535 | 535 | let asset = value(assetInfo(assetId)) | |
536 | 536 | if ((asset.issuer != this)) | |
537 | 537 | then throw("Unknown issuer of token") | |
538 | 538 | else if (!(contains(asset.name, LANDPREFIX))) | |
539 | 539 | then throw((("Only NFT " + LANDPREFIX) + " tokens can be unstaked")) | |
540 | 540 | else { | |
541 | 541 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
542 | 542 | if (!(isDefined(timeKey))) | |
543 | 543 | then throw((("NFT " + asset.name) + " is not staked")) | |
544 | 544 | else { | |
545 | 545 | let owner = valueOrErrorMessage(getString(keyLandAssetIdToOwner(landAssetId)), (("NFT " + asset.name) + " is orphaned")) | |
546 | 546 | if ((owner != address)) | |
547 | 547 | then throw("Staked NFT is not yours") | |
548 | 548 | else { | |
549 | 549 | let d = split(asset.description, "_") | |
550 | 550 | let terrainCounts = countTerrains(d[recTerrains]) | |
551 | 551 | let props = updateProportions(terrainCounts, (numPiecesBySize(d[recLandSize]) / 25), -1) | |
552 | 552 | [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, address)), StringEntry(keyResProportions(), props)] | |
553 | 553 | } | |
554 | 554 | } | |
555 | 555 | } | |
556 | 556 | } | |
557 | 557 | ||
558 | 558 | ||
559 | 559 | ||
560 | 560 | @Callable(i) | |
561 | 561 | func stakeDuck () = { | |
562 | 562 | let pmt = value(i.payments[0]) | |
563 | 563 | let assetId = value(pmt.assetId) | |
564 | 564 | let address = toString(i.caller) | |
565 | 565 | if ((pmt.amount != 1)) | |
566 | 566 | then throw((("NFT " + DUCKPREFIX) + " token should be attached as payment")) | |
567 | 567 | else { | |
568 | 568 | let asset = value(assetInfo(assetId)) | |
569 | 569 | if (if ((asset.issuer != incubatorAddr)) | |
570 | 570 | then (asset.issuer != breederAddr) | |
571 | 571 | else false) | |
572 | 572 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
573 | 573 | else if (!(contains(asset.name, DUCKPREFIX))) | |
574 | 574 | then throw((("Only NFT " + DUCKPREFIX) + " tokens are accepted")) | |
575 | 575 | else { | |
576 | 576 | let assetIdStr = toBase58String(assetId) | |
577 | 577 | let timeKey = keyStakedTimeByAssetId(assetIdStr) | |
578 | 578 | if (isDefined(getInteger(timeKey))) | |
579 | 579 | then throw((("NFT " + asset.name) + " is already staked")) | |
580 | 580 | else if (isDefined(getString(keyStakedDuckByOwner(address)))) | |
581 | 581 | then throw(("You already staked one duck: " + asset.name)) | |
582 | 582 | else { | |
583 | 583 | let locKey = keyDuckLocation(assetIdStr) | |
584 | 584 | let location = getString(locKey) | |
585 | 585 | let keyHealth = keyDuckHealth(assetIdStr) | |
586 | 586 | let health = getInteger(keyHealth) | |
587 | 587 | let bpKey = keyBackpackByDuck(assetIdStr) | |
588 | 588 | let backpack = getString(bpKey) | |
589 | 589 | ([IntegerEntry(timeKey, lastBlock.timestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, toBase58String(assetId), address), lastBlock.timestamp), StringEntry(keyDuckIdToOwner(assetIdStr), address), StringEntry(keyStakedDuckByOwner(address), assetIdStr)] ++ (if (isDefined(location)) | |
590 | 590 | then nil | |
591 | 591 | else ([StringEntry(locKey, DEFAULTLOCATION)] ++ (if (isDefined(health)) | |
592 | 592 | then nil | |
593 | 593 | else ([IntegerEntry(keyHealth, 100)] ++ (if (isDefined(backpack)) | |
594 | 594 | then nil | |
595 | 595 | else [StringEntry(bpKey, "0:0_0_0_0_0_0:0_0_0_0_0_0:")])))))) | |
596 | 596 | } | |
597 | 597 | } | |
598 | 598 | } | |
599 | 599 | } | |
600 | 600 | ||
601 | 601 | ||
602 | 602 | ||
603 | 603 | @Callable(i) | |
604 | 604 | func unstakeDuck (assetIdStr) = if ((size(i.payments) != 0)) | |
605 | 605 | then throw("unstake doesn't require any payments") | |
606 | 606 | else { | |
607 | 607 | let assetId = fromBase58String(assetIdStr) | |
608 | 608 | let address = toString(i.caller) | |
609 | 609 | let asset = value(assetInfo(assetId)) | |
610 | 610 | if (if ((asset.issuer != incubatorAddr)) | |
611 | 611 | then (asset.issuer != breederAddr) | |
612 | 612 | else false) | |
613 | 613 | then throw((("Unknown issuer of " + DUCKPREFIX) + " token")) | |
614 | 614 | else if (!(contains(asset.name, DUCKPREFIX))) | |
615 | 615 | then throw((("Only NFT " + DUCKPREFIX) + " tokens can be unstaked")) | |
616 | 616 | else { | |
617 | 617 | let timeKey = keyStakedTimeByAssetId(toBase58String(assetId)) | |
618 | 618 | if (!(isDefined(timeKey))) | |
619 | 619 | then throw((("NFT " + asset.name) + " is not staked")) | |
620 | 620 | else if (!(isDefined(keyStakedDuckByOwner(address)))) | |
621 | 621 | then throw((("The duck " + asset.name) + " is not staked")) | |
622 | 622 | else { | |
623 | 623 | let owner = valueOrErrorMessage(getString(keyDuckIdToOwner(toBase58String(assetId))), (("NFT " + asset.name) + " is orphaned")) | |
624 | 624 | if ((owner != address)) | |
625 | 625 | then throw("Staked NFT is not yours") | |
626 | 626 | else [ScriptTransfer(i.caller, 1, assetId), DeleteEntry(timeKey), DeleteEntry(keyDuckLocation(assetIdStr)), DeleteEntry(keyStakedTimeByTypeAssetIdAndOwner(DUCKPREFIX, assetIdStr, address)), DeleteEntry(keyStakedDuckByOwner(address))] | |
627 | 627 | } | |
628 | 628 | } | |
629 | 629 | } | |
630 | 630 | ||
631 | 631 | ||
632 | 632 | ||
633 | 633 | @Callable(i) | |
634 | 634 | func claimRes (amount,landAssetId) = if ((size(i.payments) != 0)) | |
635 | 635 | then throw("claimRes doesn't require any payments") | |
636 | 636 | else { | |
637 | 637 | let addr = toString(i.originCaller) | |
638 | 638 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
639 | 639 | if (!(contains(asset.name, LANDPREFIX))) | |
640 | 640 | then throw((("NFT " + LANDPREFIX) + " token should be passed as param")) | |
641 | 641 | else { | |
642 | 642 | let timeKey = keyStakedTimeByAssetId(landAssetId) | |
643 | 643 | let owner = getStringValue(keyLandAssetIdToOwner(landAssetId)) | |
644 | 644 | if ((owner != addr)) | |
645 | 645 | then throw((LANDPREFIX + " is not yours")) | |
646 | 646 | else { | |
647 | 647 | let d = split(asset.description, "_") | |
648 | 648 | let landSize = d[recLandSize] | |
649 | 649 | let terrainCounts = countTerrains(d[recTerrains]) | |
650 | 650 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(addr)), "You don't have a duck staked") | |
651 | 651 | let curLocation = valueOrElse(getString(keyDuckLocation(duckAssetId)), DEFAULTLOCATION) | |
652 | 652 | let loc = split(value(curLocation), "_") | |
653 | 653 | if ((loc[locIdxType] != "L")) | |
654 | 654 | then throw((("Duck location type is " + loc[locIdxType]) + ", but should be L")) | |
655 | 655 | else if ((loc[locIdxId] != landAssetId)) | |
656 | 656 | then throw(((("Duck location id is " + loc[locIdxId]) + ", but should be ") + landAssetId)) | |
657 | 657 | else { | |
658 | 658 | let savedTime = valueOrErrorMessage(getInteger(timeKey), (("NFT " + asset.name) + " is not staked")) | |
659 | 659 | let deltaTime = (lastBlock.timestamp - savedTime) | |
660 | 660 | if ((0 > deltaTime)) | |
661 | 661 | then throw(((("Saved timestamp is in future, saved = " + toString(savedTime)) + ", current = ") + toString(lastBlock.timestamp))) | |
662 | 662 | else { | |
663 | 663 | let pieces = numPiecesBySize(landSize) | |
664 | 664 | let infraLevel = valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) | |
665 | 665 | let availRes = (fraction((deltaTime + fraction(deltaTime, infraLevel, 4)), DAILYRESBYPIECE, DAYMILLIS) * pieces) | |
666 | 666 | if ((amount > availRes)) | |
667 | 667 | then throw(((("Not enough resources, available = " + toString(availRes)) + ", requested = ") + toString(amount))) | |
668 | 668 | else { | |
669 | 669 | let newDeltaTime = fraction((availRes - amount), DAYMILLIS, (pieces * DAILYRESBYPIECE)) | |
670 | 670 | let newTimestamp = (lastBlock.timestamp - newDeltaTime) | |
671 | 671 | let bpKey = keyBackpackByDuck(duckAssetId) | |
672 | 672 | let currentPack = getBackpack(bpKey) | |
673 | 673 | let currentRes = split(currentPack[bpIdxRes], "_") | |
674 | 674 | let bpRes = addRes(currentRes, terrainCounts, ((deltaTime - newDeltaTime) + fraction((deltaTime - newDeltaTime), infraLevel, 4)), (pieces / 25)) | |
675 | 675 | let newPack = makeString([currentPack[bpIdxLevel], bpRes, currentPack[bpIdxMat], currentPack[bpIdxProd]], ":") | |
676 | 676 | $Tuple2([StringEntry(bpKey, newPack), IntegerEntry(timeKey, newTimestamp), IntegerEntry(keyStakedTimeByTypeAssetIdAndOwner(LANDPREFIX, landAssetId, owner), newTimestamp)], bpRes) | |
677 | 677 | } | |
678 | 678 | } | |
679 | 679 | } | |
680 | 680 | } | |
681 | 681 | } | |
682 | 682 | } | |
683 | 683 | ||
684 | 684 | ||
685 | 685 | ||
686 | 686 | @Callable(i) | |
687 | 687 | func flight (message,sig) = if (!(sigVerify_8Kb(message, sig, pub))) | |
688 | 688 | then throw("signature does not match") | |
689 | 689 | else if ((size(i.payments) != 0)) | |
690 | 690 | then throw("flight doesn't require any payments") | |
691 | 691 | else { | |
692 | 692 | let parts = split(toUtf8String(message), ";") | |
693 | 693 | let hp = split(split(parts[0], "|")[0], "_") | |
694 | 694 | let curHP = parseIntValue(hp[0]) | |
695 | 695 | let newHP = parseIntValue(hp[1]) | |
696 | 696 | let newLocAndTime = split(parts[1], ":") | |
697 | 697 | let newLocation = newLocAndTime[0] | |
698 | 698 | let time = parseIntValue(newLocAndTime[1]) | |
699 | 699 | if (if ((time > (lastBlock.timestamp + FIVEMINUTESMILLIS))) | |
700 | 700 | then true | |
701 | 701 | else ((lastBlock.timestamp - FIVEMINUTESMILLIS) > time)) | |
702 | 702 | then throw("signature outdated") | |
703 | 703 | else { | |
704 | 704 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
705 | 705 | let keyHealth = keyDuckHealth(duckAssetId) | |
706 | 706 | let oldFromState = valueOrElse(getInteger(keyHealth), 100) | |
707 | 707 | if ((oldFromState != curHP)) | |
708 | 708 | then throw(((("oldHealth=" + toString(valueOrElse(getInteger(keyHealth), 100))) + " from state does not match one from flight log=") + toString(curHP))) | |
709 | 709 | else if ((0 >= curHP)) | |
710 | 710 | then throw("You can't fly with zero health") | |
711 | 711 | else { | |
712 | 712 | let locKey = keyDuckLocation(duckAssetId) | |
713 | 713 | let curLocation = valueOrElse(getString(locKey), DEFAULTLOCATION) | |
714 | 714 | if ((newLocation == curLocation)) | |
715 | 715 | then throw("You can't fly to the same location") | |
716 | 716 | else $Tuple2([StringEntry(locKey, if ((newHP > 0)) | |
717 | 717 | then newLocation | |
718 | 718 | else curLocation), IntegerEntry(keyHealth, newHP)], unit) | |
719 | 719 | } | |
720 | 720 | } | |
721 | 721 | } | |
722 | 722 | ||
723 | 723 | ||
724 | 724 | ||
725 | 725 | @Callable(i) | |
726 | 726 | func setHealth (health,duckAssetId) = if (if ((0 > health)) | |
727 | 727 | then true | |
728 | 728 | else (health > 100)) | |
729 | 729 | then throw("HP should be within 0..100") | |
730 | 730 | else [IntegerEntry(keyDuckHealth(duckAssetId), health)] | |
731 | 731 | ||
732 | 732 | ||
733 | 733 | ||
734 | 734 | @Callable(i) | |
735 | 735 | func heal (matType,amount) = if (if ((0 > matType)) | |
736 | 736 | then true | |
737 | 737 | else (matType >= NUMRES)) | |
738 | 738 | then throw(("Unknown material: " + toString(matType))) | |
739 | 739 | else if ((0 >= amount)) | |
740 | 740 | then throw(("Amount should be positive! " + toString(amount))) | |
741 | 741 | else { | |
742 | 742 | let duckAssetId = valueOrErrorMessage(getString(keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
743 | 743 | let keyHealth = keyDuckHealth(duckAssetId) | |
744 | 744 | let oldHealth = valueOrElse(getInteger(keyHealth), 100) | |
745 | 745 | if ((oldHealth >= 100)) | |
746 | 746 | then throw("HP should be < 100 to heal") | |
747 | 747 | else { | |
748 | 748 | let bpKey = keyBackpackByDuck(duckAssetId) | |
749 | 749 | let currentPack = getBackpack(bpKey) | |
750 | 750 | let mList = split(currentPack[bpIdxMat], "_") | |
751 | 751 | let currentAmount = parseIntValue(mList[matType]) | |
752 | 752 | let deltaHealth = min([(amount / HEALCOST), (100 - oldHealth)]) | |
753 | 753 | let spendAmount = (deltaHealth * HEALCOST) | |
754 | 754 | if ((spendAmount > currentAmount)) | |
755 | 755 | then throw(((((("You need " + toString(spendAmount)) + " of ") + matTypes[matType]) + " to heal, but you backpack contains ") + toString(currentAmount))) | |
756 | 756 | else { | |
757 | 757 | let newMat = subOneInList(mList, matType, spendAmount) | |
758 | 758 | [IntegerEntry(keyHealth, (oldHealth + deltaHealth)), StringEntry(bpKey, makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], newMat, currentPack[bpIdxProd]], ":"))] | |
759 | 759 | } | |
760 | 760 | } | |
761 | 761 | } | |
762 | 762 | ||
763 | 763 | ||
764 | 764 | ||
765 | 765 | @Callable(i) | |
766 | 766 | func updateBackpack (duckAssetId,newPack) = if ((i.caller != economyAddr)) | |
767 | 767 | then throw("permission denied") | |
768 | 768 | else $Tuple2([StringEntry(keyBackpackByDuck(duckAssetId), newPack)], newPack) | |
769 | 769 | ||
770 | 770 | ||
771 | 771 | ||
772 | 772 | @Callable(i) | |
773 | 773 | func expeditionBuy (message,sig) = if ((size(i.payments) != 1)) | |
774 | 774 | then throw("Exactly one payment required") | |
775 | 775 | else { | |
776 | 776 | let pmt = value(i.payments[0]) | |
777 | 777 | if ((pmt.assetId != usdnAssetId)) | |
778 | 778 | then throw("Allowed USDN payment only!") | |
779 | 779 | else if ((pmt.amount != EXPUSDN)) | |
780 | 780 | then throw(("Payment attached should be " + toString(EXPUSDN))) | |
781 | 781 | else expeditionCommon(false, i.caller, i.transactionId, message, sig) | |
782 | 782 | } | |
783 | 783 | ||
784 | 784 | ||
785 | 785 | ||
786 | 786 | @Callable(i) | |
787 | 787 | func expedition (message,sig) = if ((size(i.payments) != 0)) | |
788 | 788 | then throw("expedition doesn't require any payments") | |
789 | 789 | else expeditionCommon(true, i.caller, i.transactionId, message, sig) | |
790 | 790 | ||
791 | 791 | ||
792 | 792 | ||
793 | 793 | @Callable(i) | |
794 | 794 | func upgradeInfra (landAssetId) = if ((size(i.payments) != 0)) | |
795 | 795 | then throw("Infrastructure upgrade doesn't require any payments") | |
796 | 796 | else upInfraCommon(true, i.caller, landAssetId) | |
797 | 797 | ||
798 | 798 | ||
799 | 799 | ||
800 | 800 | @Callable(i) | |
801 | 801 | func upgradeInfraUsdn (landAssetId) = if ((size(i.payments) != 1)) | |
802 | 802 | then throw("Exactly one payment required") | |
803 | 803 | else { | |
804 | 804 | let pmt = value(i.payments[0]) | |
805 | 805 | if ((pmt.assetId != usdnAssetId)) | |
806 | 806 | then throw("Allowed USDN payment only!") | |
807 | 807 | else { | |
808 | + | let newLevel = (valueOrElse(getInteger(keyInfraLevelByAssetId(landAssetId)), 0) + 1) | |
808 | 809 | let asset = value(assetInfo(fromBase58String(landAssetId))) | |
809 | 810 | let d = split(asset.description, "_") | |
810 | - | let cost = fraction(InfraUpgradeCostSUsdn, numPiecesBySize(d[recLandSize]), 25) | |
811 | + | let cost = fraction(InfraUpgradeCostSUsdn, (numPiecesBySize(d[recLandSize]) * newLevel), 25) | |
811 | 812 | if ((pmt.amount != cost)) | |
812 | 813 | then throw(("Payment attached should be " + toString(cost))) | |
813 | 814 | else upInfraCommon(false, i.caller, landAssetId) | |
814 | 815 | } | |
815 | 816 | } | |
816 | 817 | ||
817 | 818 |
github/deemru/w8io/169f3d6 134.09 ms ◑