tx · ALGV1coJFBbDoPLC3wdakEXPHegc8UqaEBwiDQfawFF2 3MrtCAwzpyGd4gHfZvRRc3n3vJBceDLL7kg: -0.01400000 Waves 2019.08.26 20:09 [648411] smart account 3MrtCAwzpyGd4gHfZvRRc3n3vJBceDLL7kg > SELF 0.00000000 Waves
{ "type": 13, "id": "ALGV1coJFBbDoPLC3wdakEXPHegc8UqaEBwiDQfawFF2", "fee": 1400000, "feeAssetId": null, "timestamp": 1566839342664, "version": 1, "sender": "3MrtCAwzpyGd4gHfZvRRc3n3vJBceDLL7kg", "senderPublicKey": "Cr8RLkR22KKA9JwqQGzjSzFMDsKRxBMqT6Lj7KYd7ca8", "proofs": [ "2gQNFPHuL3oGQY2UAy83ZcTtnD4PcXfrcenmBNE5SizbEzaZSTH7CKSPwhwb3P3tDur5AsHg4Ljd7iAtgJEDxk8q" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAAOcmV2ZWFsRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAABwEAAAAKaGFzaFN0cmluZwAAAAEAAAAEZGF0YQQAAAAGcmVzdWx0CQACWgAAAAEJAAH3AAAAAQkAAZsAAAABBQAAAARkYXRhBQAAAAZyZXN1bHQBAAAACWFkZFRvTGlzdAAAAAIAAAAEbGlzdAAAAAl3aGF0VG9BZGQDCQAAAAAAAAIJAASzAAAAAgUAAAAEbGlzdAUAAAAJd2hhdFRvQWRkAP//////////CQABLAAAAAIJAAEsAAAAAgUAAAAEbGlzdAIAAAABIAUAAAAJd2hhdFRvQWRkBQAAAARsaXN0AQAAAA5yZW1vdmVGcm9tTGlzdAAAAAIAAAAEbGlzdAAAAAx3aGF0VG9SZW1vdmUEAAAAA2lkeAkABLMAAAACBQAAAARsaXN0BQAAAAx3aGF0VG9SZW1vdmUEAAAABnJlc3VsdAMJAQAAAAlpc0RlZmluZWQAA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AAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAdkZXBvc2l0BQAAAApwcmljZUFzc2V0BQAAAANuaWwAAAAA4YKOZQ==", "chainId": 84, "height": 648411, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
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(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 ((lastBlock.height >= endHeight)) | |
76 | + | then throw("Auction already finished") | |
77 | + | else if (if (!(bidFromTheSameUser)) | |
78 | + | then (priceAssetId != pmtAssetIdStr) | |
79 | + | else false) | |
80 | + | then throw((("Bid must be in asset '" + priceAssetId) + "'")) | |
81 | + | else if (!(isDefined(organizer))) | |
82 | + | then throw("Organizer should be defined") | |
83 | + | else if (if (!(bidFromTheSameUser)) | |
84 | + | then (pmt.amount != deposit) | |
85 | + | else false) | |
86 | + | then throw("Payment should be equel to deposit") | |
87 | + | else { | |
88 | + | let inc = if (bidFromTheSameUser) | |
89 | + | then 0 | |
90 | + | else 1 | |
91 | + | 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)) | |
92 | + | then value(bidder) | |
93 | + | else "") + " ") + auctionId))]) | |
94 | + | } | |
95 | + | } | |
96 | + | ||
97 | + | ||
98 | + | ||
99 | + | @Callable(i) | |
100 | + | func reveal (auctionId,bidAmount,salt) = { | |
101 | + | let callerAddressStr = toBase58String(i.caller.bytes) | |
102 | + | let organizer = getStringValue(this, (auctionId + "_organizer")) | |
103 | + | let bidHash = getStringValue(this, ((auctionId + callerAddressStr) + "_bid_hash")) | |
104 | + | let revealed = getBooleanValue(this, ((auctionId + callerAddressStr) + "_revealed")) | |
105 | + | let revealStart = getIntegerValue(this, (auctionId + "_reveal_start")) | |
106 | + | let closingStart = getIntegerValue(this, (auctionId + "_closing_start")) | |
107 | + | let oldTopPrice = getIntegerValue(this, (auctionId + "_top_price")) | |
108 | + | let oldSecondPrice = getIntegerValue(this, (auctionId + "_second_price")) | |
109 | + | let winner = getString(this, (auctionId + "_winner")) | |
110 | + | let unrevealedCount = getIntegerValue(this, (auctionId + "_unrevealed_count")) | |
111 | + | let bidAmountAsStr = toString(bidAmount) | |
112 | + | let stringToHash = (salt + bidAmountAsStr) | |
113 | + | let hash = hashString(stringToHash) | |
114 | + | if (!(isDefined(organizer))) | |
115 | + | then throw("Organizer is not defined") | |
116 | + | else if (!(isDefined(bidHash))) | |
117 | + | then throw("Bid is not defined") | |
118 | + | else if (if ((revealStart > lastBlock.height)) | |
119 | + | then true | |
120 | + | else (lastBlock.height > closingStart)) | |
121 | + | then throw(((((("Auction should be revealed between reveal (" + toString(revealStart)) + ") and closing (") + toString(closingStart)) + ") time, now is ") + toString(lastBlock.height))) | |
122 | + | else if (isDefined(i.payment)) | |
123 | + | then throw("Payment shoud not exist") | |
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(pmt)) | |
174 | + | then throw("Payment shoud not exist") | |
175 | + | else if (!(isDefined(organizer))) | |
176 | + | then throw("Organizer shoud exist") | |
177 | + | else if (if ((closingStart > (revealTime - lastBlock.height))) | |
178 | + | then (unrevealedCount != 0) | |
179 | + | else false) | |
180 | + | then throw("Its too early to withdraw") | |
181 | + | else if (if ((callerAddressStr == organizer)) | |
182 | + | then true | |
183 | + | else (callerAddressStr == winner)) | |
184 | + | then if ((settle == true)) | |
185 | + | then throw("Illegal state, settle shoould be false") | |
186 | + | else if (!(isDefined(winner))) | |
187 | + | then if (isDefined(getString(this, (auctionId + "_lot_passed")))) | |
188 | + | then throw("Organizer has already got his lot back") | |
189 | + | else { | |
190 | + | let organizerAddr = addressFromStringValue(value(organizer)) | |
191 | + | ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry((organizer + "_organizer"), removeFromList(getStringValue(this, (organizer + "_organizer")), auctionId))]), TransferSet([ScriptTransfer(organizerAddr, lotAmount, lotAsset)])) | |
192 | + | } | |
193 | + | else { | |
194 | + | let winnerAddr = addressFromStringValue(value(winner)) | |
195 | + | let organizerAddr = addressFromStringValue(value(organizer)) | |
196 | + | 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)])) | |
197 | + | } | |
198 | + | else if ((settle == true)) | |
199 | + | then throw("Illegal state, settle shoould be false") | |
200 | + | else ScriptResult(WriteSet([DataEntry((auctionId + "_settle"), true), DataEntry(((auctionId + callerAddressStr) + "_settle"), true), DataEntry((callerAddressStr + "_bidder"), removeFromList(getStringValue(this, (callerAddressStr + "_bidder")), auctionId))]), TransferSet([ScriptTransfer(i.caller, deposit, priceAsset)])) | |
201 | + | } | |
202 | + | ||
203 | + |
github/deemru/w8io/169f3d6 22.79 ms ◑