tx · GeMAKHtqJDtNo4TutAMuVHfG1gHkaFi6nKaM4eNANeTD 3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF: -0.01400000 Waves 2019.06.27 22:37 [560964] smart account 3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF > SELF 0.00000000 Waves
{ "type": 13, "id": "GeMAKHtqJDtNo4TutAMuVHfG1gHkaFi6nKaM4eNANeTD", "fee": 1400000, "feeAssetId": null, "timestamp": 1561664295396, "version": 1, "sender": "3MwyXzxpp65TzAvdJxnexgz9G5kFkcqGLMF", "senderPublicKey": "7pDDrtFSiQHYSxpdxuBQVCeBQBwa3fFWMBmtJ85aytGX", "proofs": [ "AzFjJqe5DjWnoifhzGuQmsWZqLjZNw7JCTuFzNbysktSRpNBK49rLRH5YUrkThdbxYDuuDoWfzLDahce5VELaCP" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAQAAABNnZXRBZGRyZXNzRnJvbUVudHJ5AAAAAQAAAANrZXkEAAAAB2FkZHJlc3MEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAA3N0cgUAAAAHJG1hdGNoMAUAAAADc3RyCQAAAgAAAAECAAAAFkZpcnN0IGFkZHJlc3Mgbm90IHNldCEFAAAAB2FkZHJlc3MBAAAAGmdldEFkZHJlc3NGcm9tRW50cnlPckVtcHR5AAAAAQAAAANrZXkEAAAAB2FkZHJlc3MEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAA3N0cgUAAAAHJG1hdGNoMAUAAAADc3RyAgAAAAAFAAAAB2FkZHJlc3MBAAAADWdldEludEZyb21LZXkAAAABAAAAA2tleQQAAAASZmlyc3RBZGRyZXNzQW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFA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ACIT0AAAACBQAAABNjdXJyZW50Rmlyc3RBZGRyZXNzAgAAAAAGCQEAAAACIT0AAAACBQAAABRjdXJyZW50U2Vjb25kQWRkcmVzcwIAAAAACQAAAgAAAAECAAAAG0NvbnRyYWN0IGFscmVhZHkgaW5pdGlhdGVkIQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAMZmlyc3RBZGRyZXNzBQAAAAxmaXJzdEFkZHJlc3MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAADXNlY29uZEFkZHJlc3MFAAAADXNlY29uZEFkZHJlc3MJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAEsAAAAAgUAAAAMZmlyc3RBZGRyZXNzAgAAAAxfY291bnRlcnBhcnQFAAAAD3NlY29uZFB1YmxpY0tleQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAA1zZWNvbmRBZGRyZXNzAgAAAAxfY291bnRlcnBhcnQFAAAADmZpcnN0UHVibGljS2V5CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAA50aW1lbG9ja1BlcmlvZAUAAAAOdGltZWxvY2tQZXJpb2QFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4Bg+ksUg=", "chainId": 84, "height": 560964, "spentComplexity": 0 } View: original | compacted Prev: 2s3h14MpDKwzrbMv2NXQumLzFCCqh2Gmb4eb5puWWTk6 Next: C2oS55Dqxi7s8g9nsMj4hwUhcaiKguT2GSFt5kYEp2tS Diff:
Old | New | Differences | |
---|---|---|---|
119 | 119 | let u = j(k) | |
120 | 120 | let v = base58'93M7wAymK2hDNWAzYkHZcWgiL2Cey4ZvTtfLPTFyhf23yVE3H1ikTSpBuHkSU5vi9qXbXWiJmhxamKyUuA17SxgGpWvwy1MqwBLDh8c5hh6iudfiY3mj5UeGM4n' | |
121 | 121 | let w = a((k + "_counterpart")) | |
122 | - | let x = sigVerify(v, | |
122 | + | let x = sigVerify(v, fromBase58String(t), fromBase58String(w)) | |
123 | 123 | let C = g("timelockPeriod") | |
124 | 124 | if (if (x) | |
125 | 125 | 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 = base58'93M7wAymK2hDNWAzYkHZcWgiL2Cey4ZvTtfLPTFyhf23yVE3H1ikTSpBuHkSU5vi9qXbXWiJmhxamKyUuA17SxgGpWvwy1MqwBLDh8c5hh6iudfiY3mj5UeGM4n' | |
121 | 121 | let w = a((k + "_counterpart")) | |
122 | - | let x = sigVerify(v, | |
122 | + | let x = sigVerify(v, fromBase58String(t), fromBase58String(w)) | |
123 | 123 | let C = g("timelockPeriod") | |
124 | 124 | if (if (x) | |
125 | 125 | then u | |
126 | 126 | else false) | |
127 | 127 | then WriteSet([DataEntry(o, p), DataEntry(q, r), DataEntry("closing_initiated_by", k), DataEntry("timestamp", s), DataEntry("timelock", (height + C))]) | |
128 | 128 | else throw("Wrong signature!") | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Callable(n) | |
134 | 134 | func fund () = { | |
135 | 135 | let k = toBase58String(n.caller.bytes) | |
136 | 136 | let u = j(k) | |
137 | 137 | let D = extract(n.payment) | |
138 | 138 | let E = (k + "_amount") | |
139 | 139 | let F = g(E) | |
140 | 140 | if (u) | |
141 | 141 | then if ((F != 0)) | |
142 | 142 | then throw("User has already funded payment channel!") | |
143 | 143 | else WriteSet([DataEntry(E, (F + D.amount))]) | |
144 | 144 | else throw("Wrong account tries to fund channel!") | |
145 | 145 | } | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | 149 | @Callable(n) | |
150 | 150 | func init (l,G,m,H,C) = { | |
151 | 151 | let I = f((l + "_counterpart")) | |
152 | 152 | let J = f((m + "_counterpart")) | |
153 | 153 | if (if ((I != "")) | |
154 | 154 | then true | |
155 | 155 | else (J != "")) | |
156 | 156 | then throw("Contract already initiated!") | |
157 | 157 | else WriteSet([DataEntry("firstAddress", l), DataEntry("secondAddress", m), DataEntry((l + "_counterpart"), H), DataEntry((m + "_counterpart"), G), DataEntry("timelockPeriod", C)]) | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | @Verifier(K) | |
162 | 162 | func L () = { | |
163 | 163 | let d = K | |
164 | 164 | true | |
165 | 165 | } | |
166 | 166 |
github/deemru/w8io/169f3d6 38.07 ms ◑