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