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