tx · 4MnYe91jp6gPxSSBp9xtJXK9gRavLWPKpLBnK5kD3dSi 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw: -0.01200000 Waves 2023.02.11 11:57 [2444746] smart account 3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw > SELF 0.00000000 Waves
{ "type": 13, "id": "4MnYe91jp6gPxSSBp9xtJXK9gRavLWPKpLBnK5kD3dSi", "fee": 1200000, "feeAssetId": null, "timestamp": 1676105944532, "version": 2, "chainId": 84, "sender": "3NBYw8rxLmTvyEdsvaYor8nHG6GJ4NjB2Aw", "senderPublicKey": "4NDsd3dGKXuKLCoSbYvcWCX276K9ShP75cs9HTBMLJEN", "proofs": [ "67gbQMitXYGLf3wpWygmXWJbkCn1FHtPVnTNDWCENsTkeEYCXvhZKcS7uZwB7ZhRo2pBfnH6DTzHtnh63mkt7EWc" ], "script": "base64:BgJLCAISCwoJCAgICAgBCAgIEgQKAggIEgQKAggIEgMKAQgSBwoFCAgIAQISBwoFCAgICAISBgoECAgIAhIECgIIAhIECgIICBIDCgEICwAJc2VwYXJhdG9yAgFfAARrQnV5AgNidXkABmtQcmljZQIFcHJpY2UABWtTZWxsAgRzZWxsABJtYXhBdWN0aW9uRHVyYXRpb24AHgAFdGVhbXMBIIVjlaPziI6w3gwXjghOv5o/krsm2zrodo4W3BQiKkh+AAVXQVZFUwEAAARrQmlkAgNiaWQADHN0YXR1c0Zvck5GVAkAlgoEAgRPUEVOAgZDTE9TRUQCCFJFV0FSREVEAghDQU5DRUxFRAALZEFwcEFkZHJlc3MBGgFUSrhPbN7C2pPt9I7pSjb41U9/ldVVW12gAQVpc05mdAEHYXNzZXRJZAQHJG1hdGNoMAkA7AcBBQdhc3NldElkAwkAAQIFByRtYXRjaDACBUFzc2V0BAV0b2tlbgUHJG1hdGNoMAMDCQAAAggFBXRva2VuCGRlY2ltYWxzAAAJAAACCAUFdG9rZW4IcXVhbnRpdHkAAQcJAAACCAUFdG9rZW4KcmVp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New | Differences | |
---|---|---|---|
9 | 9 | ||
10 | 10 | let kSell = "sell" | |
11 | 11 | ||
12 | - | let maxAuctionDuration = | |
12 | + | let maxAuctionDuration = 30 | |
13 | 13 | ||
14 | 14 | let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
15 | 15 | ||
68 | 68 | false | |
69 | 69 | } | |
70 | 70 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
71 | - | let platfrom_fee = ((amount / 1000) * 975) | |
71 | + | let seller_amount = ((amount / 1000) * 975) | |
72 | + | let platform_fee = ((amount / 1000) * 25) | |
72 | 73 | if ((current_nft_owner == toString(i.caller))) | |
73 | 74 | then throw("current Owner of NFT not able to purchase") | |
74 | 75 | else if ((i.payments[0].assetId == teams)) | |
75 | - | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), | |
76 | + | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), seller_amount, teams), StringEntry((("nft_" + nftID) + "platform_fee"), toString(platform_fee)), 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 | 77 | else if ((i.payments[0].assetId == unit)) | |
77 | - | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), | |
78 | + | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), seller_amount, unit), StringEntry((("nft_" + nftID) + "platform_fee"), toString(platform_fee)), 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))] | |
78 | 79 | else nil | |
79 | 80 | } | |
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | @Callable(i) | |
85 | + | func cancelSell (nftId) = { | |
86 | + | let txId = toBase58String(i.transactionId) | |
87 | + | let seller = i.caller.bytes | |
88 | + | [StringEntry(((txId + nftId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(seller), 1, fromBase58String(nftId))] | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | @Callable(i) | |
94 | + | func addAuction (start,end,startPrice,duration,payment_currency) = { | |
95 | + | let txId = toBase58String(i.transactionId) | |
96 | + | let nftId = value(i.payments[0].assetId) | |
97 | + | let price = value(startPrice) | |
98 | + | let endHeight = (lastBlock.height + duration) | |
99 | + | let caller = i.caller.bytes | |
100 | + | let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) { | |
101 | + | case a: String => | |
102 | + | true | |
103 | + | case _ => | |
104 | + | false | |
105 | + | } | |
106 | + | if ((checkNftAuctioned == true)) | |
107 | + | then throw("Already in auction list") | |
108 | + | else if ((duration > maxAuctionDuration)) | |
109 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(maxAuctionDuration))) | |
110 | + | else if ((i.payments[0].assetId == unit)) | |
111 | + | then throw("NFT not attached") | |
112 | + | else if ((i.payments[0].assetId == teams)) | |
113 | + | then throw("NFT not attached") | |
114 | + | 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")] | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | @Callable(i) | |
120 | + | func placeBid (auctionId,nftId,nft_owner,bid_price,current_currency) = { | |
121 | + | let txId = toBase58String(i.transactionId) | |
122 | + | let caller = i.caller.bytes | |
123 | + | let assetId = fromBase58String(nftId) | |
124 | + | let currentBidPrice = i.payments[0].amount | |
125 | + | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
126 | + | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
127 | + | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
128 | + | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
129 | + | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
130 | + | if ((checkNftAuctioned != "OPEN")) | |
131 | + | then throw("Not open for auction") | |
132 | + | else if ((parseIntValue(getLastWinnerBidPrice) >= parseIntValue(toString(currentBidPrice)))) | |
133 | + | then throw("Bid is less then starting/highest Bid") | |
134 | + | else if ((getLastWinnerBidPrice == "0")) | |
135 | + | 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)] | |
136 | + | else if ((getLastWinnerBidPrice != "0")) | |
137 | + | then [ScriptTransfer(Address(fromBase58String(getLastWinnerAddress)), parseIntValue(getLastWinnerBidPrice), current_currency), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), 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)] | |
138 | + | else nil | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | @Callable(i) | |
144 | + | func acceptBidOffer (auctionId,nftId,bid_amount_from_user,current_currency) = { | |
145 | + | let txId = toBase58String(i.transactionId) | |
146 | + | let caller = i.caller.bytes | |
147 | + | let assetId = fromBase58String(nftId) | |
148 | + | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
149 | + | let getNftWinningamount = ((parseIntValue(getNftWinningPrice) / 1000) * 975) | |
150 | + | let platform_fee = ((parseIntValue(getNftWinningPrice) / 1000) * 25) | |
151 | + | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
152 | + | if ((current_currency == WAVES)) | |
153 | + | then [ScriptTransfer(Address(caller), getNftWinningamount, unit), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry("platform_fee", toString(platform_fee)), 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")] | |
154 | + | else if ((current_currency == teams)) | |
155 | + | then [ScriptTransfer(Address(caller), getNftWinningamount, teams), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry("platform_fee", toString(platform_fee)), 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")] | |
156 | + | else nil | |
157 | + | } | |
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | @Callable(i) | |
162 | + | func cancelAuction (auctionId,current_currency) = { | |
163 | + | let txId = toBase58String(i.transactionId) | |
164 | + | let caller = i.caller.bytes | |
165 | + | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
166 | + | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
167 | + | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
168 | + | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
169 | + | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
170 | + | if ((biddingWinner == "0")) | |
171 | + | then [StringEntry(((txId + auctionId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))] | |
172 | + | else if ((biddingWinner != "0")) | |
173 | + | then throw("soory you can't cancel it because already auction placed by someone") | |
174 | + | else nil | |
175 | + | } | |
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | @Callable(i) | |
180 | + | func manualFundTransfer (recepientAddr,message) = { | |
181 | + | let caller = i.caller.bytes | |
182 | + | let reciver = fromBase58String(recepientAddr) | |
183 | + | let amount = i.payments[0].amount | |
184 | + | let recepient_payment = ((amount / 1000) * 975) | |
185 | + | let platform_fee = ((amount / 1000) * 25) | |
186 | + | if ((i.payments[0].assetId == unit)) | |
187 | + | then [IntegerEntry((toBase58String(caller) + "_transfer"), amount), StringEntry("platform_fee", toString(platform_fee)), StringEntry((toBase58String(caller) + "_transfer_to"), recepientAddr), ScriptTransfer(Address(reciver), recepient_payment, unit)] | |
188 | + | else if ((i.payments[0].assetId == teams)) | |
189 | + | then [IntegerEntry((toBase58String(caller) + "_transfer"), amount), StringEntry("platform_fee", toString(platform_fee)), StringEntry((toBase58String(caller) + "_transfer_to"), recepientAddr), ScriptTransfer(Address(reciver), recepient_payment, teams)] | |
190 | + | else nil | |
191 | + | } | |
192 | + | ||
193 | + | ||
194 | + | ||
195 | + | @Callable(i) | |
196 | + | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
80 | 197 | ||
81 | 198 |
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 | - | let maxAuctionDuration = | |
12 | + | let maxAuctionDuration = 30 | |
13 | 13 | ||
14 | 14 | let teams = base58'9yhJDfWjPpv6tFjWRD1AJyBQwausJf2ZdxzLn86Uknnq' | |
15 | 15 | ||
16 | 16 | let WAVES = base58'' | |
17 | 17 | ||
18 | 18 | let kBid = "bid" | |
19 | 19 | ||
20 | 20 | let statusForNFT = $Tuple4("OPEN", "CLOSED", "REWARDED", "CANCELED") | |
21 | 21 | ||
22 | 22 | let dAppAddress = base58'3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq' | |
23 | 23 | ||
24 | 24 | func isNft (assetId) = match assetInfo(assetId) { | |
25 | 25 | case token: Asset => | |
26 | 26 | if (if ((token.decimals == 0)) | |
27 | 27 | then (token.quantity == 1) | |
28 | 28 | else false) | |
29 | 29 | then (token.reissuable == false) | |
30 | 30 | else false | |
31 | 31 | case _ => | |
32 | 32 | false | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | 37 | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
38 | 38 | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
39 | 39 | let issueId = calculateAssetId(newToken) | |
40 | 40 | let txId = i.transactionId | |
41 | 41 | [newToken, ScriptTransfer(i.caller, 1, issueId), StringEntry(((toBase58String(issueId) + separator) + "Owner"), toString(i.caller)), StringEntry(((toBase58String(issueId) + separator) + "nft_type"), nft_type), StringEntry(((toBase58String(issueId) + separator) + "nft_tags"), nft_tags), StringEntry(((toBase58String(issueId) + separator) + "nft_dAppAddress"), nft_dAppAddress), IntegerEntry(((toBase58String(issueId) + separator) + "nft_selling_price"), nft_selling_price), StringEntry(((toBase58String(issueId) + separator) + "nft_onSell"), nft_onSell), StringEntry(((toBase58String(issueId) + separator) + "nft_data"), nft_data), StringEntry(((toBase58String(txId) + separator) + "issue_nft"), toBase58String(issueId))] | |
42 | 42 | } | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func sellNFT (price,payment_currency) = { | |
48 | 48 | let txId = i.transactionId | |
49 | 49 | let seller = i.caller.bytes | |
50 | 50 | let $t019011986 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
51 | 51 | let token0 = $t019011986._1 | |
52 | 52 | let amount0 = $t019011986._2 | |
53 | 53 | if (!(isNft(token0))) | |
54 | 54 | then throw("Token is not NFT") | |
55 | 55 | else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), price), StringEntry(((toString(i.caller) + separator) + kSell), (((toBase58String(token0) + separator) + toString(amount0)) + payment_currency))] | |
56 | 56 | } | |
57 | 57 | ||
58 | 58 | ||
59 | 59 | ||
60 | 60 | @Callable(i) | |
61 | 61 | func buyNFT (nftID,current_nft_owner) = { | |
62 | 62 | let assetId = fromBase58String(nftID) | |
63 | 63 | let amount = value(i.payments[0].amount) | |
64 | 64 | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
65 | 65 | case a: String => | |
66 | 66 | a | |
67 | 67 | case _ => | |
68 | 68 | false | |
69 | 69 | } | |
70 | 70 | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
71 | - | let platfrom_fee = ((amount / 1000) * 975) | |
71 | + | let seller_amount = ((amount / 1000) * 975) | |
72 | + | let platform_fee = ((amount / 1000) * 25) | |
72 | 73 | if ((current_nft_owner == toString(i.caller))) | |
73 | 74 | then throw("current Owner of NFT not able to purchase") | |
74 | 75 | else if ((i.payments[0].assetId == teams)) | |
75 | - | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), | |
76 | + | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), seller_amount, teams), StringEntry((("nft_" + nftID) + "platform_fee"), toString(platform_fee)), 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 | 77 | else if ((i.payments[0].assetId == unit)) | |
77 | - | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), | |
78 | + | then [ScriptTransfer(i.caller, 1, assetId), ScriptTransfer(Address(fromBase58String(current_nft_owner)), seller_amount, unit), StringEntry((("nft_" + nftID) + "platform_fee"), toString(platform_fee)), 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))] | |
78 | 79 | else nil | |
79 | 80 | } | |
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | @Callable(i) | |
85 | + | func cancelSell (nftId) = { | |
86 | + | let txId = toBase58String(i.transactionId) | |
87 | + | let seller = i.caller.bytes | |
88 | + | [StringEntry(((txId + nftId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(seller), 1, fromBase58String(nftId))] | |
89 | + | } | |
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | @Callable(i) | |
94 | + | func addAuction (start,end,startPrice,duration,payment_currency) = { | |
95 | + | let txId = toBase58String(i.transactionId) | |
96 | + | let nftId = value(i.payments[0].assetId) | |
97 | + | let price = value(startPrice) | |
98 | + | let endHeight = (lastBlock.height + duration) | |
99 | + | let caller = i.caller.bytes | |
100 | + | let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) { | |
101 | + | case a: String => | |
102 | + | true | |
103 | + | case _ => | |
104 | + | false | |
105 | + | } | |
106 | + | if ((checkNftAuctioned == true)) | |
107 | + | then throw("Already in auction list") | |
108 | + | else if ((duration > maxAuctionDuration)) | |
109 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(maxAuctionDuration))) | |
110 | + | else if ((i.payments[0].assetId == unit)) | |
111 | + | then throw("NFT not attached") | |
112 | + | else if ((i.payments[0].assetId == teams)) | |
113 | + | then throw("NFT not attached") | |
114 | + | 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")] | |
115 | + | } | |
116 | + | ||
117 | + | ||
118 | + | ||
119 | + | @Callable(i) | |
120 | + | func placeBid (auctionId,nftId,nft_owner,bid_price,current_currency) = { | |
121 | + | let txId = toBase58String(i.transactionId) | |
122 | + | let caller = i.caller.bytes | |
123 | + | let assetId = fromBase58String(nftId) | |
124 | + | let currentBidPrice = i.payments[0].amount | |
125 | + | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
126 | + | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
127 | + | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
128 | + | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
129 | + | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
130 | + | if ((checkNftAuctioned != "OPEN")) | |
131 | + | then throw("Not open for auction") | |
132 | + | else if ((parseIntValue(getLastWinnerBidPrice) >= parseIntValue(toString(currentBidPrice)))) | |
133 | + | then throw("Bid is less then starting/highest Bid") | |
134 | + | else if ((getLastWinnerBidPrice == "0")) | |
135 | + | 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)] | |
136 | + | else if ((getLastWinnerBidPrice != "0")) | |
137 | + | then [ScriptTransfer(Address(fromBase58String(getLastWinnerAddress)), parseIntValue(getLastWinnerBidPrice), current_currency), StringEntry((txId + "_previous_bid_amount_refund_to_address"), getLastWinnerAddress), StringEntry((txId + "_prevoius_bid_amount_refund"), getLastWinnerBidPrice), StringEntry((auctionId + "_bidder_count"), toString((parseIntValue(currentBidCount) + 1))), StringEntry((auctionId + "_highest_bid"), toString(currentBidPrice)), StringEntry((auctionId + "_winner_of_nft"), toBase58String(i.caller.bytes)), 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)] | |
138 | + | else nil | |
139 | + | } | |
140 | + | ||
141 | + | ||
142 | + | ||
143 | + | @Callable(i) | |
144 | + | func acceptBidOffer (auctionId,nftId,bid_amount_from_user,current_currency) = { | |
145 | + | let txId = toBase58String(i.transactionId) | |
146 | + | let caller = i.caller.bytes | |
147 | + | let assetId = fromBase58String(nftId) | |
148 | + | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
149 | + | let getNftWinningamount = ((parseIntValue(getNftWinningPrice) / 1000) * 975) | |
150 | + | let platform_fee = ((parseIntValue(getNftWinningPrice) / 1000) * 25) | |
151 | + | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
152 | + | if ((current_currency == WAVES)) | |
153 | + | then [ScriptTransfer(Address(caller), getNftWinningamount, unit), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry("platform_fee", toString(platform_fee)), 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")] | |
154 | + | else if ((current_currency == teams)) | |
155 | + | then [ScriptTransfer(Address(caller), getNftWinningamount, teams), ScriptTransfer(Address(fromBase58String(getAuctionWinner)), 1, assetId), StringEntry("platform_fee", toString(platform_fee)), 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")] | |
156 | + | else nil | |
157 | + | } | |
158 | + | ||
159 | + | ||
160 | + | ||
161 | + | @Callable(i) | |
162 | + | func cancelAuction (auctionId,current_currency) = { | |
163 | + | let txId = toBase58String(i.transactionId) | |
164 | + | let caller = i.caller.bytes | |
165 | + | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
166 | + | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
167 | + | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
168 | + | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
169 | + | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
170 | + | if ((biddingWinner == "0")) | |
171 | + | then [StringEntry(((txId + auctionId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))] | |
172 | + | else if ((biddingWinner != "0")) | |
173 | + | then throw("soory you can't cancel it because already auction placed by someone") | |
174 | + | else nil | |
175 | + | } | |
176 | + | ||
177 | + | ||
178 | + | ||
179 | + | @Callable(i) | |
180 | + | func manualFundTransfer (recepientAddr,message) = { | |
181 | + | let caller = i.caller.bytes | |
182 | + | let reciver = fromBase58String(recepientAddr) | |
183 | + | let amount = i.payments[0].amount | |
184 | + | let recepient_payment = ((amount / 1000) * 975) | |
185 | + | let platform_fee = ((amount / 1000) * 25) | |
186 | + | if ((i.payments[0].assetId == unit)) | |
187 | + | then [IntegerEntry((toBase58String(caller) + "_transfer"), amount), StringEntry("platform_fee", toString(platform_fee)), StringEntry((toBase58String(caller) + "_transfer_to"), recepientAddr), ScriptTransfer(Address(reciver), recepient_payment, unit)] | |
188 | + | else if ((i.payments[0].assetId == teams)) | |
189 | + | then [IntegerEntry((toBase58String(caller) + "_transfer"), amount), StringEntry("platform_fee", toString(platform_fee)), StringEntry((toBase58String(caller) + "_transfer_to"), recepientAddr), ScriptTransfer(Address(reciver), recepient_payment, teams)] | |
190 | + | else nil | |
191 | + | } | |
192 | + | ||
193 | + | ||
194 | + | ||
195 | + | @Callable(i) | |
196 | + | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
80 | 197 | ||
81 | 198 |
github/deemru/w8io/026f985 44.76 ms ◑