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