tx · Dc7hwifkqJQ2xBTXJjtst192sDTjz5RQ9kZJWQmHbp7p 3N2D6tJAXzcTDgUiTWmcdCHd6ctYwNENuBn: -0.01000000 Waves 2022.11.02 13:44 [2299386] smart account 3N2D6tJAXzcTDgUiTWmcdCHd6ctYwNENuBn > SELF 0.00000000 Waves
{ "type": 13, "id": "Dc7hwifkqJQ2xBTXJjtst192sDTjz5RQ9kZJWQmHbp7p", "fee": 1000000, "feeAssetId": null, "timestamp": 1667385934674, "version": 2, "chainId": 84, "sender": "3N2D6tJAXzcTDgUiTWmcdCHd6ctYwNENuBn", "senderPublicKey": "Cq4RbcVcQJpCWyHiACDqUf2PbU8PaX949Dun9wRSeDzE", "proofs": [ "52xDrd86dmGmAmSs6cZt7WqALmMaVfkjfFffL48K7QJcj4dUL1y5U7cHBSb52Qws6v3opXuDePG9tn2LbsuZxd9G" ], "script": "base64:AAIDAAAAAAAAABMIARIFCgMBAQgSAwoBCBIDCgEIAAAAAQAAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQAAaAAAAAIAAAAAAAAABaAAAAAAAAAAAB4AAAADAAAAAWkBAAAADHN0YXJ0QXVjdGlvbgAAAAMAAAAIZHVyYXRpb24AAAAKc3RhcnRQcmljZQAAAAxwcmljZUFzc2V0SWQEAAAACWF1Y3Rpb25JZAkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkBAAAAAllbmRIZWlnaHQJAABkAAAAAggFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAACGR1cmF0aW9uBAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAABmAAAAAgUAAAAIZHVyYXRpb24FAAAAEm1heEF1Y3Rpb25EdXJhdGlvbgkAAAIAAAABCQABLAAAAAICAAAAKER1cmF0aW9uIGlzIHRvbyBsb25nLiBNdXN0IGJlIGxlc3MgdGhhbiAJAAGkAAAAAQUAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQEAAAAIV3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JBZGRyBQAAAAlsb3RBbW91bnQFAAAACGxvdEFzc2V0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAADW9yZ2FuaXplckFkZHIFAAAACXdpbkFtb3VudAUAAAAKcHJpY2VBc3NldAUAAAADbmlsAAAAAK2i3zY=", "height": 2299386, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Dtze5EK8oKmskB84SZXVSmhmHiDa7LbiUezfeeKrWveL Next: HNVsJpMfWYk3acCdf2pwS2KmPRToAcAE1QSJwpWztbyR Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = (1440 * 30) | |
5 | 5 | ||
6 | 6 | @Callable(b) | |
7 | 7 | func startAuction (c,d,e) = { | |
8 | 8 | let f = toBase58String(b.transactionId) | |
9 | 9 | let g = (lastBlock.height + c) | |
10 | 10 | let h = extract(b.payment) | |
11 | 11 | if ((c > a)) | |
12 | 12 | then throw(("Duration is too long. Must be less than " + toString(a))) | |
13 | 13 | else WriteSet([DataEntry(f, g), DataEntry((f + "_organizer"), toBase58String(b.caller.bytes)), DataEntry((f + "_lot_assetId"), if (isDefined(h.assetId)) | |
14 | 14 | then toBase58String(value(h.assetId)) | |
15 | 15 | else "WAVES"), DataEntry((f + "_lot_amount"), h.amount), DataEntry((f + "_startPrice"), d), DataEntry((f + "_priceAssetId"), e)]) | |
16 | 16 | } | |
17 | 17 | ||
18 | 18 | ||
19 | 19 | ||
20 | 20 | @Callable(b) | |
21 | 21 | func bid (f) = { | |
22 | 22 | let h = extract(b.payment) | |
23 | 23 | let i = if (isDefined(h.assetId)) | |
24 | 24 | then toBase58String(value(h.assetId)) | |
25 | 25 | else "WAVES" | |
26 | 26 | let j = toBase58String(b.caller.bytes) | |
27 | 27 | let g = getIntegerValue(this, f) | |
28 | 28 | let d = getIntegerValue(this, (f + "_startPrice")) | |
29 | 29 | let e = getStringValue(this, (f + "_priceAssetId")) | |
30 | 30 | let k = getInteger(this, (f + "_winAmount")) | |
31 | 31 | let l = getString(this, (f + "_winner")) | |
32 | 32 | let m = if (isDefined(l)) | |
33 | 33 | then (value(l) == j) | |
34 | 34 | else false | |
35 | 35 | let n = (h.amount + (if (m) | |
36 | 36 | then value(k) | |
37 | 37 | else 0)) | |
38 | 38 | if ((lastBlock.height >= g)) | |
39 | 39 | then throw("Auction already finished") | |
40 | 40 | else if ((e != i)) | |
41 | 41 | then throw((("Bid must be in asset '" + e) + "'")) | |
42 | 42 | else if (if (if (isDefined(k)) | |
43 | 43 | then (value(k) >= n) | |
44 | 44 | else false) | |
45 | 45 | then true | |
46 | 46 | else if (!(isDefined(k))) | |
47 | 47 | then (d >= n) | |
48 | 48 | else false) | |
49 | 49 | then throw(("Bid must be more then " + toString(if (isDefined(k)) | |
50 | 50 | then value(k) | |
51 | 51 | else d))) | |
52 | 52 | else if (if (m) | |
53 | 53 | then true | |
54 | 54 | else !(isDefined(l))) | |
55 | 55 | then WriteSet([DataEntry((f + "_winner"), j), DataEntry((f + "_winAmount"), n)]) | |
56 | 56 | else { | |
57 | 57 | let o = addressFromStringValue(value(l)) | |
58 | 58 | let p = if (if ((e == "WAVES")) | |
59 | 59 | then true | |
60 | 60 | else (e == "")) | |
61 | 61 | then unit | |
62 | 62 | else fromBase58String(e) | |
63 | 63 | ScriptResult(WriteSet([DataEntry((f + "_winner"), j), DataEntry((f + "_winAmount"), n)]), TransferSet([ScriptTransfer(o, value(k), p)])) | |
64 | 64 | } | |
65 | 65 | } | |
66 | 66 | ||
67 | 67 | ||
68 | 68 | ||
69 | 69 | @Callable(b) | |
70 | 70 | func withdraw (f) = { | |
71 | 71 | let h = extract(b.payment) | |
72 | 72 | let i = if (isDefined(h.assetId)) | |
73 | 73 | then toBase58String(value(h.assetId)) | |
74 | 74 | else "WAVES" | |
75 | 75 | let j = toBase58String(b.caller.bytes) | |
76 | 76 | let g = getIntegerValue(this, f) | |
77 | 77 | let q = getStringValue(this, (f + "_organizer")) | |
78 | 78 | let l = getString(this, (f + "_winner")) | |
79 | 79 | let r = getStringValue(this, (f + "_lot_assetId")) | |
80 | 80 | let s = getIntegerValue(this, (f + "_lot_amount")) | |
81 | 81 | let e = getStringValue(this, (f + "_priceAssetId")) | |
82 | 82 | let k = getIntegerValue(this, (f + "_winAmount")) | |
83 | 83 | let t = if ((r == "WAVES")) | |
84 | 84 | then unit | |
85 | 85 | else fromBase58String(r) | |
86 | 86 | let p = if (if ((e == "WAVES")) | |
87 | 87 | then true | |
88 | 88 | else (e == "")) | |
89 | 89 | then unit | |
90 | 90 | else fromBase58String(e) | |
91 | 91 | let u = addressFromStringValue(value(l)) | |
92 | 92 | let v = addressFromStringValue(value(q)) | |
93 | 93 | let w = getInteger(this, ((f + "_bidder_") + j)) | |
94 | 94 | if ((g > lastBlock.height)) | |
95 | 95 | then throw("Auction is not finished yet") | |
96 | 96 | else if (!(isDefined(l))) | |
97 | 97 | then if (isDefined(getString(this, (f + "_lot_passed")))) | |
98 | 98 | then throw("Organizer has already got his lot back") | |
99 | 99 | else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), q)]), TransferSet([ScriptTransfer(v, s, t)])) | |
100 | 100 | else if (isDefined(getString(this, (f + "_lot_passed")))) | |
101 | 101 | then throw("Lot is already passed to the winner, and organizer got his reward") | |
102 | 102 | else ScriptResult(WriteSet([DataEntry((f + "_lot_passed"), toBase58String(u.bytes))]), TransferSet([ScriptTransfer(u, s, t), ScriptTransfer(v, k, p)])) | |
103 | 103 | } | |
104 | 104 | ||
105 | 105 |
github/deemru/w8io/026f985 24.94 ms ◑