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 | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func addAuction (b,c,d,e) = { | |
8 | - | let f = toBase58String(a.transactionId) | |
9 | - | let g = value(a.payments[0].assetId) | |
10 | - | let h = value(d) | |
11 | - | let i = a.caller.bytes | |
12 | - | let j = { | |
13 | - | let k = getString(this, ((toBase58String(g) + "nft_status_") + toBase58String(i))) | |
14 | - | if ($isInstanceOf(k, "String")) | |
15 | - | then { | |
16 | - | let l = k | |
17 | - | true | |
18 | - | } | |
19 | - | else false | |
20 | - | } | |
21 | - | if ((a.payments[0].assetId == unit)) | |
22 | - | then throw("NFT not attached") | |
23 | - | else if ((j == true)) | |
24 | - | then throw("Already in auction list") | |
25 | - | else [StringEntry(((f + "_nft_start_auction_date_") + toBase58String(i)), b), StringEntry(((f + "_nft_end_auction_date_") + toBase58String(i)), c), StringEntry((f + "_nft_start_price"), d), StringEntry((f + "duration_of_auction"), e), StringEntry((f + "_nft_owner"), toString(a.caller)), StringEntry((f + "_nft_on_auction"), toBase58String(g)), StringEntry((f + "_previous_bidder"), "none"), StringEntry((f + "_highest_bid"), "0"), StringEntry((f + "_winner_of_nft"), "0"), StringEntry((f + "_bidder_count"), "0"), StringEntry((f + "_nft_status"), "OPEN")] | |
7 | + | func acceptBidOffer (b,c,d) = { | |
8 | + | let e = toBase58String(a.transactionId) | |
9 | + | let f = a.caller.bytes | |
10 | + | let g = fromBase58String(c) | |
11 | + | let h = getStringValue(this, (b + "_highest_bid")) | |
12 | + | let i = getStringValue(this, (b + "_winner_of_nft")) | |
13 | + | [ScriptTransfer(Address(f), parseIntValue(h), unit), ScriptTransfer(Address(fromBase58String(i)), 1, g), StringEntry((e + "_amount_paid_to_owner"), h), StringEntry((e + "_nft_transfer_to"), i), StringEntry((e + "_nft_status"), "REWARDED"), StringEntry((b + "_amount_paid_to_owner"), h), StringEntry((b + "_nft_transfer_to"), i), StringEntry((b + "_nft_status"), "REWARDED")] | |
26 | 14 | } | |
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | @Callable(a) | |
31 | - | func placeBid (m,g,n,o) = { | |
32 | - | let f = toBase58String(a.transactionId) | |
33 | - | let i = a.caller.bytes | |
34 | - | let p = fromBase58String(g) | |
35 | - | let q = a.payments[0].amount | |
36 | - | let r = getStringValue(this, (m + "_highest_bid")) | |
37 | - | let s = getString(this, (m + "_previous_bidder")) | |
38 | - | let t = getStringValue(this, (m + "_bidder_count")) | |
39 | - | let u = getStringValue(this, (m + "_winner_of_nft")) | |
40 | - | let j = getStringValue(this, (m + "_nft_status")) | |
41 | - | if ((a.payments[0].assetId != unit)) | |
42 | - | then throw("Pay in waves") | |
43 | - | else if ((j != "OPEN")) | |
44 | - | then throw("Not open for auction") | |
45 | - | else if ((parseIntValue(r) >= q)) | |
46 | - | then throw("Bid is less then starting/highest Bid") | |
47 | - | else if ((r == "0")) | |
48 | - | then [StringEntry((m + "_highest_bid"), toString(q)), StringEntry((m + "_winner_of_nft"), toBase58String(a.caller.bytes)), StringEntry((m + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((m + "_nft_id"), toBase58String(p)), StringEntry((m + "_nft_owner"), n), StringEntry((((f + "_") + m) + "_highest_bid"), toString(q)), StringEntry((((f + "_") + m) + "_winner"), toBase58String(a.caller.bytes)), StringEntry((((f + "_") + m) + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((((f + "_") + m) + "_nft_id"), toBase58String(p)), StringEntry((((f + "_") + m) + "_nft_owner"), n), StringEntry((f + "_bid_for_nft_by"), toBase58String(i)), StringEntry((f + "_bid_price_place"), o), StringEntry((f + "_previous_bid_amount_refund_to_address"), u), StringEntry((f + "_prevoius_bid_amount_refund"), r)] | |
49 | - | else [StringEntry((m + "_highest_bid"), toString(q)), StringEntry((m + "_winner_of_nft"), toBase58String(a.caller.bytes)), StringEntry((m + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((m + "_nft_id"), toBase58String(p)), StringEntry((m + "_nft_owner"), n), StringEntry((((f + "_") + m) + "_highest_bid"), toString(q)), StringEntry((((f + "_") + m) + "_winner"), toBase58String(a.caller.bytes)), StringEntry((((f + "_") + m) + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((((f + "_") + m) + "_nft_id"), toBase58String(p)), StringEntry((((f + "_") + m) + "_nft_owner"), n), StringEntry((f + "_bid_for_nft_by"), toBase58String(i)), StringEntry((f + "_bid_price_place"), o), StringEntry((f + "_previous_bid_amount_refund_to_address"), u), StringEntry((f + "_prevoius_bid_amount_refund"), r), ScriptTransfer(Address(fromBase58String(u)), parseIntValue(r), unit)] | |
50 | - | } | |
51 | - | ||
52 | - | ||
53 | - | ||
54 | - | @Callable(a) | |
55 | - | func acceptBidOffer (m,g,v) = { | |
56 | - | let f = toBase58String(a.transactionId) | |
57 | - | let i = a.caller.bytes | |
58 | - | let p = fromBase58String(g) | |
59 | - | let w = getStringValue(this, (m + "_highest_bid")) | |
60 | - | let x = getStringValue(this, (m + "_winner_of_nft")) | |
61 | - | [ScriptTransfer(Address(i), parseIntValue(w), unit), ScriptTransfer(Address(fromBase58String(x)), 1, p), StringEntry((f + "_amount_paid_to_owner"), w), StringEntry((f + "_nft_transfer_to"), x), StringEntry((f + "_nft_status"), "REWARDED"), StringEntry((m + "_amount_paid_to_owner"), w), StringEntry((m + "_nft_transfer_to"), x), StringEntry((m + "_nft_status"), "REWARDED")] | |
62 | - | } | |
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | @Callable(a) | |
67 | - | func cancelAuction (m) = { | |
68 | - | let f = toBase58String(a.transactionId) | |
69 | - | let i = a.caller.bytes | |
70 | - | let y = getStringValue(this, (m + "_nft_status")) | |
71 | - | let z = getStringValue(this, (m + "_winner_of_nft")) | |
72 | - | let A = getStringValue(this, (m + "_nft_owner")) | |
73 | - | let g = getStringValue(this, (m + "_nft_on_auction")) | |
74 | - | let B = getStringValue(this, (m + "_highest_bid")) | |
75 | - | [StringEntry((m + "_nft_status"), "CANCELED"), StringEntry((m + "_previous_bid_amount_refund_to_address"), z), StringEntry((m + "_prevoius_bid_amount_refund"), B), StringEntry((f + "_nft_status"), "CANCELED"), StringEntry((f + "_previous_bid_amount_refund_to_address"), z), StringEntry((f + "_prevoius_bid_amount_refund"), B), ScriptTransfer(Address(fromBase58String(A)), 1, fromBase58String(g)), ScriptTransfer(Address(fromBase58String(z)), parseIntValue(B), unit)] | |
76 | - | } | |
77 | - | ||
78 | - | ||
79 | - | ||
80 | - | @Callable(a) | |
81 | - | func withdrawBid (C) = { | |
82 | - | let i = a.caller.bytes | |
83 | - | let D = getStringValue(this, (C + "_highest_bid")) | |
84 | - | let E = getStringValue(this, (C + "_winner")) | |
85 | - | let F = getStringValue(this, (C + "_nft_id")) | |
86 | - | if ((toBase58String(i) != E)) | |
87 | - | then throw("No bid") | |
88 | - | else [StringEntry((C + "_nft_bid"), "WITHDRAW"), StringEntry((C + "_nft_id"), F), StringEntry((C + "_bidding_price_refund_amount"), D), ScriptTransfer(a.caller, parseIntValue(D), unit)] | |
89 | - | } | |
90 | - | ||
91 | - | ||
92 | - | ||
93 | - | @Callable(a) | |
94 | - | func testBid (G) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
95 | 15 | ||
96 | 16 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | - | func addAuction (b,c,d,e) = { | |
8 | - | let f = toBase58String(a.transactionId) | |
9 | - | let g = value(a.payments[0].assetId) | |
10 | - | let h = value(d) | |
11 | - | let i = a.caller.bytes | |
12 | - | let j = { | |
13 | - | let k = getString(this, ((toBase58String(g) + "nft_status_") + toBase58String(i))) | |
14 | - | if ($isInstanceOf(k, "String")) | |
15 | - | then { | |
16 | - | let l = k | |
17 | - | true | |
18 | - | } | |
19 | - | else false | |
20 | - | } | |
21 | - | if ((a.payments[0].assetId == unit)) | |
22 | - | then throw("NFT not attached") | |
23 | - | else if ((j == true)) | |
24 | - | then throw("Already in auction list") | |
25 | - | else [StringEntry(((f + "_nft_start_auction_date_") + toBase58String(i)), b), StringEntry(((f + "_nft_end_auction_date_") + toBase58String(i)), c), StringEntry((f + "_nft_start_price"), d), StringEntry((f + "duration_of_auction"), e), StringEntry((f + "_nft_owner"), toString(a.caller)), StringEntry((f + "_nft_on_auction"), toBase58String(g)), StringEntry((f + "_previous_bidder"), "none"), StringEntry((f + "_highest_bid"), "0"), StringEntry((f + "_winner_of_nft"), "0"), StringEntry((f + "_bidder_count"), "0"), StringEntry((f + "_nft_status"), "OPEN")] | |
7 | + | func acceptBidOffer (b,c,d) = { | |
8 | + | let e = toBase58String(a.transactionId) | |
9 | + | let f = a.caller.bytes | |
10 | + | let g = fromBase58String(c) | |
11 | + | let h = getStringValue(this, (b + "_highest_bid")) | |
12 | + | let i = getStringValue(this, (b + "_winner_of_nft")) | |
13 | + | [ScriptTransfer(Address(f), parseIntValue(h), unit), ScriptTransfer(Address(fromBase58String(i)), 1, g), StringEntry((e + "_amount_paid_to_owner"), h), StringEntry((e + "_nft_transfer_to"), i), StringEntry((e + "_nft_status"), "REWARDED"), StringEntry((b + "_amount_paid_to_owner"), h), StringEntry((b + "_nft_transfer_to"), i), StringEntry((b + "_nft_status"), "REWARDED")] | |
26 | 14 | } | |
27 | - | ||
28 | - | ||
29 | - | ||
30 | - | @Callable(a) | |
31 | - | func placeBid (m,g,n,o) = { | |
32 | - | let f = toBase58String(a.transactionId) | |
33 | - | let i = a.caller.bytes | |
34 | - | let p = fromBase58String(g) | |
35 | - | let q = a.payments[0].amount | |
36 | - | let r = getStringValue(this, (m + "_highest_bid")) | |
37 | - | let s = getString(this, (m + "_previous_bidder")) | |
38 | - | let t = getStringValue(this, (m + "_bidder_count")) | |
39 | - | let u = getStringValue(this, (m + "_winner_of_nft")) | |
40 | - | let j = getStringValue(this, (m + "_nft_status")) | |
41 | - | if ((a.payments[0].assetId != unit)) | |
42 | - | then throw("Pay in waves") | |
43 | - | else if ((j != "OPEN")) | |
44 | - | then throw("Not open for auction") | |
45 | - | else if ((parseIntValue(r) >= q)) | |
46 | - | then throw("Bid is less then starting/highest Bid") | |
47 | - | else if ((r == "0")) | |
48 | - | then [StringEntry((m + "_highest_bid"), toString(q)), StringEntry((m + "_winner_of_nft"), toBase58String(a.caller.bytes)), StringEntry((m + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((m + "_nft_id"), toBase58String(p)), StringEntry((m + "_nft_owner"), n), StringEntry((((f + "_") + m) + "_highest_bid"), toString(q)), StringEntry((((f + "_") + m) + "_winner"), toBase58String(a.caller.bytes)), StringEntry((((f + "_") + m) + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((((f + "_") + m) + "_nft_id"), toBase58String(p)), StringEntry((((f + "_") + m) + "_nft_owner"), n), StringEntry((f + "_bid_for_nft_by"), toBase58String(i)), StringEntry((f + "_bid_price_place"), o), StringEntry((f + "_previous_bid_amount_refund_to_address"), u), StringEntry((f + "_prevoius_bid_amount_refund"), r)] | |
49 | - | else [StringEntry((m + "_highest_bid"), toString(q)), StringEntry((m + "_winner_of_nft"), toBase58String(a.caller.bytes)), StringEntry((m + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((m + "_nft_id"), toBase58String(p)), StringEntry((m + "_nft_owner"), n), StringEntry((((f + "_") + m) + "_highest_bid"), toString(q)), StringEntry((((f + "_") + m) + "_winner"), toBase58String(a.caller.bytes)), StringEntry((((f + "_") + m) + "_bidder_count"), toString((parseIntValue(t) + 1))), StringEntry((((f + "_") + m) + "_nft_id"), toBase58String(p)), StringEntry((((f + "_") + m) + "_nft_owner"), n), StringEntry((f + "_bid_for_nft_by"), toBase58String(i)), StringEntry((f + "_bid_price_place"), o), StringEntry((f + "_previous_bid_amount_refund_to_address"), u), StringEntry((f + "_prevoius_bid_amount_refund"), r), ScriptTransfer(Address(fromBase58String(u)), parseIntValue(r), unit)] | |
50 | - | } | |
51 | - | ||
52 | - | ||
53 | - | ||
54 | - | @Callable(a) | |
55 | - | func acceptBidOffer (m,g,v) = { | |
56 | - | let f = toBase58String(a.transactionId) | |
57 | - | let i = a.caller.bytes | |
58 | - | let p = fromBase58String(g) | |
59 | - | let w = getStringValue(this, (m + "_highest_bid")) | |
60 | - | let x = getStringValue(this, (m + "_winner_of_nft")) | |
61 | - | [ScriptTransfer(Address(i), parseIntValue(w), unit), ScriptTransfer(Address(fromBase58String(x)), 1, p), StringEntry((f + "_amount_paid_to_owner"), w), StringEntry((f + "_nft_transfer_to"), x), StringEntry((f + "_nft_status"), "REWARDED"), StringEntry((m + "_amount_paid_to_owner"), w), StringEntry((m + "_nft_transfer_to"), x), StringEntry((m + "_nft_status"), "REWARDED")] | |
62 | - | } | |
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | @Callable(a) | |
67 | - | func cancelAuction (m) = { | |
68 | - | let f = toBase58String(a.transactionId) | |
69 | - | let i = a.caller.bytes | |
70 | - | let y = getStringValue(this, (m + "_nft_status")) | |
71 | - | let z = getStringValue(this, (m + "_winner_of_nft")) | |
72 | - | let A = getStringValue(this, (m + "_nft_owner")) | |
73 | - | let g = getStringValue(this, (m + "_nft_on_auction")) | |
74 | - | let B = getStringValue(this, (m + "_highest_bid")) | |
75 | - | [StringEntry((m + "_nft_status"), "CANCELED"), StringEntry((m + "_previous_bid_amount_refund_to_address"), z), StringEntry((m + "_prevoius_bid_amount_refund"), B), StringEntry((f + "_nft_status"), "CANCELED"), StringEntry((f + "_previous_bid_amount_refund_to_address"), z), StringEntry((f + "_prevoius_bid_amount_refund"), B), ScriptTransfer(Address(fromBase58String(A)), 1, fromBase58String(g)), ScriptTransfer(Address(fromBase58String(z)), parseIntValue(B), unit)] | |
76 | - | } | |
77 | - | ||
78 | - | ||
79 | - | ||
80 | - | @Callable(a) | |
81 | - | func withdrawBid (C) = { | |
82 | - | let i = a.caller.bytes | |
83 | - | let D = getStringValue(this, (C + "_highest_bid")) | |
84 | - | let E = getStringValue(this, (C + "_winner")) | |
85 | - | let F = getStringValue(this, (C + "_nft_id")) | |
86 | - | if ((toBase58String(i) != E)) | |
87 | - | then throw("No bid") | |
88 | - | else [StringEntry((C + "_nft_bid"), "WITHDRAW"), StringEntry((C + "_nft_id"), F), StringEntry((C + "_bidding_price_refund_amount"), D), ScriptTransfer(a.caller, parseIntValue(D), unit)] | |
89 | - | } | |
90 | - | ||
91 | - | ||
92 | - | ||
93 | - | @Callable(a) | |
94 | - | func testBid (G) = [StringEntry("E8kkFBYCy44JJaq6pAZ6KizsuResi5UKNhbD1WNZwhhY_highest_bid", "0")] | |
95 | 15 | ||
96 | 16 |
github/deemru/w8io/169f3d6 27.42 ms ◑