tx · FRbHLg5MkDmQ4siTchNuRhkE3FKC62GUFrK9yQwtJpsq 3N7EYPDKBqUg4pv1CwQxVYHPhkYWcNReDkC: -0.01000000 Waves 2022.12.05 20:41 [2347369] smart account 3N7EYPDKBqUg4pv1CwQxVYHPhkYWcNReDkC > SELF 0.00000000 Waves
{ "type": 13, "id": "FRbHLg5MkDmQ4siTchNuRhkE3FKC62GUFrK9yQwtJpsq", "fee": 1000000, "feeAssetId": null, "timestamp": 1670262179137, "version": 2, "chainId": 84, "sender": "3N7EYPDKBqUg4pv1CwQxVYHPhkYWcNReDkC", "senderPublicKey": "iobD17ceCEhvEHvfFp9YXuxUHspDfyQMgKFL9nLBtkL", "proofs": [ "2kss4TSZeYjggV87aPmBvf6sfNrC1KaX9SNtck8ytZpKJ3pN4WhdD2esaXLopzRD4vocbTaHR5cE6B5XRn4z8Z4R" ], "script": "base64:BgIJCAISBQoDCAgBAAEBaQEOYWNjZXB0QmlkT2ZmZXIDCWF1Y3Rpb25JZAVuZnRJZBRiaWRfYW1vdW50X2Zyb21fdXNlcgQEdHhJZAkA2AQBCAUBaQ10cmFuc2FjdGlvbklkBAZjYWxsZXIICAUBaQZjYWxsZXIFYnl0ZXMEB2Fzc2V0SWQJANkEAQUFbmZ0SWQEEmdldE5mdFdpbm5pbmdQcmljZQkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCDF9oaWdoZXN0X2JpZAQQZ2V0QXVjdGlvbldpbm5lcgkBEUBleHRyTmF0aXZlKDEwNTMpAgUEdGhpcwkArAICBQlhdWN0aW9uSWQCDl93aW5uZXJfb2ZfbmZ0CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMJAQdBZGRyZXNzAQUGY2FsbGVyCQENcGFyc2VJbnRWYWx1ZQEFEmdldE5mdFdpbm5pbmdQcmljZQUEdW5pdAkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCQEHQWRkcmVzcwEJANkEAQUQZ2V0QXVjdGlvbldpbm5lcgABBQdhc3NldElkCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUEdHhJZAIVX2Ftb3VudF9wYWlkX3RvX293bmVyBRJnZXROZnRXaW5uaW5nUHJpY2UJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQR0eElkAhBfbmZ0X3RyYW5zZmVyX3RvBRBnZXRBdWN0aW9uV2lubmVyCQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUEdHhJZAILX25mdF9zdGF0dXMCCFJFV0FSREVECQDMCAIJAQtTdHJpbmdFbnRyeQIJAKwCAgUJYXVjdGlvbklkAhVfYW1vdW50X3BhaWRfdG9fb3duZXIFEmdldE5mdFdpbm5pbmdQcmljZQkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAIQX25mdF90cmFuc2Zlcl90bwUQZ2V0QXVjdGlvbldpbm5lcgkAzAgCCQELU3RyaW5nRW50cnkCCQCsAgIFCWF1Y3Rpb25JZAILX25mdF9zdGF0dXMCCFJFV0FSREVEBQNuaWwATcK1Cg==", "height": 2347369, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5khbUuGHGNTLqn2pNFCw3upZsFrMK1cy351re9ZXJaZ8 Next: HzkZmZdQE86YjZZ4yC6NQnPEHMro2ctGqqjEKhbi5ALy Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
5 | - | ||
6 | - | @Callable(i) | |
7 | - | func addAuction (start,end,startPrice,duration) = { | |
8 | - | let txId = toBase58String(i.transactionId) | |
9 | - | let nftId = value(i.payments[0].assetId) | |
10 | - | let price = value(startPrice) | |
11 | - | let caller = i.caller.bytes | |
12 | - | let checkNftAuctioned = match getString(this, ((toBase58String(nftId) + "nft_status_") + toBase58String(caller))) { | |
13 | - | case a: String => | |
14 | - | true | |
15 | - | case _ => | |
16 | - | false | |
17 | - | } | |
18 | - | if ((i.payments[0].assetId == unit)) | |
19 | - | then throw("NFT not attached") | |
20 | - | else if ((checkNftAuctioned == true)) | |
21 | - | then throw("Already in auction list") | |
22 | - | 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 + "duration_of_auction"), duration), 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")] | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | ||
27 | - | @Callable(i) | |
28 | - | func placeBid (auctionId,nftId,nft_owner,bid_price) = { | |
29 | - | let txId = toBase58String(i.transactionId) | |
30 | - | let caller = i.caller.bytes | |
31 | - | let assetId = fromBase58String(nftId) | |
32 | - | let currentBidPrice = i.payments[0].amount | |
33 | - | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
34 | - | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
35 | - | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
36 | - | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
37 | - | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
38 | - | if ((i.payments[0].assetId != unit)) | |
39 | - | then throw("Pay in waves") | |
40 | - | else if ((checkNftAuctioned != "OPEN")) | |
41 | - | then throw("Not open for auction") | |
42 | - | else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice)) | |
43 | - | then throw("Bid is less then starting/highest Bid") | |
44 | - | else if ((getLastWinnerBidPrice == "0")) | |
45 | - | 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)] | |
46 | - | 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)] | |
47 | - | } | |
48 | - | ||
49 | 4 | ||
50 | 5 | ||
51 | 6 | @Callable(i) | |
59 | 14 | } | |
60 | 15 | ||
61 | 16 | ||
62 | - | ||
63 | - | @Callable(i) | |
64 | - | func cancelAuction (auctionId) = { | |
65 | - | let txId = toBase58String(i.transactionId) | |
66 | - | let caller = i.caller.bytes | |
67 | - | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
68 | - | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
69 | - | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
70 | - | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
71 | - | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
72 | - | [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)] | |
73 | - | } | |
74 | - | ||
75 | - | ||
76 | - | ||
77 | - | @Callable(i) | |
78 | - | func withdrawBid (bidTxId) = { | |
79 | - | let caller = i.caller.bytes | |
80 | - | let bidPrice = getStringValue(this, (bidTxId + "_highest_bid")) | |
81 | - | let asBidder = getStringValue(this, (bidTxId + "_winner")) | |
82 | - | let bidForNFT = getStringValue(this, (bidTxId + "_nft_id")) | |
83 | - | if ((toBase58String(caller) != asBidder)) | |
84 | - | then throw("No bid") | |
85 | - | else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)] | |
86 | - | } | |
87 | - | ||
88 | - | ||
89 | - | ||
90 | - | @Callable(i) | |
91 | - | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
92 | - | ||
93 | - |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
5 | - | ||
6 | - | @Callable(i) | |
7 | - | func addAuction (start,end,startPrice,duration) = { | |
8 | - | let txId = toBase58String(i.transactionId) | |
9 | - | let nftId = value(i.payments[0].assetId) | |
10 | - | let price = value(startPrice) | |
11 | - | let caller = i.caller.bytes | |
12 | - | let checkNftAuctioned = match getString(this, ((toBase58String(nftId) + "nft_status_") + toBase58String(caller))) { | |
13 | - | case a: String => | |
14 | - | true | |
15 | - | case _ => | |
16 | - | false | |
17 | - | } | |
18 | - | if ((i.payments[0].assetId == unit)) | |
19 | - | then throw("NFT not attached") | |
20 | - | else if ((checkNftAuctioned == true)) | |
21 | - | then throw("Already in auction list") | |
22 | - | 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 + "duration_of_auction"), duration), 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")] | |
23 | - | } | |
24 | - | ||
25 | - | ||
26 | - | ||
27 | - | @Callable(i) | |
28 | - | func placeBid (auctionId,nftId,nft_owner,bid_price) = { | |
29 | - | let txId = toBase58String(i.transactionId) | |
30 | - | let caller = i.caller.bytes | |
31 | - | let assetId = fromBase58String(nftId) | |
32 | - | let currentBidPrice = i.payments[0].amount | |
33 | - | let getLastWinnerBidPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
34 | - | let getPreviousBidderAddress = getString(this, (auctionId + "_previous_bidder")) | |
35 | - | let currentBidCount = getStringValue(this, (auctionId + "_bidder_count")) | |
36 | - | let getLastWinnerAddress = getStringValue(this, (auctionId + "_winner_of_nft")) | |
37 | - | let checkNftAuctioned = getStringValue(this, (auctionId + "_nft_status")) | |
38 | - | if ((i.payments[0].assetId != unit)) | |
39 | - | then throw("Pay in waves") | |
40 | - | else if ((checkNftAuctioned != "OPEN")) | |
41 | - | then throw("Not open for auction") | |
42 | - | else if ((parseIntValue(getLastWinnerBidPrice) >= currentBidPrice)) | |
43 | - | then throw("Bid is less then starting/highest Bid") | |
44 | - | else if ((getLastWinnerBidPrice == "0")) | |
45 | - | 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)] | |
46 | - | 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)] | |
47 | - | } | |
48 | - | ||
49 | 4 | ||
50 | 5 | ||
51 | 6 | @Callable(i) | |
52 | 7 | func acceptBidOffer (auctionId,nftId,bid_amount_from_user) = { | |
53 | 8 | let txId = toBase58String(i.transactionId) | |
54 | 9 | let caller = i.caller.bytes | |
55 | 10 | let assetId = fromBase58String(nftId) | |
56 | 11 | let getNftWinningPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
57 | 12 | let getAuctionWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
58 | 13 | [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")] | |
59 | 14 | } | |
60 | 15 | ||
61 | 16 | ||
62 | - | ||
63 | - | @Callable(i) | |
64 | - | func cancelAuction (auctionId) = { | |
65 | - | let txId = toBase58String(i.transactionId) | |
66 | - | let caller = i.caller.bytes | |
67 | - | let auctionStatus = getStringValue(this, (auctionId + "_nft_status")) | |
68 | - | let biddingWinner = getStringValue(this, (auctionId + "_winner_of_nft")) | |
69 | - | let nftOwner = getStringValue(this, (auctionId + "_nft_owner")) | |
70 | - | let nftId = getStringValue(this, (auctionId + "_nft_on_auction")) | |
71 | - | let biddingPrice = getStringValue(this, (auctionId + "_highest_bid")) | |
72 | - | [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)] | |
73 | - | } | |
74 | - | ||
75 | - | ||
76 | - | ||
77 | - | @Callable(i) | |
78 | - | func withdrawBid (bidTxId) = { | |
79 | - | let caller = i.caller.bytes | |
80 | - | let bidPrice = getStringValue(this, (bidTxId + "_highest_bid")) | |
81 | - | let asBidder = getStringValue(this, (bidTxId + "_winner")) | |
82 | - | let bidForNFT = getStringValue(this, (bidTxId + "_nft_id")) | |
83 | - | if ((toBase58String(caller) != asBidder)) | |
84 | - | then throw("No bid") | |
85 | - | else [StringEntry((bidTxId + "_nft_bid"), "WITHDRAW"), StringEntry((bidTxId + "_nft_id"), bidForNFT), StringEntry((bidTxId + "_bidding_price_refund_amount"), bidPrice), ScriptTransfer(i.caller, parseIntValue(bidPrice), unit)] | |
86 | - | } | |
87 | - | ||
88 | - | ||
89 | - | ||
90 | - | @Callable(i) | |
91 | - | func testBid (data) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
92 | - | ||
93 | - |
github/deemru/w8io/169f3d6 38.60 ms ◑