tx · 3Np9XXsZAAF6myzAQ6XNZwDBDyzkgeJkFxcQXxu5GNrr 3NAnrRUttuM8z2xyQdcZDZ9siKDcExnMD7h: -0.01400000 Waves 2022.12.06 12:44 [2348319] smart account 3NAnrRUttuM8z2xyQdcZDZ9siKDcExnMD7h > SELF 0.00000000 Waves
{ "type": 13, "id": "3Np9XXsZAAF6myzAQ6XNZwDBDyzkgeJkFxcQXxu5GNrr", "fee": 1400000, "feeAssetId": null, "timestamp": 1670319607205, "version": 2, "chainId": 84, "sender": "3NAnrRUttuM8z2xyQdcZDZ9siKDcExnMD7h", "senderPublicKey": "9N3y4L5Mhfn5nsh2J2sfe2wNG7t8TFXQVHJb1mXXSahb", "proofs": [ "4Mcdk2muKo9JX3PXkuSrHn8CpGnpRmWgHheqeUqXWFm8uQMTbcdCuPC5MbH62ubM979XrSdna7twCHuFrbmJzeV7" ], "script": "base64:BgIjCAISBAoCGAESAwoBCBIDCgEIEgMKAQESBAoCCAgSBAoCCAgIAAlTRVBBUkFUT1ICAl9fAAxLRVlfTVVMVElTSUcCCE1VTFRJU0lHAA9LRVlfUFVCTElDX0tFWVMCC1BVQkxJQ19LRVlTAApLRVlfUVVPUlVNAgZRVU9SVU0AC0tFWV9DT05GSVJNAgdDT05GSVJNAApLRVlfU1RBVFVTAgZTVEFUVVMBEF92YWxpZGF0ZUFkZHJlc3MBCGFkZHJlc3NfBAckbWF0Y2gwCQCmCAEFCGFkZHJlc3NfAwkAAQIFByRtYXRjaDACB0FkZHJlc3MEAWEFByRtYXRjaDAGBwEOX3ZhbGlkYXRlT3duZXICBGFjY18FZWxlbV8DCQAAAgUFZWxlbV8CAAkAAgECDWludmFsaWQgb3duZXIDCQECIT0CCQDIAQEJANkEAQUFZWxlbV8AIAkAAgECGGludmFsaWQgb3duZXIgcHVibGljIGtleQUEYWNjXwYBaQEEaW5pdAIHb3duZXJzXwdxdW9ydW1fBANlcnIDCQEJaXNEZWZpbmVkAQkAoggBBQxLRVlfTVVMVElTSUcJ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Jvb2xlYW5FbnRyeQIFCXN0YXR1c0tleQkAZwIFEmNvbmZpcm1hdGlvbnNDb3VudAUGcXVvcnVtBQNuaWwFBHVuaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAckbWF0Y2gwCQCiCAEFDEtFWV9NVUxUSVNJRwMJAAECBQckbWF0Y2gwAgZTdHJpbmcECG11bHRpc2lnBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCG11bHRpc2lnCQC5CQIJAMwIAgUKS0VZX1NUQVRVUwkAzAgCCQClCAEFBHRoaXMJAMwIAgkA2AQBCAUCdHgCaWQFA25pbAUJU0VQQVJBVE9SBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tledsxC/w=", "height": 2348319, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BufGtpBmQXbwF79168vLrt8gUWLdKH8HH6NdQkT3Vtah Next: none Diff:
Old | New | Differences | |
---|---|---|---|
80 | 80 | let C = split(B, a) | |
81 | 81 | if ((n.caller != this)) | |
82 | 82 | then throw("addOwner: not allowed") | |
83 | - | else if ((k(0, A) | |
83 | + | else if ((k(0, A) != 0)) | |
84 | 84 | then throw("addOwner: invalid public key") | |
85 | - | else if ((size(C) == 10)) | |
86 | - | then throw("addOwner: too many owners") | |
87 | - | else { | |
88 | - | let D = (C :+ A) | |
89 | - | let E = [StringEntry(c, makeString(D, a))] | |
90 | - | $Tuple2(E, unit) | |
91 | - | } | |
85 | + | else if (containsElement(C, A)) | |
86 | + | then throw("addOwner: public key already added") | |
87 | + | else if ((size(C) == 10)) | |
88 | + | then throw("addOwner: too many owners") | |
89 | + | else { | |
90 | + | let D = (C :+ A) | |
91 | + | let E = [StringEntry(c, makeString(D, a))] | |
92 | + | $Tuple2(E, unit) | |
93 | + | } | |
92 | 94 | } | |
93 | 95 | ||
94 | 96 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "__" | |
5 | 5 | ||
6 | 6 | let b = "MULTISIG" | |
7 | 7 | ||
8 | 8 | let c = "PUBLIC_KEYS" | |
9 | 9 | ||
10 | 10 | let d = "QUORUM" | |
11 | 11 | ||
12 | 12 | let e = "CONFIRM" | |
13 | 13 | ||
14 | 14 | let f = "STATUS" | |
15 | 15 | ||
16 | 16 | func g (h) = { | |
17 | 17 | let i = addressFromString(h) | |
18 | 18 | if ($isInstanceOf(i, "Address")) | |
19 | 19 | then { | |
20 | 20 | let j = i | |
21 | 21 | true | |
22 | 22 | } | |
23 | 23 | else false | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func k (l,m) = if ((m == "")) | |
28 | 28 | then throw("invalid owner") | |
29 | 29 | else if ((size(fromBase58String(m)) != 32)) | |
30 | 30 | then throw("invalid owner public key") | |
31 | 31 | else l | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(n) | |
35 | 35 | func init (o,p) = { | |
36 | 36 | let q = if (isDefined(getString(b))) | |
37 | 37 | then throw("init: already initialized") | |
38 | 38 | else unit | |
39 | 39 | if ((q == q)) | |
40 | 40 | then { | |
41 | 41 | let r = if (if ((0 >= size(o))) | |
42 | 42 | then true | |
43 | 43 | else (size(o) > 10)) | |
44 | 44 | then throw("init: invalid owners") | |
45 | 45 | else if (if ((0 >= p)) | |
46 | 46 | then true | |
47 | 47 | else (p > size(o))) | |
48 | 48 | then throw("init: invalid quorum") | |
49 | 49 | else unit | |
50 | 50 | if ((r == r)) | |
51 | 51 | then { | |
52 | 52 | let s = { | |
53 | 53 | let t = o | |
54 | 54 | let u = size(t) | |
55 | 55 | let v = 0 | |
56 | 56 | func w (x,y) = if ((y >= u)) | |
57 | 57 | then x | |
58 | 58 | else k(x, t[y]) | |
59 | 59 | ||
60 | 60 | func z (x,y) = if ((y >= u)) | |
61 | 61 | then x | |
62 | 62 | else throw("List size exceeds 10") | |
63 | 63 | ||
64 | 64 | z(w(w(w(w(w(w(w(w(w(w(v, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
65 | 65 | } | |
66 | 66 | if ((s == s)) | |
67 | 67 | then $Tuple2([StringEntry(b, toString(this)), StringEntry(c, makeString(o, a)), IntegerEntry(d, p)], unit) | |
68 | 68 | else throw("Strict value is not equal to itself.") | |
69 | 69 | } | |
70 | 70 | else throw("Strict value is not equal to itself.") | |
71 | 71 | } | |
72 | 72 | else throw("Strict value is not equal to itself.") | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(n) | |
78 | 78 | func addOwner (A) = { | |
79 | 79 | let B = getStringValue(c) | |
80 | 80 | let C = split(B, a) | |
81 | 81 | if ((n.caller != this)) | |
82 | 82 | then throw("addOwner: not allowed") | |
83 | - | else if ((k(0, A) | |
83 | + | else if ((k(0, A) != 0)) | |
84 | 84 | then throw("addOwner: invalid public key") | |
85 | - | else if ((size(C) == 10)) | |
86 | - | then throw("addOwner: too many owners") | |
87 | - | else { | |
88 | - | let D = (C :+ A) | |
89 | - | let E = [StringEntry(c, makeString(D, a))] | |
90 | - | $Tuple2(E, unit) | |
91 | - | } | |
85 | + | else if (containsElement(C, A)) | |
86 | + | then throw("addOwner: public key already added") | |
87 | + | else if ((size(C) == 10)) | |
88 | + | then throw("addOwner: too many owners") | |
89 | + | else { | |
90 | + | let D = (C :+ A) | |
91 | + | let E = [StringEntry(c, makeString(D, a))] | |
92 | + | $Tuple2(E, unit) | |
93 | + | } | |
92 | 94 | } | |
93 | 95 | ||
94 | 96 | ||
95 | 97 | ||
96 | 98 | @Callable(n) | |
97 | 99 | func removeOwner (A) = { | |
98 | 100 | let F = getIntegerValue(d) | |
99 | 101 | let B = getStringValue(c) | |
100 | 102 | let C = split(B, a) | |
101 | 103 | if ((n.caller != this)) | |
102 | 104 | then throw("removeOwner: not allowed") | |
103 | 105 | else if ((A == "")) | |
104 | 106 | then throw("removeOwner: invalid public key") | |
105 | 107 | else if ((size(C) == 1)) | |
106 | 108 | then throw("removeOwner: too few owners") | |
107 | 109 | else { | |
108 | 110 | let G = { | |
109 | 111 | let i = indexOf(C, A) | |
110 | 112 | if ($isInstanceOf(i, "Int")) | |
111 | 113 | then { | |
112 | 114 | let j = i | |
113 | 115 | j | |
114 | 116 | } | |
115 | 117 | else throw("removeOwner: no such owner") | |
116 | 118 | } | |
117 | 119 | let D = removeByIndex(C, G) | |
118 | 120 | let E = [StringEntry(c, makeString(D, a))] | |
119 | 121 | let H = if ((F > size(D))) | |
120 | 122 | then [IntegerEntry(d, size(D))] | |
121 | 123 | else nil | |
122 | 124 | $Tuple2((E ++ H), unit) | |
123 | 125 | } | |
124 | 126 | } | |
125 | 127 | ||
126 | 128 | ||
127 | 129 | ||
128 | 130 | @Callable(n) | |
129 | 131 | func setQuorum (p) = { | |
130 | 132 | let B = getStringValue(c) | |
131 | 133 | let C = split(B, a) | |
132 | 134 | if ((n.caller != this)) | |
133 | 135 | then throw("setQuorum: not allowed") | |
134 | 136 | else if (if ((0 >= p)) | |
135 | 137 | then true | |
136 | 138 | else (p > size(C))) | |
137 | 139 | then throw("setQuorum: invalid quorum") | |
138 | 140 | else $Tuple2([IntegerEntry(d, p)], unit) | |
139 | 141 | } | |
140 | 142 | ||
141 | 143 | ||
142 | 144 | ||
143 | 145 | @Callable(n) | |
144 | 146 | func confirmTransaction (I,J) = { | |
145 | 147 | let K = toBase58String(n.callerPublicKey) | |
146 | 148 | let F = getIntegerValue(d) | |
147 | 149 | let B = getStringValue(c) | |
148 | 150 | let C = split(B, a) | |
149 | 151 | let L = makeString([e, I, J], a) | |
150 | 152 | let M = valueOrElse(getString(L), "") | |
151 | 153 | let N = makeString([f, I, J], a) | |
152 | 154 | let q = if (!(containsElement(C, K))) | |
153 | 155 | then throw("confirmTransaction: only admin") | |
154 | 156 | else if ((size(fromBase58String(J)) != 32)) | |
155 | 157 | then throw("confirmTransaction: invalid txId") | |
156 | 158 | else if (!(g(I))) | |
157 | 159 | then throw("confirmTransaction: invalid dapp address") | |
158 | 160 | else if (contains(M, K)) | |
159 | 161 | then throw("confirmTransaction: already confirmed") | |
160 | 162 | else unit | |
161 | 163 | if ((q == q)) | |
162 | 164 | then { | |
163 | 165 | let O = (1 + (if ((M == "")) | |
164 | 166 | then 0 | |
165 | 167 | else size(split(M, a)))) | |
166 | 168 | let P = if ((M == "")) | |
167 | 169 | then K | |
168 | 170 | else ((M + a) + K) | |
169 | 171 | $Tuple2([StringEntry(L, P), BooleanEntry(N, (O >= F))], unit) | |
170 | 172 | } | |
171 | 173 | else throw("Strict value is not equal to itself.") | |
172 | 174 | } | |
173 | 175 | ||
174 | 176 | ||
175 | 177 | ||
176 | 178 | @Callable(n) | |
177 | 179 | func revokeConfirmation (I,J) = { | |
178 | 180 | let K = toBase58String(n.callerPublicKey) | |
179 | 181 | let F = getIntegerValue(d) | |
180 | 182 | let B = getStringValue(c) | |
181 | 183 | let C = split(B, a) | |
182 | 184 | let L = makeString([e, I, J], a) | |
183 | 185 | let M = valueOrElse(getString(L), "") | |
184 | 186 | let Q = split(M, a) | |
185 | 187 | let N = makeString([f, I, J], a) | |
186 | 188 | let R = valueOrElse(getBoolean(N), false) | |
187 | 189 | let q = if (!(containsElement(C, K))) | |
188 | 190 | then throw("revokeConfirmation: only admin") | |
189 | 191 | else if ((size(fromBase58String(J)) != 32)) | |
190 | 192 | then throw("revokeConfirmation: invalid txId") | |
191 | 193 | else if (!(g(I))) | |
192 | 194 | then throw("revokeConfirmation: invalid dapp address") | |
193 | 195 | else if (!(containsElement(Q, K))) | |
194 | 196 | then throw("revokeConfirmation: not confirmed") | |
195 | 197 | else if (R) | |
196 | 198 | then throw("revokeConfirmation: quorum already reached") | |
197 | 199 | else unit | |
198 | 200 | if ((q == q)) | |
199 | 201 | then { | |
200 | 202 | let S = removeByIndex(Q, value(indexOf(Q, K))) | |
201 | 203 | let O = size(S) | |
202 | 204 | $Tuple2([StringEntry(L, makeString(S, a)), BooleanEntry(N, (O >= F))], unit) | |
203 | 205 | } | |
204 | 206 | else throw("Strict value is not equal to itself.") | |
205 | 207 | } | |
206 | 208 | ||
207 | 209 | ||
208 | 210 | @Verifier(T) | |
209 | 211 | func U () = { | |
210 | 212 | let i = getString(b) | |
211 | 213 | if ($isInstanceOf(i, "String")) | |
212 | 214 | then { | |
213 | 215 | let V = i | |
214 | 216 | valueOrElse(getBoolean(addressFromStringValue(V), makeString([f, toString(this), toBase58String(T.id)], a)), false) | |
215 | 217 | } | |
216 | 218 | else sigVerify(T.bodyBytes, T.proofs[0], T.senderPublicKey) | |
217 | 219 | } | |
218 | 220 |
github/deemru/w8io/026f985 29.50 ms ◑