tx · 3VssaqgX31BCvDCi9fx94qky9wAkU14okyZzEMJJuAko 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq: -0.05000000 Waves 2022.12.15 10:21 [2361115] smart account 3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq > SELF 0.00000000 Waves
{ "type": 13, "id": "3VssaqgX31BCvDCi9fx94qky9wAkU14okyZzEMJJuAko", "fee": 5000000, "feeAssetId": null, "timestamp": 1671088909663, "version": 2, "chainId": 84, "sender": "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq", "senderPublicKey": "H6UqxUDcJamDRg1uykVcWMn4zhAMTV7i1nfPq1moLWmJ", "proofs": [ "5ebZV6RZx94MGoHH4E8xnZzXwBMA3CMnL8phrZT9RsJdgN3zTh2AQSnJFAzYrwusALXGaYWsP5ZoB9UoSzwdUvmk" ], "script": "base64:BgJBCAISCwoJCAgICAgBCAgIEgQKAggIEgQKAggIEgYKBAgICAESBgoECAgICBIFCgMICAESAwoBCBIDCgEIEgMKAQgJAAlzZXBhcmF0b3ICAV8ABGtCdXkCA2J1eQAGa1ByaWNlAgVwcmljZQAFa1NlbGwCBHNlbGwAEm1heEF1Y3Rpb25EdXJhdGlvbgAHAARrQmlkAgNiaWQADHN0YXR1c0Zvck5GVAkAlgoEAgRPUEVOAgZDTE9TRUQCCFJFV0FSREVEAghDQU5DRUxFRAALZEFwcEFkZHJlc3MBGgFUSrhPbN7C2pPt9I7pSjb41U9/ldVVW12gAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVpc3N1YWJsZQcHBwkBaQEJY3JlYXRlTmZ0CQhuZnRfbmFtZQluZnRfb3duZXIPbmZ0X2RBcHBBZGRyZXN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AgkBC1N0cmluZ0VudHJ5AgkArAICBQdiaWRUeElkAhxfYmlkZGluZ19wcmljZV9yZWZ1bmRfYW1vdW50BQhiaWRQcmljZQkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIJAQ1wYXJzZUludFZhbHVlAQUIYmlkUHJpY2UFBHVuaXQFA25pbAFpAQd0ZXN0QmlkAQRkYXRhCQDMCAIJAQtTdHJpbmdFbnRyeQICOEU4a2tGQllDeTQ0SkphcTZwQVo2S2l6c3VSZXNpNVVLTmhiRDFXTlp3aGhZX2hpZ2hlc3RfYmlkAgEwBQNuaWwAIcNXKQ==", "height": 2361115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6MTypCYKNsJew3s8rUUzXw7EBG6VRAxA3QDjJzYr3C1x Next: 8ERcviQkRa4qnQft6YLqYV4eYBQPb7wrTHrF2Ve61Ked Diff:
Old | New | Differences | |
---|---|---|---|
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | - | func buyNFT ( | |
58 | + | func buyNFT (sell_nft_txid,nftID) = { | |
59 | 59 | let assetId = fromBase58String(nftID) | |
60 | + | let buy_nft_txid = i.transactionId | |
61 | + | let current_nft_owner = getStringValue(this, (sell_nft_txid + "_owner")) | |
60 | 62 | let amount = value(i.payments[0].amount) | |
61 | - | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
62 | - | case a: String => | |
63 | - | a | |
64 | - | case _ => | |
65 | - | false | |
66 | - | } | |
67 | 63 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
68 | 64 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
69 | 65 | if ((i.payments[0].assetId != unit)) | |
70 | 66 | then throw("Pay in waves") | |
71 | 67 | else if ((current_nft_owner == toString(i.caller))) | |
72 | - | then throw("current Owner of NFT not able to purchase") | |
73 | - | else if ((owner == toString(i.caller))) | |
74 | - | then throw("owner never buy after sell") | |
75 | - | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))] | |
68 | + | then throw("Not eligible to buy as you are owner") | |
69 | + | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))] | |
76 | 70 | } | |
77 | 71 | ||
78 | 72 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "_" | |
5 | 5 | ||
6 | 6 | let kBuy = "buy" | |
7 | 7 | ||
8 | 8 | let kPrice = "price" | |
9 | 9 | ||
10 | 10 | let kSell = "sell" | |
11 | 11 | ||
12 | 12 | let maxAuctionDuration = 7 | |
13 | 13 | ||
14 | 14 | let kBid = "bid" | |
15 | 15 | ||
16 | 16 | let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
17 | 17 | ||
18 | 18 | let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
19 | 19 | ||
20 | 20 | func isNft (assetId) = match assetInfo(assetId) { | |
21 | 21 | case token: Asset => | |
22 | 22 | if (if ((token.decimals == 0)) | |
23 | 23 | then (token.quantity == 1) | |
24 | 24 | else false) | |
25 | 25 | then (token.reissuable == false) | |
26 | 26 | else false | |
27 | 27 | case _ => | |
28 | 28 | false | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | 33 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
34 | 34 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
35 | 35 | let issueId = calculateAssetId(newToken) | |
36 | 36 | let create_nft_txid = i.transactionId | |
37 | 37 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(create_nft_txid) + separator) + "owner"), toString(i.caller)), StringEntry((toBase58String(issueId) + "_owner"), toString(i.caller)), StringEntry(((toBase58String(create_nft_txid) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(create_nft_txid) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(create_nft_txid) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(create_nft_txid) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(create_nft_txid) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(create_nft_txid) + separator) + "nft_data"), nft_data), StringEntry(((toBase58String(create_nft_txid) + separator) + "issue_nft"), toBase58String(issueId))] | |
38 | 38 | } | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | ||
42 | 42 | @Callable(i) | |
43 | 43 | func sellNFT (create_nft_txid,price) = { | |
44 | 44 | let sell_nft_txid = i.transactionId | |
45 | 45 | let assetId = getStringValue(this, (create_nft_txid + "_owner")) | |
46 | 46 | let seller = i.caller.bytes | |
47 | 47 | let $t020442129 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
48 | 48 | let token0 = $t020442129._1 | |
49 | 49 | let amount0 = $t020442129._2 | |
50 | 50 | if (!(isNft(token0))) | |
51 | 51 | then throw("Token is not NFT") | |
52 | 52 | else [StringEntry((toBase58String(sell_nft_txid) + "_owner"), toString(i.caller)), StringEntry((toBase58String(sell_nft_txid) + "_nft_selling_price"), price), StringEntry((toBase58String(sell_nft_txid) + "_nft_puton_sell"), assetId), StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(i) | |
58 | - | func buyNFT ( | |
58 | + | func buyNFT (sell_nft_txid,nftID) = { | |
59 | 59 | let assetId = fromBase58String(nftID) | |
60 | + | let buy_nft_txid = i.transactionId | |
61 | + | let current_nft_owner = getStringValue(this, (sell_nft_txid + "_owner")) | |
60 | 62 | let amount = value(i.payments[0].amount) | |
61 | - | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
62 | - | case a: String => | |
63 | - | a | |
64 | - | case _ => | |
65 | - | false | |
66 | - | } | |
67 | 63 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
68 | 64 | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
69 | 65 | if ((i.payments[0].assetId != unit)) | |
70 | 66 | then throw("Pay in waves") | |
71 | 67 | else if ((current_nft_owner == toString(i.caller))) | |
72 | - | then throw("current Owner of NFT not able to purchase") | |
73 | - | else if ((owner == toString(i.caller))) | |
74 | - | then throw("owner never buy after sell") | |
75 | - | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))] | |
68 | + | then throw("Not eligible to buy as you are owner") | |
69 | + | else [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(owner)), amount, unit), StringEntry(((toString(i.caller) + separator) + kBuy), ((nftID + separator) + toString(amount))), DeleteEntry((("nft_" + current_nft_owner) + "_owner")), StringEntry((("nft_" + current_nft_owner) + "_owner"), toString(i.caller)), StringEntry(((nftID + separator) + "_owner"), toString(i.caller))] | |
76 | 70 | } | |
77 | 71 | ||
78 | 72 | ||
79 | 73 | ||
80 | 74 | @Callable(i) | |
81 | 75 | func addAuction (start,end,startPrice,duration) = { | |
82 | 76 | let txId = toBase58String(i.transactionId) | |
83 | 77 | let nftId = value(i.payments[0].assetId) | |
84 | 78 | let price = value(startPrice) | |
85 | 79 | let endHeight = (lastBlock.height + duration) | |
86 | 80 | let caller = i.caller.bytes | |
87 | 81 | let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) { | |
88 | 82 | case a: String => | |
89 | 83 | true | |
90 | 84 | case _ => | |
91 | 85 | false | |
92 | 86 | } | |
93 | 87 | if ((i.payments[0].assetId == unit)) | |
94 | 88 | then throw("NFT not attached") | |
95 | 89 | else if ((checkNftAuctioned == true)) | |
96 | 90 | then throw("Already in auction list") | |
97 | 91 | else if ((duration > maxAuctionDuration)) | |
98 | 92 | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(maxAuctionDuration))) | |
99 | 93 | else [StringEntry(((txId + "nft_start_auction_date") + toBase58String(caller)), start), StringEntry(((txId + "nft_end_auction_date") + toBase58String(caller)), end), StringEntry((txId + "_nft_start_price"), startPrice), StringEntry((txId + "_nft_owner"), toString(i.caller)), StringEntry((txId + "_nft_on_auction"), toBase58String(nftId)), StringEntry((txId + "_previous_bidder"), "none"), StringEntry((txId + "_highest_bid"), "0"), StringEntry((txId + "_winner_of_nft"), "0"), StringEntry((txId + "_bidder_count"), "0"), StringEntry((txId + "_nft_status"), "OPEN")] | |
100 | 94 | } | |
101 | 95 | ||
102 | 96 | ||
103 | 97 | ||
104 | 98 | @Callable(i) | |
105 | 99 | func placeBid (auctionId,nftId,nft_owner,bid_price) = { | |
106 | 100 | let txId = toBase58String(i.transactionId) | |
107 | 101 | let caller = i.caller.bytes | |
108 | 102 | let assetId = fromBase58String(nftId) | |
109 | 103 | let currentBidPrice = i.payments[0].amount | |
110 | 104 | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
111 | 105 | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
112 | 106 | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
113 | 107 | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
114 | 108 | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
115 | 109 | if ((i.payments[0].assetId != unit)) | |
116 | 110 | then throw("Pay in waves") | |
117 | 111 | else if ((checkNftAuctioned != "OPEN")) | |
118 | 112 | then throw("Not open for auction") | |
119 | 113 | else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice)) | |
120 | 114 | then throw("Bid is less then starting/highest Bid") | |
121 | 115 | else if ((getLastWinnerBidPrice == "0")) | |
122 | 116 | then [StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_nft_id"), toBase58String(assetId)), StringEntry((auctionId + "_nft_owner"), nft_owner), StringEntry((((txId + "_") + auctionId) + "_highest_bid"), toString(currentBidPrice)), StringEntry((((txId + "_") + auctionId) + "_winner"), toBase58String(i.caller.bytes)), StringEntry((((txId + "_") + auctionId) + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((((txId + "_") + auctionId) + "_nft_id"), toBase58String(assetId)), StringEntry((((txId + "_") + auctionId) + "_nft_owner"), nft_owner), StringEntry((txId + "_bid_for_nft_by"), toBase58String(caller)), StringEntry((txId + "_bid_price_place"), bid_price), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice)] | |
123 | 117 | else [StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_nft_id"), toBase58String(assetId)), StringEntry((auctionId + "_nft_owner"), nft_owner), StringEntry((((txId + "_") + auctionId) + "_highest_bid"), toString(currentBidPrice)), StringEntry((((txId + "_") + auctionId) + "_winner"), toBase58String(i.caller.bytes)), StringEntry((((txId + "_") + auctionId) + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((((txId + "_") + auctionId) + "_nft_id"), toBase58String(assetId)), StringEntry((((txId + "_") + auctionId) + "_nft_owner"), nft_owner), StringEntry((txId + "_bid_for_nft_by"), toBase58String(caller)), StringEntry((txId + "_bid_price_place"), bid_price), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice), ScriptTransfer(Address(fromBase58String(getLastWinnerAddress)), parseIntValue(getLastWinnerBidPrice), unit)] | |
124 | 118 | } | |
125 | 119 | ||
126 | 120 | ||
127 | 121 | ||
128 | 122 | @Callable(i) | |
129 | 123 | func acceptBidOffer (auctionId,nftId,bid_amount_from_user) = { | |
130 | 124 | let txId = toBase58String(i.transactionId) | |
131 | 125 | let caller = i.caller.bytes | |
132 | 126 | let assetId = fromBase58String(nftId) | |
133 | 127 | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
134 | 128 | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
135 | 129 | [ScriptTransfer(Address(caller), parseIntValue(getNftWinningPrice), unit), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry((txId + "_amount_paid_to_owner"), getNftWinningPrice), StringEntry((txId + "_nft_transfer_to"), getAuctionWinner), StringEntry((txId + "_nft_status"), "REWARDED"), StringEntry((auctionId + "_amount_paid_to_owner"), getNftWinningPrice), StringEntry((auctionId + "_nft_transfer_to"), getAuctionWinner), StringEntry((auctionId + "_nft_status"), "REWARDED")] | |
136 | 130 | } | |
137 | 131 | ||
138 | 132 | ||
139 | 133 | ||
140 | 134 | @Callable(i) | |
141 | 135 | func cancelAuction (auctionId) = { | |
142 | 136 | let txId = toBase58String(i.transactionId) | |
143 | 137 | let caller = i.caller.bytes | |
144 | 138 | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
145 | 139 | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
146 | 140 | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
147 | 141 | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
148 | 142 | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
149 | 143 | if ((biddingWinner == "0")) | |
150 | 144 | then [StringEntry(((txId + auctionId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))] | |
151 | 145 | else [StringEntry((auctionId + "_nft_status"), "CANCELED"), StringEntry((auctionId + "_previous_bid_amount_refund_to_address"), biddingWinner), StringEntry((auctionId + "_prevoius_bid_amount_refund"), biddingPrice), StringEntry((txId + "_nft_status"), "CANCELED"), StringEntry((txId + "_previous_bid_amount_refund_to_address"), biddingWinner), StringEntry((txId + "_prevoius_bid_amount_refund"), biddingPrice), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId)), ScriptTransfer(Address(fromBase58String(biddingWinner)), parseIntValue(biddingPrice), unit)] | |
152 | 146 | } | |
153 | 147 | ||
154 | 148 | ||
155 | 149 | ||
156 | 150 | @Callable(i) | |
157 | 151 | func withdrawBid (bidTxId) = { | |
158 | 152 | let caller = i.caller.bytes | |
159 | 153 | let bidPrice = getStringValue(this, (bidTxId + "_highest_bid")) | |
160 | 154 | let asBidder = getStringValue(this, (bidTxId + "_winner")) | |
161 | 155 | let bidForNFT = getStringValue(this, (bidTxId + "_nft_id")) | |
162 | 156 | if ((toBase58String(caller) != asBidder)) | |
163 | 157 | then throw("No bid") | |
164 | 158 | else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)] | |
165 | 159 | } | |
166 | 160 | ||
167 | 161 | ||
168 | 162 | ||
169 | 163 | @Callable(i) | |
170 | 164 | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
171 | 165 | ||
172 | 166 |
github/deemru/w8io/026f985 39.86 ms ◑