tx · 8zj4y1qoaqr17SUaocEkRL67bpkGdYd1vxMjHFZ2ygEq 3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN: -0.01400000 Waves 2022.02.26 13:08 [1940452] smart account 3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN > SELF 0.00000000 Waves
{ "type": 13, "id": "8zj4y1qoaqr17SUaocEkRL67bpkGdYd1vxMjHFZ2ygEq", "fee": 1400000, "feeAssetId": null, "timestamp": 1645870074203, "version": 2, "chainId": 84, "sender": "3MtVYGt1cJJB8g21cvSzJScK3hxUi9JHdcN", "senderPublicKey": "65qdY9G3EVQgF1GhvrT6rw2zPmUsFirt9Kjm5q5fdJvu", "proofs": [ "516CGSafTL7WWjyqh7UaeEvS3PUMJnQA9yyD3M6cuJUkUbu9QiXoFQczEEQVXDK7k7s9KNFLyFnF8HLRmFWaDY7z" ], "script": "base64:AAIFAAAAAAAAACUIAhIGCgQBAQgIEgMKAQgSBAoCCAgSBAoCCAgSAwoBCBIDCgEIAAAACgAAAAAQTkZUSXNzdWVyQWRkcmVzcwEAAAAaAVSkbismJBFmcMkgJZc5DHJ4ubtUkh4dvMsAAAAACmVnZ0Fzc2V0SWQBAAAAIBf+GAnQXjZz14vZmMBb3vYiBhGeUGUFXoH1EKZHEFHcAAAAABBjb2xsZWN0b3JBZGRyZXNzAQAAABoBVAKsCJPgGHb0VtKeW7feZiwE3kTfCSFe0wAAAAAKZmVlUGVyY2VudAAAAAAAAAAABQAAAAATYXJ0ZWZhY3RzRmVlUGVyY2VudAAAAAAAAAAAFAEAAAANdHJ5R2V0SW50ZWdlcgAAAAEAAAADa2V5BAAAAAN2YWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWIFAAAAByRtYXRjaDAFAAAAAWIAAAAAAAAAAAAFAAAAA3ZhbAEAAAAMdHJ5R2V0U3RyaW5nAAAAAQAAAANrZ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AAAAGYW1vdW50BQAAAAhmaW5hbEZlZQAAAAAAAAAAZAUAAAAOcGF5bWVudEFzc2V0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V51Euo0A==", "height": 1940452, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HhQdsLCqEXJzjkMrS3NU4BBDob1vAYhxwWvJgjcC3UEa Next: none Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let NFTIssuerAddress = base58' | |
4 | + | let NFTIssuerAddress = base58'3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv' | |
5 | 5 | ||
6 | 6 | let eggAssetId = base58'2cf6jyVG19oHU79R8iHfqFEesjstr3e7nSYEUhb2WagB' | |
7 | 7 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let NFTIssuerAddress = base58' | |
4 | + | let NFTIssuerAddress = base58'3N4uWa2T9W2p4WgDwLPo3kWRp8eXRatp4vv' | |
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 | 89 | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
90 | 90 | then throw("Auction was closed") | |
91 | 91 | else { | |
92 | 92 | let minPrice = tryGetInteger((("auction_" + auctionId) + "_startPrice")) | |
93 | 93 | if ((minPrice > amount)) | |
94 | 94 | then throw(("The minimal initial price is set as " + toString(minPrice))) | |
95 | 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 | 96 | } | |
97 | 97 | } | |
98 | 98 | ||
99 | 99 | ||
100 | 100 | ||
101 | 101 | @Callable(i) | |
102 | 102 | func acceptBid (auctionId,bidId) = { | |
103 | 103 | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
104 | 104 | let paymentAssetId = if ((isEggSell == true)) | |
105 | 105 | then eggAssetId | |
106 | 106 | else unit | |
107 | 107 | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
108 | 108 | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
109 | 109 | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
110 | 110 | let bidStatus = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) | |
111 | 111 | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
112 | 112 | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
113 | 113 | then artefactsFeePercent | |
114 | 114 | else feePercent | |
115 | 115 | if ((toString(i.originCaller) != auctionOwner)) | |
116 | 116 | then throw("Only allowed to auction owner") | |
117 | 117 | else if ((bidStatus != "open")) | |
118 | 118 | then throw("Bid was cancelled and cannot be accepted") | |
119 | 119 | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
120 | 120 | then throw("Auction was closed") | |
121 | 121 | else { | |
122 | 122 | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
123 | 123 | let newRecordPrice = max([recordPrice, bidAmount]) | |
124 | 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 | 125 | } | |
126 | 126 | } | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | ||
130 | 130 | @Callable(i) | |
131 | 131 | func cancelBid (auctionId,bidId) = { | |
132 | 132 | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
133 | 133 | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
134 | 134 | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
135 | 135 | if ((toString(i.originCaller) != bidAuthor)) | |
136 | 136 | then throw("Only allowed to the bid author") | |
137 | 137 | else if ((tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) != "open")) | |
138 | 138 | then throw("bid is not open") | |
139 | 139 | else getBidCancelResults(auctionId, bidId) | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | ||
144 | 144 | @Callable(i) | |
145 | 145 | func cancelAuction (auctionId) = { | |
146 | 146 | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
147 | 147 | if ((toString(i.originCaller) != auctionOwner)) | |
148 | 148 | then throw("Only allowed to auction owner") | |
149 | 149 | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
150 | 150 | then throw("auction is close") | |
151 | 151 | else [StringEntry((("auction_" + auctionId) + "_status"), "cancelled"), DeleteEntry((((("address_" + auctionOwner) + "_auction_") + auctionId) + "_lockedNFT")), ScriptTransfer(i.originCaller, 1, fromBase58String(getStringValue(this, (("auction_" + auctionId) + "_assetId"))))] | |
152 | 152 | } | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | ||
156 | 156 | @Callable(i) | |
157 | 157 | func instantBuy (auctionId) = { | |
158 | 158 | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
159 | 159 | let paymentAssetId = if ((isEggSell == true)) | |
160 | 160 | then eggAssetId | |
161 | 161 | else unit | |
162 | 162 | let paymentAssetName = if ((isEggSell == true)) | |
163 | 163 | then "EGG" | |
164 | 164 | else "WAVES" | |
165 | 165 | let pmt = value(i.payments[0]) | |
166 | 166 | let amount = pmt.amount | |
167 | 167 | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
168 | 168 | let bidId = toBase58String(i.transactionId) | |
169 | 169 | let auctionStatus = tryGetString((("auction_" + auctionId) + "_status")) | |
170 | 170 | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
171 | 171 | then artefactsFeePercent | |
172 | 172 | else feePercent | |
173 | 173 | if ((pmt.assetId != paymentAssetId)) | |
174 | 174 | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
175 | 175 | else if ((auctionStatus != "open")) | |
176 | 176 | then throw("Auction is closed. You cannot place a bid.") | |
177 | 177 | else { | |
178 | 178 | let instantPrice = tryGetInteger((("auction_" + auctionId) + "_instantPrice")) | |
179 | 179 | if ((instantPrice > amount)) | |
180 | 180 | then throw(("For instant purchase you need to pay at least " + toString(instantPrice))) | |
181 | 181 | else { | |
182 | 182 | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
183 | 183 | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
184 | 184 | let newRecordPrice = max([recordPrice, amount]) | |
185 | 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 | 186 | } | |
187 | 187 | } | |
188 | 188 | } | |
189 | 189 | ||
190 | 190 | ||
191 | 191 | @Verifier(tx) | |
192 | 192 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
193 | 193 |
github/deemru/w8io/03bedc9 45.84 ms ◑![]()