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