tx · B1EpEemJ2uPWHsAihkrpgUGcruvJvphbio75UCZLPj3H 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7: -0.01400000 Waves 2021.08.03 04:37 [1641505] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves
{ "type": 13, "id": "B1EpEemJ2uPWHsAihkrpgUGcruvJvphbio75UCZLPj3H", "fee": 1400000, "feeAssetId": null, "timestamp": 1627954633900, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "KkXkBxbomCVfxMGD4qDz5dVA6r3Qd3Vm5xJ7QbXAvA567468oMEtpb5d8ZTQJkXUgbpxQBtaCk9zeEDbFRtaRBK" ], "script": "base64:AAIEAAAAAAAAADwIAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgMKAQgSBAoCCAgSABIECgIICBIFCgMICAgAAAA8AAAAAAROT05FAgAAAAROT05FAAAAAAZWT1RFUlMAAAAAAAAAAAMAAAAABlFVT1JVTQAAAAAAAAAAAgAAAAAIRkVBVFVSRUQCAAAACGZlYXR1cmVkAAAAAAhERUxJU1RFRAIAAAAIZGVsaXN0ZWQAAAAABlZPVElORwIAAAAGdm90aW5nAAAAAAZSRVZFQUwCAAAABnJldmVhbAAAAAAIQVBQUk9WQUwCAAAACGFwcHJvdmFsAAAAAAhSRUpFQ1RFRAIAAAAIcmVqZWN0ZWQAAAAACEFDQ0VQVEVEAgAAAAhhY2NlcHRlZAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQEAAAAPZ2V0SW50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AAgkBAAAAEGdldEtleVZvdGVzQ291bnQAAAACBQAAAARpdGVtBQAAAAR1c2VyBQAAAA1uZXdWb3Rlc0NvdW50CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAABBnZXRLZXlJdGVtU3RhdHVzAAAAAQUAAAAEaXRlbQUAAAAJbmV3U3RhdHVzBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABBJc3N1ZVRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHK0JeEA==", "height": 1641505, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EVuzr7zjLCEckjE9DyT9dWqSYTfXLt7VfjeEENB7Q1CP Next: FPXzQ3tBxQwn7o7VenCya73YBcSJnYRjCZJvu7nE1mCQ Diff:
Old | New | Differences | |
---|---|---|---|
85 | 85 | func getKeySupplierBalance (supplier) = (supplier + "_balance") | |
86 | 86 | ||
87 | 87 | ||
88 | + | func getKeySupplierAvailableBalance (supplier) = (supplier + "_available") | |
89 | + | ||
90 | + | ||
88 | 91 | func getKeyUserItemCounter (user,item) = (((user + "_") + item) + "_counter") | |
89 | 92 | ||
90 | 93 | ||
119 | 122 | ||
120 | 123 | ||
121 | 124 | func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier)) | |
125 | + | ||
126 | + | ||
127 | + | func getValueSupplierAvailableBalance (supplier) = getIntegerByKey(getKeySupplierAvailableBalance(supplier)) | |
122 | 128 | ||
123 | 129 | ||
124 | 130 | func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item)) | |
158 | 164 | ||
159 | 165 | ||
160 | 166 | func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item)) | |
167 | + | ||
168 | + | ||
169 | + | func getValueCouponPurchase (assetId) = getStringByKey(getKeyCouponPurchase(assetId)) | |
161 | 170 | ||
162 | 171 | ||
163 | 172 | func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user)) | |
337 | 346 | ||
338 | 347 | ||
339 | 348 | @Callable(i) | |
349 | + | func burn () = { | |
350 | + | let caller = toBase58String(i.caller.bytes) | |
351 | + | let pmt = i.payments[0] | |
352 | + | if ((isDefined(pmt.assetId) == false)) | |
353 | + | then throw("Need a coupon to burn") | |
354 | + | else { | |
355 | + | let assetId = match pmt.assetId { | |
356 | + | case e: ByteVector => | |
357 | + | e | |
358 | + | case _ => | |
359 | + | throw("Need a coupon to burn") | |
360 | + | } | |
361 | + | let asset = toBase58String(assetId) | |
362 | + | let purchase = getValueCouponPurchase(asset) | |
363 | + | let supplier = getValuePurchaseSupplier(purchase) | |
364 | + | if ((caller != supplier)) | |
365 | + | then throw("Your are not the supplier for this coupon") | |
366 | + | else { | |
367 | + | let amount = getValuePurchaseAmount(purchase) | |
368 | + | let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier) | |
369 | + | let availableBalance = (getValueSupplierAvailableBalance(supplier) + amount) | |
370 | + | [Burn(assetId, 1), IntegerEntry(keySupplierAvailableBalance, availableBalance)] | |
371 | + | } | |
372 | + | } | |
373 | + | } | |
374 | + | ||
375 | + | ||
376 | + | ||
377 | + | @Callable(i) | |
340 | 378 | func voteCommit (item,hash) = { | |
341 | 379 | let user = toBase58String(i.caller.bytes) | |
342 | 380 | let commitsCount = getValueCommitsCount(item) |
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 getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getKeyCommitsCount (item) = (item + "_cmtcnt") | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getKeyItemStatus (item) = (item + "_status") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getKeyVotesCount (item,vote) = ((item + "_res:") + vote) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func getKeySupplierBalance (supplier) = (supplier + "_balance") | |
86 | 86 | ||
87 | 87 | ||
88 | + | func getKeySupplierAvailableBalance (supplier) = (supplier + "_available") | |
89 | + | ||
90 | + | ||
88 | 91 | func getKeyUserItemCounter (user,item) = (((user + "_") + item) + "_counter") | |
89 | 92 | ||
90 | 93 | ||
91 | 94 | func genPurchaseKey (supplier,item,user,counter) = ("purchase_" + toBase58String(sha256(toBytes(((((((supplier + "_") + item) + "_") + user) + "_") + toString(counter)))))) | |
92 | 95 | ||
93 | 96 | ||
94 | 97 | func getKeyPurchaseStatus (purchase) = (purchase + "_status") | |
95 | 98 | ||
96 | 99 | ||
97 | 100 | func getKeyPurchaseItem (purchase) = (purchase + "_item") | |
98 | 101 | ||
99 | 102 | ||
100 | 103 | func getKeyPurchaseSupplier (purchase) = (purchase + "_supplier") | |
101 | 104 | ||
102 | 105 | ||
103 | 106 | func getKeyPurchaseUser (purchase) = (purchase + "_user") | |
104 | 107 | ||
105 | 108 | ||
106 | 109 | func getKeyPurchaseAmount (purchase) = (purchase + "_amount") | |
107 | 110 | ||
108 | 111 | ||
109 | 112 | func getKeyPurchaseTimestamp (purchase) = (purchase + "_timestamp") | |
110 | 113 | ||
111 | 114 | ||
112 | 115 | func getKeyPurchaseAssetId (purchase) = (purchase + "_assetId") | |
113 | 116 | ||
114 | 117 | ||
115 | 118 | func getKeyCouponPurchase (assetId) = (("coupon_" + assetId) + "_purchase") | |
116 | 119 | ||
117 | 120 | ||
118 | 121 | func getKeyCouponItem (assetId) = (("coupon_" + assetId) + "_item") | |
119 | 122 | ||
120 | 123 | ||
121 | 124 | func getValueSupplierBalance (supplier) = getIntegerByKey(getKeySupplierBalance(supplier)) | |
125 | + | ||
126 | + | ||
127 | + | func getValueSupplierAvailableBalance (supplier) = getIntegerByKey(getKeySupplierAvailableBalance(supplier)) | |
122 | 128 | ||
123 | 129 | ||
124 | 130 | func getValueUserItemCounter (user,item) = getIntegerByKey(getKeyUserItemCounter(user, item)) | |
125 | 131 | ||
126 | 132 | ||
127 | 133 | func getValuePurchaseStatus (purchase) = getStringByKey(getKeyPurchaseStatus(purchase)) | |
128 | 134 | ||
129 | 135 | ||
130 | 136 | func getValuePurchaseItem (purchase) = getStringValue(this, getKeyPurchaseItem(purchase)) | |
131 | 137 | ||
132 | 138 | ||
133 | 139 | func getValuePurchaseSupplier (purchase) = getStringValue(this, getKeyPurchaseSupplier(purchase)) | |
134 | 140 | ||
135 | 141 | ||
136 | 142 | func getValuePurchaseUser (purchase) = getStringValue(this, getKeyPurchaseUser(purchase)) | |
137 | 143 | ||
138 | 144 | ||
139 | 145 | func getValuePurchaseAmount (purchase) = getIntegerValue(this, getKeyPurchaseAmount(purchase)) | |
140 | 146 | ||
141 | 147 | ||
142 | 148 | func getValuePurchaseTimestamp (purchase) = getIntegerByKey(getKeyPurchaseTimestamp(purchase)) | |
143 | 149 | ||
144 | 150 | ||
145 | 151 | func getValuePurchaseAssetId (purchase) = getStringByKey(getKeyPurchaseAssetId(purchase)) | |
146 | 152 | ||
147 | 153 | ||
148 | 154 | func getValueItemPrice (item) = getIntegerValue(this, getKeyItemPrice(item)) | |
149 | 155 | ||
150 | 156 | ||
151 | 157 | func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item)) | |
152 | 158 | ||
153 | 159 | ||
154 | 160 | func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item)) | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func getValueItemTitle (item) = getStringByKey(getKeyItemTitle(item)) | |
158 | 164 | ||
159 | 165 | ||
160 | 166 | func getValueItemSoldCounter (item) = getIntegerByKey(getKeyItemSoldCounter(item)) | |
167 | + | ||
168 | + | ||
169 | + | func getValueCouponPurchase (assetId) = getStringByKey(getKeyCouponPurchase(assetId)) | |
161 | 170 | ||
162 | 171 | ||
163 | 172 | func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user)) | |
164 | 173 | ||
165 | 174 | ||
166 | 175 | func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item)) | |
167 | 176 | ||
168 | 177 | ||
169 | 178 | func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user)) | |
170 | 179 | ||
171 | 180 | ||
172 | 181 | func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item)) | |
173 | 182 | ||
174 | 183 | ||
175 | 184 | func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote)) | |
176 | 185 | ||
177 | 186 | ||
178 | 187 | @Callable(i) | |
179 | 188 | func registerSupplier (data) = { | |
180 | 189 | let supplier = toBase58String(i.caller.bytes) | |
181 | 190 | let account = getSupplierAccount(supplier) | |
182 | 191 | if ((account != NONE)) | |
183 | 192 | then throw("This address has already registred as supplier") | |
184 | 193 | else [StringEntry(getKeySupplierAccount(supplier), data)] | |
185 | 194 | } | |
186 | 195 | ||
187 | 196 | ||
188 | 197 | ||
189 | 198 | @Callable(i) | |
190 | 199 | func addItem (title,price,data,expire) = { | |
191 | 200 | let supplier = toBase58String(i.caller.bytes) | |
192 | 201 | let account = getSupplierAccount(supplier) | |
193 | 202 | let item = getKeyItem(supplier, title) | |
194 | 203 | if ((account == NONE)) | |
195 | 204 | then throw("You should register as supplier to add an item") | |
196 | 205 | else if ((0 >= price)) | |
197 | 206 | then throw("Purchase amount cannot be less than item price") | |
198 | 207 | else if ((getValueItemSupplier(item) != NONE)) | |
199 | 208 | then throw("An item already exists") | |
200 | 209 | else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
201 | 210 | } | |
202 | 211 | ||
203 | 212 | ||
204 | 213 | ||
205 | 214 | @Callable(i) | |
206 | 215 | func updateItem (item,title,price,data,expire) = { | |
207 | 216 | let supplier = toBase58String(i.caller.bytes) | |
208 | 217 | let account = getSupplierAccount(supplier) | |
209 | 218 | let itemSupplier = getValueItemSupplier(item) | |
210 | 219 | if ((account == NONE)) | |
211 | 220 | then throw("You should register as supplier to remove an item") | |
212 | 221 | else if (if ((item == NONE)) | |
213 | 222 | then true | |
214 | 223 | else (supplier != itemSupplier)) | |
215 | 224 | then throw(("You don't owned item " + item)) | |
216 | 225 | else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
217 | 226 | } | |
218 | 227 | ||
219 | 228 | ||
220 | 229 | ||
221 | 230 | @Callable(i) | |
222 | 231 | func removeItem (item) = { | |
223 | 232 | let supplier = toBase58String(i.caller.bytes) | |
224 | 233 | let account = getSupplierAccount(supplier) | |
225 | 234 | let itemSupplier = getValueItemSupplier(item) | |
226 | 235 | if ((account == NONE)) | |
227 | 236 | then throw("You should register as supplier to remove an item") | |
228 | 237 | else if (if ((item == NONE)) | |
229 | 238 | then true | |
230 | 239 | else (supplier != itemSupplier)) | |
231 | 240 | then throw(("You don't owned item " + item)) | |
232 | 241 | else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))] | |
233 | 242 | } | |
234 | 243 | ||
235 | 244 | ||
236 | 245 | ||
237 | 246 | @Callable(i) | |
238 | 247 | func purchase (item) = { | |
239 | 248 | let pmt = i.payments[0] | |
240 | 249 | if (isDefined(pmt.assetId)) | |
241 | 250 | then throw("You can buy tokens only with Waves tokens") | |
242 | 251 | else { | |
243 | 252 | let user = toBase58String(i.caller.bytes) | |
244 | 253 | let price = getValueItemPrice(item) | |
245 | 254 | let supplier = getValueItemSupplier(item) | |
246 | 255 | let expire = getValueItemExpireTime(item) | |
247 | 256 | if (if ((expire > 0)) | |
248 | 257 | then (lastBlock.timestamp >= expire) | |
249 | 258 | else false) | |
250 | 259 | then throw("Coupon expired") | |
251 | 260 | else if ((price > pmt.amount)) | |
252 | 261 | then throw("Purchase amount cannot be less than item price") | |
253 | 262 | else if ((pmt.amount > price)) | |
254 | 263 | then throw("Purchase amount cannot be higher than item price") | |
255 | 264 | else if ((supplier == NONE)) | |
256 | 265 | then throw("Supplier does not exists") | |
257 | 266 | else { | |
258 | 267 | let keyUserItemCounter = getKeyUserItemCounter(user, item) | |
259 | 268 | let userItemCounter = (getValueUserItemCounter(user, item) + 1) | |
260 | 269 | let purchase = genPurchaseKey(supplier, item, user, userItemCounter) | |
261 | 270 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
262 | 271 | let keyPurchaseItem = getKeyPurchaseItem(purchase) | |
263 | 272 | let keyPurchaseSupplier = getKeyPurchaseSupplier(purchase) | |
264 | 273 | let keyPurchaseUser = getKeyPurchaseUser(purchase) | |
265 | 274 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
266 | 275 | let keyPurchaseTimestamp = getKeyPurchaseTimestamp(purchase) | |
267 | 276 | [IntegerEntry(keyUserItemCounter, userItemCounter), StringEntry(keyPurchaseStatus, APPROVAL), StringEntry(keyPurchaseItem, item), StringEntry(keyPurchaseSupplier, supplier), StringEntry(keyPurchaseUser, user), IntegerEntry(keyPurchaseAmount, pmt.amount), IntegerEntry(keyPurchaseTimestamp, lastBlock.timestamp)] | |
268 | 277 | } | |
269 | 278 | } | |
270 | 279 | } | |
271 | 280 | ||
272 | 281 | ||
273 | 282 | ||
274 | 283 | @Callable(i) | |
275 | 284 | func rejectPurchase (purchase) = { | |
276 | 285 | let caller = toBase58String(i.caller.bytes) | |
277 | 286 | let status = getValuePurchaseStatus(purchase) | |
278 | 287 | let supplier = getValuePurchaseSupplier(purchase) | |
279 | 288 | let item = getValuePurchaseItem(purchase) | |
280 | 289 | if (if ((supplier == NONE)) | |
281 | 290 | then true | |
282 | 291 | else (caller != supplier)) | |
283 | 292 | then throw("Your are not the owner of this item") | |
284 | 293 | else if ((status != APPROVAL)) | |
285 | 294 | then throw("You cannot reject this purchased") | |
286 | 295 | else { | |
287 | 296 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
288 | 297 | let keyPurchaseAmount = getKeyPurchaseAmount(purchase) | |
289 | 298 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
290 | 299 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
291 | 300 | let user = getValuePurchaseUser(purchase) | |
292 | 301 | let amount = getValuePurchaseAmount(purchase) | |
293 | 302 | let supplierBalance = (getValueSupplierBalance(supplier) - amount) | |
294 | 303 | let itemSoldCounter = (getValueItemSoldCounter(item) - 1) | |
295 | 304 | let address = addressFromStringValue(user) | |
296 | 305 | [StringEntry(keyPurchaseStatus, REJECTED), IntegerEntry(keyPurchaseAmount, 0), ScriptTransfer(address, amount, unit)] | |
297 | 306 | } | |
298 | 307 | } | |
299 | 308 | ||
300 | 309 | ||
301 | 310 | ||
302 | 311 | @Callable(i) | |
303 | 312 | func acceptPurchase (purchase,couponAssetId) = { | |
304 | 313 | let caller = toBase58String(i.caller.bytes) | |
305 | 314 | let status = getValuePurchaseStatus(purchase) | |
306 | 315 | let supplier = getValuePurchaseSupplier(purchase) | |
307 | 316 | let item = getValuePurchaseItem(purchase) | |
308 | 317 | let expire = getValueItemExpireTime(item) | |
309 | 318 | if (if ((supplier == NONE)) | |
310 | 319 | then true | |
311 | 320 | else (caller != supplier)) | |
312 | 321 | then throw("Your are not the owner of this item") | |
313 | 322 | else if ((status != APPROVAL)) | |
314 | 323 | then throw("You cannot reject this purchased") | |
315 | 324 | else if ((item == NONE)) | |
316 | 325 | then throw("Unexpected error [ tem not found ]") | |
317 | 326 | else if (if ((expire > 0)) | |
318 | 327 | then (lastBlock.timestamp >= expire) | |
319 | 328 | else false) | |
320 | 329 | then throw("Coupon expired") | |
321 | 330 | else { | |
322 | 331 | let keyPurchaseStatus = getKeyPurchaseStatus(purchase) | |
323 | 332 | let keyPurchaseAssetId = getKeyPurchaseAssetId(purchase) | |
324 | 333 | let keySupplierBalance = getKeySupplierBalance(supplier) | |
325 | 334 | let keyItemSoldCounter = getKeyItemSoldCounter(item) | |
326 | 335 | let keyCouponPurchase = getKeyCouponPurchase(couponAssetId) | |
327 | 336 | let keyCouponItem = getKeyCouponItem(couponAssetId) | |
328 | 337 | let amount = getValuePurchaseAmount(purchase) | |
329 | 338 | let supplierBalance = (getValueSupplierBalance(supplier) + amount) | |
330 | 339 | let itemSoldCounter = (getValueItemSoldCounter(item) + 1) | |
331 | 340 | let user = getValuePurchaseUser(purchase) | |
332 | 341 | let address = addressFromStringValue(user) | |
333 | 342 | [StringEntry(keyPurchaseStatus, ACCEPTED), StringEntry(keyCouponPurchase, purchase), StringEntry(keyCouponItem, item), StringEntry(keyPurchaseAssetId, couponAssetId), IntegerEntry(keySupplierBalance, supplierBalance), IntegerEntry(keyItemSoldCounter, itemSoldCounter)] | |
334 | 343 | } | |
335 | 344 | } | |
336 | 345 | ||
337 | 346 | ||
338 | 347 | ||
339 | 348 | @Callable(i) | |
349 | + | func burn () = { | |
350 | + | let caller = toBase58String(i.caller.bytes) | |
351 | + | let pmt = i.payments[0] | |
352 | + | if ((isDefined(pmt.assetId) == false)) | |
353 | + | then throw("Need a coupon to burn") | |
354 | + | else { | |
355 | + | let assetId = match pmt.assetId { | |
356 | + | case e: ByteVector => | |
357 | + | e | |
358 | + | case _ => | |
359 | + | throw("Need a coupon to burn") | |
360 | + | } | |
361 | + | let asset = toBase58String(assetId) | |
362 | + | let purchase = getValueCouponPurchase(asset) | |
363 | + | let supplier = getValuePurchaseSupplier(purchase) | |
364 | + | if ((caller != supplier)) | |
365 | + | then throw("Your are not the supplier for this coupon") | |
366 | + | else { | |
367 | + | let amount = getValuePurchaseAmount(purchase) | |
368 | + | let keySupplierAvailableBalance = getKeySupplierAvailableBalance(supplier) | |
369 | + | let availableBalance = (getValueSupplierAvailableBalance(supplier) + amount) | |
370 | + | [Burn(assetId, 1), IntegerEntry(keySupplierAvailableBalance, availableBalance)] | |
371 | + | } | |
372 | + | } | |
373 | + | } | |
374 | + | ||
375 | + | ||
376 | + | ||
377 | + | @Callable(i) | |
340 | 378 | func voteCommit (item,hash) = { | |
341 | 379 | let user = toBase58String(i.caller.bytes) | |
342 | 380 | let commitsCount = getValueCommitsCount(item) | |
343 | 381 | let status = getValueItemStatus(item) | |
344 | 382 | if ((commitsCount >= VOTERS)) | |
345 | 383 | then throw("Reached max number of voters") | |
346 | 384 | else if ((getValueCommit(item, user) != NONE)) | |
347 | 385 | then throw("You voted already") | |
348 | 386 | else if ((getKeyItemSupplier(item) == NONE)) | |
349 | 387 | then throw("Item does not exists") | |
350 | 388 | else if (if ((status != NONE)) | |
351 | 389 | then (status != VOTING) | |
352 | 390 | else false) | |
353 | 391 | then throw("Voting is not active for this item now") | |
354 | 392 | else { | |
355 | 393 | let newStatus = if ((commitsCount == VOTERS)) | |
356 | 394 | then REVEAL | |
357 | 395 | else VOTING | |
358 | 396 | [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)] | |
359 | 397 | } | |
360 | 398 | } | |
361 | 399 | ||
362 | 400 | ||
363 | 401 | ||
364 | 402 | @Callable(i) | |
365 | 403 | func voteReveal (item,vote,salt) = { | |
366 | 404 | let user = toBase58String(i.caller.bytes) | |
367 | 405 | let status = getValueItemStatus(item) | |
368 | 406 | let newVotesCount = (getValueVotesCount(item, vote) + 1) | |
369 | 407 | let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt)))) | |
370 | 408 | if ((saltedVote != getValueCommit(item, user))) | |
371 | 409 | then throw("Reveal data is not valid") | |
372 | 410 | else if ((VOTERS > getValueCommitsCount(item))) | |
373 | 411 | then throw("Max number of voters not reached") | |
374 | 412 | else if ((getValueReveal(item, user) != NONE)) | |
375 | 413 | then throw("You voted already") | |
376 | 414 | else if (if ((status != VOTING)) | |
377 | 415 | then (status != REVEAL) | |
378 | 416 | else false) | |
379 | 417 | then throw("Voting is not active for this item now") | |
380 | 418 | else if (if ((vote != FEATURED)) | |
381 | 419 | then (vote != DELISTED) | |
382 | 420 | else false) | |
383 | 421 | then throw("Provided voting option is incorrect") | |
384 | 422 | else { | |
385 | 423 | let newStatus = if ((newVotesCount >= QUORUM)) | |
386 | 424 | then vote | |
387 | 425 | else REVEAL | |
388 | 426 | [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)] | |
389 | 427 | } | |
390 | 428 | } | |
391 | 429 | ||
392 | 430 | ||
393 | 431 | @Verifier(tx) | |
394 | 432 | func verify () = match tx { | |
395 | 433 | case t: SetScriptTransaction => | |
396 | 434 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
397 | 435 | case t: IssueTransaction => | |
398 | 436 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
399 | 437 | case t: TransferTransaction => | |
400 | 438 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
401 | 439 | case _ => | |
402 | 440 | false | |
403 | 441 | } | |
404 | 442 |
github/deemru/w8io/169f3d6 75.80 ms ◑