tx · 6KHFVaNueH8uFxiXHAc84mvqg6CGr7vbETFCh5sAvVwj

3Mu8XbQMWkzpp7bPBTjpfJAsr6BZRGkJ7DJ:  -0.01400000 Waves

2019.09.08 14:12 [667024] smart account 3Mu8XbQMWkzpp7bPBTjpfJAsr6BZRGkJ7DJ > SELF 0.00000000 Waves

{ "type": 13, "id": "6KHFVaNueH8uFxiXHAc84mvqg6CGr7vbETFCh5sAvVwj", "fee": 1400000, "feeAssetId": null, "timestamp": 1567941201319, "version": 1, "sender": "3Mu8XbQMWkzpp7bPBTjpfJAsr6BZRGkJ7DJ", "senderPublicKey": "9hAjKAPiZsttXfKLFXed8BFDtedqe2KVibkhFNmkkvoH", "proofs": [ "2kRJKsDXY82UVAK9jm3rTNML7bAfZvGVVs6mTjFKJVGHMzgnLHiUdEExYcyV9SzbTQVDY2tiqtqbo2rChxrduofq" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAAOcmV2ZWFsRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAABwEAAAAKaGFzaFN0cmluZwAAAAEAAAAEZGF0YQQAAAAGcmVzdWx0CQACWgAAAAEJAAH3AAAAAQkAAZsAAAABBQAAAARkYXRhBQAAAAZyZXN1bHQBAAAACWFkZFRvTGlzdAAAAAIAAAAEbGlzdAAAAAl3aGF0VG9BZGQDCQAAAAAAAAIJAASzAAAAAgUAAAAEbGlzdAUAAAAJd2hhdFRvQWRkAP//////////CQABLAAAAAIJAAEsAAAAAgUAAAAEbGlzdAIAAAABIAUAAAAJd2hhdFRvQWRkBQAAAARsaXN0AQAAAA5yZW1vdmVGcm9tTGlzdAAAAAIAAAAEbGlzdAAAAAx3aGF0VG9SZW1vdmUEAAAAA2lkeAkABLMAAAACBQAAAARsaXN0BQAAAAx3aGF0VG9SZW1vdmUEAAAABnJlc3VsdAMJAQAAAAlpc0RlZ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3JpcHRUcmFuc2ZlcgAAAAMFAAAACndpbm5lckFkZHIFAAAACWxvdEFtb3VudAUAAAAIbG90QXNzZXQFAAAAA25pbAAAAADbDrqJ", "chainId": 84, "height": 667024, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let maxAuctionDuration = (1440 * 30)
5+
6+let revealDuration = (1440 * 7)
7+
8+func hashString (data) = {
9+ let result = toBase64String(sha256(toBytes(data)))
10+ result
11+ }
12+
13+
14+func addToList (list,whatToAdd) = if ((indexOf(list, whatToAdd) == -1))
15+ then ((list + " ") + whatToAdd)
16+ else list
17+
18+
19+func removeFromList (list,whatToRemove) = {
20+ let idx = indexOf(list, whatToRemove)
21+ let result = if (isDefined(idx))
22+ then (take(list, value(idx)) + takeRight(list, (value(idx) + size(whatToRemove))))
23+ else list
24+ result
25+ }
26+
27+
28+@Callable(i)
29+func startAuction (duration,startPrice,priceAssetId,deposit) = {
30+ let auctionId = toBase58String(i.transactionId)
31+ let revealStart = (lastBlock.height + duration)
32+ let closingStart = (revealStart + revealDuration)
33+ let organizer = toBase58String(i.caller.bytes)
34+ let organizerKey = (organizer + "_organizer")
35+ let maybeOrganizerList = getString(this, organizerKey)
36+ let organizerList = if (isDefined(maybeOrganizerList))
37+ then value(maybeOrganizerList)
38+ else ""
39+ let newOrganizerList = ((organizerList + " ") + auctionId)
40+ let pmt = extract(i.payment)
41+ if ((duration > maxAuctionDuration))
42+ then throw(("Duration is too long. Must be less than " + toString(maxAuctionDuration)))
43+ else if (!(isDefined(pmt.assetId)))
44+ then throw("Payment currency should not be in WAVES")
45+ else if ((pmt.amount != 1))
46+ then throw("Payment amount should be only one NFT")
47+ else if ((0 >= startPrice))
48+ then throw("Start price should be > 0")
49+ else if ((startPrice >= deposit))
50+ then throw((("Start price should be < deposit (" + toString(deposit)) + ")"))
51+ else if ((0 >= duration))
52+ then throw("Duration should be > 0")
53+ else WriteSet([DataEntry((auctionId + "_reveal_start"), revealStart), DataEntry((auctionId + "_closing_start"), closingStart), DataEntry((auctionId + "_deposit"), deposit), DataEntry((auctionId + "_unrevealed_count"), 0), DataEntry((auctionId + "_top_price"), 0), DataEntry((auctionId + "_second_price"), 0), DataEntry((auctionId + "_settle"), false), DataEntry((auctionId + "_organizer"), organizer), DataEntry((auctionId + "_lot_assetId"), if (isDefined(pmt.assetId))
54+ then toBase58String(value(pmt.assetId))
55+ else "WAVES"), DataEntry((auctionId + "_lot_amount"), pmt.amount), DataEntry((auctionId + "_startPrice"), startPrice), DataEntry((auctionId + "_priceAssetId"), priceAssetId), DataEntry((auctionId + "_top_price"), startPrice), DataEntry((auctionId + "_second_price"), startPrice), DataEntry(organizerKey, newOrganizerList), DataEntry("test", hashString(("123" + toString(startPrice))))])
56+ }
57+
58+
59+
60+@Callable(i)
61+func bid (auctionId,hashBidAmount) = {
62+ let pmt = extract(i.payment)
63+ let pmtAssetIdStr = if (isDefined(pmt.assetId))
64+ then toBase58String(value(pmt.assetId))
65+ else "WAVES"
66+ let callerAddressStr = toBase58String(i.caller.bytes)
67+ let endHeight = getIntegerValue(this, (auctionId + "_reveal_start"))
68+ let startPrice = getIntegerValue(this, (auctionId + "_startPrice"))
69+ let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
70+ let organizer = getStringValue(this, (auctionId + "_organizer"))
71+ let deposit = getIntegerValue(this, (auctionId + "_deposit"))
72+ let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
73+ let bidder = getString(this, (callerAddressStr + "_bidder"))
74+ let bidFromTheSameUser = isDefined(getString(this, ((auctionId + callerAddressStr) + "_bid_hash")))
75+ if ((callerAddressStr == organizer))
76+ then throw("Organizer can not bid")
77+ else if ((lastBlock.height >= endHeight))
78+ then throw("Auction already finished")
79+ else if (if (!(bidFromTheSameUser))
80+ then (priceAssetId != pmtAssetIdStr)
81+ else false)
82+ then throw((("Bid must be in asset '" + priceAssetId) + "'"))
83+ else if (!(isDefined(organizer)))
84+ then throw("Organizer should be defined")
85+ else if (if (!(bidFromTheSameUser))
86+ then (pmt.amount != deposit)
87+ else false)
88+ then throw("Payment should be equel to deposit")
89+ else {
90+ let inc = if (bidFromTheSameUser)
91+ then 0
92+ else 1
93+ WriteSet([DataEntry(((auctionId + callerAddressStr) + "_revealed"), false), DataEntry(((auctionId + callerAddressStr) + "_bid_hash"), hashBidAmount), DataEntry(((auctionId + callerAddressStr) + "_settle"), false), DataEntry((auctionId + "_unrevealed_count"), (unrevealedCount + inc)), DataEntry((callerAddressStr + "_bidder"), (((if (isDefined(bidder))
94+ then value(bidder)
95+ else "") + " ") + auctionId))])
96+ }
97+ }
98+
99+
100+
101+@Callable(i)
102+func reveal (auctionId,bidAmount,salt) = {
103+ let callerAddressStr = toBase58String(i.caller.bytes)
104+ let organizer = getStringValue(this, (auctionId + "_organizer"))
105+ let bidHash = getStringValue(this, ((auctionId + callerAddressStr) + "_bid_hash"))
106+ let revealed = getBooleanValue(this, ((auctionId + callerAddressStr) + "_revealed"))
107+ let revealStart = getIntegerValue(this, (auctionId + "_reveal_start"))
108+ let closingStart = getIntegerValue(this, (auctionId + "_closing_start"))
109+ let oldTopPrice = getIntegerValue(this, (auctionId + "_top_price"))
110+ let oldSecondPrice = getIntegerValue(this, (auctionId + "_second_price"))
111+ let winner = getString(this, (auctionId + "_winner"))
112+ let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
113+ let bidAmountAsStr = toString(bidAmount)
114+ let stringToHash = (salt + bidAmountAsStr)
115+ let hash = hashString(stringToHash)
116+ if (!(isDefined(organizer)))
117+ then throw("Organizer is not defined")
118+ else if (!(isDefined(bidHash)))
119+ then throw("Bid is not defined")
120+ else if (if ((revealStart > lastBlock.height))
121+ then true
122+ else (lastBlock.height > closingStart))
123+ then throw(((((("Auction should be revealed between reveal (" + toString(revealStart)) + ") and closing (") + toString(closingStart)) + ") time, now is ") + toString(lastBlock.height)))
124+ else if ((hash != bidHash))
125+ then throw("Bid hash from bidMount and sault is not equel with hash from the caller bid")
126+ else if ((revealed == true))
127+ then throw("The bid has been already revealed")
128+ else {
129+ let newTopPrice = if ((bidAmount > oldTopPrice))
130+ then bidAmount
131+ else oldTopPrice
132+ let newSecondPrice = if ((oldTopPrice == 0))
133+ then newTopPrice
134+ else if ((bidAmount > oldTopPrice))
135+ then oldTopPrice
136+ else if ((bidAmount > oldSecondPrice))
137+ then bidAmount
138+ else oldSecondPrice
139+ let newWinner = if ((bidAmount > newTopPrice))
140+ then callerAddressStr
141+ else if (isDefined(winner))
142+ then value(winner)
143+ else callerAddressStr
144+ WriteSet([DataEntry((auctionId + "_top_price"), newTopPrice), DataEntry((auctionId + "_second_price"), newSecondPrice), DataEntry((auctionId + "_winner"), newWinner), DataEntry(((auctionId + callerAddressStr) + "_revealed"), true), DataEntry((auctionId + "_unrevealed_count"), (unrevealedCount - 1))])
145+ }
146+ }
147+
148+
149+
150+@Callable(i)
151+func withdraw (auctionId) = {
152+ let pmt = i.payment
153+ let callerAddressStr = toBase58String(i.caller.bytes)
154+ let closingStart = getIntegerValue(this, (auctionId + "_closing_start"))
155+ let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count"))
156+ let organizer = getStringValue(this, (auctionId + "_organizer"))
157+ let revealTime = getIntegerValue(this, (auctionId + "_reveal_start"))
158+ let winner = getString(this, (auctionId + "_winner"))
159+ let lotAssetId = getStringValue(this, (auctionId + "_lot_assetId"))
160+ let lotAmount = getIntegerValue(this, (auctionId + "_lot_amount"))
161+ let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
162+ let settle = getBooleanValue(this, (auctionId + "_settle"))
163+ let secondPrice = getIntegerValue(this, (auctionId + "_second_price"))
164+ let deposit = getIntegerValue(this, (auctionId + "_deposit"))
165+ let lotAsset = if ((lotAssetId == "WAVES"))
166+ then unit
167+ else fromBase58String(lotAssetId)
168+ let priceAsset = if (if ((priceAssetId == "WAVES"))
169+ then true
170+ else (priceAssetId == ""))
171+ then unit
172+ else fromBase58String(priceAssetId)
173+ if (!(isDefined(organizer)))
174+ then throw("Organizer shoud exist")
175+ else if (if ((closingStart > (revealTime - lastBlock.height)))
176+ then (unrevealedCount != 0)
177+ else false)
178+ then throw("Its too early to withdraw")
179+ else if (if ((callerAddressStr == organizer))
180+ then true
181+ else (callerAddressStr == winner))
182+ then if ((settle == true))
183+ then throw("Illegal state, settle shoould be false")
184+ else if (!(isDefined(winner)))
185+ then if (isDefined(getString(this, (auctionId + "_lot_passed"))))
186+ then throw("Organizer has already got his lot back")
187+ else {
188+ let organizerAddr = addressFromStringValue(value(organizer))
189+ ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(organizerAddr, lotAmount, lotAsset)]))
190+ }
191+ else {
192+ let winnerAddr = addressFromStringValue(value(winner))
193+ let organizerAddr = addressFromStringValue(value(organizer))
194+ ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry(((auctionId + value(winner)) + "_settle"), true), DataEntry((value(winner) + "_bidder"), removeFromList(getStringValue(this, (value(winner) + "_bidder")), auctionId)), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(organizerAddr, secondPrice, priceAsset), ScriptTransfer(winnerAddr, lotAmount, lotAsset), ScriptTransfer(winnerAddr, (deposit - secondPrice), priceAsset)]))
195+ }
196+ else {
197+ let maybeLocalSettle = getBooleanValue(this, ((auctionId + callerAddressStr) + "_settle"))
198+ let localSettle = if (isDefined(maybeLocalSettle))
199+ then (value(maybeLocalSettle) == true)
200+ else false
201+ if (localSettle)
202+ then throw("Illegal state, settle shoould be false")
203+ else ScriptResult(WriteSet([DataEntry(((auctionId + callerAddressStr) + "_settle"), true), DataEntry((callerAddressStr + "_bidder"), removeFromList(getStringValue(this, (callerAddressStr + "_bidder")), auctionId))]), TransferSet([ScriptTransfer(i.caller, deposit, priceAsset)]))
204+ }
205+ }
206+
207+
208+
209+@Callable(i)
210+func instantBuy (auctionId) = {
211+ let pmt = extract(i.payment)
212+ let pmtAssetIdStr = if (isDefined(pmt.assetId))
213+ then toBase58String(value(pmt.assetId))
214+ else "WAVES"
215+ let callerAddressStr = toBase58String(i.caller.bytes)
216+ let lotAssetId = getStringValue(this, (auctionId + "_lot_assetId"))
217+ let priceAssetId = getStringValue(this, (auctionId + "_priceAssetId"))
218+ let deposit = getIntegerValue(this, (auctionId + "_deposit"))
219+ let settle = getBooleanValue(this, (auctionId + "_settle"))
220+ let organizer = getStringValue(this, (auctionId + "_organizer"))
221+ let endHeight = getIntegerValue(this, (auctionId + "_reveal_start"))
222+ if ((lastBlock.height >= endHeight))
223+ then throw("Only avialible diring budding phase")
224+ else if (if ((pmtAssetIdStr != priceAssetId))
225+ then true
226+ else (pmt.amount != deposit))
227+ then throw("Invalid payment")
228+ else if (settle)
229+ then throw("Already settled")
230+ else {
231+ let winner = callerAddressStr
232+ let organizerAddr = addressFromStringValue(value(organizer))
233+ let winnerAddr = addressFromStringValue(value(winner))
234+ let lotAmount = getIntegerValue(this, (auctionId + "_lot_amount"))
235+ let lotAsset = if ((lotAssetId == "WAVES"))
236+ then unit
237+ else fromBase58String(lotAssetId)
238+ ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry(((auctionId + value(winner)) + "_settle"), true), DataEntry((value(winner) + "_bidder"), removeFromList(getStringValue(this, (value(winner) + "_bidder")), auctionId)), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(organizerAddr, deposit, pmt.assetId), ScriptTransfer(winnerAddr, lotAmount, lotAsset)]))
239+ }
240+ }
241+
242+

github/deemru/w8io/169f3d6 
30.31 ms