tx · 6VFMfAC5YHBBHwV7rdR3TPwKg4D3JUDbuusqTqaTpz4r 3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF: -0.01400000 Waves 2019.06.28 18:27 [562154] smart account 3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF > SELF 0.00000000 Waves
{ "type": 13, "id": "6VFMfAC5YHBBHwV7rdR3TPwKg4D3JUDbuusqTqaTpz4r", "fee": 1400000, "feeAssetId": null, "timestamp": 1561735693904, "version": 1, "sender": "3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF", "senderPublicKey": "7pDDrtFSiQHYSxpdxuBQVCeBQBwa3fFWMBmtJ85aytGX", "proofs": [ "5Qu9zBBzyiT8MFBuogB2fXyU2inkmQoQCTaFHt9xF2e7JG1GpZTJpFDZX2qB3XdGzVGbWxfx9EbnTkj8pcwNUXrn" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAQAAABNnZXRBZGRyZXNzRnJvbUVudHJ5AAAAAQAAAANrZXkEAAAAB2FkZHJlc3MEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAA3N0cgUAAAAHJG1hdGNoMAUAAAADc3RyCQAAAgAAAAECAAAAFkZpcnN0IGFkZHJlc3Mgbm90IHNldCEFAAAAB2FkZHJlc3MBAAAAGmdldEFkZHJlc3NGcm9tRW50cnlPckVtcHR5AAAAAQAAAANrZXkEAAAAB2FkZHJlc3MEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAA3N0cgUAAAAHJG1hdGNoMAUAAAADc3RyAgAAAAAFAAAAB2FkZHJlc3MBAAAADWdldEludEZyb21LZXkAAAABAAAAA2tleQQAAAASZmlyc3RBZGRyZXNzQW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFA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3VycmVudFNlY29uZEFkZHJlc3MJAQAAABpnZXRBZGRyZXNzRnJvbUVudHJ5T3JFbXB0eQAAAAEJAAEsAAAAAgUAAAANc2Vjb25kQWRkcmVzcwIAAAAMX2NvdW50ZXJwYXJ0AwMJAQAAAAIhPQAAAAIFAAAAE2N1cnJlbnRGaXJzdEFkZHJlc3MCAAAAAAYJAQAAAAIhPQAAAAIFAAAAFGN1cnJlbnRTZWNvbmRBZGRyZXNzAgAAAAAJAAACAAAAAQIAAAAbQ29udHJhY3QgYWxyZWFkeSBpbml0aWF0ZWQhCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAxmaXJzdEFkZHJlc3MFAAAADGZpcnN0QWRkcmVzcwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAANc2Vjb25kQWRkcmVzcwUAAAANc2Vjb25kQWRkcmVzcwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAxmaXJzdEFkZHJlc3MCAAAADF9jb3VudGVycGFydAUAAAAPc2Vjb25kUHVibGljS2V5CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAADXNlY29uZEFkZHJlc3MCAAAADF9jb3VudGVycGFydAUAAAAOZmlyc3RQdWJsaWNLZXkJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAADnRpbWVsb2NrUGVyaW9kBQAAAA50aW1lbG9ja1BlcmlvZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgGThOtmA==", "chainId": 84, "height": 562154, "spentComplexity": 0 } View: original | compacted Prev: FojUwSUufR4zkPtmChvhAGYaSv6mzrhGLkKWoG9rwJyf Next: 2YVo26kgx2XvHbNVPkA8KYp5UJMaAbTLPL1txnATXqLD Diff:
Old | New | Differences | |
---|---|---|---|
120 | 120 | let v = ((((o + toString(p)) + q) + toString(r)) + toString(s)) | |
121 | 121 | let C = toBase58String(toBytes(v)) | |
122 | 122 | let w = a((k + "_counterpart")) | |
123 | - | let x = sigVerify( | |
123 | + | let x = sigVerify(toBytes(v), fromBase58String(t), fromBase58String(w)) | |
124 | 124 | let D = g("timelockPeriod") | |
125 | 125 | if (if (x) | |
126 | 126 | then u |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a (b) = { | |
5 | 5 | let c = { | |
6 | 6 | let d = getString(this, b) | |
7 | 7 | if ($isInstanceOf(d, "String")) | |
8 | 8 | then { | |
9 | 9 | let e = d | |
10 | 10 | e | |
11 | 11 | } | |
12 | 12 | else throw("First address not set!") | |
13 | 13 | } | |
14 | 14 | c | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func f (b) = { | |
19 | 19 | let c = { | |
20 | 20 | let d = getString(this, b) | |
21 | 21 | if ($isInstanceOf(d, "String")) | |
22 | 22 | then { | |
23 | 23 | let e = d | |
24 | 24 | e | |
25 | 25 | } | |
26 | 26 | else "" | |
27 | 27 | } | |
28 | 28 | c | |
29 | 29 | } | |
30 | 30 | ||
31 | 31 | ||
32 | 32 | func g (b) = { | |
33 | 33 | let h = { | |
34 | 34 | let d = getInteger(this, b) | |
35 | 35 | if ($isInstanceOf(d, "Int")) | |
36 | 36 | then { | |
37 | 37 | let i = d | |
38 | 38 | i | |
39 | 39 | } | |
40 | 40 | else 0 | |
41 | 41 | } | |
42 | 42 | h | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func j (k) = { | |
47 | 47 | let l = a("firstAddress") | |
48 | 48 | let m = a("secondAddress") | |
49 | 49 | if (if ((l != k)) | |
50 | 50 | then (m != k) | |
51 | 51 | else false) | |
52 | 52 | then throw(("Method call from invalid account: " + k)) | |
53 | 53 | else true | |
54 | 54 | } | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | @Callable(n) | |
58 | 58 | func claimCheating (o,p,q,r,s,t) = { | |
59 | 59 | let k = toBase58String(n.caller.bytes) | |
60 | 60 | let u = j(k) | |
61 | 61 | let v = ((((o + toString(p)) + q) + toString(r)) + toString(s)) | |
62 | 62 | let w = a((k + "_counterpart")) | |
63 | 63 | let x = sigVerify(fromBase58String(v), fromBase58String(t), fromBase58String(w)) | |
64 | 64 | let y = g("timestamp") | |
65 | 65 | if (if (if (u) | |
66 | 66 | then x | |
67 | 67 | else false) | |
68 | 68 | then (s > y) | |
69 | 69 | else false) | |
70 | 70 | then TransferSet([ScriptTransfer(n.caller, (p + r), unit)]) | |
71 | 71 | else throw("Wrong signature or timestamp not newer!") | |
72 | 72 | } | |
73 | 73 | ||
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Callable(n) | |
77 | 77 | func confirmClose () = { | |
78 | 78 | let k = toBase58String(n.caller.bytes) | |
79 | 79 | let u = j(k) | |
80 | 80 | let z = getString(this, "closing_initiated_by") | |
81 | 81 | if (if ((k != z)) | |
82 | 82 | then u | |
83 | 83 | else false) | |
84 | 84 | then { | |
85 | 85 | let l = a("firstAddress") | |
86 | 86 | let m = a("secondAddress") | |
87 | 87 | let h = g(l) | |
88 | 88 | let A = g(m) | |
89 | 89 | TransferSet([ScriptTransfer(Address(fromBase58String(l)), h, unit), ScriptTransfer(Address(fromBase58String(m)), A, unit)]) | |
90 | 90 | } | |
91 | 91 | else throw("Initiator can not confirm closing of the channel!") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | ||
96 | 96 | @Callable(n) | |
97 | 97 | func closeAfterTimelock () = { | |
98 | 98 | let k = toBase58String(n.caller.bytes) | |
99 | 99 | let u = j(k) | |
100 | 100 | let B = g("timelock") | |
101 | 101 | if (if ((height > B)) | |
102 | 102 | then u | |
103 | 103 | else false) | |
104 | 104 | then { | |
105 | 105 | let l = a("firstAddress") | |
106 | 106 | let m = a("secondAddress") | |
107 | 107 | let h = g(l) | |
108 | 108 | let A = g(m) | |
109 | 109 | TransferSet([ScriptTransfer(Address(fromBase58String(l)), h, unit), ScriptTransfer(Address(fromBase58String(m)), A, unit)]) | |
110 | 110 | } | |
111 | 111 | else throw("Timelock still valid!") | |
112 | 112 | } | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | ||
116 | 116 | @Callable(n) | |
117 | 117 | func initialClosing (o,p,q,r,s,t) = { | |
118 | 118 | let k = toBase58String(n.caller.bytes) | |
119 | 119 | let u = j(k) | |
120 | 120 | let v = ((((o + toString(p)) + q) + toString(r)) + toString(s)) | |
121 | 121 | let C = toBase58String(toBytes(v)) | |
122 | 122 | let w = a((k + "_counterpart")) | |
123 | - | let x = sigVerify( | |
123 | + | let x = sigVerify(toBytes(v), fromBase58String(t), fromBase58String(w)) | |
124 | 124 | let D = g("timelockPeriod") | |
125 | 125 | if (if (x) | |
126 | 126 | then u | |
127 | 127 | else false) | |
128 | 128 | then WriteSet([DataEntry(o, p), DataEntry(q, r), DataEntry("closing_initiated_by", k), DataEntry("timestamp", s), DataEntry("timelock", (height + D))]) | |
129 | 129 | else throw("Wrong signature!") | |
130 | 130 | } | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | ||
134 | 134 | @Callable(n) | |
135 | 135 | func fund () = { | |
136 | 136 | let k = toBase58String(n.caller.bytes) | |
137 | 137 | let u = j(k) | |
138 | 138 | let E = extract(n.payment) | |
139 | 139 | let F = (k + "_amount") | |
140 | 140 | let G = g(F) | |
141 | 141 | if (u) | |
142 | 142 | then if ((G != 0)) | |
143 | 143 | then throw("User has already funded payment channel!") | |
144 | 144 | else WriteSet([DataEntry(F, (G + E.amount))]) | |
145 | 145 | else throw("Wrong account tries to fund channel!") | |
146 | 146 | } | |
147 | 147 | ||
148 | 148 | ||
149 | 149 | ||
150 | 150 | @Callable(n) | |
151 | 151 | func init (l,H,m,I,D) = { | |
152 | 152 | let J = f((l + "_counterpart")) | |
153 | 153 | let K = f((m + "_counterpart")) | |
154 | 154 | if (if ((J != "")) | |
155 | 155 | then true | |
156 | 156 | else (K != "")) | |
157 | 157 | then throw("Contract already initiated!") | |
158 | 158 | else WriteSet([DataEntry("firstAddress", l), DataEntry("secondAddress", m), DataEntry((l + "_counterpart"), I), DataEntry((m + "_counterpart"), H), DataEntry("timelockPeriod", D)]) | |
159 | 159 | } | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | @Verifier(L) | |
163 | 163 | func M () = { | |
164 | 164 | let d = L | |
165 | 165 | true | |
166 | 166 | } | |
167 | 167 |
github/deemru/w8io/169f3d6 152.47 ms ◑