tx · 71TRJ8kbznKzK8KZ1JhqGNB5Kr3ooSPDRNPqw3iN6wvE 3MzgHu3mKKdBoJKyz1jArzWBNwbB6dHAyti: -0.01000000 Waves 2019.09.07 19:32 [665909] smart account 3MzgHu3mKKdBoJKyz1jArzWBNwbB6dHAyti > SELF 0.00000000 Waves
{ "type": 13, "id": "71TRJ8kbznKzK8KZ1JhqGNB5Kr3ooSPDRNPqw3iN6wvE", "fee": 1000000, "feeAssetId": null, "timestamp": 1567873935996, "version": 1, "sender": "3MzgHu3mKKdBoJKyz1jArzWBNwbB6dHAyti", "senderPublicKey": "6h5J81bqqj3kUeyxapapiFTqmaAh9U3vVhthdffmRqyW", "proofs": [ "5NSmwgREvGSnw5AeamWdwfw1RWgBVkrkcJXoYxRRMEPTiCjKr72J6TKFpgCYvtBBKbsoBaUD3Rmzibta5pwgux28" ], "script": "base64:AAIDAAAAAAAAAAAAAAALAAAAAApzZXJ2aWNlRmVlAAAAAAAAAYagAAAAAAVlbXB0eQIAAAAETlVMTAAAAAASYWxsTWVzc2FnZUJvYXJkS2V5AgAAAAthbGxfbWVzc2FnZQAAAAAQYWN0aXZlTWVzc2FnZUtleQIAAAAOYWN0aXZlX21lc3NhZ2UAAAAADmVhcm5lZFdhdmVzS2V5AgAAAAtlYXJuZWRXYXZlcwAAAAANc2VydmljZUZlZUtleQIAAAAKc2VydmljZUZlZQAAAAAJZEFwcE93bmVyAgAAABojZEFwcCBPd25lciBXYXZlcyBBZGRyZXNzIwEAAAAJdW5pcXVlS2V5AAAAAgAAAAVvd25lcgAAAAR0ZXh0BAAAAAR1S2V5CQACWAAAAAEJAAH3AAAAAQkAAZsAAAABCQABLAAAAAIFAAAABW93bmVyBQAAAAR0ZXh0BQAAAAR1S2V5AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAANudW0EAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJ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AAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEGFjdGl2ZU1lc3NhZ2VLZXkJAABlAAAAAgUAAAAKYWN0TWVzc2FnZQAAAAAAAAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACAgAAAAhtZXNzYWdlXwUAAAAEdUtleQIAAAAUI1ZJT0xBVElPTiBPRiBSVUxFUyMFAAAAA25pbAAAAAFpAQAAAAh3aXRoZHJhdwAAAAEAAAAGYW1vdW50BAAAAA1zZW5kZXJBZGRyZXNzCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMDCQEAAAACIT0AAAACBQAAAA1zZW5kZXJBZGRyZXNzBQAAAAlkQXBwT3duZXIJAAACAAAAAQIAAAAaWW91IGFyZW4ndCBvd25lciB0aGlzIGRBcHAJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAZhbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5/cm/Ww==", "chainId": 84, "height": 665909, "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 = 100000 | |
5 | + | ||
6 | + | let b = "NULL" | |
7 | + | ||
8 | + | let c = "all_message" | |
9 | + | ||
10 | + | let d = "active_message" | |
11 | + | ||
12 | + | let e = "earnedWaves" | |
13 | + | ||
14 | + | let f = "serviceFee" | |
15 | + | ||
16 | + | let g = "#dApp Owner Waves Address#" | |
17 | + | ||
18 | + | func h (i,j) = { | |
19 | + | let k = toBase58String(sha256(toBytes((i + j)))) | |
20 | + | k | |
21 | + | } | |
22 | + | ||
23 | + | ||
24 | + | func l (m) = { | |
25 | + | let n = { | |
26 | + | let o = getInteger(this, m) | |
27 | + | if ($isInstanceOf(o, "Int")) | |
28 | + | then { | |
29 | + | let p = o | |
30 | + | p | |
31 | + | } | |
32 | + | else 0 | |
33 | + | } | |
34 | + | n | |
35 | + | } | |
36 | + | ||
37 | + | ||
38 | + | func q (m) = { | |
39 | + | let r = { | |
40 | + | let o = getString(this, m) | |
41 | + | if ($isInstanceOf(o, "String")) | |
42 | + | then { | |
43 | + | let p = o | |
44 | + | p | |
45 | + | } | |
46 | + | else b | |
47 | + | } | |
48 | + | r | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | func s () = { | |
53 | + | let t = { | |
54 | + | let o = getInteger(this, f) | |
55 | + | if ($isInstanceOf(o, "Int")) | |
56 | + | then { | |
57 | + | let p = o | |
58 | + | p | |
59 | + | } | |
60 | + | else a | |
61 | + | } | |
62 | + | t | |
63 | + | } | |
64 | + | ||
65 | + | ||
66 | + | @Callable(u) | |
67 | + | func setMessage (j) = { | |
68 | + | let v = extract(u.payment) | |
69 | + | let w = s() | |
70 | + | if (isDefined(v.assetId)) | |
71 | + | then throw("WAVES token only at the moment") | |
72 | + | else if ((v.amount != w)) | |
73 | + | then throw("Wrong service fee amount") | |
74 | + | else { | |
75 | + | let x = toBase58String(u.caller.bytes) | |
76 | + | let k = h(x, (toString(height) + toBase58String(u.transactionId))) | |
77 | + | let y = l(c) | |
78 | + | let z = l(d) | |
79 | + | let A = l(e) | |
80 | + | WriteSet([DataEntry(("owner_" + k), x), DataEntry(("message_" + k), j), DataEntry(c, (y + 1)), DataEntry(d, (z + 1)), DataEntry(e, (A + w))]) | |
81 | + | } | |
82 | + | } | |
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | @Callable(u) | |
87 | + | func removeMessage (k) = { | |
88 | + | let i = q(("owner_" + k)) | |
89 | + | let z = l(d) | |
90 | + | let B = toBase58String(u.caller.bytes) | |
91 | + | if ((i == b)) | |
92 | + | then throw("Message didn't found") | |
93 | + | else if ((i != B)) | |
94 | + | then throw(("You don't owner of message " + k)) | |
95 | + | else WriteSet([DataEntry(d, (z - 1)), DataEntry(("message_" + k), "#REMOVED#")]) | |
96 | + | } | |
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | @Callable(u) | |
101 | + | func setServiceFee (C) = { | |
102 | + | let B = toBase58String(u.caller.bytes) | |
103 | + | if ((B != g)) | |
104 | + | then throw("You aren't owner this dApp") | |
105 | + | else WriteSet([DataEntry(f, C)]) | |
106 | + | } | |
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | @Callable(u) | |
111 | + | func violationDetected (k) = { | |
112 | + | let z = l(d) | |
113 | + | let B = toBase58String(u.caller.bytes) | |
114 | + | if ((B != g)) | |
115 | + | then throw("You aren't owner this dApp") | |
116 | + | else WriteSet([DataEntry(d, (z - 1)), DataEntry(("message_" + k), "#VIOLATION OF RULES#")]) | |
117 | + | } | |
118 | + | ||
119 | + | ||
120 | + | ||
121 | + | @Callable(u) | |
122 | + | func withdraw (D) = { | |
123 | + | let B = toBase58String(u.caller.bytes) | |
124 | + | if ((B != g)) | |
125 | + | then throw("You aren't owner this dApp") | |
126 | + | else TransferSet([ScriptTransfer(u.caller, D, unit)]) | |
127 | + | } | |
128 | + | ||
129 | + | ||
130 | + | @Verifier(E) | |
131 | + | func F () = sigVerify(E.bodyBytes, E.proofs[0], E.senderPublicKey) | |
132 | + |
github/deemru/w8io/026f985 40.57 ms ◑