tx · 7DPVu2h7cVFEyCPCPQtLkSks27xqdj7UkWfXrf6dBCwL 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7: -0.01400000 Waves 2021.07.31 20:58 [1638139] smart account 3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7 > SELF 0.00000000 Waves
{ "type": 13, "id": "7DPVu2h7cVFEyCPCPQtLkSks27xqdj7UkWfXrf6dBCwL", "fee": 1400000, "feeAssetId": null, "timestamp": 1627754323781, "version": 2, "chainId": 84, "sender": "3MovmZoJtqutkf49oGXHzABSMUQ7HU5Dcg7", "senderPublicKey": "3tp5fNYyPi4jMnkf6s1k4kBqvJ7nm57SxzvLyi8RkxT2", "proofs": [ "4h2Mc9MfMfGLSBVJpJpHDdy7GNKQhuToZRE8WM26Q31UThVRvGkdB7LVFXT5kfmeXmLSJdp9vBbU1o4mnCH8qR9e" ], "script": "base64:AAIEAAAAAAAAAC8IAhIDCgEIEgYKBAgBCAESBwoFCAgBCAESAwoBCBIDCgEIEgQKAggIEgUKAwgICAAAACIAAAAABE5PTkUCAAAABE5PTkUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAhGRUFUVVJFRAIAAAAIZmVhdHVyZWQAAAAACERFTElTVEVEAgAAAAhkZWxpc3RlZAAAAAAGVk9USU5HAgAAAAZ2b3RpbmcAAAAABlJFVkVBTAIAAAAGcmV2ZWFsAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FAQAAAA9nZXRJbnRlZ2VyQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA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ldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQdcxZbI", "height": 1638139, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2iKmC1AfjngVF8QJ47GNYUANHmyPyTzSRJfLyV2Rp6ny Next: GCnnXXJq4X5TxtNiDpSvcLiEzb8g4Z43fk7g3MghnpFB Diff:
Old | New | Differences | |
---|---|---|---|
190 | 190 | @Callable(i) | |
191 | 191 | func purchase (item) = { | |
192 | 192 | let pmt = i.payments[0] | |
193 | - | if (isDefined(pmt.assetId)) | |
194 | - | then throw("You can buy tokens only with Waves tokens") | |
195 | - | else { | |
196 | - | let userAddress = toBase58String(i.caller.bytes) | |
197 | - | let price = getValueItemPrice(item) | |
198 | - | if ((1 == 1)) | |
199 | - | then throw(("price -> " + toString(price))) | |
200 | - | else { | |
201 | - | let supplier = getValueItemSupplier(item) | |
202 | - | let expire = getValueItemExpireTime(item) | |
203 | - | if (if ((expire > 0)) | |
204 | - | then (lastBlock.timestamp >= expire) | |
205 | - | else false) | |
206 | - | then throw("Coupon expired") | |
207 | - | else if ((price > pmt.amount)) | |
208 | - | then throw("Purchase amount cannot be less than item price") | |
209 | - | else if ((pmt.amount > price)) | |
210 | - | then throw("Purchase amount cannot be higher than item price") | |
211 | - | else if ((supplier == NONE)) | |
212 | - | then throw("Supplier does not exists") | |
213 | - | else { | |
214 | - | let userItemCounter = getKeyUserItemCounter(userAddress, item) | |
215 | - | let newValueUserItemCounter = (getValueUserItemCounter(userAddress, item) + 1) | |
216 | - | let supplierBalanceKey = getKeyBalanceSupplier(supplier) | |
217 | - | let newSupplierBalance = (getValueBalanceSupplier(supplier) + pmt.amount) | |
218 | - | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
219 | - | let assetId = calculateAssetId(asset) | |
193 | + | if ((1 == 1)) | |
194 | + | then throw("error error error") | |
195 | + | else if (isDefined(pmt.assetId)) | |
196 | + | then throw("You can buy tokens only with Waves tokens") | |
197 | + | else { | |
198 | + | let userAddress = toBase58String(i.caller.bytes) | |
199 | + | let price = getValueItemPrice(item) | |
200 | + | if ((1 == 1)) | |
201 | + | then throw(("price -> " + toString(price))) | |
202 | + | else { | |
203 | + | let supplier = getValueItemSupplier(item) | |
204 | + | let expire = getValueItemExpireTime(item) | |
205 | + | if (if ((expire > 0)) | |
206 | + | then (lastBlock.timestamp >= expire) | |
207 | + | else false) | |
208 | + | then throw("Coupon expired") | |
209 | + | else if ((price > pmt.amount)) | |
210 | + | then throw("Purchase amount cannot be less than item price") | |
211 | + | else if ((pmt.amount > price)) | |
212 | + | then throw("Purchase amount cannot be higher than item price") | |
213 | + | else if ((supplier == NONE)) | |
214 | + | then throw("Supplier does not exists") | |
215 | + | else { | |
216 | + | let userItemCounter = getKeyUserItemCounter(userAddress, item) | |
217 | + | let newValueUserItemCounter = (getValueUserItemCounter(userAddress, item) + 1) | |
218 | + | let supplierBalanceKey = getKeyBalanceSupplier(supplier) | |
219 | + | let newSupplierBalance = (getValueBalanceSupplier(supplier) + pmt.amount) | |
220 | + | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
221 | + | let assetId = calculateAssetId(asset) | |
220 | 222 | [IntegerEntry(userItemCounter, newValueUserItemCounter), IntegerEntry(supplierBalanceKey, newSupplierBalance)] | |
221 | - | } | |
222 | - | } | |
223 | - | } | |
223 | + | } | |
224 | + | } | |
225 | + | } | |
224 | 226 | } | |
225 | 227 | ||
226 | 228 |
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 | func getStringByKey (key) = match getString(this, key) { | |
19 | 19 | case a: String => | |
20 | 20 | a | |
21 | 21 | case _ => | |
22 | 22 | NONE | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | func getIntegerByKey (key) = match getInteger(this, key) { | |
27 | 27 | case a: Int => | |
28 | 28 | a | |
29 | 29 | case _ => | |
30 | 30 | 0 | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getKeySupplierAccount (account) = (account + "_account") | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func getSupplierAccount (account) = getStringByKey(getKeySupplierAccount(account)) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getKeyItem (supplier,title) = { | |
41 | 41 | let supplierTitle = (supplier + title) | |
42 | 42 | ("item_" + toBase58String(sha256(toBytes(supplierTitle)))) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func getKeyItemSupplier (item) = (item + "_owner") | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | func getKeyItemTitle (item) = (item + "_title") | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | func getKeyItemPrice (item) = (item + "_price") | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | func getKeyItemData (item) = (item + "_data") | |
56 | 56 | ||
57 | 57 | ||
58 | 58 | func getKeyItemExpireDate (item) = (item + "_expiredate") | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func getKeyCommit (item,user) = (((item + "_") + user) + "_commit") | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func getKeyCommitsCount (item) = (item + "_cmtcnt") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal") | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func getKeyItemStatus (item) = (item + "_status") | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func getKeyVotesCount (item,vote) = ((item + "_res:") + vote) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt") | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func getKeyBalanceSupplier (account) = (account + "_balance") | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func getValueBalanceSupplier (account) = { | |
83 | 83 | let supplierBalanceKey = getKeyBalanceSupplier(account) | |
84 | 84 | match getInteger(this, supplierBalanceKey) { | |
85 | 85 | case a: Int => | |
86 | 86 | a | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getValueUserItemCounter (user,item) = { | |
94 | 94 | let userItemCounterKey = getKeyUserItemCounter(user, item) | |
95 | 95 | match getInteger(this, userItemCounterKey) { | |
96 | 96 | case a: Int => | |
97 | 97 | a | |
98 | 98 | case _ => | |
99 | 99 | 0 | |
100 | 100 | } | |
101 | 101 | } | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func getValueItemPrice (item) = { | |
105 | 105 | let keyItemPrice = getKeyItemPrice(item) | |
106 | 106 | getIntegerValue(this, keyItemPrice) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func getValueItemSupplier (item) = getStringByKey(getKeyItemSupplier(item)) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func getValueItemExpireTime (item) = getIntegerByKey(getKeyItemExpireDate(item)) | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func getValueCommit (item,user) = getStringByKey(getKeyCommit(item, user)) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func getValueCommitsCount (item) = getIntegerByKey(getKeyCommitsCount(item)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func getValueReveal (item,user) = getStringByKey(getKeyReveal(item, user)) | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func getValueItemStatus (item) = getStringByKey(getKeyItemStatus(item)) | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func getValueVotesCount (item,vote) = getIntegerByKey(getKeyVotesCount(item, vote)) | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | @Callable(i) | |
132 | 132 | func registerSupplier (data) = { | |
133 | 133 | let supplier = toBase58String(i.caller.bytes) | |
134 | 134 | let account = getSupplierAccount(supplier) | |
135 | 135 | if ((account != NONE)) | |
136 | 136 | then throw("This address has already registred as supplier") | |
137 | 137 | else [StringEntry(getKeySupplierAccount(supplier), data)] | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(i) | |
143 | 143 | func addItem (title,price,data,expire) = { | |
144 | 144 | let supplier = toBase58String(i.caller.bytes) | |
145 | 145 | let account = getSupplierAccount(supplier) | |
146 | 146 | let item = getKeyItem(supplier, title) | |
147 | 147 | if ((account == NONE)) | |
148 | 148 | then throw("You should register as supplier to add an item") | |
149 | 149 | else if ((0 >= price)) | |
150 | 150 | then throw("Purchase amount cannot be less than item price") | |
151 | 151 | else if ((getValueItemSupplier(item) != NONE)) | |
152 | 152 | then throw("An item already exists") | |
153 | 153 | else [StringEntry(getKeyItemSupplier(item), supplier), StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
154 | 154 | } | |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | @Callable(i) | |
159 | 159 | func updateItem (item,title,price,data,expire) = { | |
160 | 160 | let supplier = toBase58String(i.caller.bytes) | |
161 | 161 | let account = getSupplierAccount(supplier) | |
162 | 162 | let itemSupplier = getValueItemSupplier(item) | |
163 | 163 | if ((account == NONE)) | |
164 | 164 | then throw("You should register as supplier to remove an item") | |
165 | 165 | else if (if ((item == NONE)) | |
166 | 166 | then true | |
167 | 167 | else (supplier != itemSupplier)) | |
168 | 168 | then throw(("You don't owned item " + item)) | |
169 | 169 | else [StringEntry(getKeyItemTitle(item), title), IntegerEntry(getKeyItemPrice(item), price), StringEntry(getKeyItemData(item), data), IntegerEntry(getKeyItemExpireDate(item), expire)] | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | ||
174 | 174 | @Callable(i) | |
175 | 175 | func removeItem (item) = { | |
176 | 176 | let supplier = toBase58String(i.caller.bytes) | |
177 | 177 | let account = getSupplierAccount(supplier) | |
178 | 178 | let itemSupplier = getValueItemSupplier(item) | |
179 | 179 | if ((account == NONE)) | |
180 | 180 | then throw("You should register as supplier to remove an item") | |
181 | 181 | else if (if ((item == NONE)) | |
182 | 182 | then true | |
183 | 183 | else (supplier != itemSupplier)) | |
184 | 184 | then throw(("You don't owned item " + item)) | |
185 | 185 | else [DeleteEntry(getKeyItemSupplier(item)), DeleteEntry(getKeyItemTitle(item)), DeleteEntry(getKeyItemPrice(item)), DeleteEntry(getKeyItemData(item)), DeleteEntry(getKeyItemExpireDate(item))] | |
186 | 186 | } | |
187 | 187 | ||
188 | 188 | ||
189 | 189 | ||
190 | 190 | @Callable(i) | |
191 | 191 | func purchase (item) = { | |
192 | 192 | let pmt = i.payments[0] | |
193 | - | if (isDefined(pmt.assetId)) | |
194 | - | then throw("You can buy tokens only with Waves tokens") | |
195 | - | else { | |
196 | - | let userAddress = toBase58String(i.caller.bytes) | |
197 | - | let price = getValueItemPrice(item) | |
198 | - | if ((1 == 1)) | |
199 | - | then throw(("price -> " + toString(price))) | |
200 | - | else { | |
201 | - | let supplier = getValueItemSupplier(item) | |
202 | - | let expire = getValueItemExpireTime(item) | |
203 | - | if (if ((expire > 0)) | |
204 | - | then (lastBlock.timestamp >= expire) | |
205 | - | else false) | |
206 | - | then throw("Coupon expired") | |
207 | - | else if ((price > pmt.amount)) | |
208 | - | then throw("Purchase amount cannot be less than item price") | |
209 | - | else if ((pmt.amount > price)) | |
210 | - | then throw("Purchase amount cannot be higher than item price") | |
211 | - | else if ((supplier == NONE)) | |
212 | - | then throw("Supplier does not exists") | |
213 | - | else { | |
214 | - | let userItemCounter = getKeyUserItemCounter(userAddress, item) | |
215 | - | let newValueUserItemCounter = (getValueUserItemCounter(userAddress, item) + 1) | |
216 | - | let supplierBalanceKey = getKeyBalanceSupplier(supplier) | |
217 | - | let newSupplierBalance = (getValueBalanceSupplier(supplier) + pmt.amount) | |
218 | - | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
219 | - | let assetId = calculateAssetId(asset) | |
193 | + | if ((1 == 1)) | |
194 | + | then throw("error error error") | |
195 | + | else if (isDefined(pmt.assetId)) | |
196 | + | then throw("You can buy tokens only with Waves tokens") | |
197 | + | else { | |
198 | + | let userAddress = toBase58String(i.caller.bytes) | |
199 | + | let price = getValueItemPrice(item) | |
200 | + | if ((1 == 1)) | |
201 | + | then throw(("price -> " + toString(price))) | |
202 | + | else { | |
203 | + | let supplier = getValueItemSupplier(item) | |
204 | + | let expire = getValueItemExpireTime(item) | |
205 | + | if (if ((expire > 0)) | |
206 | + | then (lastBlock.timestamp >= expire) | |
207 | + | else false) | |
208 | + | then throw("Coupon expired") | |
209 | + | else if ((price > pmt.amount)) | |
210 | + | then throw("Purchase amount cannot be less than item price") | |
211 | + | else if ((pmt.amount > price)) | |
212 | + | then throw("Purchase amount cannot be higher than item price") | |
213 | + | else if ((supplier == NONE)) | |
214 | + | then throw("Supplier does not exists") | |
215 | + | else { | |
216 | + | let userItemCounter = getKeyUserItemCounter(userAddress, item) | |
217 | + | let newValueUserItemCounter = (getValueUserItemCounter(userAddress, item) + 1) | |
218 | + | let supplierBalanceKey = getKeyBalanceSupplier(supplier) | |
219 | + | let newSupplierBalance = (getValueBalanceSupplier(supplier) + pmt.amount) | |
220 | + | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
221 | + | let assetId = calculateAssetId(asset) | |
220 | 222 | [IntegerEntry(userItemCounter, newValueUserItemCounter), IntegerEntry(supplierBalanceKey, newSupplierBalance)] | |
221 | - | } | |
222 | - | } | |
223 | - | } | |
223 | + | } | |
224 | + | } | |
225 | + | } | |
224 | 226 | } | |
225 | 227 | ||
226 | 228 | ||
227 | 229 | ||
228 | 230 | @Callable(i) | |
229 | 231 | func voteCommit (item,hash) = { | |
230 | 232 | let user = toBase58String(i.caller.bytes) | |
231 | 233 | let commitsCount = getValueCommitsCount(item) | |
232 | 234 | let status = getValueItemStatus(item) | |
233 | 235 | if ((commitsCount >= VOTERS)) | |
234 | 236 | then throw("Reached max number of voters") | |
235 | 237 | else if ((getValueCommit(item, user) != NONE)) | |
236 | 238 | then throw("You voted already") | |
237 | 239 | else if ((getKeyItemSupplier(item) == NONE)) | |
238 | 240 | then throw("Item does not exists") | |
239 | 241 | else if (if ((status != NONE)) | |
240 | 242 | then (status != VOTING) | |
241 | 243 | else false) | |
242 | 244 | then throw("Voting is not active for this item now") | |
243 | 245 | else { | |
244 | 246 | let newStatus = if ((commitsCount == VOTERS)) | |
245 | 247 | then REVEAL | |
246 | 248 | else VOTING | |
247 | 249 | [StringEntry(getKeyCommit(item, user), hash), IntegerEntry(getKeyCommitsCount(item), (commitsCount + 1)), StringEntry(getKeyItemStatus(item), newStatus)] | |
248 | 250 | } | |
249 | 251 | } | |
250 | 252 | ||
251 | 253 | ||
252 | 254 | ||
253 | 255 | @Callable(i) | |
254 | 256 | func voteReveal (item,vote,salt) = { | |
255 | 257 | let user = toBase58String(i.caller.bytes) | |
256 | 258 | let status = getValueItemStatus(item) | |
257 | 259 | let newVotesCount = (getValueVotesCount(item, vote) + 1) | |
258 | 260 | let saltedVote = toBase58String(sha256(toBytes(((item + vote) + salt)))) | |
259 | 261 | if ((saltedVote != getValueCommit(item, user))) | |
260 | 262 | then throw("Reveal data is not valid") | |
261 | 263 | else if ((VOTERS > getValueCommitsCount(item))) | |
262 | 264 | then throw("Max number of voters not reached") | |
263 | 265 | else if ((getValueReveal(item, user) != NONE)) | |
264 | 266 | then throw("You voted already") | |
265 | 267 | else if (if ((status != VOTING)) | |
266 | 268 | then (status != REVEAL) | |
267 | 269 | else false) | |
268 | 270 | then throw("Voting is not active for this item now") | |
269 | 271 | else if (if ((vote != FEATURED)) | |
270 | 272 | then (vote != DELISTED) | |
271 | 273 | else false) | |
272 | 274 | then throw("Provided voting option is incorrect") | |
273 | 275 | else { | |
274 | 276 | let newStatus = if ((newVotesCount >= QUORUM)) | |
275 | 277 | then vote | |
276 | 278 | else REVEAL | |
277 | 279 | [StringEntry(getKeyReveal(item, user), vote), IntegerEntry(getKeyVotesCount(item, user), newVotesCount), StringEntry(getKeyItemStatus(item), newStatus)] | |
278 | 280 | } | |
279 | 281 | } | |
280 | 282 | ||
281 | 283 | ||
282 | 284 | @Verifier(tx) | |
283 | 285 | func verify () = match tx { | |
284 | 286 | case t: SetScriptTransaction => | |
285 | 287 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
286 | 288 | case _ => | |
287 | 289 | false | |
288 | 290 | } | |
289 | 291 |
github/deemru/w8io/026f985 55.46 ms ◑