tx · 9SUTMYdaXvtZ4ZcFd3D5BoNgPVWC341zaDtAUaKDDVGF 3N5fiWxd1Tj36FwnY3WhSwaGuZqaZBXGg4y: -0.01400000 Waves 2019.08.10 18:11 [625086] smart account 3N5fiWxd1Tj36FwnY3WhSwaGuZqaZBXGg4y > SELF 0.00000000 Waves
{ "type": 13, "id": "9SUTMYdaXvtZ4ZcFd3D5BoNgPVWC341zaDtAUaKDDVGF", "fee": 1400000, "feeAssetId": null, "timestamp": 1565449824796, "version": 1, "sender": "3N5fiWxd1Tj36FwnY3WhSwaGuZqaZBXGg4y", "senderPublicKey": "CTtCHPVJUyydMg5UVRJqwu91B2zdiFfC2wXev1WGofcU", "proofs": [ "3Dj5u2CuZr9nEhhZQpvS83yMwHa8hRX671pwbaykvz2P7JQhYEpmfzHkYWQ6xXw699gUb7bX8oKdxxCZHBNf2wB7" ], "script": "base64:AAIDAAAAAAAAAAAAAAABAAAAABJtYXhBdWN0aW9uRHVyYXRpb24JAABoAAAAAgAAAAAAAAAFoAAAAAAAAAAAHgAAAAMAAAABaQEAAAAMc3RhcnRBdWN0aW9uAAAAAwAAAAhkdXJhdGlvbgAAAApzdGFydFByaWNlAAAADHByaWNlQXNzZXRJZAQAAAAJYXVjdGlvbklkCQACWAAAAAEIBQAAAAFpAAAADXRyYW5zYWN0aW9uSWQEAAAACWVuZEhlaWdodAkAAGQAAAACCAUAAAAJbGFzdEJsb2NrAAAABmhlaWdodAUAAAAIZHVyYXRpb24EAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkAAGYAAAACBQAAAAhkdXJhdGlvbgUAAAASbWF4QXVjdGlvbkR1cmF0aW9uCQAAAgAAAAEJAAEsAAAAAgIAAAAoRHVyYXRpb24gaXMgdG9vIGxvbmcuIE11c3QgYmUgbGVzcyB0aGFuIAkAAaQAAAABBQAAABJtYXhBdWN0aW9uRHVyYXRpb24JAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAA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NzZXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAANb3JnYW5pemVyQWRkcgUAAAAJd2luQW1vdW50BQAAAApwcmljZUFzc2V0BQAAAANuaWwAAAAAXiC0PQ==", "chainId": 84, "height": 625086, "spentComplexity": 0 } View: original | compacted Prev: 5ZyueLf3zRHsYjWjzGGEESP7zSHpwHTLHb8tJGrnHRSz Next: none 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 30.65 ms ◑