tx · QwWQ9G7YsaUpm38hQcbf8vUzWN87ZeuyRu4rpQN8kUV

3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt:  -0.05000000 Waves

2019.08.16 22:14 [634048] smart account 3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt > SELF 0.00000000 Waves

{ "type": 13, "id": "QwWQ9G7YsaUpm38hQcbf8vUzWN87ZeuyRu4rpQN8kUV", "fee": 5000000, "feeAssetId": null, "timestamp": 1565982669736, "version": 1, "sender": "3NB6ViLiZv3r5EdQ2Q8GA8GKpuwmG3zevAt", "senderPublicKey": "3ghbp6Z5eXoKniLSE8XPjn5od7gT1K7qhk6zANBhv9C3", "proofs": [ "47RHJWbyH3rYjk5srh5ThXaoXU6SxkaVPc4fLjKwqSSJMDf2PkZuRL2a7fv7X3p2C5insWXaK7guPTGwmC4J1FQr" ], "script": "base64:AAIDAAAAAAAAAAAAAAAlAAAAAA5vd25lclB1YmxpY2tleQEAAAAgJ+LupRtywYm1DtC2wa7+mcHTm1BkasCvRteam1vswWgAAAAADGFsbGljZVB1YmtleQEAAAAgdahQG7OF8VCvnmrXif7UUhoQjaCrm/2hFDfEk/59nDEAAAAACWJvYlB1YmtleQEAAAAgoHwmi+qXZSlN20yTARZQ9O8s6pUs/3qey7EnxhpjMk8AAAAADGNvb3BlclB1YmtleQEAAAAgU/w5K0kRwpKzXSOUcyJ72drbib04bPq1q9XqkXENjioAAAAABE5PTkUCAAAABG5vbmUAAAAABlZPVEVSUwAAAAAAAAAAAwAAAAAGUVVPUlVNAAAAAAAAAAACAAAAAAZWT1RJTkcCAAAABnZvdGluZwAAAAAGUkVWRUFMAgAAAAZyZXZlYWwAAAAACEZFQVRVUkVEAgAAAAhmZWF0dXJlZAAAAAAIREVMSVNURUQCAAAACGRlbGlzdGVkAAAAAAh2ZXJpZmllcgIAAAAjM01zOXNVYjdXM0w1NUxMR3hlSFdpcWdUZmRIOXluMm1heWIAAAAACFZFUklGSUVEAgAAAAh2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djb3BwZXIyBwQAAAANYm9iZUFuZENvb3BlcgMDAwMDAwUAAAAHY29vcGVyMQUAAAAEYm9iMgcGAwUAAAAHY29vcGVyMQUAAAAEYm9iMwcGAwUAAAAHY29wcGVyMgUAAAAEYm9iMQcGAwUAAAAHY29wcGVyMgUAAAAEYm9iMwcGAwUAAAAHY29wcGVyMwUAAAAEYm9iMQcGAwUAAAAHY29wcGVyMwUAAAAEYm9iMgcEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAADm93bmVyUHVibGlja2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwMFAAAADGFsbGljZUFuZEJvYgYFAAAAD2FsbGljZUFuZENvb3BlcgYFAAAADWJvYmVBbmRDb29wZXKUXSYu", "chainId": 84, "height": 634048, "spentComplexity": 0 } View: original | compacted Prev: 7cZihdB6jum9cwmofEsk1q9K5juMWRe9d7QFZ5hhxtYo Next: E9mRHv82fimc1iEFHocqtEv4TAUfM4TPFTV9v65zWmvZ Diff:
OldNewDifferences
123123 else WriteSet([DataEntry(auctionId, endHeight), DataEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
124124 then toBase58String(value(pmt.assetId))
125125 else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId)])
126+ }
127+
128+
129+
130+@Callable(i)
131+func bid (auctionId) = {
132+ let pmt = extract(i.payment)
133+ let pmtAssetIdStr = if (isDefined(pmt.assetId))
134+ then toBase58String(value(pmt.assetId))
135+ else "WAVES"
136+ let callerAddressStr = toBase58String(i.caller.bytes)
137+ let endHeight = getIntegerValue(this, auctionId)
138+ let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
139+ let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
140+ let winAmount = getInteger(this, (auctionId + "_winAmount"))
141+ let winner = getString(this, (auctionId + "_winner"))
142+ let bidFromTheSameUser = if (isDefined(winner))
143+ then (value(winner) == callerAddressStr)
144+ else false
145+ let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
146+ then value(winAmount)
147+ else 0))
148+ if ((lastBlock.height >= endHeight))
149+ then throw("Auction already finished")
150+ else if ((priceAssetId != pmtAssetIdStr))
151+ then throw((("Bid must be in asset '" + priceAssetId) + "'"))
152+ else if (if (if (isDefined(winAmount))
153+ then (value(winAmount) >= totalBidAmount)
154+ else false)
155+ then true
156+ else if (!(isDefined(winAmount)))
157+ then (startPrice >= totalBidAmount)
158+ else false)
159+ then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
160+ then value(winAmount)
161+ else startPrice)))
162+ else if (if (bidFromTheSameUser)
163+ then true
164+ else !(isDefined(winner)))
165+ then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)])
166+ else {
167+ let previousBidderAddr = addressFromStringValue(value(winner))
168+ let priceAsset = if (if ((priceAssetId == "WAVES"))
169+ then true
170+ else (priceAssetId == ""))
171+ then unit
172+ else fromBase58String(priceAssetId)
173+ ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]))
174+ }
126175 }
127176
128177
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,priceAssetId) = {
118118 let auctionId = toBase58String(i.transactionId)
119119 let endHeight = (lastBlock.height + duration)
120120 let pmt = extract(i.payment)
121121 if ((duration > maxAuctionDuration))
122122 then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
123123 else WriteSet([DataEntry(auctionId, endHeight), DataEntry((auctionId + "_organizer"), toBase58String(i.caller.bytes)), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
124124 then toBase58String(value(pmt.assetId))
125125 else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId)])
126+ }
127+
128+
129+
130+@Callable(i)
131+func bid (auctionId) = {
132+ let pmt = extract(i.payment)
133+ let pmtAssetIdStr = if (isDefined(pmt.assetId))
134+ then toBase58String(value(pmt.assetId))
135+ else "WAVES"
136+ let callerAddressStr = toBase58String(i.caller.bytes)
137+ let endHeight = getIntegerValue(this, auctionId)
138+ let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
139+ let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
140+ let winAmount = getInteger(this, (auctionId + "_winAmount"))
141+ let winner = getString(this, (auctionId + "_winner"))
142+ let bidFromTheSameUser = if (isDefined(winner))
143+ then (value(winner) == callerAddressStr)
144+ else false
145+ let totalBidAmount = (pmt.amount + (if (bidFromTheSameUser)
146+ then value(winAmount)
147+ else 0))
148+ if ((lastBlock.height >= endHeight))
149+ then throw("Auction already finished")
150+ else if ((priceAssetId != pmtAssetIdStr))
151+ then throw((("Bid must be in asset '" + priceAssetId) + "'"))
152+ else if (if (if (isDefined(winAmount))
153+ then (value(winAmount) >= totalBidAmount)
154+ else false)
155+ then true
156+ else if (!(isDefined(winAmount)))
157+ then (startPrice >= totalBidAmount)
158+ else false)
159+ then throw(("Bid must be more then " + toString(if (isDefined(winAmount))
160+ then value(winAmount)
161+ else startPrice)))
162+ else if (if (bidFromTheSameUser)
163+ then true
164+ else !(isDefined(winner)))
165+ then WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)])
166+ else {
167+ let previousBidderAddr = addressFromStringValue(value(winner))
168+ let priceAsset = if (if ((priceAssetId == "WAVES"))
169+ then true
170+ else (priceAssetId == ""))
171+ then unit
172+ else fromBase58String(priceAssetId)
173+ ScriptResult(WriteSet([DataEntry((auctionId + "_winner"), callerAddressStr), DataEntry((auctionId + "_winAmount"), totalBidAmount)]), TransferSet([ScriptTransfer(previousBidderAddr, value(winAmount), priceAsset)]))
174+ }
126175 }
127176
128177
129178
130179 @Callable(i)
131180 func purchase (item) = {
132181 let pmt = extract(i.payment)
133182 if (isDefined(pmt.assetId))
134183 then throw("can use Waves only at the moment")
135184 else {
136185 let userAddress = toBase58String(i.caller.bytes)
137186 let price = getValueItemPrice(item)
138187 let supplierAddress = getValueItemSupplier(item)
139188 if ((price > pmt.amount))
140189 then throw("purchase amount cannot be less than item price")
141190 else if ((pmt.amount > price))
142191 then throw("purchase amount cannot be higher than item price")
143192 else if ((supplierAddress == NONE))
144193 then throw("supplier is not exist")
145194 else WriteSet([DataEntry(getKeyUserItemCounter(userAddress, item), (getValueUserItemCounter(userAddress, item) + 1)), DataEntry(getKeyBalanceSupplier(supplierAddress), (getValueBalanceSupplier(supplierAddress) + pmt.amount))])
146195 }
147196 }
148197
149198
150199
151200 @Callable(i)
152201 func addItem (title,price,data) = {
153202 let supplierAddress = toBase58String(i.caller.bytes)
154203 let item = getKeyItem(supplierAddress, title)
155204 if ((0 >= price))
156205 then throw("purchase amount cannot be less than item price")
157206 else if ((getValueItemSupplier(item) != NONE))
158207 then throw("An item is allready exist")
159208 else if ((supplierAddress == BLACKLISTED))
160209 then throw("supplier's account has been blacklist")
161210 else WriteSet([DataEntry(getKeyItemSupplier(item), supplierAddress), DataEntry(getKeyItemPrice(item), price), DataEntry(getKeyItemData(item), data)])
162211 }
163212
164213
165214
166215 @Callable(i)
167216 func deposit () = {
168217 let pmt = extract(i.payment)
169218 let supplierAddress = toBase58String(i.caller.bytes)
170219 let balance = getValueBalanceSupplier(supplierAddress)
171220 let newBalance = (balance + pmt.amount)
172221 if (isDefined(pmt.assetId))
173222 then throw("can hodl waves only at the moment")
174223 else if ((0 > pmt.amount))
175224 then throw("Can not deposit negative amount")
176225 else WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), newBalance)])
177226 }
178227
179228
180229
181230 @Callable(i)
182231 func withdraw (amount) = {
183232 let supplierAddress = toBase58String(i.caller.bytes)
184233 let balance = getValueBalanceSupplier(supplierAddress)
185234 let newBalance = (balance - amount)
186235 if ((0 > amount))
187236 then throw("Can not withdraw negative amount")
188237 else if ((0 > newBalance))
189238 then throw("not enough balance")
190239 else if ((0 >= balance))
191240 then throw("insufficient balance")
192241 else ScriptResult(WriteSet([DataEntry(getKeyBalanceSupplier(supplierAddress), newBalance)]), TransferSet([ScriptTransfer(addressFromStringValue(supplierAddress), amount, unit)]))
193242 }
194243
195244
196245
197246 @Callable(i)
198247 func voteCommit (item,hash) = {
199248 let user = toBase58String(i.caller.bytes)
200249 let commits = getValueCommitsCount(item)
201250 let status = getValueItemStatus(item)
202251 if ((commits >= VOTERS))
203252 then throw("reached max num of vouters")
204253 else if ((getValueCommit(item, user) != NONE))
205254 then throw("user has allready participated")
206255 else if ((getKeyItemSupplier(item) == NONE))
207256 then throw("item dose not exist")
208257 else if (if ((status != NONE))
209258 then (status != VOTING)
210259 else false)
211260 then throw("vouting is not posible")
212261 else WriteSet([DataEntry(getKeyCommit(item, user), hash), DataEntry(getKeyCommitsCount(item), (commits + 1)), DataEntry(getKeyItemStatus(item), if ((commits == VOTERS))
213262 then REVEAL
214263 else VOTING)])
215264 }
216265
217266
218267
219268 @Callable(i)
220269 func voteReveal (item,vote,salt) = {
221270 let user = toBase58String(i.caller.bytes)
222271 let status = getValueItemStatus(item)
223272 let newVoteCount = getValueVouteCount(item, vote)
224273 if ((toBase58String(sha256(toBytes((vote + salt)))) != getValueCommit(item, user)))
225274 then throw("reveal data is not valid")
226275 else if ((VOTERS > getValueCommitsCount(item)))
227276 then throw("max num of hasn't reached yet")
228277 else if ((getValueReveal(item, user) != NONE))
229278 then throw("user has already participated")
230279 else if (if ((status != VOTING))
231280 then (status != REVEAL)
232281 else false)
233282 then throw("wrong status")
234283 else if (if ((vote != FEATURED))
235284 then (vote != DELISTED)
236285 else false)
237286 then throw("wrong vote")
238287 else if (if ((status == FEATURED))
239288 then true
240289 else (status == DELISTED))
241290 then throw("vote has finished")
242291 else WriteSet([DataEntry(getKeyReveal(item, user), vote), DataEntry(getKeyVoteCount(item, vote), newVoteCount), DataEntry(getKeyItemStatus(item), if ((newVoteCount >= QUORUM))
243292 then vote
244293 else REVEAL)])
245294 }
246295
247296
248297 @Verifier(tx)
249298 func verify () = {
250299 let alice1 = sigVerify(tx.bodyBytes, tx.proofs[0], allicePubkey)
251300 let alice2 = sigVerify(tx.bodyBytes, tx.proofs[1], allicePubkey)
252301 let alice3 = sigVerify(tx.bodyBytes, tx.proofs[2], allicePubkey)
253302 let bob1 = sigVerify(tx.bodyBytes, tx.proofs[0], bobPubkey)
254303 let bob2 = sigVerify(tx.bodyBytes, tx.proofs[1], bobPubkey)
255304 let bob3 = sigVerify(tx.bodyBytes, tx.proofs[2], bobPubkey)
256305 let cooper1 = sigVerify(tx.bodyBytes, tx.proofs[0], cooperPubkey)
257306 let copper2 = sigVerify(tx.bodyBytes, tx.proofs[1], cooperPubkey)
258307 let copper3 = sigVerify(tx.bodyBytes, tx.proofs[2], cooperPubkey)
259308 let alliceAndBob = if (if (if (if (if (if (alice1)
260309 then bob2
261310 else false)
262311 then true
263312 else if (alice1)
264313 then bob3
265314 else false)
266315 then true
267316 else if (alice2)
268317 then bob1
269318 else false)
270319 then true
271320 else if (alice2)
272321 then bob3
273322 else false)
274323 then true
275324 else if (alice3)
276325 then bob1
277326 else false)
278327 then true
279328 else if (alice3)
280329 then bob2
281330 else false
282331 let alliceAndCooper = if (if (if (if (if (if (alice1)
283332 then copper2
284333 else false)
285334 then true
286335 else if (alice1)
287336 then copper3
288337 else false)
289338 then true
290339 else if (alice2)
291340 then cooper1
292341 else false)
293342 then true
294343 else if (alice2)
295344 then copper3
296345 else false)
297346 then true
298347 else if (alice3)
299348 then cooper1
300349 else false)
301350 then true
302351 else if (alice3)
303352 then copper2
304353 else false
305354 let bobeAndCooper = if (if (if (if (if (if (cooper1)
306355 then bob2
307356 else false)
308357 then true
309358 else if (cooper1)
310359 then bob3
311360 else false)
312361 then true
313362 else if (copper2)
314363 then bob1
315364 else false)
316365 then true
317366 else if (copper2)
318367 then bob3
319368 else false)
320369 then true
321370 else if (copper3)
322371 then bob1
323372 else false)
324373 then true
325374 else if (copper3)
326375 then bob2
327376 else false
328377 match tx {
329378 case d: SetScriptTransaction =>
330379 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublickey)
331380 case d: DataTransaction =>
332381 true
333382 case _ =>
334383 if (if (alliceAndBob)
335384 then true
336385 else alliceAndCooper)
337386 then true
338387 else bobeAndCooper
339388 }
340389 }
341390

github/deemru/w8io/169f3d6 
79.27 ms