tx · E1hrjQYodTW4tt16rpVPS4XRsM7g2bvwsSmbXTHtf1YS 3MpZUVUydnP6sJRLkmfFVzbPyZxCJaMF26C: -0.01300000 Waves 2022.07.23 22:54 [2152868] smart account 3MpZUVUydnP6sJRLkmfFVzbPyZxCJaMF26C > SELF 0.00000000 Waves
{ "type": 13, "id": "E1hrjQYodTW4tt16rpVPS4XRsM7g2bvwsSmbXTHtf1YS", "fee": 1300000, "feeAssetId": null, "timestamp": 1658606083634, "version": 2, "chainId": 84, "sender": "3MpZUVUydnP6sJRLkmfFVzbPyZxCJaMF26C", "senderPublicKey": "eQkxCgvo8ueRXjE3r7m1LmZQYPNEJR1TsDVEezZWMCf", "proofs": [ "3e77KDx4zwptYLcnSGXpFURMhGLnt4kKNJhhwGdwmakkAYVy4wo9srSMopZ21wRnKKw1XWj1nHxvoEyTsSiU2Hcb" ], "script": "base64:AAIFAAAAAAAAACUIAhIGCgQBAQgIEgMKAQgSBAoCCAgSBAoCCAgSAwoBCBIDCgEIAAAACgAAAAAQTkZUSXNzdWVyQWRkcmVzcwEAAAAaAVTlJ2uHz8YVlpS/IPoouqjzxzTkUWR15aUAAAAACmVnZ0Fzc2V0SWQBAAAAIN8WvUlvKV5KiKQ/riUCHs+JsW0b1QoOZ6GXBgkTWewqAAAAABBjb2xsZWN0b3JBZGRyZXNzAQAAABoBVE2leYfAmTR6zrVRjBa4yfYIQ2WPdOa++QAAAAAKZmVlUGVyY2VudAAAAAAAAAAABQAAAAATYXJ0ZWZhY3RzRmVlUGVyY2VudAAAAAAAAAAAFAEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZXk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jb2xsZWN0b3JBZGRyZXNzCQAAawAAAAMFAAAABmFtb3VudAUAAAAIZmluYWxGZWUAAAAAAAAAAGQFAAAADnBheW1lbnRBc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tlefV+CEE=", "height": 2152868, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let NFTIssuerAddress = base58'3NAojjoUnKBrRXG9mCbkSDaUEcVaMXkVMoS' | |
5 | + | ||
6 | + | let eggAssetId = base58'G1r2bKT6wwoScJ9k213SGoaQVjwZs16TLRhuYowNy77f' | |
7 | + | ||
8 | + | let collectorAddress = base58'3Mvze35RhgMCjGrqEnhQLjgtVUJVh8c2svx' | |
9 | + | ||
10 | + | let feePercent = 5 | |
11 | + | ||
12 | + | let artefactsFeePercent = 20 | |
13 | + | ||
14 | + | func tryGetInteger (key) = { | |
15 | + | let val = match getInteger(this, key) { | |
16 | + | case b: Int => | |
17 | + | b | |
18 | + | case _ => | |
19 | + | 0 | |
20 | + | } | |
21 | + | val | |
22 | + | } | |
23 | + | ||
24 | + | ||
25 | + | func tryGetString (key) = { | |
26 | + | let val = match getString(this, key) { | |
27 | + | case b: String => | |
28 | + | b | |
29 | + | case _ => | |
30 | + | "" | |
31 | + | } | |
32 | + | val | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | func tryGetBoolean (key) = match getBoolean(this, key) { | |
37 | + | case b: Boolean => | |
38 | + | b | |
39 | + | case _ => | |
40 | + | false | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | func getBidCancelResults (auctionId,bidId) = { | |
45 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
46 | + | let paymentAssetId = if ((isEggSell == true)) | |
47 | + | then eggAssetId | |
48 | + | else unit | |
49 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
50 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
51 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
52 | + | [StringEntry((((("assetId_" + assetId) + "_bid_") + bidId) + "_data"), (((((("{\"auctionId\": \"" + auctionId) + "\", \"author\": \"") + bidAuthor) + "\", \"amount\": \"") + toString(bidAmount)) + "\", \"status\": \"cancelled\"}")), StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_status"), "cancelled"), DeleteEntry(((((("address_" + bidAuthor) + "_auction_") + auctionId) + "_bid_") + bidId)), ScriptTransfer(Address(fromBase58String(bidAuthor)), bidAmount, paymentAssetId)] | |
53 | + | } | |
54 | + | ||
55 | + | ||
56 | + | func getAssetGenotype (assetId) = if ((value(assetInfo(assetId)).issuer == Address(NFTIssuerAddress))) | |
57 | + | then "ART" | |
58 | + | else "" | |
59 | + | ||
60 | + | ||
61 | + | @Callable(i) | |
62 | + | func initAuction (startPrice,instantPrice,description,eggSell) = { | |
63 | + | let auctionId = toBase58String(i.transactionId) | |
64 | + | let pmt = value(i.payments[0]) | |
65 | + | let assetId = value(pmt.assetId) | |
66 | + | let asset = getAssetGenotype(assetId) | |
67 | + | if ((asset == "")) | |
68 | + | then throw("You can only sell an NFT-panda created in incubator or breeder") | |
69 | + | else [StringEntry((("auction_" + auctionId) + "_status"), "open"), BooleanEntry((("auction_" + auctionId) + "_eggSell"), (eggSell == "true")), StringEntry((("auction_" + toBase58String(assetId)) + "_last"), auctionId), StringEntry((("auction_" + auctionId) + "_assetGen"), asset), StringEntry((("auction_" + auctionId) + "_assetId"), toBase58String(assetId)), IntegerEntry((("auction_" + auctionId) + "_startedAt"), lastBlock.timestamp), StringEntry((("auction_" + auctionId) + "_owner"), toString(i.originCaller)), StringEntry((("auction_" + auctionId) + "_description"), description), IntegerEntry((("auction_" + auctionId) + "_startPrice"), startPrice), BooleanEntry((("auction_" + auctionId) + "_isArtefact"), (value(assetInfo(assetId)).issuer == Address(NFTIssuerAddress))), IntegerEntry((("auction_" + auctionId) + "_instantPrice"), instantPrice), StringEntry((((("address_" + toString(i.originCaller)) + "_auction_") + auctionId) + "_lockedNFT"), toBase58String(assetId))] | |
70 | + | } | |
71 | + | ||
72 | + | ||
73 | + | ||
74 | + | @Callable(i) | |
75 | + | func placeBid (auctionId) = { | |
76 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
77 | + | let paymentAssetId = if ((isEggSell == true)) | |
78 | + | then eggAssetId | |
79 | + | else unit | |
80 | + | let paymentAssetName = if ((isEggSell == true)) | |
81 | + | then "EGG" | |
82 | + | else "WAVES" | |
83 | + | let pmt = value(i.payments[0]) | |
84 | + | let amount = pmt.amount | |
85 | + | let bidId = toBase58String(i.transactionId) | |
86 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
87 | + | if ((pmt.assetId != paymentAssetId)) | |
88 | + | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
89 | + | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
90 | + | then throw("Auction was closed") | |
91 | + | else { | |
92 | + | let minPrice = tryGetInteger((("auction_" + auctionId) + "_startPrice")) | |
93 | + | if ((minPrice > amount)) | |
94 | + | then throw(("The minimal initial price is set as " + toString(minPrice))) | |
95 | + | else [StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_author"), toString(i.originCaller)), StringEntry((((("assetId_" + assetId) + "_bid_") + bidId) + "_data"), (((((("{\"auctionId\": \"" + auctionId) + "\", \"author\": \"") + toString(i.originCaller)) + "\", \"amount\": \"") + toString(amount)) + "\", \"status\": \"open\"}")), IntegerEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount"), amount), StringEntry(((((("address_" + toString(i.originCaller)) + "_auction_") + auctionId) + "_bid_") + bidId), assetId), StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_status"), "open")] | |
96 | + | } | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func acceptBid (auctionId,bidId) = { | |
103 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
104 | + | let paymentAssetId = if ((isEggSell == true)) | |
105 | + | then eggAssetId | |
106 | + | else unit | |
107 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
108 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
109 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
110 | + | let bidStatus = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) | |
111 | + | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
112 | + | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
113 | + | then artefactsFeePercent | |
114 | + | else feePercent | |
115 | + | if ((toString(i.originCaller) != auctionOwner)) | |
116 | + | then throw("Only allowed to auction owner") | |
117 | + | else if ((bidStatus != "open")) | |
118 | + | then throw("Bid was cancelled and cannot be accepted") | |
119 | + | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
120 | + | then throw("Auction was closed") | |
121 | + | else { | |
122 | + | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
123 | + | let newRecordPrice = max([recordPrice, bidAmount]) | |
124 | + | [StringEntry((((("auction_" + auctionId) + "_bid_") + bidId) + "_status"), "finished"), StringEntry((("auction_" + auctionId) + "_status"), "finished"), StringEntry((((("assetId_" + assetId) + "_bid_") + bidId) + "_data"), (((((("{\"auctionId\": \"" + auctionId) + "\", \"author\": \"") + toString(i.originCaller)) + "\", \"amount\": \"") + toString(bidAmount)) + "\", \"status\": \"finished\"}")), IntegerEntry((("auction_" + auctionId) + "_finalPrice"), bidAmount), IntegerEntry((assetId + "_recordPrice"), newRecordPrice), DeleteEntry(((((("address_" + bidAuthor) + "_auction_") + auctionId) + "_bid_") + bidId)), DeleteEntry((((("address_" + auctionOwner) + "_auction_") + auctionId) + "_lockedNFT")), ScriptTransfer(i.caller, fraction(bidAmount, (100 - finalFee), 100), paymentAssetId), ScriptTransfer(Address(collectorAddress), fraction(bidAmount, finalFee, 100), paymentAssetId), ScriptTransfer(addressFromStringValue(bidAuthor), 1, fromBase58String(assetId))] | |
125 | + | } | |
126 | + | } | |
127 | + | ||
128 | + | ||
129 | + | ||
130 | + | @Callable(i) | |
131 | + | func cancelBid (auctionId,bidId) = { | |
132 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
133 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
134 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
135 | + | if ((toString(i.originCaller) != bidAuthor)) | |
136 | + | then throw("Only allowed to the bid author") | |
137 | + | else if ((tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) != "open")) | |
138 | + | then throw("bid is not open") | |
139 | + | else getBidCancelResults(auctionId, bidId) | |
140 | + | } | |
141 | + | ||
142 | + | ||
143 | + | ||
144 | + | @Callable(i) | |
145 | + | func cancelAuction (auctionId) = { | |
146 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
147 | + | if ((toString(i.originCaller) != auctionOwner)) | |
148 | + | then throw("Only allowed to auction owner") | |
149 | + | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
150 | + | then throw("auction is close") | |
151 | + | else [StringEntry((("auction_" + auctionId) + "_status"), "cancelled"), DeleteEntry((((("address_" + auctionOwner) + "_auction_") + auctionId) + "_lockedNFT")), ScriptTransfer(i.originCaller, 1, fromBase58String(getStringValue(this, (("auction_" + auctionId) + "_assetId"))))] | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | ||
156 | + | @Callable(i) | |
157 | + | func instantBuy (auctionId) = { | |
158 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
159 | + | let paymentAssetId = if ((isEggSell == true)) | |
160 | + | then eggAssetId | |
161 | + | else unit | |
162 | + | let paymentAssetName = if ((isEggSell == true)) | |
163 | + | then "EGG" | |
164 | + | else "WAVES" | |
165 | + | let pmt = value(i.payments[0]) | |
166 | + | let amount = pmt.amount | |
167 | + | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
168 | + | let bidId = toBase58String(i.transactionId) | |
169 | + | let auctionStatus = tryGetString((("auction_" + auctionId) + "_status")) | |
170 | + | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
171 | + | then artefactsFeePercent | |
172 | + | else feePercent | |
173 | + | if ((pmt.assetId != paymentAssetId)) | |
174 | + | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
175 | + | else if ((auctionStatus != "open")) | |
176 | + | then throw("Auction is closed. You cannot place a bid.") | |
177 | + | else { | |
178 | + | let instantPrice = tryGetInteger((("auction_" + auctionId) + "_instantPrice")) | |
179 | + | if ((instantPrice > amount)) | |
180 | + | then throw(("For instant purchase you need to pay at least " + toString(instantPrice))) | |
181 | + | else { | |
182 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
183 | + | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
184 | + | let newRecordPrice = max([recordPrice, amount]) | |
185 | + | [StringEntry((("auction_" + auctionId) + "_status"), "finished"), IntegerEntry((("auction_" + auctionId) + "_finalPrice"), amount), IntegerEntry((assetId + "_recordPrice"), newRecordPrice), StringEntry((((("assetId_" + assetId) + "_bid_") + bidId) + "_data"), (((((("{\"auctionId\": \"" + auctionId) + "\", \"author\": \"") + toString(i.originCaller)) + "\", \"amount\": \"") + toString(amount)) + "\", \"status\": \"finished\"}")), DeleteEntry((((("address_" + auctionOwner) + "_auction_") + auctionId) + "_lockedNFT")), ScriptTransfer(i.originCaller, 1, fromBase58String(getStringValue(this, (("auction_" + auctionId) + "_assetId")))), ScriptTransfer(addressFromStringValue(auctionOwner), fraction(amount, (100 - finalFee), 100), paymentAssetId), ScriptTransfer(Address(collectorAddress), fraction(amount, finalFee, 100), paymentAssetId)] | |
186 | + | } | |
187 | + | } | |
188 | + | } | |
189 | + | ||
190 | + | ||
191 | + | @Verifier(tx) | |
192 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
193 | + |
github/deemru/w8io/169f3d6 47.02 ms ◑