tx · 8WNFfa5SFP6PV1iRzgkFfzntnQ5DCrPv9vpivxNBV8tr 3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH: -0.01200000 Waves 2022.10.12 17:41 [2269271] smart account 3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH > SELF 0.00000000 Waves
{ "type": 13, "id": "8WNFfa5SFP6PV1iRzgkFfzntnQ5DCrPv9vpivxNBV8tr", "fee": 1200000, "feeAssetId": null, "timestamp": 1665585768733, "version": 2, "chainId": 84, "sender": "3MxssetYXJfiGwzo9pqChsSwYj3tCYq5FFH", "senderPublicKey": "46sMMaC9rMPQdyTE87RpcnevTY9oheuDqzfnuQzoyCtv", "proofs": [ "58VM1tkJ113bt5fSYciKxdB8tBCiXXFCEBvBFBks4A72iGynqfiQ7C8cHptFZX4KM9sTWq9c5PG2ixCueWC8vfZH" ], "script": "base64:AAIFAAAAAAAAACoIAhIJCgcBAQEBAQgBEgMKAQESAwoBCBIECgIBCBIFCgMBCAESBAoCARgAAAAlAQAAABFnZXRJbnRlZ2VyT3JUaHJvdwAAAAIAAAAHYWRkcmVzcwAAAANrZXkJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABBoAAAACBQAAAAdhZGRyZXNzBQAAAANrZXkJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADENhbid0IHJlYWQgJwUAAAADa2V5AgAAAA0nIGF0IGFkZHJlc3MgCQAEJQAAAAEFAAAAB2FkZHJlc3MBAAAAEGdldFN0cmluZ09yVGhyb3cAAAACAAAAB2FkZHJlc3MAAAADa2V5CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5CQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAxDYW4ndCByZWFkICcFAAAAA2tleQIAAAANJyBhdCBhZGRyZXNzIAkABCUAAAABBQAAAAdhZGRyZXNzAQAAABNnZXRJbnRlZ2VyT3JEZWZhdWx0A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MQAAAAIAAAACJGEAAAACJGkDCQAAZwAAAAIFAAAAAiRpBQAAAAIkcwUAAAACJGEJAQAAAApmb2xkUmVmdW5kAAAAAgUAAAACJGEJAAGRAAAAAgUAAAACJGwFAAAAAiRpCgEAAAAFJGYwXzIAAAACAAAAAiRhAAAAAiRpAwkAAGcAAAACBQAAAAIkaQUAAAACJHMFAAAAAiRhCQAAAgAAAAECAAAAFExpc3Qgc2l6ZSBleGNlZWRzIDEwCQEAAAAFJGYwXzIAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACCQEAAAAFJGYwXzEAAAACBQAAAAUkYWNjMAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAgAAAAAAAAAAAwAAAAAAAAAABAAAAAAAAAAABQAAAAAAAAAABgAAAAAAAAAABwAAAAAAAAAACAAAAAAAAAAACQAAAAAAAAAACgAAAADRGkku", "height": 2269271, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FrcFEPe3c2Q4biky73t689YDHHV4fk1sqFgRGE3hfddD Next: BkQcKRvjb3cSSd64XEifK2XrAtGYjJnxaJM6HrjTMaAK Diff:
Old | New | Differences | |
---|---|---|---|
211 | 211 | then (bidAmount > topBidAmount) | |
212 | 212 | else false) | |
213 | 213 | then { | |
214 | - | let newTopBids = [StringEntry(topKey, revealKey), StringEntry( | |
214 | + | let newTopBids = [StringEntry(topKey, revealKey), StringEntry(top2Key, ((topBidderKey + ",") + toString(topBidAmount)))] | |
215 | 215 | (revealBid ++ newTopBids) | |
216 | 216 | } | |
217 | 217 | else if (if (if ((top2BidAmount >= bidAmount)) | |
252 | 252 | let bidKey = key_bid(bidderHashKey) | |
253 | 253 | let revealKey = key_reveal(bidderHashKey) | |
254 | 254 | let revealedBid = getString(this, revealKey) | |
255 | - | let $ | |
255 | + | let $t089699264 = { | |
256 | 256 | let bidValues = split(valueOrErrorMessage(revealedBid, (("Bid with hash " + hash) + " not found")), ",") | |
257 | 257 | $Tuple3(parseIntValue(bidValues[0]), parseIntValue(bidValues[1]), bidValues[2]) | |
258 | 258 | } | |
259 | - | let deposit = $ | |
260 | - | let bid = $ | |
261 | - | let name = $ | |
259 | + | let deposit = $t089699264._1 | |
260 | + | let bid = $t089699264._2 | |
261 | + | let name = $t089699264._3 | |
262 | 262 | let topKey = key_top(name) | |
263 | 263 | let top2Key = key_top2(name) | |
264 | 264 | let winnerLink = valueOrErrorMessage(getString(this, topKey), "Auction winner has not been determined") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func getIntegerOrThrow (address,key) = valueOrErrorMessage(getInteger(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
5 | 5 | ||
6 | 6 | ||
7 | 7 | func getStringOrThrow (address,key) = valueOrErrorMessage(getString(address, key), ((("Can't read '" + key) + "' at address ") + toString(address))) | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func getIntegerOrDefault (address,key,default) = valueOrElse(getInteger(address, key), default) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | func parseIntOrThrow (maybeInt) = valueOrErrorMessage(parseInt(maybeInt), (("Can't parse integer from '" + maybeInt) + "'")) | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | func parseAddressOrThrow (maybeAddress) = valueOrErrorMessage(addressFromString(maybeAddress), (("Can't parse address from '" + maybeAddress) + "'")) | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | func parseIntOrDefault (maybeInt,default) = valueOrElse(parseInt(maybeInt), default) | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | func key_entity (name,pk,property) = ((((name + "_") + pk) + "_") + property) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | func key_top (name) = ("Top_" + name) | |
26 | 26 | ||
27 | 27 | ||
28 | 28 | func key_top2 (name) = ("Top2_" + name) | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | func key_bidderHash (auctionId,address,hash) = ((((auctionId + "_") + address) + "_") + hash) | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func key_bid (bidderHash) = ("Bid_" + bidderHash) | |
35 | 35 | ||
36 | 36 | ||
37 | 37 | func key_reveal (bidderHash) = ("Reveal_" + bidderHash) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | let key_initTimestamp = "initTimestamp" | |
41 | 41 | ||
42 | 42 | let key_bidDuration = "bidDuration" | |
43 | 43 | ||
44 | 44 | let key_revealDuration = "revealDuration" | |
45 | 45 | ||
46 | 46 | let key_errorFee = "errorFee" | |
47 | 47 | ||
48 | 48 | let key_minimalBid = "minimalBid" | |
49 | 49 | ||
50 | 50 | let key_registrarAddress = "registrarAddress" | |
51 | 51 | ||
52 | 52 | let key_nameMinimalLength = "nameMinimalLength" | |
53 | 53 | ||
54 | 54 | let auctionStart = getIntegerOrThrow(this, key_initTimestamp) | |
55 | 55 | ||
56 | 56 | let bidDuration = getIntegerOrThrow(this, key_bidDuration) | |
57 | 57 | ||
58 | 58 | let revealDuration = getIntegerOrThrow(this, key_revealDuration) | |
59 | 59 | ||
60 | 60 | let auctionDuration = (bidDuration + revealDuration) | |
61 | 61 | ||
62 | 62 | let errorFee = getIntegerOrThrow(this, key_errorFee) | |
63 | 63 | ||
64 | 64 | let minimalBid = getIntegerOrThrow(this, key_minimalBid) | |
65 | 65 | ||
66 | 66 | let nameMinimalLength = getIntegerOrThrow(this, key_nameMinimalLength) | |
67 | 67 | ||
68 | 68 | let registrarAddress = getStringOrThrow(this, key_registrarAddress) | |
69 | 69 | ||
70 | 70 | let registrar = parseAddressOrThrow(registrarAddress) | |
71 | 71 | ||
72 | 72 | func calcHash (name,amount) = toBase58String(blake2b256_16Kb(keccak256_16Kb((toBytes(name) + toBytes(amount))))) | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | let PHASE_BID = "BID" | |
76 | 76 | ||
77 | 77 | let PHASE_REVEAL = "REVEAL" | |
78 | 78 | ||
79 | 79 | func _getAuctionById (auctionId) = { | |
80 | 80 | let bidStart = (auctionStart + (auctionId * auctionDuration)) | |
81 | 81 | let revealStart = (bidStart + bidDuration) | |
82 | 82 | let auctionEnd = (revealStart + revealDuration) | |
83 | 83 | let phase = if ((lastBlock.timestamp > revealStart)) | |
84 | 84 | then PHASE_REVEAL | |
85 | 85 | else PHASE_BID | |
86 | 86 | $Tuple5(auctionId, phase, bidStart, revealStart, auctionEnd) | |
87 | 87 | } | |
88 | 88 | ||
89 | 89 | ||
90 | 90 | func getAuction () = { | |
91 | 91 | let auctionId = ((lastBlock.timestamp - auctionStart) / auctionDuration) | |
92 | 92 | _getAuctionById(auctionId) | |
93 | 93 | } | |
94 | 94 | ||
95 | 95 | ||
96 | 96 | func getAuctionPhase () = match getAuction() { | |
97 | 97 | case auction: (Int, String, Int, Int, Int) => | |
98 | 98 | let auctionId = auction._1 | |
99 | 99 | let phase = auction._2 | |
100 | 100 | $Tuple2(auctionId, phase) | |
101 | 101 | case _ => | |
102 | 102 | throw("Invalid auction info") | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 | ||
106 | 106 | func isCorrect (name) = { | |
107 | 107 | let available = match invoke(registrar, "available", [name], nil) { | |
108 | 108 | case a: Boolean => | |
109 | 109 | a | |
110 | 110 | case _ => | |
111 | 111 | throw("Unsupported result format (available)") | |
112 | 112 | } | |
113 | 113 | if (available) | |
114 | 114 | then (size(name) >= nameMinimalLength) | |
115 | 115 | else false | |
116 | 116 | } | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func isWinnable (name) = { | |
120 | 120 | let revealKey = getString(this, key_top(name)) | |
121 | 121 | if (!(isDefined(revealKey))) | |
122 | 122 | then true | |
123 | 123 | else { | |
124 | 124 | let currentAuction = getAuctionPhase()._1 | |
125 | 125 | let topAuctionId = split(value(revealKey), "_")[1] | |
126 | 126 | let auctionId = parseIntOrDefault(topAuctionId, 0) | |
127 | 127 | (auctionId == currentAuction) | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func isAvailable (name) = if (isCorrect(name)) | |
133 | 133 | then isWinnable(name) | |
134 | 134 | else false | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | @Callable(inv) | |
138 | 138 | func init (timestamp,bidDuration,revealDuration,errorFee,minimalBid,registrarAddress,nameMinimalLength) = if ((this != inv.caller)) | |
139 | 139 | then throw("only self calls are allowed") | |
140 | 140 | else [IntegerEntry(key_initTimestamp, timestamp), IntegerEntry(key_bidDuration, bidDuration), IntegerEntry(key_revealDuration, revealDuration), IntegerEntry(key_errorFee, errorFee), IntegerEntry(key_minimalBid, minimalBid), StringEntry(key_registrarAddress, registrarAddress), IntegerEntry(key_nameMinimalLength, nameMinimalLength)] | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(inv) | |
145 | 145 | func getAuctionById (auctionId) = $Tuple2(nil, _getAuctionById(auctionId)) | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | 149 | @Callable(inv) | |
150 | 150 | func available (name) = $Tuple2(nil, isAvailable(name)) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(inv) | |
155 | 155 | func bid (auctionId,hash) = { | |
156 | 156 | let pmt = if (if ((size(inv.payments) == 1)) | |
157 | 157 | then (inv.payments[0].assetId == unit) | |
158 | 158 | else false) | |
159 | 159 | then inv.payments[0].amount | |
160 | 160 | else throw("Single payment required") | |
161 | 161 | let address = toString(inv.caller) | |
162 | 162 | let bidKey = key_bid(key_bidderHash(toString(auctionId), address, hash)) | |
163 | 163 | let $t053715428 = getAuctionPhase() | |
164 | 164 | let currentAuctionId = $t053715428._1 | |
165 | 165 | let currentPeriod = $t053715428._2 | |
166 | 166 | if ((currentAuctionId != auctionId)) | |
167 | 167 | then throw("Auctions is already over") | |
168 | 168 | else if ((currentPeriod != PHASE_BID)) | |
169 | 169 | then throw("Bid period is over") | |
170 | 170 | else if (isDefined(getInteger(this, bidKey))) | |
171 | 171 | then throw("Bid with exact amount already presented") | |
172 | 172 | else [IntegerEntry(bidKey, pmt)] | |
173 | 173 | } | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | ||
177 | 177 | @Callable(inv) | |
178 | 178 | func reveal (auctionId,name,bidAmount) = { | |
179 | 179 | let address = toString(inv.caller) | |
180 | 180 | let hash = calcHash(name, bidAmount) | |
181 | 181 | let bidderHashKey = key_bidderHash(toString(auctionId), address, hash) | |
182 | 182 | let revealKey = key_reveal(bidderHashKey) | |
183 | 183 | let topKey = key_top(name) | |
184 | 184 | let top2Key = key_top2(name) | |
185 | 185 | let deposit = valueOrErrorMessage(getInteger(this, key_bid(bidderHashKey)), ("Bid doesn't exists " + hash)) | |
186 | 186 | let $t062086265 = getAuctionPhase() | |
187 | 187 | let currentAuctionId = $t062086265._1 | |
188 | 188 | let currentPeriod = $t062086265._2 | |
189 | 189 | if ((currentAuctionId != auctionId)) | |
190 | 190 | then throw("Auctions is already over") | |
191 | 191 | else if ((currentPeriod != PHASE_REVEAL)) | |
192 | 192 | then throw("Reveal period is over") | |
193 | 193 | else if (isDefined(getString(this, revealKey))) | |
194 | 194 | then throw("Bid is already revealed") | |
195 | 195 | else { | |
196 | 196 | let revealBid = [StringEntry(revealKey, ((((toString(deposit) + ",") + toString(bidAmount)) + ",") + name))] | |
197 | 197 | let topBidderRevealKey = getString(this, topKey) | |
198 | 198 | if (isDefined(topBidderRevealKey)) | |
199 | 199 | then { | |
200 | 200 | let topBidderKey = value(topBidderRevealKey) | |
201 | 201 | let topBidderData = value(getString(this, topBidderKey)) | |
202 | 202 | let topBidAmount = parseIntValue(split(topBidderData, ",")[1]) | |
203 | 203 | let top2BidderInfo = split(getStringOrThrow(this, top2Key), ",") | |
204 | 204 | let top2BidderKey = top2BidderInfo[0] | |
205 | 205 | let top2BidAmount = parseIntOrThrow(top2BidderInfo[1]) | |
206 | 206 | if (if (if (if ((bidAmount > minimalBid)) | |
207 | 207 | then (deposit >= bidAmount) | |
208 | 208 | else false) | |
209 | 209 | then isAvailable(name) | |
210 | 210 | else false) | |
211 | 211 | then (bidAmount > topBidAmount) | |
212 | 212 | else false) | |
213 | 213 | then { | |
214 | - | let newTopBids = [StringEntry(topKey, revealKey), StringEntry( | |
214 | + | let newTopBids = [StringEntry(topKey, revealKey), StringEntry(top2Key, ((topBidderKey + ",") + toString(topBidAmount)))] | |
215 | 215 | (revealBid ++ newTopBids) | |
216 | 216 | } | |
217 | 217 | else if (if (if ((top2BidAmount >= bidAmount)) | |
218 | 218 | then (top2BidderKey == topBidderKey) | |
219 | 219 | else false) | |
220 | 220 | then (bidAmount > minimalBid) | |
221 | 221 | else false) | |
222 | 222 | then (revealBid :+ StringEntry(top2Key, ((revealKey + ",") + toString(bidAmount)))) | |
223 | 223 | else if (if ((bidAmount > top2BidAmount)) | |
224 | 224 | then (bidAmount > minimalBid) | |
225 | 225 | else false) | |
226 | 226 | then (revealBid :+ StringEntry(top2Key, ((revealKey + ",") + toString(bidAmount)))) | |
227 | 227 | else revealBid | |
228 | 228 | } | |
229 | 229 | else if (if ((deposit >= bidAmount)) | |
230 | 230 | then isAvailable(name) | |
231 | 231 | else false) | |
232 | 232 | then { | |
233 | 233 | let topBids = [StringEntry(topKey, revealKey), StringEntry(top2Key, ((revealKey + ",") + toString(bidAmount)))] | |
234 | 234 | (revealBid ++ topBids) | |
235 | 235 | } | |
236 | 236 | else revealBid | |
237 | 237 | } | |
238 | 238 | } | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | ||
242 | 242 | @Callable(inv) | |
243 | 243 | func finalize (auctionId,hashes) = { | |
244 | 244 | let _auctionEnd = _getAuctionById(auctionId)._5 | |
245 | 245 | let auctionEnd = if ((lastBlock.timestamp > _auctionEnd)) | |
246 | 246 | then _auctionEnd | |
247 | 247 | else throw("Cannot finalize auction that has not ended") | |
248 | 248 | let caller = inv.caller | |
249 | 249 | let callerStr = toString(caller) | |
250 | 250 | func foldRefund (acc,hash) = { | |
251 | 251 | let bidderHashKey = key_bidderHash(toString(auctionId), callerStr, hash) | |
252 | 252 | let bidKey = key_bid(bidderHashKey) | |
253 | 253 | let revealKey = key_reveal(bidderHashKey) | |
254 | 254 | let revealedBid = getString(this, revealKey) | |
255 | - | let $ | |
255 | + | let $t089699264 = { | |
256 | 256 | let bidValues = split(valueOrErrorMessage(revealedBid, (("Bid with hash " + hash) + " not found")), ",") | |
257 | 257 | $Tuple3(parseIntValue(bidValues[0]), parseIntValue(bidValues[1]), bidValues[2]) | |
258 | 258 | } | |
259 | - | let deposit = $ | |
260 | - | let bid = $ | |
261 | - | let name = $ | |
259 | + | let deposit = $t089699264._1 | |
260 | + | let bid = $t089699264._2 | |
261 | + | let name = $t089699264._3 | |
262 | 262 | let topKey = key_top(name) | |
263 | 263 | let top2Key = key_top2(name) | |
264 | 264 | let winnerLink = valueOrErrorMessage(getString(this, topKey), "Auction winner has not been determined") | |
265 | 265 | let winnerInfo = split(winnerLink, "_") | |
266 | 266 | let winnerAuctionId = parseIntValue(winnerInfo[1]) | |
267 | 267 | let winnerAddress = winnerInfo[2] | |
268 | 268 | let top2BidderInfo = split(getStringOrThrow(this, top2Key), ",") | |
269 | 269 | let top2Bid = parseIntOrThrow(top2BidderInfo[1]) | |
270 | 270 | let deleteEntries = [DeleteEntry(revealKey), DeleteEntry(bidKey)] | |
271 | 271 | let transferAndDeleteEntry = if (if (if (if ((minimalBid > bid)) | |
272 | 272 | then true | |
273 | 273 | else (bid > deposit)) | |
274 | 274 | then true | |
275 | 275 | else (winnerAuctionId != auctionId)) | |
276 | 276 | then true | |
277 | 277 | else !(isCorrect(name))) | |
278 | 278 | then [ScriptTransfer(caller, (deposit - fraction(deposit, 10, 100)), unit)] | |
279 | 279 | else if ((winnerLink == revealKey)) | |
280 | 280 | then { | |
281 | 281 | let claimNft = invoke(registrar, "register", [name, winnerAddress, auctionEnd], nil) | |
282 | 282 | if ((claimNft == claimNft)) | |
283 | 283 | then [ScriptTransfer(caller, (deposit - top2Bid), unit), DeleteEntry(top2Key)] | |
284 | 284 | else throw("Strict value is not equal to itself.") | |
285 | 285 | } | |
286 | 286 | else [ScriptTransfer(caller, deposit, unit)] | |
287 | 287 | ((acc ++ deleteEntries) ++ transferAndDeleteEntry) | |
288 | 288 | } | |
289 | 289 | ||
290 | 290 | let $l = hashes | |
291 | 291 | let $s = size($l) | |
292 | 292 | let $acc0 = nil | |
293 | 293 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
294 | 294 | then $a | |
295 | 295 | else foldRefund($a, $l[$i]) | |
296 | 296 | ||
297 | 297 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
298 | 298 | then $a | |
299 | 299 | else throw("List size exceeds 10") | |
300 | 300 | ||
301 | 301 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
302 | 302 | } | |
303 | 303 | ||
304 | 304 |
github/deemru/w8io/169f3d6 54.73 ms ◑