tx · 7CPpvKifNrYRatTqKnSQveksxB1gZo3e93spMEDPoxaT 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK: -0.10000000 Waves 2022.11.30 08:51 [2339459] smart account 3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK > SELF 0.00000000 Waves
{ "type": 13, "id": "7CPpvKifNrYRatTqKnSQveksxB1gZo3e93spMEDPoxaT", "fee": 10000000, "feeAssetId": null, "timestamp": 1669787546586, "version": 2, "chainId": 84, "sender": "3My7JvybytBTv6LBND2MeZCbkeUS7jR3PiK", "senderPublicKey": "FVTpXbDNs3kNEiYy4vjvjfzxbQim8PuN6fNLFntwM31j", "proofs": [ "2LTPTNAFLdJjp2p5DgqR8bgmmF3mTLfASvBwYCjMLwkuqM84ep5nSMieokqhQBzaEH1MB7XkNtsGRq8TC1z1Bqzk" ], "script": "base64:AAIFAAAAAAAAACsIAhIGCgQBAQgIEgMKAQgSAwoBCBIDCgEIEgQKAggIEgQKAggIEgQKAggIAAAADgAAAAAQaW5jdWJhdG9yQWRkcmVzcwEAAAAaAVeMtUiffp4V1RiXjht3+wl/Z2La4W1jJUkAAAAADmJyZWVkZXJBZGRyZXNzAQAAABoBV37nuflxxEx4XH14e4ZxgkMVpnlqD7YfHgAAAAAQYXJ0ZWZhY3RzQWRkcmVzcwEAAAAaAVckLCl6DNoqDnqWL2+K0xfDoRii/FGhzfIAAAAADWZlZUFnZ3JlZ2F0b3IBAAAAGgFXLoIKHH5zIfMhhT3embLQ7heN1n/zzxuFAAAAAAplZ2dBc3NldElkAQAAACCjn39PI3JR0SziIZJiiE0MC/PqIm6B1a/8C5MXzm2xyQAAAAAOa0dsb2JhbENvdW50ZXICAAAADkdMT0JBTF9DT1VOVEVSAAAAAApmZWVQZXJjZW50AAAAAAAAAAAFAAAAABNhcnRlZmFjdHNGZWVQZXJjZW50AAAAAAAAAAAUAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGN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RAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQUbKMQ=", "height": 2339459, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6dAyneXWeqL89wpCGYDX3eSFuZrM91wL3mkaP8tcfNMq Next: GBWbwyUxXrKW5zxHZemrGAqA994sM32okAZSNjUGD2YA Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let | |
4 | + | let incubatorAddress = base58'3PEktVux2RhchSN63DsDo4b4mz4QqzKSeDv' | |
5 | 5 | ||
6 | - | let | |
6 | + | let breederAddress = base58'3PDVuU45H7Eh5dmtNbnRNRStGwULA7NY6Hb' | |
7 | 7 | ||
8 | - | let | |
8 | + | let artefactsAddress = base58'3P5E9xamcWoymiqLx8ZdmR7o4fJSRMGp1WR' | |
9 | 9 | ||
10 | - | let | |
10 | + | let feeAggregator = base58'3P6AobNbcQ3ZjcRY37mJPKN8PP9Giz8kgeY' | |
11 | 11 | ||
12 | - | func isNft (assetId) = match assetInfo(assetId) { | |
13 | - | case token: Asset => | |
14 | - | if (if ((token.decimals == 0)) | |
15 | - | then (token.quantity == 1) | |
16 | - | else false) | |
17 | - | then (token.reissuable == false) | |
18 | - | else false | |
12 | + | let eggAssetId = base58'C1iWsKGqLwjHUndiQ7iXpdmPum9PeCDFfyXBdJJosDRS' | |
13 | + | ||
14 | + | let kGlobalCounter = "GLOBAL_COUNTER" | |
15 | + | ||
16 | + | let feePercent = 5 | |
17 | + | ||
18 | + | let artefactsFeePercent = 20 | |
19 | + | ||
20 | + | func tryGetInteger (key) = { | |
21 | + | let val = match getInteger(this, key) { | |
22 | + | case b: Int => | |
23 | + | b | |
24 | + | case _ => | |
25 | + | 0 | |
26 | + | } | |
27 | + | val | |
28 | + | } | |
29 | + | ||
30 | + | ||
31 | + | func tryGetString (key) = { | |
32 | + | let val = match getString(this, key) { | |
33 | + | case b: String => | |
34 | + | b | |
35 | + | case _ => | |
36 | + | "" | |
37 | + | } | |
38 | + | val | |
39 | + | } | |
40 | + | ||
41 | + | ||
42 | + | func tryGetBoolean (key) = match getBoolean(this, key) { | |
43 | + | case b: Boolean => | |
44 | + | b | |
19 | 45 | case _ => | |
20 | 46 | false | |
21 | 47 | } | |
22 | 48 | ||
23 | 49 | ||
50 | + | func getGlobalCounter () = tryGetInteger(kGlobalCounter) | |
51 | + | ||
52 | + | ||
53 | + | func getAssetGenotype (assetId) = if ((value(assetInfo(assetId)).issuer == Address(artefactsAddress))) | |
54 | + | then "ART" | |
55 | + | else { | |
56 | + | let asset1 = match getString(Address(incubatorAddress), toBase58String(assetId)) { | |
57 | + | case b: String => | |
58 | + | b | |
59 | + | case _ => | |
60 | + | "" | |
61 | + | } | |
62 | + | if ((asset1 != "")) | |
63 | + | then asset1 | |
64 | + | else { | |
65 | + | let asset2 = match getString(Address(breederAddress), toBase58String(assetId)) { | |
66 | + | case c: String => | |
67 | + | c | |
68 | + | case _ => | |
69 | + | "" | |
70 | + | } | |
71 | + | if ((asset2 != "")) | |
72 | + | then asset2 | |
73 | + | else "" | |
74 | + | } | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | func getBidCancelResults (auctionId,bidId) = { | |
79 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
80 | + | let paymentAssetId = if ((isEggSell == true)) | |
81 | + | then eggAssetId | |
82 | + | else unit | |
83 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
84 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
85 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
86 | + | [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)] | |
87 | + | } | |
88 | + | ||
89 | + | ||
24 | 90 | @Callable(i) | |
25 | - | func issueNft (name,meta,price) = { | |
26 | - | let newToken = Issue(name, meta, 1, 0, false) | |
27 | - | let issueId = calculateAssetId(newToken) | |
28 | - | [newToken, StringEntry(((kPrice + separator) + toBase58String(issueId)), toString(price))] | |
91 | + | func initAuction (startPrice,instantPrice,description,eggSell) = { | |
92 | + | let globalCounter = getGlobalCounter() | |
93 | + | let auctionId = (toBase58String(i.transactionId) + toString(globalCounter)) | |
94 | + | let pmt = value(i.payments[0]) | |
95 | + | let assetId = value(pmt.assetId) | |
96 | + | let asset = getAssetGenotype(assetId) | |
97 | + | if ((asset == "")) | |
98 | + | then throw("You can only sell an NFT-duck created in incubator or breeder") | |
99 | + | else [StringEntry((("auction_" + auctionId) + "_status"), "open"), BooleanEntry((("auction_" + auctionId) + "_eggSell"), (eggSell == "true")), IntegerEntry(kGlobalCounter, (globalCounter + 1)), 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(artefactsAddress))), IntegerEntry((("auction_" + auctionId) + "_instantPrice"), instantPrice), StringEntry((((("address_" + toString(i.originCaller)) + "_auction_") + auctionId) + "_lockedNFT"), toBase58String(assetId))] | |
29 | 100 | } | |
30 | 101 | ||
31 | 102 | ||
32 | 103 | ||
33 | 104 | @Callable(i) | |
34 | - | func buyNFT (nftID) = { | |
35 | - | let assetId = fromBase58String(nftID) | |
36 | - | let amount = value(i.payments[0].amount) | |
37 | - | let price = valueOrErrorMessage(getString(((kPrice + separator) + nftID)), "There is no price for this nft") | |
38 | - | if ((i.payments[0].assetId != unit)) | |
39 | - | then throw("pay in waves") | |
40 | - | else if ((parseIntValue(price) > amount)) | |
41 | - | then throw("Invalid payment") | |
42 | - | else [ScriptTransfer(i.caller, 1, assetId), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount)))] | |
105 | + | func cancelAuction (auctionId) = { | |
106 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
107 | + | if ((toString(i.originCaller) != auctionOwner)) | |
108 | + | then throw("Only allowed to auction owner") | |
109 | + | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
110 | + | then throw("auction is close") | |
111 | + | else [StringEntry((("auction_" + auctionId) + "_status"), "cancelled"), DeleteEntry((((("address_" + auctionOwner) + "_auction_") + auctionId) + "_lockedNFT")), ScriptTransfer(i.originCaller, 1, fromBase58String(getStringValue(this, (("auction_" + auctionId) + "_assetId"))))] | |
43 | 112 | } | |
44 | 113 | ||
45 | 114 | ||
46 | 115 | ||
47 | 116 | @Callable(i) | |
48 | - | func sellNFT () = { | |
49 | - | let $t011731258 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
50 | - | let token0 = $t011731258._1 | |
51 | - | let amount0 = $t011731258._2 | |
52 | - | let price = getStringValue(((kPrice + separator) + valueOrErrorMessage(toBase58String(token0), "There is no price for this nft"))) | |
53 | - | if (!(isNft(token0))) | |
54 | - | then throw("Token is not NFT") | |
55 | - | else [ScriptTransfer(i.caller, parseIntValue(price), unit), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
117 | + | func instantBuy (auctionId) = { | |
118 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
119 | + | let paymentAssetId = if ((isEggSell == true)) | |
120 | + | then eggAssetId | |
121 | + | else unit | |
122 | + | let paymentAssetName = if ((isEggSell == true)) | |
123 | + | then "EGG" | |
124 | + | else "WAVES" | |
125 | + | let pmt = value(i.payments[0]) | |
126 | + | let amount = pmt.amount | |
127 | + | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
128 | + | let bidId = toBase58String(i.transactionId) | |
129 | + | let auctionStatus = tryGetString((("auction_" + auctionId) + "_status")) | |
130 | + | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
131 | + | then artefactsFeePercent | |
132 | + | else feePercent | |
133 | + | if ((pmt.assetId != paymentAssetId)) | |
134 | + | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
135 | + | else if ((auctionStatus != "open")) | |
136 | + | then throw("Auction is closed. You cannot place a bid.") | |
137 | + | else { | |
138 | + | let instantPrice = tryGetInteger((("auction_" + auctionId) + "_instantPrice")) | |
139 | + | if ((instantPrice > amount)) | |
140 | + | then throw(("For instant purchase you need to pay at least " + toString(instantPrice))) | |
141 | + | else { | |
142 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
143 | + | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
144 | + | let newRecordPrice = max([recordPrice, amount]) | |
145 | + | [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(feeAggregator), fraction(amount, finalFee, 100), paymentAssetId)] | |
146 | + | } | |
147 | + | } | |
56 | 148 | } | |
57 | 149 | ||
150 | + | ||
151 | + | ||
152 | + | @Callable(i) | |
153 | + | func placeBid (auctionId) = { | |
154 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
155 | + | let paymentAssetId = if ((isEggSell == true)) | |
156 | + | then eggAssetId | |
157 | + | else unit | |
158 | + | let paymentAssetName = if ((isEggSell == true)) | |
159 | + | then "EGG" | |
160 | + | else "WAVES" | |
161 | + | let pmt = value(i.payments[0]) | |
162 | + | let amount = pmt.amount | |
163 | + | let bidId = toBase58String(i.transactionId) | |
164 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
165 | + | if ((pmt.assetId != paymentAssetId)) | |
166 | + | then throw((("Auction does only support " + paymentAssetName) + " payments.")) | |
167 | + | else { | |
168 | + | let minPrice = tryGetInteger((("auction_" + auctionId) + "_startPrice")) | |
169 | + | if ((minPrice > amount)) | |
170 | + | then throw(("The minimal initial price is set as " + toString(minPrice))) | |
171 | + | 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")] | |
172 | + | } | |
173 | + | } | |
174 | + | ||
175 | + | ||
176 | + | ||
177 | + | @Callable(i) | |
178 | + | func cancelBid (auctionId,bidId) = { | |
179 | + | let assetId = getStringValue(this, (("auction_" + auctionId) + "_assetId")) | |
180 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
181 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
182 | + | if ((toString(i.originCaller) != bidAuthor)) | |
183 | + | then throw("Only allowed to the bid author") | |
184 | + | else if ((tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) != "open")) | |
185 | + | then throw("bid is not open") | |
186 | + | else getBidCancelResults(auctionId, bidId) | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | ||
191 | + | @Callable(i) | |
192 | + | func cancelOutdatedBid (auctionId,bidId) = throw("to be released") | |
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | @Callable(i) | |
197 | + | func acceptBid (auctionId,bidId) = { | |
198 | + | let isEggSell = tryGetBoolean((("auction_" + auctionId) + "_eggSell")) | |
199 | + | let paymentAssetId = if ((isEggSell == true)) | |
200 | + | then eggAssetId | |
201 | + | else unit | |
202 | + | let auctionOwner = tryGetString((("auction_" + auctionId) + "_owner")) | |
203 | + | let bidAuthor = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_author")) | |
204 | + | let bidAmount = tryGetInteger((((("auction_" + auctionId) + "_bid_") + bidId) + "_amount")) | |
205 | + | let bidStatus = tryGetString((((("auction_" + auctionId) + "_bid_") + bidId) + "_status")) | |
206 | + | let assetId = tryGetString((("auction_" + auctionId) + "_assetId")) | |
207 | + | let finalFee = if ((tryGetBoolean((("auction_" + auctionId) + "_isArtefact")) == true)) | |
208 | + | then artefactsFeePercent | |
209 | + | else feePercent | |
210 | + | if ((toString(i.originCaller) != auctionOwner)) | |
211 | + | then throw("Only allowed to auction owner") | |
212 | + | else if ((bidStatus != "open")) | |
213 | + | then throw("Bid was cancelled and cannot be accepted") | |
214 | + | else if ((tryGetString((("auction_" + auctionId) + "_status")) != "open")) | |
215 | + | then throw("Auction was closed") | |
216 | + | else { | |
217 | + | let recordPrice = tryGetInteger((assetId + "_recordPrice")) | |
218 | + | let newRecordPrice = max([recordPrice, bidAmount]) | |
219 | + | [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(feeAggregator), fraction(bidAmount, finalFee, 100), paymentAssetId), ScriptTransfer(addressFromStringValue(bidAuthor), 1, fromBase58String(assetId))] | |
220 | + | } | |
221 | + | } | |
222 | + | ||
223 | + | ||
224 | + | @Verifier(tx) | |
225 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
58 | 226 |
github/deemru/w8io/169f3d6 155.32 ms ◑