tx · 5mmfkuCtvrdGBiM6F1hDyM64tmzcynPawGmVpNYPBSro 3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F: -0.01000000 Waves 2023.01.05 13:14 [2391525] smart account 3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F > SELF 0.00000000 Waves
{ "type": 13, "id": "5mmfkuCtvrdGBiM6F1hDyM64tmzcynPawGmVpNYPBSro", "fee": 1000000, "feeAssetId": null, "timestamp": 1672913762736, "version": 2, "chainId": 84, "sender": "3N9cKCHp6ZLMgz7rRgF8Q8DEt8zbtd1Ht7F", "senderPublicKey": "3V22YUj3GF4AeBxdWx8rgGdG4groE4W6P2s4sAkshe7R", "proofs": [ "4cWmNckHS9XSvcWErxRoDeU3coKrTgyRYQXUA5Z7Puwi895JsnUjnMsqvkeb5EHrYQNuFzoHrxqJVKz4DpBSdNyy" ], "script": "base64:BgJACAISCwoJCAgICAgBCAgIEgMKAQESBAoCCAgSBgoECAgIARIGCgQICAgIEgUKAwgIARIDCgEIEgMKAQgSAwoBCAkACXNlcGFyYXRvcgIBXwAEa0J1eQIDYnV5AAZrUHJpY2UCBXByaWNlAAVrU2VsbAIEc2VsbAASbWF4QXVjdGlvbkR1cmF0aW9uAAcABGtCaWQCA2JpZAAMc3RhdHVzRm9yTkZUCQCWCgQCBE9QRU4CBkNMT1NFRAIIUkVXQVJERUQCCENBTkNFTEVEAAtkQXBwQWRkcmVzcwEaAVRKuE9s3sLak+30julKNvjVT3+V1VVbXaABBWlzTmZ0AQdhc3NldElkBAckbWF0Y2gwCQDsBwEFB2Fzc2V0SWQDCQABAgUHJG1hdGNoMAIFQXNzZXQEBXRva2VuBQckbWF0Y2gwAwMJAAACCAUFdG9rZW4IZGVjaW1hbHMAAAkAAAIIBQV0b2tlbghxdWFudGl0eQABBwkAAAIIBQV0b2tlbgpyZWlzc3VhYmxlBwcHCQFpAQljcmVhdGVOZnQJCG5mdF9uYW1lCW5mdF9vd25lcg9uZnRfZEF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CAgUHYmlkVHhJZAIHX25mdF9pZAMJAQIhPQIJANgEAQUGY2FsbGVyBQhhc0JpZGRlcgkAAgECBk5vIGJpZAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFB2JpZFR4SWQCCF9uZnRfYmlkAghXSVRIRFJBVwkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFB2JpZFR4SWQCB19uZnRfaWQFCWJpZEZvck5GVAkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFB2JpZFR4SWQCHF9iaWRkaW5nX3ByaWNlX3JlZnVuZF9hbW91bnQFCGJpZFByaWNlCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkBDXBhcnNlSW50VmFsdWUBBQhiaWRQcmljZQUEdW5pdAUDbmlsAWkBB3Rlc3RCaWQBBGRhdGEJAMwIAgkBC1N0cmluZ0VudHJ5AgI4RThra0ZCWUN5NDRKSmFxNnBBWjZLaXpzdVJlc2k1VUtOaGJEMVdOWndoaFlfaGlnaGVzdF9iaWQCATAFA25pbABvbVR9", "height": 2391525, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4o5zmW6XLMiRrdzHJfFjc4WTsMkbue6Ta9CUiXXCuWEz Next: 5SaU139HamsH6oNfYfgXhonL47hU39TUkR6o23BLxWK2 Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | ||
31 | 31 | ||
32 | 32 | @Callable(i) | |
33 | + | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
34 | + | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
35 | + | let issueId = calculateAssetId(newToken) | |
36 | + | let txId = i.transactionId | |
37 | + | [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))] | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | @Callable(i) | |
43 | + | func sellNFT (price) = { | |
44 | + | let txId = i.transactionId | |
45 | + | let seller = i.caller.bytes | |
46 | + | let $t017891874 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
47 | + | let token0 = $t017891874._1 | |
48 | + | let amount0 = $t017891874._2 | |
49 | + | if (!(isNft(token0))) | |
50 | + | then throw("Token is not NFT") | |
51 | + | else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func buyNFT (nftID,current_nft_owner) = { | |
58 | + | let assetId = fromBase58String(nftID) | |
59 | + | let amount = value(i.payments[0].amount) | |
60 | + | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
61 | + | case a: String => | |
62 | + | a | |
63 | + | case _ => | |
64 | + | false | |
65 | + | } | |
66 | + | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
67 | + | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
68 | + | if ((i.payments[0].assetId != unit)) | |
69 | + | then throw("Pay in waves") | |
70 | + | else if ((checkOwnerIsSame == toString(i.caller))) | |
71 | + | then throw("Owner of NFT not able to purchase") | |
72 | + | 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"))] | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | @Callable(i) | |
78 | + | func addAuction (start,end,startPrice,duration) = { | |
79 | + | let txId = toBase58String(i.transactionId) | |
80 | + | let nftId = value(i.payments[0].assetId) | |
81 | + | let price = value(startPrice) | |
82 | + | let endHeight = (lastBlock.height + duration) | |
83 | + | let caller = i.caller.bytes | |
84 | + | let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) { | |
85 | + | case a: String => | |
86 | + | true | |
87 | + | case _ => | |
88 | + | false | |
89 | + | } | |
90 | + | if ((i.payments[0].assetId == unit)) | |
91 | + | then throw("NFT not attached") | |
92 | + | else if ((checkNftAuctioned == true)) | |
93 | + | then throw("Already in auction list") | |
94 | + | else if ((duration > maxAuctionDuration)) | |
95 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(maxAuctionDuration))) | |
96 | + | 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")] | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
33 | 102 | func placeBid (auctionId,nftId,nft_owner,bid_price) = { | |
34 | 103 | let txId = toBase58String(i.transactionId) | |
35 | 104 | let caller = i.caller.bytes | |
41 | 110 | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
42 | 111 | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
43 | 112 | if ((i.payments[0].assetId != unit)) | |
44 | - | then throw("Pay in waves | |
113 | + | then throw("Pay in waves") | |
45 | 114 | else if ((checkNftAuctioned != "OPEN")) | |
46 | 115 | then throw("Not open for auction") | |
47 | 116 | else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice)) | |
52 | 121 | } | |
53 | 122 | ||
54 | 123 | ||
124 | + | ||
125 | + | @Callable(i) | |
126 | + | func acceptBidOffer (auctionId,nftId,bid_amount_from_user) = { | |
127 | + | let txId = toBase58String(i.transactionId) | |
128 | + | let caller = i.caller.bytes | |
129 | + | let assetId = fromBase58String(nftId) | |
130 | + | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
131 | + | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
132 | + | [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")] | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | ||
137 | + | @Callable(i) | |
138 | + | func cancelAuction (auctionId) = { | |
139 | + | let txId = toBase58String(i.transactionId) | |
140 | + | let caller = i.caller.bytes | |
141 | + | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
142 | + | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
143 | + | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
144 | + | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
145 | + | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
146 | + | if ((biddingWinner == "0")) | |
147 | + | then [StringEntry(((txId + auctionId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))] | |
148 | + | 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)] | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | ||
153 | + | @Callable(i) | |
154 | + | func withdrawBid (bidTxId) = { | |
155 | + | let caller = i.caller.bytes | |
156 | + | let bidPrice = getStringValue(this, (bidTxId + "_highest_bid")) | |
157 | + | let asBidder = getStringValue(this, (bidTxId + "_winner")) | |
158 | + | let bidForNFT = getStringValue(this, (bidTxId + "_nft_id")) | |
159 | + | if ((toBase58String(caller) != asBidder)) | |
160 | + | then throw("No bid") | |
161 | + | else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)] | |
162 | + | } | |
163 | + | ||
164 | + | ||
165 | + | ||
166 | + | @Callable(i) | |
167 | + | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
168 | + | ||
169 | + |
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 | + | func createNft (nft_name,nft_owner,nft_dAppAddress,nft_type,nft_tags,nft_selling_price,nft_description,nft_onSell,nft_data) = { | |
34 | + | let newToken = Issue(nft_name, nft_description, 1, 0, false) | |
35 | + | let issueId = calculateAssetId(newToken) | |
36 | + | let txId = i.transactionId | |
37 | + | [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))] | |
38 | + | } | |
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | @Callable(i) | |
43 | + | func sellNFT (price) = { | |
44 | + | let txId = i.transactionId | |
45 | + | let seller = i.caller.bytes | |
46 | + | let $t017891874 = $Tuple2(value(i.payments[0].assetId), value(i.payments[0].amount)) | |
47 | + | let token0 = $t017891874._1 | |
48 | + | let amount0 = $t017891874._2 | |
49 | + | if (!(isNft(token0))) | |
50 | + | then throw("Token is not NFT") | |
51 | + | else [StringEntry(((kPrice + separator) + toBase58String(value(i.payments[0].assetId))), toString(price)), StringEntry(((toString(i.caller) + separator) + kSell), ((toBase58String(token0) + separator) + toString(amount0)))] | |
52 | + | } | |
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | @Callable(i) | |
57 | + | func buyNFT (nftID,current_nft_owner) = { | |
58 | + | let assetId = fromBase58String(nftID) | |
59 | + | let amount = value(i.payments[0].amount) | |
60 | + | let checkOwnerIsSame = match getString(this, (("nft_" + current_nft_owner) + "_owner")) { | |
61 | + | case a: String => | |
62 | + | a | |
63 | + | case _ => | |
64 | + | false | |
65 | + | } | |
66 | + | let price = getStringValue(((((kPrice + separator) + nftID) + "_") + current_nft_owner)) | |
67 | + | let owner = valueOrErrorMessage(getStringValue(((nftID + separator) + "Owner")), "No owner") | |
68 | + | if ((i.payments[0].assetId != unit)) | |
69 | + | then throw("Pay in waves") | |
70 | + | else if ((checkOwnerIsSame == toString(i.caller))) | |
71 | + | then throw("Owner of NFT not able to purchase") | |
72 | + | 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"))] | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | @Callable(i) | |
78 | + | func addAuction (start,end,startPrice,duration) = { | |
79 | + | let txId = toBase58String(i.transactionId) | |
80 | + | let nftId = value(i.payments[0].assetId) | |
81 | + | let price = value(startPrice) | |
82 | + | let endHeight = (lastBlock.height + duration) | |
83 | + | let caller = i.caller.bytes | |
84 | + | let checkNftAuctioned = match getString(this, (((toBase58String(nftId) + separator) + "nft_status_") + toBase58String(caller))) { | |
85 | + | case a: String => | |
86 | + | true | |
87 | + | case _ => | |
88 | + | false | |
89 | + | } | |
90 | + | if ((i.payments[0].assetId == unit)) | |
91 | + | then throw("NFT not attached") | |
92 | + | else if ((checkNftAuctioned == true)) | |
93 | + | then throw("Already in auction list") | |
94 | + | else if ((duration > maxAuctionDuration)) | |
95 | + | then throw(("Duration is too long. Must be less than or equal to 7 " + toString(maxAuctionDuration))) | |
96 | + | 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")] | |
97 | + | } | |
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
33 | 102 | func placeBid (auctionId,nftId,nft_owner,bid_price) = { | |
34 | 103 | let txId = toBase58String(i.transactionId) | |
35 | 104 | let caller = i.caller.bytes | |
36 | 105 | let assetId = fromBase58String(nftId) | |
37 | 106 | let currentBidPrice = i.payments[0].amount | |
38 | 107 | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
39 | 108 | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
40 | 109 | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
41 | 110 | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
42 | 111 | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
43 | 112 | if ((i.payments[0].assetId != unit)) | |
44 | - | then throw("Pay in waves | |
113 | + | then throw("Pay in waves") | |
45 | 114 | else if ((checkNftAuctioned != "OPEN")) | |
46 | 115 | then throw("Not open for auction") | |
47 | 116 | else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice)) | |
48 | 117 | then throw("Bid is less then starting/highest Bid") | |
49 | 118 | else if ((getLastWinnerBidPrice == "0")) | |
50 | 119 | 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)] | |
51 | 120 | 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)] | |
52 | 121 | } | |
53 | 122 | ||
54 | 123 | ||
124 | + | ||
125 | + | @Callable(i) | |
126 | + | func acceptBidOffer (auctionId,nftId,bid_amount_from_user) = { | |
127 | + | let txId = toBase58String(i.transactionId) | |
128 | + | let caller = i.caller.bytes | |
129 | + | let assetId = fromBase58String(nftId) | |
130 | + | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
131 | + | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
132 | + | [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")] | |
133 | + | } | |
134 | + | ||
135 | + | ||
136 | + | ||
137 | + | @Callable(i) | |
138 | + | func cancelAuction (auctionId) = { | |
139 | + | let txId = toBase58String(i.transactionId) | |
140 | + | let caller = i.caller.bytes | |
141 | + | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
142 | + | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
143 | + | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
144 | + | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
145 | + | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
146 | + | if ((biddingWinner == "0")) | |
147 | + | then [StringEntry(((txId + auctionId) + "_nft_status"), "CANCELED"), ScriptTransfer(Address(fromBase58String(nftOwner)), 1, fromBase58String(nftId))] | |
148 | + | 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)] | |
149 | + | } | |
150 | + | ||
151 | + | ||
152 | + | ||
153 | + | @Callable(i) | |
154 | + | func withdrawBid (bidTxId) = { | |
155 | + | let caller = i.caller.bytes | |
156 | + | let bidPrice = getStringValue(this, (bidTxId + "_highest_bid")) | |
157 | + | let asBidder = getStringValue(this, (bidTxId + "_winner")) | |
158 | + | let bidForNFT = getStringValue(this, (bidTxId + "_nft_id")) | |
159 | + | if ((toBase58String(caller) != asBidder)) | |
160 | + | then throw("No bid") | |
161 | + | else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)] | |
162 | + | } | |
163 | + | ||
164 | + | ||
165 | + | ||
166 | + | @Callable(i) | |
167 | + | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
168 | + | ||
169 | + |
github/deemru/w8io/026f985 68.35 ms ◑