tx · B7gBHvQVXRJMAUkNK1M6RfUaSmAhyuExbYPsfY3EKMMg

3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt:  -0.05000000 Waves

2019.08.17 12:59 [634950] smart account 3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt > SELF 0.00000000 Waves

{ "type": 13, "id": "B7gBHvQVXRJMAUkNK1M6RfUaSmAhyuExbYPsfY3EKMMg", "fee": 5000000, "feeAssetId": null, "timestamp": 1566035983155, "version": 1, "sender": "3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt", "senderPublicKey": "3ghbp6Z5eXoKniLSE8XPjn5od7gT1K7qhk6zANBhv9C3", "proofs": [ "2nLBPfnN1B9Md81CmkNekeMtqWJ6guCgf6GQSzMuvx3is5HAn9UxVJfHFdsTGMoitjsrzQp5t9pFyjqoZCZWdRf" ], "script": "base64:AAIDAAAAAAAAAAAAAAAlAAAAAA5vd25lclB1YmxpY2tleQEAAAAgJ+LupRtywYm1DtC2wa7+mcHTm1BkasCvRteam1vswWgAAAAADGFsbGljZVB1YmtleQEAAAAgdahQG7OF8VCvnmrXif7UUhoQjaCrm/2hFDfEk/59nDEAAAAACWJvYlB1YmtleQEAAAAgoHwmi+qXZSlN20yTARZQ9O8s6pUs/3qey7EnxhpjMk8AAAAADGNvb3BlclB1YmtleQEAAAAgU/w5K0kRwpKzXSOUcyJ72drbib04bPq1q9XqkXENjioAAAAABE5PTkUCAAAABG5vbmUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAAAAAAh2ZXJpZmllcgIAAAAjM01zOXNVYjdXM0w1NUxMR3hlSFdpcWdUZmRIOXluMm1heWIAAAAACFZFUklGSUVEAgAAAAh2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GAwUAAAAHY29wcGVyMgUAAAAEYm9iMwcGAwUAAAAHY29wcGVyMwUAAAAEYm9iMQcGAwUAAAAHY29wcGVyMwUAAAAEYm9iMgcEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGlja2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwMFAAAADGFsbGljZUFuZEJvYgYFAAAAD2FsbGljZUFuZENvb3BlcgYFAAAADWJvYmVBbmRDb29wZXLDMsH9", "chainId": 84, "height": 634950, "spentComplexity": 0 } View: original | compacted Prev: BsxkbY6dmLCx3JF1tJDmoqGrv2gDB8BgKpwaVgToBXHw Next: 6cWt5DowfuZwP3sZBUJWyEspRUWBW816smUh3rVqXBXV Diff:
OldNewDifferences
125125
126126
127127 @Callable(i)
128-func bid (auctionId) = {
128+func bid (auctionId,bid,price,endHeight) = {
129129 let pmt = extract(i.payment)
130130 let pmtAssetIdStr = if (isDefined(pmt.assetId))
131131 then toBase58String(value(pmt.assetId))
132132 else "WAVES"
133133 let callerAddressStr = toBase58String(i.caller.bytes)
134- let endHeight = getIntegerValue(this, auctionId)
135- let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
136134 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
135+ let winner = getString(this, (auctionId + "_winner"))
137136 let winAmount = getInteger(this, (auctionId + "_winAmount"))
138- let winner = getString(this, (auctionId + "_winner"))
139137 let bidFromTheSameUser = if (isDefined(winner))
140138 then (value(winner) == callerAddressStr)
141139 else false
142- let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
143- then value(winAmount)
144- else 0))
145- if ((lastBlock.height >= endHeight))
146- then throw("Auction already finished")
147- else if ((priceAssetId != pmtAssetIdStr))
148- then throw((("Bid must be in asset '" + priceAssetId) + "'"))
149- else if (if (if (isDefined(winAmount))
150- then (value(winAmount) >= totalBidAmount)
151- else false)
152- then true
153- else if (!(isDefined(winAmount)))
154- then (startPrice >= totalBidAmount)
155- else false)
156- then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
157- then value(winAmount)
158- else startPrice)))
159- else if (if (bidFromTheSameUser)
160- then true
161- else !(isDefined(winner)))
162- then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)])
163- else {
164- let previousBidderAddr = addressFromStringValue(value(winner))
165- let priceAsset = if (if ((priceAssetId == "WAVES"))
166- then true
167- else (priceAssetId == ""))
168- then unit
169- else fromBase58String(priceAssetId)
170- ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]))
171- }
140+ if (if (bidFromTheSameUser)
141+ then true
142+ else !(isDefined(winner)))
143+ then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), price), DataEntry((auctionId + "_count"), bid), DataEntry((auctionId + "_endHeight"), endHeight)])
144+ else {
145+ let previousBidderAddr = addressFromStringValue(value(winner))
146+ ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), price)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), unit)]))
147+ }
172148 }
173149
174150
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPublickey = base58'3ghbp6Z5eXoKniLSE8XPjn5od7gT1K7qhk6zANBhv9C3'
55
66 let allicePubkey = base58'8vHZLEG3BmzYYVjQyNi1m11kh6FeSoVAKKwtsYXC3bqA'
77
88 let bobPubkey = base58'BoU2oQn7y52MZgT1Q7vJCJwUxov9tXb2zpC5gmWQbutJ'
99
1010 let cooperPubkey = base58'6equaSt4fnw6gEoLGiL3dTDDGxDc4PY5NyV3gVkEEr1F'
1111
1212 let NONE = "none"
1313
1414 let VOTERS = 3
1515
1616 let QUORUM = 2
1717
1818 let VOTING = "voting"
1919
2020 let REVEAL = "reveal"
2121
2222 let FEATURED = "featured"
2323
2424 let DELISTED = "delisted"
2525
2626 let verifier = "3Ms9sUb7W3L55LLGxeHWiqgTfdH9yn2mayb"
2727
2828 let VERIFIED = "verified"
2929
3030 let BLACKLISTED = "blacklist"
3131
3232 let maxAuctionDuration = (1440 * 30)
3333
3434 func getNumberByKey (key) = {
3535 let num = match getInteger(this, key) {
3636 case a: Int =>
3737 a
3838 case _ =>
3939 0
4040 }
4141 num
4242 }
4343
4444
4545 func getStrByKey (key) = {
4646 let str = match getString(this, key) {
4747 case a: String =>
4848 a
4949 case _ =>
5050 NONE
5151 }
5252 str
5353 }
5454
5555
5656 func getKeyItemPrice (item) = (item + "_price")
5757
5858
5959 func getValueItemPrice (item) = getNumberByKey(getKeyItemPrice(item))
6060
6161
6262 func getKeyUserItemCounter (user,item) = (((item + "_") + user) + "_cnt")
6363
6464
6565 func getValueUserItemCounter (user,item) = getNumberByKey(getKeyUserItemCounter(user, item))
6666
6767
6868 func getKeyItem (supplier,title) = ("item_" + toBase58String(sha256(toBytes((supplier + title)))))
6969
7070
7171 func getKeyItemData (item) = (item + "_data")
7272
7373
7474 func getKeyItemSupplier (item) = (item + "_owner")
7575
7676
7777 func getValueItemSupplier (item) = getStrByKey(getKeyItemSupplier(item))
7878
7979
8080 func getKeyBalanceSupplier (account) = (account + "_balance")
8181
8282
8383 func getValueBalanceSupplier (account) = getNumberByKey(getKeyBalanceSupplier(account))
8484
8585
8686 func getKeyCommit (item,user) = (((item + "_") + user) + "_commit")
8787
8888
8989 func getValueCommit (item,user) = getStrByKey(getKeyCommit(item, user))
9090
9191
9292 func getKeyCommitsCount (item) = (item + "_comcnt")
9393
9494
9595 func getValueCommitsCount (item) = getNumberByKey(getKeyCommitsCount(item))
9696
9797
9898 func getKeyReveal (item,user) = (((item + "_") + user) + "_reveal")
9999
100100
101101 func getValueReveal (item,user) = getStrByKey(getKeyReveal(item, user))
102102
103103
104104 func getKeyItemStatus (item) = (item + "_status")
105105
106106
107107 func getValueItemStatus (item) = getStrByKey(getKeyItemStatus(item))
108108
109109
110110 func getKeyVoteCount (item,voute) = ((item + "_res:") + voute)
111111
112112
113113 func getValueVouteCount (item,voute) = getNumberByKey(getKeyVoteCount(item, voute))
114114
115115
116116 @Callable(i)
117117 func startAuction (duration,startPrice,auctionId,priceAssetId) = {
118118 let endHeight = (lastBlock.height + duration)
119119 let pmt = extract(i.payment)
120120 WriteSet([DataEntry(auctionId, endHeight), DataEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
121121 then toBase58String(value(pmt.assetId))
122122 else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId)])
123123 }
124124
125125
126126
127127 @Callable(i)
128-func bid (auctionId) = {
128+func bid (auctionId,bid,price,endHeight) = {
129129 let pmt = extract(i.payment)
130130 let pmtAssetIdStr = if (isDefined(pmt.assetId))
131131 then toBase58String(value(pmt.assetId))
132132 else "WAVES"
133133 let callerAddressStr = toBase58String(i.caller.bytes)
134- let endHeight = getIntegerValue(this, auctionId)
135- let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
136134 let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
135+ let winner = getString(this, (auctionId + "_winner"))
137136 let winAmount = getInteger(this, (auctionId + "_winAmount"))
138- let winner = getString(this, (auctionId + "_winner"))
139137 let bidFromTheSameUser = if (isDefined(winner))
140138 then (value(winner) == callerAddressStr)
141139 else false
142- let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
143- then value(winAmount)
144- else 0))
145- if ((lastBlock.height >= endHeight))
146- then throw("Auction already finished")
147- else if ((priceAssetId != pmtAssetIdStr))
148- then throw((("Bid must be in asset '" + priceAssetId) + "'"))
149- else if (if (if (isDefined(winAmount))
150- then (value(winAmount) >= totalBidAmount)
151- else false)
152- then true
153- else if (!(isDefined(winAmount)))
154- then (startPrice >= totalBidAmount)
155- else false)
156- then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
157- then value(winAmount)
158- else startPrice)))
159- else if (if (bidFromTheSameUser)
160- then true
161- else !(isDefined(winner)))
162- then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)])
163- else {
164- let previousBidderAddr = addressFromStringValue(value(winner))
165- let priceAsset = if (if ((priceAssetId == "WAVES"))
166- then true
167- else (priceAssetId == ""))
168- then unit
169- else fromBase58String(priceAssetId)
170- ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]))
171- }
140+ if (if (bidFromTheSameUser)
141+ then true
142+ else !(isDefined(winner)))
143+ then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), price), DataEntry((auctionId + "_count"), bid), DataEntry((auctionId + "_endHeight"), endHeight)])
144+ else {
145+ let previousBidderAddr = addressFromStringValue(value(winner))
146+ ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), price)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), unit)]))
147+ }
172148 }
173149
174150
175151
176152 @Callable(i)
177153 func purchase (item) = {
178154 let pmt = extract(i.payment)
179155 if (isDefined(pmt.assetId))
180156 then throw("can use Waves only at the moment")
181157 else {
182158 let userAddress = toBase58String(i.caller.bytes)
183159 let price = getValueItemPrice(item)
184160 let supplierAddress = getValueItemSupplier(item)
185161 if ((price > pmt.amount))
186162 then throw("purchase amount cannot be less than item price")
187163 else if ((pmt.amount > price))
188164 then throw("purchase amount cannot be higher than item price")
189165 else if ((supplierAddress == NONE))
190166 then throw("supplier is not exist")
191167 else WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))])
192168 }
193169 }
194170
195171
196172
197173 @Callable(i)
198174 func addItem (title,price,data) = {
199175 let supplierAddress = toBase58String(i.caller.bytes)
200176 let item = getKeyItem(supplierAddress, title)
201177 if ((0 >= price))
202178 then throw("purchase amount cannot be less than item price")
203179 else if ((getValueItemSupplier(item) != NONE))
204180 then throw("An item is allready exist")
205181 else if ((supplierAddress == BLACKLISTED))
206182 then throw("supplier's account has been blacklist")
207183 else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
208184 }
209185
210186
211187
212188 @Callable(i)
213189 func deposit () = {
214190 let pmt = extract(i.payment)
215191 let supplierAddress = toBase58String(i.caller.bytes)
216192 let balance = getValueBalanceSupplier(supplierAddress)
217193 let newBalance = (balance + pmt.amount)
218194 if (isDefined(pmt.assetId))
219195 then throw("can hodl waves only at the moment")
220196 else if ((0 > pmt.amount))
221197 then throw("Can not deposit negative amount")
222198 else WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), newBalance)])
223199 }
224200
225201
226202
227203 @Callable(i)
228204 func withdraw (amount) = {
229205 let supplierAddress = toBase58String(i.caller.bytes)
230206 let balance = getValueBalanceSupplier(supplierAddress)
231207 let newBalance = (balance - amount)
232208 if ((0 > amount))
233209 then throw("Can not withdraw negative amount")
234210 else if ((0 > newBalance))
235211 then throw("not enough balance")
236212 else if ((0 >= balance))
237213 then throw("insufficient balance")
238214 else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), newBalance)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), amount, unit)]))
239215 }
240216
241217
242218
243219 @Callable(i)
244220 func voteCommit (item,hash) = {
245221 let user = toBase58String(i.caller.bytes)
246222 let commits = getValueCommitsCount(item)
247223 let status = getValueItemStatus(item)
248224 if ((commits >= VOTERS))
249225 then throw("reached max num of vouters")
250226 else if ((getValueCommit(item, user) != NONE))
251227 then throw("user has allready participated")
252228 else if ((getKeyItemSupplier(item) == NONE))
253229 then throw("item dose not exist")
254230 else if (if ((status != NONE))
255231 then (status != VOTING)
256232 else false)
257233 then throw("vouting is not posible")
258234 else WriteSet([DataEntry(getKeyCommit(item, user), hash), DataEntry(getKeyCommitsCount(item), (commits + 1)), DataEntry(getKeyItemStatus(item), if ((commits == VOTERS))
259235 then REVEAL
260236 else VOTING)])
261237 }
262238
263239
264240
265241 @Callable(i)
266242 func voteReveal (item,vote,salt) = {
267243 let user = toBase58String(i.caller.bytes)
268244 let status = getValueItemStatus(item)
269245 let newVoteCount = getValueVouteCount(item, vote)
270246 if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user)))
271247 then throw("reveal data is not valid")
272248 else if ((VOTERS > getValueCommitsCount(item)))
273249 then throw("max num of hasn't reached yet")
274250 else if ((getValueReveal(item, user) != NONE))
275251 then throw("user has already participated")
276252 else if (if ((status != VOTING))
277253 then (status != REVEAL)
278254 else false)
279255 then throw("wrong status")
280256 else if (if ((vote != FEATURED))
281257 then (vote != DELISTED)
282258 else false)
283259 then throw("wrong vote")
284260 else if (if ((status == FEATURED))
285261 then true
286262 else (status == DELISTED))
287263 then throw("vote has finished")
288264 else WriteSet([DataEntry(getKeyReveal(item, user), vote), DataEntry(getKeyVoteCount(item, vote), newVoteCount), DataEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM))
289265 then vote
290266 else REVEAL)])
291267 }
292268
293269
294270 @Verifier(tx)
295271 func verify () = {
296272 let alice1 = sigVerify(tx.bodyBytes, tx.proofs[0], allicePubkey)
297273 let alice2 = sigVerify(tx.bodyBytes, tx.proofs[1], allicePubkey)
298274 let alice3 = sigVerify(tx.bodyBytes, tx.proofs[2], allicePubkey)
299275 let bob1 = sigVerify(tx.bodyBytes, tx.proofs[0], bobPubkey)
300276 let bob2 = sigVerify(tx.bodyBytes, tx.proofs[1], bobPubkey)
301277 let bob3 = sigVerify(tx.bodyBytes, tx.proofs[2], bobPubkey)
302278 let cooper1 = sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubkey)
303279 let copper2 = sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubkey)
304280 let copper3 = sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubkey)
305281 let alliceAndBob = if (if (if (if (if (if (alice1)
306282 then bob2
307283 else false)
308284 then true
309285 else if (alice1)
310286 then bob3
311287 else false)
312288 then true
313289 else if (alice2)
314290 then bob1
315291 else false)
316292 then true
317293 else if (alice2)
318294 then bob3
319295 else false)
320296 then true
321297 else if (alice3)
322298 then bob1
323299 else false)
324300 then true
325301 else if (alice3)
326302 then bob2
327303 else false
328304 let alliceAndCooper = if (if (if (if (if (if (alice1)
329305 then copper2
330306 else false)
331307 then true
332308 else if (alice1)
333309 then copper3
334310 else false)
335311 then true
336312 else if (alice2)
337313 then cooper1
338314 else false)
339315 then true
340316 else if (alice2)
341317 then copper3
342318 else false)
343319 then true
344320 else if (alice3)
345321 then cooper1
346322 else false)
347323 then true
348324 else if (alice3)
349325 then copper2
350326 else false
351327 let bobeAndCooper = if (if (if (if (if (if (cooper1)
352328 then bob2
353329 else false)
354330 then true
355331 else if (cooper1)
356332 then bob3
357333 else false)
358334 then true
359335 else if (copper2)
360336 then bob1
361337 else false)
362338 then true
363339 else if (copper2)
364340 then bob3
365341 else false)
366342 then true
367343 else if (copper3)
368344 then bob1
369345 else false)
370346 then true
371347 else if (copper3)
372348 then bob2
373349 else false
374350 match tx {
375351 case d: SetScriptTransaction =>
376352 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublickey)
377353 case d: DataTransaction =>
378354 true
379355 case _ =>
380356 if (if (alliceAndBob)
381357 then true
382358 else alliceAndCooper)
383359 then true
384360 else bobeAndCooper
385361 }
386362 }
387363

github/deemru/w8io/169f3d6 
56.14 ms