tx · 9WQMk5SDnGzAz3TYrkeD7UvSEeprmTe6x16St6EDLXtQ 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7: -0.01400000 Waves 2021.08.03 17:29 [1642285] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves
{ "type": 13, "id": "9WQMk5SDnGzAz3TYrkeD7UvSEeprmTe6x16St6EDLXtQ", "fee": 1400000, "feeAssetId": null, "timestamp": 1628001028500, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "5umiZqbEbQJoYEj9pfQ7h8qtYkNT8GuyFY4B2LVZoTDunSxzZCt8yjRA7mFrxTX8Xoo6VWzsBpTR66qCzAjjFdMT" ], "script": "base64:AAIEAAAAAAAAAD4IAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSABIAEgQKAggIEgUKAwgICAAAAD4AAAAABE5PTkUCAAAABE5PTkUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAAAAAAhBUFBST1ZBTAIAAAAIYXBwcm92YWwAAAAACFJFSkVDVEVEAgAAAAhyZWplY3RlZAAAAAAIQUNDRVBURUQCAAAACGFjY2VwdGVkAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05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AAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABBJc3N1ZVRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHKkOB0Q==", "height": 1642285, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 93aipbv2S6caXcT95GMeXibdLBgEh91evNLsd7RuCybA Next: 8feNKHbNMUGHt7nPTBYdYaggJpNyAW1HTMiJoHYc2DyY Diff:
Old | New | Differences | |
---|---|---|---|
257 | 257 | then throw(("You don't owned item " + item)) | |
258 | 258 | else { | |
259 | 259 | let soldCounter = getValueItemSoldCounter(item) | |
260 | - | if ((soldCounter | |
260 | + | if ((soldCounter == 0)) | |
261 | 261 | then [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))] | |
262 | 262 | else [BooleanEntry(getKeyItemRemoved(item), true)] | |
263 | 263 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let NONE = "NONE" | |
5 | 5 | ||
6 | 6 | let VOTERS = 3 | |
7 | 7 | ||
8 | 8 | let QUORUM = 2 | |
9 | 9 | ||
10 | 10 | let FEATURED = "featured" | |
11 | 11 | ||
12 | 12 | let DELISTED = "delisted" | |
13 | 13 | ||
14 | 14 | let VOTING = "voting" | |
15 | 15 | ||
16 | 16 | let REVEAL = "reveal" | |
17 | 17 | ||
18 | 18 | let APPROVAL = "approval" | |
19 | 19 | ||
20 | 20 | let REJECTED = "rejected" | |
21 | 21 | ||
22 | 22 | let ACCEPTED = "accepted" | |
23 | 23 | ||
24 | 24 | func getStringByKey (key) = match getString(this, key) { | |
25 | 25 | case a: String => | |
26 | 26 | a | |
27 | 27 | case _ => | |
28 | 28 | NONE | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func getIntegerByKey (key) = match getInteger(this, key) { | |
33 | 33 | case a: Int => | |
34 | 34 | a | |
35 | 35 | case _ => | |
36 | 36 | 0 | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getKeySupplierAccount (account) = (account + "_account") | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func getSupplierAccount (account) = getStringByKey(getKeySupplierAccount(account)) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getKeyItem (supplier,title) = { | |
47 | 47 | let supplierTitle = (supplier + title) | |
48 | 48 | ("item_" + toBase58String(sha256(toBytes(supplierTitle)))) | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getKeyItemSupplier (item) = (item + "_owner") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getKeyItemTitle (item) = (item + "_title") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getKeyItemPrice (item) = (item + "_price") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getKeyItemData (item) = (item + "_data") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getKeyItemExpireDate (item) = (item + "_expiredate") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getKeyItemSoldCounter (item) = (item + "_sold") | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getKeyItemRemoved (item) = (item + "_removed") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyCommitsCount (item) = (item + "_cmtcnt") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyItemStatus (item) = (item + "_status") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getKeyVotesCount (item,vote) = ((item + "_res:") + vote) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func getKeySupplierBalance (supplier) = (supplier + "_balance") | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func getKeySupplierAvailableBalance (supplier) = (supplier + "_available") | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func getKeyUserItemCounter (user,item) = (((user + "_") + item) + "_counter") | |
95 | 95 | ||
96 | 96 | ||
97 | 97 | func genPurchaseKey (supplier,item,user,counter) = ("purchase_" + toBase58String(sha256(toBytes(((((((supplier + "_") + item) + "_") + user) + "_") + toString(counter)))))) | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | func getKeyPurchaseStatus (purchase) = (purchase + "_status") | |
101 | 101 | ||
102 | 102 | ||
103 | 103 | func getKeyPurchaseItem (purchase) = (purchase + "_item") | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier") | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | func getKeyPurchaseUser (purchase) = (purchase + "_user") | |
110 | 110 | ||
111 | 111 | ||
112 | 112 | func getKeyPurchaseAmount (purchase) = (purchase + "_amount") | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp") | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | func getKeyPurchaseAssetId (purchase) = (purchase + "_assetId") | |
119 | 119 | ||
120 | 120 | ||
121 | 121 | func getKeyCouponPurchase (assetId) = (("coupon_" + assetId) + "_purchase") | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | func getKeyCouponItem (assetId) = (("coupon_" + assetId) + "_item") | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier)) | |
128 | 128 | ||
129 | 129 | ||
130 | 130 | func getValueSupplierAvailableBalance (supplier) = getIntegerByKey(getKeySupplierAvailableBalance(supplier)) | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item)) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase)) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase)) | |
140 | 140 | ||
141 | 141 | ||
142 | 142 | func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase)) | |
143 | 143 | ||
144 | 144 | ||
145 | 145 | func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase)) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase)) | |
152 | 152 | ||
153 | 153 | ||
154 | 154 | func getValuePurchaseAssetId (purchase) = getStringByKey(getKeyPurchaseAssetId(purchase)) | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item)) | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item)) | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item)) | |
164 | 164 | ||
165 | 165 | ||
166 | 166 | func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item)) | |
167 | 167 | ||
168 | 168 | ||
169 | 169 | func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item)) | |
170 | 170 | ||
171 | 171 | ||
172 | 172 | func getValueItemRemoved (item) = match getBoolean(this, getKeyItemRemoved(item)) { | |
173 | 173 | case b: Boolean => | |
174 | 174 | b | |
175 | 175 | case _ => | |
176 | 176 | false | |
177 | 177 | } | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func getValueCouponPurchase (assetId) = getStringByKey(getKeyCouponPurchase(assetId)) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user)) | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item)) | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user)) | |
190 | 190 | ||
191 | 191 | ||
192 | 192 | func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item)) | |
193 | 193 | ||
194 | 194 | ||
195 | 195 | func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote)) | |
196 | 196 | ||
197 | 197 | ||
198 | 198 | @Callable(i) | |
199 | 199 | func registerSupplier (data) = { | |
200 | 200 | let supplier = toBase58String(i.caller.bytes) | |
201 | 201 | let account = getSupplierAccount(supplier) | |
202 | 202 | if ((account != NONE)) | |
203 | 203 | then throw("This address has already registred as supplier") | |
204 | 204 | else [StringEntry(getKeySupplierAccount(supplier), data)] | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | ||
209 | 209 | @Callable(i) | |
210 | 210 | func addItem (title,price,data,expire) = { | |
211 | 211 | let supplier = toBase58String(i.caller.bytes) | |
212 | 212 | let account = getSupplierAccount(supplier) | |
213 | 213 | let item = getKeyItem(supplier, title) | |
214 | 214 | if ((account == NONE)) | |
215 | 215 | then throw("You should register as supplier to add an item") | |
216 | 216 | else if ((0 >= price)) | |
217 | 217 | then throw("Purchase amount cannot be less than item price") | |
218 | 218 | else if ((getValueItemSupplier(item) != NONE)) | |
219 | 219 | then throw("An item already exists") | |
220 | 220 | else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
221 | 221 | } | |
222 | 222 | ||
223 | 223 | ||
224 | 224 | ||
225 | 225 | @Callable(i) | |
226 | 226 | func updateItem (item,title,price,data,expire) = { | |
227 | 227 | let supplier = toBase58String(i.caller.bytes) | |
228 | 228 | let account = getSupplierAccount(supplier) | |
229 | 229 | let itemSupplier = getValueItemSupplier(item) | |
230 | 230 | let notFound = if ((getValueItemTitle(item) == NONE)) | |
231 | 231 | then true | |
232 | 232 | else (getValueItemRemoved(item) == true) | |
233 | 233 | if ((account == NONE)) | |
234 | 234 | then throw("You should register as supplier to remove an item") | |
235 | 235 | else if (notFound) | |
236 | 236 | then throw(("Item does not exists or has been removed " + item)) | |
237 | 237 | else if ((supplier != itemSupplier)) | |
238 | 238 | then throw(("You don't owned item " + item)) | |
239 | 239 | else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
240 | 240 | } | |
241 | 241 | ||
242 | 242 | ||
243 | 243 | ||
244 | 244 | @Callable(i) | |
245 | 245 | func removeItem (item) = { | |
246 | 246 | let supplier = toBase58String(i.caller.bytes) | |
247 | 247 | let account = getSupplierAccount(supplier) | |
248 | 248 | let itemSupplier = getValueItemSupplier(item) | |
249 | 249 | let notFound = if ((getValueItemTitle(item) == NONE)) | |
250 | 250 | then true | |
251 | 251 | else (getValueItemRemoved(item) == true) | |
252 | 252 | if ((account == NONE)) | |
253 | 253 | then throw("You should register as supplier to remove an item") | |
254 | 254 | else if (notFound) | |
255 | 255 | then throw(("Item does not exists or has been removed " + item)) | |
256 | 256 | else if ((supplier != itemSupplier)) | |
257 | 257 | then throw(("You don't owned item " + item)) | |
258 | 258 | else { | |
259 | 259 | let soldCounter = getValueItemSoldCounter(item) | |
260 | - | if ((soldCounter | |
260 | + | if ((soldCounter == 0)) | |
261 | 261 | then [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))] | |
262 | 262 | else [BooleanEntry(getKeyItemRemoved(item), true)] | |
263 | 263 | } | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | ||
268 | 268 | @Callable(i) | |
269 | 269 | func purchase (item) = { | |
270 | 270 | let pmt = i.payments[0] | |
271 | 271 | let notFound = if ((getValueItemTitle(item) == NONE)) | |
272 | 272 | then true | |
273 | 273 | else (getValueItemRemoved(item) == true) | |
274 | 274 | if (notFound) | |
275 | 275 | then throw(("Item does not exists or has been removed " + item)) | |
276 | 276 | else if (isDefined(pmt.assetId)) | |
277 | 277 | then throw("You can buy tokens only with Waves tokens") | |
278 | 278 | else { | |
279 | 279 | let user = toBase58String(i.caller.bytes) | |
280 | 280 | let price = getValueItemPrice(item) | |
281 | 281 | let supplier = getValueItemSupplier(item) | |
282 | 282 | let expire = getValueItemExpireTime(item) | |
283 | 283 | if (if ((expire > 0)) | |
284 | 284 | then (lastBlock.timestamp >= expire) | |
285 | 285 | else false) | |
286 | 286 | then throw("Coupon expired") | |
287 | 287 | else if ((price > pmt.amount)) | |
288 | 288 | then throw("Purchase amount cannot be less than item price") | |
289 | 289 | else if ((pmt.amount > price)) | |
290 | 290 | then throw("Purchase amount cannot be higher than item price") | |
291 | 291 | else if ((supplier == NONE)) | |
292 | 292 | then throw("Supplier does not exists") | |
293 | 293 | else { | |
294 | 294 | let keyUserItemCounter = getKeyUserItemCounter(user, item) | |
295 | 295 | let userItemCounter = (getValueUserItemCounter(user, item) + 1) | |
296 | 296 | let purchase = genPurchaseKey(supplier, item, user, userItemCounter) | |
297 | 297 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
298 | 298 | let keyPurchaseItem = getKeyPurchaseItem(purchase) | |
299 | 299 | let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase) | |
300 | 300 | let keyPurchaseUser = getKeyPurchaseUser(purchase) | |
301 | 301 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
302 | 302 | let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase) | |
303 | 303 | [IntegerEntry(keyUserItemCounter, userItemCounter), StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)] | |
304 | 304 | } | |
305 | 305 | } | |
306 | 306 | } | |
307 | 307 | ||
308 | 308 | ||
309 | 309 | ||
310 | 310 | @Callable(i) | |
311 | 311 | func rejectPurchase (purchase) = { | |
312 | 312 | let caller = toBase58String(i.caller.bytes) | |
313 | 313 | let status = getValuePurchaseStatus(purchase) | |
314 | 314 | let supplier = getValuePurchaseSupplier(purchase) | |
315 | 315 | let item = getValuePurchaseItem(purchase) | |
316 | 316 | let notFound = (item == NONE) | |
317 | 317 | if (notFound) | |
318 | 318 | then throw(("Purchase not found " + purchase)) | |
319 | 319 | else if (if ((supplier == NONE)) | |
320 | 320 | then true | |
321 | 321 | else (caller != supplier)) | |
322 | 322 | then throw("Your are not the owner of this item") | |
323 | 323 | else if ((status != APPROVAL)) | |
324 | 324 | then throw("You cannot reject this purchased") | |
325 | 325 | else { | |
326 | 326 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
327 | 327 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
328 | 328 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
329 | 329 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
330 | 330 | let user = getValuePurchaseUser(purchase) | |
331 | 331 | let amount = getValuePurchaseAmount(purchase) | |
332 | 332 | let supplierBalance = (getValueSupplierBalance(supplier) - amount) | |
333 | 333 | let itemSoldCounter = (getValueItemSoldCounter(item) - 1) | |
334 | 334 | let address = addressFromStringValue(user) | |
335 | 335 | [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)] | |
336 | 336 | } | |
337 | 337 | } | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | ||
341 | 341 | @Callable(i) | |
342 | 342 | func acceptPurchase (purchase,couponAssetId) = { | |
343 | 343 | let caller = toBase58String(i.caller.bytes) | |
344 | 344 | let status = getValuePurchaseStatus(purchase) | |
345 | 345 | let supplier = getValuePurchaseSupplier(purchase) | |
346 | 346 | let item = getValuePurchaseItem(purchase) | |
347 | 347 | let expire = getValueItemExpireTime(item) | |
348 | 348 | let notFound = (item == NONE) | |
349 | 349 | if (notFound) | |
350 | 350 | then throw(("Purchase not found " + purchase)) | |
351 | 351 | else if (if ((supplier == NONE)) | |
352 | 352 | then true | |
353 | 353 | else (caller != supplier)) | |
354 | 354 | then throw("Your are not the owner of this item") | |
355 | 355 | else if ((status != APPROVAL)) | |
356 | 356 | then throw("You cannot reject this purchased") | |
357 | 357 | else if (if ((expire > 0)) | |
358 | 358 | then (lastBlock.timestamp >= expire) | |
359 | 359 | else false) | |
360 | 360 | then throw("Coupon expired") | |
361 | 361 | else { | |
362 | 362 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
363 | 363 | let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase) | |
364 | 364 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
365 | 365 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
366 | 366 | let keyCouponPurchase = getKeyCouponPurchase(couponAssetId) | |
367 | 367 | let keyCouponItem = getKeyCouponItem(couponAssetId) | |
368 | 368 | let amount = getValuePurchaseAmount(purchase) | |
369 | 369 | let supplierBalance = (getValueSupplierBalance(supplier) + amount) | |
370 | 370 | let itemSoldCounter = (getValueItemSoldCounter(item) + 1) | |
371 | 371 | let user = getValuePurchaseUser(purchase) | |
372 | 372 | let address = addressFromStringValue(user) | |
373 | 373 | [StringEntry(keyPurchaseStatus, ACCEPTED), StringEntry(keyCouponPurchase, purchase), StringEntry(keyCouponItem, item), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)] | |
374 | 374 | } | |
375 | 375 | } | |
376 | 376 | ||
377 | 377 | ||
378 | 378 | ||
379 | 379 | @Callable(i) | |
380 | 380 | func burn () = { | |
381 | 381 | let caller = toBase58String(i.caller.bytes) | |
382 | 382 | let pmt = if ((size(i.payments) == 1)) | |
383 | 383 | then i.payments[0] | |
384 | 384 | else throw("An attached coupon is required as payment[0]") | |
385 | 385 | if ((isDefined(pmt.assetId) == false)) | |
386 | 386 | then throw("Need a coupon to burn") | |
387 | 387 | else { | |
388 | 388 | let assetId = match pmt.assetId { | |
389 | 389 | case e: ByteVector => | |
390 | 390 | e | |
391 | 391 | case _ => | |
392 | 392 | throw("Need a coupon to burn") | |
393 | 393 | } | |
394 | 394 | let asset = toBase58String(assetId) | |
395 | 395 | let purchase = getValueCouponPurchase(asset) | |
396 | 396 | let supplier = getValuePurchaseSupplier(purchase) | |
397 | 397 | if ((caller != supplier)) | |
398 | 398 | then throw("Your are not the supplier for this coupon") | |
399 | 399 | else { | |
400 | 400 | let amount = getValuePurchaseAmount(purchase) | |
401 | 401 | let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier) | |
402 | 402 | let availableBalance = (getValueSupplierAvailableBalance(supplier) + amount) | |
403 | 403 | [Burn(assetId, 1), IntegerEntry(keySupplierAvailableBalance, availableBalance)] | |
404 | 404 | } | |
405 | 405 | } | |
406 | 406 | } | |
407 | 407 | ||
408 | 408 | ||
409 | 409 | ||
410 | 410 | @Callable(i) | |
411 | 411 | func withdraw () = { | |
412 | 412 | let supplier = toBase58String(i.caller.bytes) | |
413 | 413 | let account = getSupplierAccount(supplier) | |
414 | 414 | if ((account == NONE)) | |
415 | 415 | then throw("You are not registred as supplier") | |
416 | 416 | else { | |
417 | 417 | let balance = getValueSupplierBalance(supplier) | |
418 | 418 | let available = getValueSupplierAvailableBalance(supplier) | |
419 | 419 | let amount = if ((0 > (balance - available))) | |
420 | 420 | then 0 | |
421 | 421 | else available | |
422 | 422 | if ((amount == 0)) | |
423 | 423 | then throw("Nothing to withdraw. You need to burn coupon to unlock balance") | |
424 | 424 | else { | |
425 | 425 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
426 | 426 | let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier) | |
427 | 427 | let newBalance = (balance - amount) | |
428 | 428 | [IntegerEntry(keySupplierBalance, newBalance), IntegerEntry(keySupplierAvailableBalance, 0), ScriptTransfer(i.caller, amount, unit)] | |
429 | 429 | } | |
430 | 430 | } | |
431 | 431 | } | |
432 | 432 | ||
433 | 433 | ||
434 | 434 | ||
435 | 435 | @Callable(i) | |
436 | 436 | func voteCommit (item,hash) = { | |
437 | 437 | let user = toBase58String(i.caller.bytes) | |
438 | 438 | let commitsCount = getValueCommitsCount(item) | |
439 | 439 | let status = getValueItemStatus(item) | |
440 | 440 | if ((commitsCount >= VOTERS)) | |
441 | 441 | then throw("Reached max number of voters") | |
442 | 442 | else if ((getValueCommit(item, user) != NONE)) | |
443 | 443 | then throw("You voted already") | |
444 | 444 | else if ((getKeyItemSupplier(item) == NONE)) | |
445 | 445 | then throw("Item does not exists") | |
446 | 446 | else if (if ((status != NONE)) | |
447 | 447 | then (status != VOTING) | |
448 | 448 | else false) | |
449 | 449 | then throw("Voting is not active for this item now") | |
450 | 450 | else { | |
451 | 451 | let newStatus = if ((commitsCount == VOTERS)) | |
452 | 452 | then REVEAL | |
453 | 453 | else VOTING | |
454 | 454 | [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)] | |
455 | 455 | } | |
456 | 456 | } | |
457 | 457 | ||
458 | 458 | ||
459 | 459 | ||
460 | 460 | @Callable(i) | |
461 | 461 | func voteReveal (item,vote,salt) = { | |
462 | 462 | let user = toBase58String(i.caller.bytes) | |
463 | 463 | let status = getValueItemStatus(item) | |
464 | 464 | let newVotesCount = (getValueVotesCount(item, vote) + 1) | |
465 | 465 | let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt)))) | |
466 | 466 | if ((saltedVote != getValueCommit(item, user))) | |
467 | 467 | then throw("Reveal data is not valid") | |
468 | 468 | else if ((VOTERS > getValueCommitsCount(item))) | |
469 | 469 | then throw("Max number of voters not reached") | |
470 | 470 | else if ((getValueReveal(item, user) != NONE)) | |
471 | 471 | then throw("You voted already") | |
472 | 472 | else if (if ((status != VOTING)) | |
473 | 473 | then (status != REVEAL) | |
474 | 474 | else false) | |
475 | 475 | then throw("Voting is not active for this item now") | |
476 | 476 | else if (if ((vote != FEATURED)) | |
477 | 477 | then (vote != DELISTED) | |
478 | 478 | else false) | |
479 | 479 | then throw("Provided voting option is incorrect") | |
480 | 480 | else { | |
481 | 481 | let newStatus = if ((newVotesCount >= QUORUM)) | |
482 | 482 | then vote | |
483 | 483 | else REVEAL | |
484 | 484 | [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)] | |
485 | 485 | } | |
486 | 486 | } | |
487 | 487 | ||
488 | 488 | ||
489 | 489 | @Verifier(tx) | |
490 | 490 | func verify () = match tx { | |
491 | 491 | case t: SetScriptTransaction => | |
492 | 492 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
493 | 493 | case t: IssueTransaction => | |
494 | 494 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
495 | 495 | case t: TransferTransaction => | |
496 | 496 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
497 | 497 | case _ => | |
498 | 498 | false | |
499 | 499 | } | |
500 | 500 |
github/deemru/w8io/169f3d6 71.95 ms ◑