tx · 9YNBxWmvUGoLXxNutSBPEoXRvBgaxH7mQo4vzjVbZgpA 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep: -0.01000000 Waves 2022.12.29 01:09 [2380703] smart account 3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep > SELF 0.00000000 Waves
{ "type": 13, "id": "9YNBxWmvUGoLXxNutSBPEoXRvBgaxH7mQo4vzjVbZgpA", "fee": 1000000, "feeAssetId": null, "timestamp": 1672265375714, "version": 2, "chainId": 84, "sender": "3N8y4wxX3JC4TdrCJBXX16SjWf6X256hrep", "senderPublicKey": "7v5L7QkXxfkirALdyqmox38QCsa9jtfAtgUfHTh34eWq", "proofs": [ "3VEojecqRudjPA9iFnsz1fmeoC8AyVWKN4JbWyMjzjaCTKiFj3PcAf832kHV5qZTNWhZBwRoB1z7xhABLzq3sbvB" ], "script": "base64:BgIOCAISBAoCERESBAoCEREfAAVNVUxUNgDAhD0ABU1VTFQ4AIDC1y8ABk1VTFQxMACAyK+gJQAFY2hhaW4JALAJAQkAyQECCQDKAQIIBQR0aGlzBWJ5dGVzAAEAAQALdXNkbkFzc2V0SWQEByRtYXRjaDAFBWNoYWluAwkAAAICAVcFByRtYXRjaDABILYmKcME9c5TkaQOS3UkL2SMUbH6369UKb1I0h0qsqrRAwkAAAICAVQFByRtYXRjaDABIPd26vf3g8pl224T7gI7z1gplanB0Y3yS9ps2B1igMjeCQACAQINVW5rbm93biBjaGFpbgAPc3Rha2luZ0NvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBBAckbWF0Y2gwBQVjaGFpbgMJAAACAgFXBQckbWF0Y2gwAiMzUExuY1h0UzFVODNENmNRYkZEM0g4ckJIUExnenhTRktaMQMJAAACAgFUBQckbWF0Y2gwAiMzTkRDeUJHNXE4NUp1YVJpaWdVZUV0YWlueWpDUVQzWHBabQkAAgECDVVua25vd24gY2hhaW4AD0RFRkFVTFRMT0NBVElPTgIPQWZyaWNhX0ZfQWZyaWNhAAZOVU1SR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hY2twYWNrCQDMCAIFC2R1Y2tBc3NldElkCQDMCAIFB25ld1BhY2sFA25pbAUDbmlsBARyZXN0AwkAZgIJAGUCBQNhbXQIBQZtZXJnZWQCXzMAAAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAGUCBQNhbXQIBQZtZXJnZWQCXzMFC3VzZG5Bc3NldElkBQNuaWwFA25pbAkAlAoCCQDOCAIIBQZtZXJnZWQCXzEFBHJlc3QFBnJlc3VsdAAay5Er", "height": 2380703, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ak5wThy6788jfSt9LcgREpNGNVjaVFRqfBqR4hnuS4aX Next: AQW4awMwXU4cnSBKhk5bxkr77ucERSQZrXfCSZBf8Usb Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let MULT6 = 1000000 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | + | ||
8 | + | let MULT10 = 10000000000 | |
7 | 9 | ||
8 | 10 | let chain = toUtf8String(take(drop(this.bytes, 1), 1)) | |
9 | 11 | ||
145 | 147 | else 0 | |
146 | 148 | let m0 = min([w0, (amount - m1)]) | |
147 | 149 | let m = (m0 + m1) | |
148 | - | let usdnSpent = (fraction(m0, (( | |
150 | + | let usdnSpent = (fraction(m0, ((300 * RESOURCEPRICEMIN) - fraction(((100 * w0) - (50 * m0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction(m1, (2 * RESOURCEPRICEMIN), MULT8)) | |
149 | 151 | let max101 = (maxPrice + (maxPrice / 100)) | |
150 | 152 | if (((usdnSpent * MULT8) > (max101 * m))) | |
151 | 153 | then throw((((((((((("Actual price = " + toString(usdnSpent)) + " / ") + toString(m)) + " > maxPrice = ") + toString(maxPrice)) + ", (") + locId) + ", ") + matTypes[matType]) + ")")) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let MULT6 = 1000000 | |
5 | 5 | ||
6 | 6 | let MULT8 = 100000000 | |
7 | + | ||
8 | + | let MULT10 = 10000000000 | |
7 | 9 | ||
8 | 10 | let chain = toUtf8String(take(drop(this.bytes, 1), 1)) | |
9 | 11 | ||
10 | 12 | let usdnAssetId = match chain { | |
11 | 13 | case _ => | |
12 | 14 | if (("W" == $match0)) | |
13 | 15 | then base58'DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p' | |
14 | 16 | else if (("T" == $match0)) | |
15 | 17 | then base58'HezsdQuRDtzksAYUy97gfhKy7Z1NW2uXYSHA3bgqenNZ' | |
16 | 18 | else throw("Unknown chain") | |
17 | 19 | } | |
18 | 20 | ||
19 | 21 | let stakingContract = addressFromStringValue(match chain { | |
20 | 22 | case _ => | |
21 | 23 | if (("W" == $match0)) | |
22 | 24 | then "3PLncXtS1U83D6cQbFD3H8rBHPLgzxSFKZ1" | |
23 | 25 | else if (("T" == $match0)) | |
24 | 26 | then "3NDCyBG5q85JuaRiigUeEtainyjCQT3XpZm" | |
25 | 27 | else throw("Unknown chain") | |
26 | 28 | }) | |
27 | 29 | ||
28 | 30 | let DEFAULTLOCATION = "Africa_F_Africa" | |
29 | 31 | ||
30 | 32 | let NUMRES = 6 | |
31 | 33 | ||
32 | 34 | let FACTORYMAXWAREHOUSE = 10000000000 | |
33 | 35 | ||
34 | 36 | let RESOURCEPRICEMIN = 158549 | |
35 | 37 | ||
36 | 38 | let MINPAYMENT = 10000 | |
37 | 39 | ||
38 | 40 | let resTypes = ["Oil", "Ore", "Wood", "Sand", "Clay", "Organic"] | |
39 | 41 | ||
40 | 42 | let matTypes = ["Fuel", "Metal", "Plank", "Glass", "Plastic", "Protein"] | |
41 | 43 | ||
42 | 44 | let continents = ["Americas", "Europe", "Asia", "Africa", "Oceania"] | |
43 | 45 | ||
44 | 46 | func keyFactoryWarehouseByIdAndType (factoryId,resType) = ((("factoryWhByContinentAndRes_" + factoryId) + "_") + toString(resType)) | |
45 | 47 | ||
46 | 48 | ||
47 | 49 | func keyStakedDuckByOwner (ownerAddr) = ("stakedDuckByOwner_" + ownerAddr) | |
48 | 50 | ||
49 | 51 | ||
50 | 52 | func keyBackpackByDuck (duckAssetId) = ("backPack_" + duckAssetId) | |
51 | 53 | ||
52 | 54 | ||
53 | 55 | func keyDuckLocation (duckAssetId) = ("duckLocation_" + duckAssetId) | |
54 | 56 | ||
55 | 57 | ||
56 | 58 | let locIdxContinent = 0 | |
57 | 59 | ||
58 | 60 | let locIdxType = 1 | |
59 | 61 | ||
60 | 62 | let locIdxId = 2 | |
61 | 63 | ||
62 | 64 | let bpIdxLevel = 0 | |
63 | 65 | ||
64 | 66 | let bpIdxRes = 1 | |
65 | 67 | ||
66 | 68 | let bpIdxMat = 2 | |
67 | 69 | ||
68 | 70 | let bpIdxProd = 3 | |
69 | 71 | ||
70 | 72 | func asString (v) = match v { | |
71 | 73 | case s: String => | |
72 | 74 | s | |
73 | 75 | case _ => | |
74 | 76 | throw("fail to cast into String") | |
75 | 77 | } | |
76 | 78 | ||
77 | 79 | ||
78 | 80 | func subRes (resList,resType,amount) = { | |
79 | 81 | func subber (acc,i) = (acc :+ (if ((i == resType)) | |
80 | 82 | then toString((parseIntValue(resList[i]) - amount)) | |
81 | 83 | else resList[i])) | |
82 | 84 | ||
83 | 85 | let r = { | |
84 | 86 | let $l = [0, 1, 2, 3, 4, 5] | |
85 | 87 | let $s = size($l) | |
86 | 88 | let $acc0 = nil | |
87 | 89 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
88 | 90 | then $a | |
89 | 91 | else subber($a, $l[$i]) | |
90 | 92 | ||
91 | 93 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
92 | 94 | then $a | |
93 | 95 | else throw("List size exceeds 6") | |
94 | 96 | ||
95 | 97 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
96 | 98 | } | |
97 | 99 | makeString(r, "_") | |
98 | 100 | } | |
99 | 101 | ||
100 | 102 | ||
101 | 103 | func addMat (matList,matType,amount) = { | |
102 | 104 | func increaser (acc,i) = (acc :+ (if ((i == matType)) | |
103 | 105 | then toString((parseIntValue(matList[i]) + amount)) | |
104 | 106 | else matList[i])) | |
105 | 107 | ||
106 | 108 | let m = { | |
107 | 109 | let $l = [0, 1, 2, 3, 4, 5] | |
108 | 110 | let $s = size($l) | |
109 | 111 | let $acc0 = nil | |
110 | 112 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
111 | 113 | then $a | |
112 | 114 | else increaser($a, $l[$i]) | |
113 | 115 | ||
114 | 116 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
115 | 117 | then $a | |
116 | 118 | else throw("List size exceeds 6") | |
117 | 119 | ||
118 | 120 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
119 | 121 | } | |
120 | 122 | makeString(m, "_") | |
121 | 123 | } | |
122 | 124 | ||
123 | 125 | ||
124 | 126 | func sellInternal (locId,resType,amount,minPrice) = { | |
125 | 127 | let whKey = keyFactoryWarehouseByIdAndType(locId, resType) | |
126 | 128 | let w0 = valueOrElse(getInteger(whKey), 0) | |
127 | 129 | let r0 = if ((w0 > FACTORYMAXWAREHOUSE)) | |
128 | 130 | then 0 | |
129 | 131 | else if (((w0 + amount) > FACTORYMAXWAREHOUSE)) | |
130 | 132 | then (FACTORYMAXWAREHOUSE - w0) | |
131 | 133 | else amount | |
132 | 134 | let usdnReceived = (fraction(r0, ((2 * RESOURCEPRICEMIN) - fraction((w0 + (r0 / 2)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT8) + fraction((amount - r0), RESOURCEPRICEMIN, MULT8)) | |
133 | 135 | let min99 = (minPrice - (minPrice / 100)) | |
134 | 136 | if (((min99 * amount) > (usdnReceived * MULT8))) | |
135 | 137 | then throw((((((((((("Actual price = " + toString(usdnReceived)) + " / ") + toString(amount)) + " < minPrice = ") + toString(minPrice)) + ", (") + locId) + ", ") + resTypes[resType]) + ")")) | |
136 | 138 | else $Tuple2(IntegerEntry(whKey, (w0 + amount)), usdnReceived) | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func buyInternal (locId,matType,amount,maxPrice) = { | |
141 | 143 | let whKey = keyFactoryWarehouseByIdAndType(locId, matType) | |
142 | 144 | let w0 = valueOrElse(getInteger(whKey), 0) | |
143 | 145 | let m1 = if ((w0 > FACTORYMAXWAREHOUSE)) | |
144 | 146 | then min([amount, (w0 - FACTORYMAXWAREHOUSE)]) | |
145 | 147 | else 0 | |
146 | 148 | let m0 = min([w0, (amount - m1)]) | |
147 | 149 | let m = (m0 + m1) | |
148 | - | let usdnSpent = (fraction(m0, (( | |
150 | + | let usdnSpent = (fraction(m0, ((300 * RESOURCEPRICEMIN) - fraction(((100 * w0) - (50 * m0)), RESOURCEPRICEMIN, FACTORYMAXWAREHOUSE)), MULT10) + fraction(m1, (2 * RESOURCEPRICEMIN), MULT8)) | |
149 | 151 | let max101 = (maxPrice + (maxPrice / 100)) | |
150 | 152 | if (((usdnSpent * MULT8) > (max101 * m))) | |
151 | 153 | then throw((((((((((("Actual price = " + toString(usdnSpent)) + " / ") + toString(m)) + " > maxPrice = ") + toString(maxPrice)) + ", (") + locId) + ", ") + matTypes[matType]) + ")")) | |
152 | 154 | else $Tuple3(IntegerEntry(whKey, (w0 - m)), usdnSpent, m) | |
153 | 155 | } | |
154 | 156 | ||
155 | 157 | ||
156 | 158 | func getBackpack (bpKey) = { | |
157 | 159 | let p = split(valueOrElse(getString(stakingContract, bpKey), "0:0_0_0_0_0_0:0_0_0_0_0_0:"), ":") | |
158 | 160 | [toString(valueOrElse(parseInt(p[bpIdxLevel]), 0)), if ((size(split(p[bpIdxRes], "_")) == NUMRES)) | |
159 | 161 | then p[bpIdxRes] | |
160 | 162 | else "0_0_0_0_0_0", if ((size(split(p[bpIdxMat], "_")) == NUMRES)) | |
161 | 163 | then p[bpIdxMat] | |
162 | 164 | else "0_0_0_0_0_0", p[bpIdxProd]] | |
163 | 165 | } | |
164 | 166 | ||
165 | 167 | ||
166 | 168 | @Callable(i) | |
167 | 169 | func sellResources (amounts,minPrices) = { | |
168 | 170 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
169 | 171 | if ((size(i.payments) != 0)) | |
170 | 172 | then throw("sellResources doesn't require any payments") | |
171 | 173 | else { | |
172 | 174 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
173 | 175 | if ((curLocation[locIdxType] != "F")) | |
174 | 176 | then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType])) | |
175 | 177 | else { | |
176 | 178 | let locId = curLocation[locIdxId] | |
177 | 179 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
178 | 180 | let resList = split(currentPack[bpIdxRes], "_") | |
179 | 181 | func adder (acc,j) = if ((amounts[j] > parseIntValue(resList[j]))) | |
180 | 182 | then throw(((((("You have " + resList[j]) + " of ") + resTypes[j]) + ", but tried to sell ") + toString(amounts[j]))) | |
181 | 183 | else if ((0 > amounts[j])) | |
182 | 184 | then throw(((("You tried to sell negative amount of " + resTypes[j]) + ": ") + toString(amounts[j]))) | |
183 | 185 | else if ((amounts[j] > 0)) | |
184 | 186 | then { | |
185 | 187 | let b = sellInternal(locId, j, amounts[j], minPrices[value(j)]) | |
186 | 188 | $Tuple3((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(resList[j]) - amounts[j]))), (acc._3 + b._2)) | |
187 | 189 | } | |
188 | 190 | else $Tuple3(acc._1, (acc._2 :+ resList[j]), acc._3) | |
189 | 191 | ||
190 | 192 | let merged = { | |
191 | 193 | let $l = [0, 1, 2, 3, 4, 5] | |
192 | 194 | let $s = size($l) | |
193 | 195 | let $acc0 = $Tuple3(nil, nil, 0) | |
194 | 196 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
195 | 197 | then $a | |
196 | 198 | else adder($a, $l[$i]) | |
197 | 199 | ||
198 | 200 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
199 | 201 | then $a | |
200 | 202 | else throw("List size exceeds 6") | |
201 | 203 | ||
202 | 204 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
203 | 205 | } | |
204 | 206 | let newPack = makeString([currentPack[bpIdxLevel], makeString(merged._2, "_"), currentPack[bpIdxMat], currentPack[bpIdxProd]], ":") | |
205 | 207 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
206 | 208 | $Tuple2((merged._1 :+ ScriptTransfer(i.caller, merged._3, usdnAssetId)), result) | |
207 | 209 | } | |
208 | 210 | } | |
209 | 211 | } | |
210 | 212 | ||
211 | 213 | ||
212 | 214 | ||
213 | 215 | @Callable(i) | |
214 | 216 | func buyMaterials (amounts,maxPrices) = { | |
215 | 217 | let duckAssetId = valueOrErrorMessage(getString(stakingContract, keyStakedDuckByOwner(toString(i.caller))), "You don't have a duck staked") | |
216 | 218 | if ((size(i.payments) != 1)) | |
217 | 219 | then throw("exactly 1 payment must be attached") | |
218 | 220 | else { | |
219 | 221 | let pmt = i.payments[0] | |
220 | 222 | let amt = pmt.amount | |
221 | 223 | let pmtAssetId = valueOrErrorMessage(pmt.assetId, "WAVES can't be used as payment") | |
222 | 224 | if ((pmtAssetId != usdnAssetId)) | |
223 | 225 | then throw("USDN payments only!") | |
224 | 226 | else { | |
225 | 227 | let curLocation = split(valueOrElse(getString(stakingContract, keyDuckLocation(duckAssetId)), DEFAULTLOCATION), "_") | |
226 | 228 | if ((curLocation[locIdxType] != "F")) | |
227 | 229 | then throw(("Duck location type should be Factory, but is " + curLocation[locIdxType])) | |
228 | 230 | else { | |
229 | 231 | let locId = curLocation[locIdxId] | |
230 | 232 | let currentPack = getBackpack(keyBackpackByDuck(duckAssetId)) | |
231 | 233 | let matList = split(currentPack[bpIdxMat], "_") | |
232 | 234 | func mUpdater (acc,j) = if ((0 > amounts[j])) | |
233 | 235 | then throw(((("You tried to buy negative amount of " + matTypes[j]) + ": ") + toString(amounts[j]))) | |
234 | 236 | else if ((amounts[j] > 0)) | |
235 | 237 | then { | |
236 | 238 | let b = buyInternal(locId, j, amounts[j], maxPrices[j]) | |
237 | 239 | $Tuple3((acc._1 :+ b._1), (acc._2 :+ toString((parseIntValue(matList[j]) + b._3))), (acc._3 + b._2)) | |
238 | 240 | } | |
239 | 241 | else $Tuple3(acc._1, (acc._2 :+ matList[j]), acc._3) | |
240 | 242 | ||
241 | 243 | let merged = { | |
242 | 244 | let $l = [0, 1, 2, 3, 4, 5] | |
243 | 245 | let $s = size($l) | |
244 | 246 | let $acc0 = $Tuple3(nil, nil, 0) | |
245 | 247 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
246 | 248 | then $a | |
247 | 249 | else mUpdater($a, $l[$i]) | |
248 | 250 | ||
249 | 251 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
250 | 252 | then $a | |
251 | 253 | else throw("List size exceeds 6") | |
252 | 254 | ||
253 | 255 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6) | |
254 | 256 | } | |
255 | 257 | if ((merged._3 > amt)) | |
256 | 258 | then throw(((("Insufficient payment! Attached=" + toString(amt)) + ", required=") + toString(merged._3))) | |
257 | 259 | else { | |
258 | 260 | let newPack = makeString([currentPack[bpIdxLevel], currentPack[bpIdxRes], makeString(merged._2, "_"), currentPack[bpIdxProd]], ":") | |
259 | 261 | let result = asString(invoke(stakingContract, "updateBackpack", [duckAssetId, newPack], nil)) | |
260 | 262 | let rest = if (((amt - merged._3) > 0)) | |
261 | 263 | then [ScriptTransfer(i.caller, (amt - merged._3), usdnAssetId)] | |
262 | 264 | else nil | |
263 | 265 | $Tuple2((merged._1 ++ rest), result) | |
264 | 266 | } | |
265 | 267 | } | |
266 | 268 | } | |
267 | 269 | } | |
268 | 270 | } | |
269 | 271 | ||
270 | 272 |
github/deemru/w8io/026f985 41.37 ms ◑