tx · E6UXrkkNqhN9D6nzvuwTpmKFY7N3YcZCLjXg1WZ1ApSa 3N81fQgwSNRedzT9Bj94U9GcR13YAxGf7eH: -0.01000000 Waves 2019.06.26 14:24 [559023] smart account 3N81fQgwSNRedzT9Bj94U9GcR13YAxGf7eH > SELF 0.00000000 Waves
{ "type": 13, "id": "E6UXrkkNqhN9D6nzvuwTpmKFY7N3YcZCLjXg1WZ1ApSa", "fee": 1000000, "feeAssetId": null, "timestamp": 1561548270243, "version": 1, "sender": "3N81fQgwSNRedzT9Bj94U9GcR13YAxGf7eH", "senderPublicKey": "B1ZNyD9xgbhqtbKhDqgkgwXspEYMQWBZkRnJRMALse6k", "proofs": [ "LwXzYi3ythHN8qw2yM4tS31GUmotJvUK9CxqKro9Z66eFmVvTnrLe79SiNMHrkXnDKFMsm7TqkujkQaK4FTJHEH" ], "script": "base64:AAIDAAAAAAAAAAAAAAAIAAAAAA1rZXlUb3BCYWxhbmNlAgAAAARfYmlkAAAAAAxrZXlUb3BCaWRkZXICAAAACl90b3BiaWRkZXIAAAAACGtleVRva2VuAgAAAAZfdG9rZW4AAAAADGtleU9yZ2FuaXplcgIAAAAKX29yZ2FuaXplcgAAAAAJa2V5SGVpZ2h0AgAAAAdfaGVpZ2h0AAAAAAppc0ZpbmlzaGVkCQAAZwAAAAIFAAAABmhlaWdodAkBAAAAB2V4dHJhY3QAAAABCQAEGgAAAAIFAAAABHRoaXMFAAAACWtleUhlaWdodAEAAAAKZ2V0QmFsYW5jZQAAAAEAAAAHYWRkcmVzcwQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAAdhZGRyZXNzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADWdldFRvcEJhbGFuY2UAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAADWtleVRvcEJhbGFuY2UDCQAAAQAAAAIFAAAABy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kZHJlc3NGcm9tU3RyaW5nAAAAAQUAAAAGYmlkZGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAACNXcm9uZyBhZGRyZXNzIG9yIG5vdGluZyB0byB0cmFuc2ZlcgkAAAIAAAABAgAAABtBdWN0aW9uIGlzIG5vdCBmaW5pc2hlZCB5ZXQAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABqbXfuU=", "chainId": 84, "height": 559023, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let a = "_bid" | |
5 | + | ||
6 | + | let b = "_topbidder" | |
7 | + | ||
8 | + | let c = "_token" | |
9 | + | ||
10 | + | let d = "_organizer" | |
11 | + | ||
12 | + | let e = "_height" | |
13 | + | ||
14 | + | let f = (height >= extract(getInteger(this, e))) | |
15 | + | ||
16 | + | func g (h) = { | |
17 | + | let i = getInteger(this, h) | |
18 | + | if ($isInstanceOf(i, "Int")) | |
19 | + | then { | |
20 | + | let j = i | |
21 | + | j | |
22 | + | } | |
23 | + | else 0 | |
24 | + | } | |
25 | + | ||
26 | + | ||
27 | + | func k () = { | |
28 | + | let i = getInteger(this, a) | |
29 | + | if ($isInstanceOf(i, "Int")) | |
30 | + | then { | |
31 | + | let j = i | |
32 | + | j | |
33 | + | } | |
34 | + | else 0 | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | @Callable(l) | |
39 | + | func bid () = { | |
40 | + | let m = toBase58String(l.caller.bytes) | |
41 | + | let n = g(m) | |
42 | + | if (!(f)) | |
43 | + | then { | |
44 | + | let o = { | |
45 | + | let i = l.payment | |
46 | + | if ($isInstanceOf(i, "AttachedPayment")) | |
47 | + | then { | |
48 | + | let p = i | |
49 | + | p | |
50 | + | } | |
51 | + | else throw("You have to provide a payment to your bid") | |
52 | + | } | |
53 | + | if ((o.assetId != unit)) | |
54 | + | then throw("This wallet cannot hold assets other than $Waves") | |
55 | + | else { | |
56 | + | let q = (n + o.amount) | |
57 | + | let r = k() | |
58 | + | if ((q > r)) | |
59 | + | then WriteSet([DataEntry(m, q), DataEntry(a, q), DataEntry(b, m)]) | |
60 | + | else WriteSet([DataEntry(m, q)]) | |
61 | + | } | |
62 | + | } | |
63 | + | else throw("Auction is over") | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | @Callable(l) | |
69 | + | func withdraw (h) = { | |
70 | + | let m = if ((h == "")) | |
71 | + | then toBase58String(l.caller.bytes) | |
72 | + | else if (if (if (if (if ((h == a)) | |
73 | + | then true | |
74 | + | else (h == b)) | |
75 | + | then true | |
76 | + | else (h == c)) | |
77 | + | then true | |
78 | + | else (h == d)) | |
79 | + | then true | |
80 | + | else (h == e)) | |
81 | + | then throw("Nice try") | |
82 | + | else h | |
83 | + | let s = (getString(this, b) == m) | |
84 | + | let t = (getString(this, d) == m) | |
85 | + | let u = (g(m) > 0) | |
86 | + | if (f) | |
87 | + | then if (if (s) | |
88 | + | then true | |
89 | + | else t) | |
90 | + | then { | |
91 | + | let v = extract(getString(this, b)) | |
92 | + | let w = extract(addressFromString(extract(getString(this, d)))) | |
93 | + | let x = g(v) | |
94 | + | let y = fromBase58String(extract(getString(this, c))) | |
95 | + | if ((x > 0)) | |
96 | + | then ScriptResult(WriteSet([DataEntry(v, 0)]), TransferSet([ScriptTransfer(extract(addressFromString(v)), 1, y), ScriptTransfer(w, x, unit)])) | |
97 | + | else throw("Not again") | |
98 | + | } | |
99 | + | else if (u) | |
100 | + | then { | |
101 | + | let z = g(m) | |
102 | + | ScriptResult(WriteSet([DataEntry(m, 0)]), TransferSet([ScriptTransfer(extract(addressFromString(m)), z, unit)])) | |
103 | + | } | |
104 | + | else throw("Wrong address or noting to transfer") | |
105 | + | else throw("Auction is not finished yet") | |
106 | + | } | |
107 | + | ||
108 | + | ||
109 | + | @Verifier(A) | |
110 | + | func B () = true | |
111 | + |
github/deemru/w8io/169f3d6 26.19 ms ◑