tx · A6sTKhNUTqP25qpY3ZPPWi9siUF7KqaHvctGjiWXWn3Q 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh: -0.01200000 Waves 2023.04.20 14:22 [2542806] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves
{ "type": 13, "id": "A6sTKhNUTqP25qpY3ZPPWi9siUF7KqaHvctGjiWXWn3Q", "fee": 1200000, "feeAssetId": null, "timestamp": 1681989766947, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "3kVyswR3q49SRLZcyUv1tAJEV9DxbNXEVV44sg7JSRAKfYjNdtVxoGxv1DoEy75giZKzNA4d4doYR2AJoAU4ZQZy" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCB4AA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQATTUFYX0FETUlOX0xJU1RfU0laRQAKABNNSU5fQURNSU5fTElTVF9TSVpFAAIAFEFERFJFU1NfQllURVNfTEVOR1RIABoAEVRYSURfQllURVNfTEVOR1RIACABCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwFA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LZXnNOy6F", "height": 2542806, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ho3tpYsfYse6LouWWjoVg73p6EhCakdSDf8wBKRrrSqV Next: FDPpxPPdueCYML14qes544JqGwPcPSJLeD4TnXptmcQM Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let contractFilename = "manager_vault.ride" | |
7 | 7 | ||
8 | - | let MAX_ADMIN_COUNT = 10 | |
8 | + | let MAX_ADMIN_LIST_SIZE = 10 | |
9 | + | ||
10 | + | let MIN_ADMIN_LIST_SIZE = 2 | |
9 | 11 | ||
10 | 12 | let ADDRESS_BYTES_LENGTH = 26 | |
13 | + | ||
14 | + | let TXID_BYTES_LENGTH = 32 | |
11 | 15 | ||
12 | 16 | func throwErr (s) = throw(((contractFilename + ": ") + s)) | |
13 | 17 | ||
39 | 43 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
40 | 44 | ||
41 | 45 | ||
46 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
47 | + | ||
48 | + | ||
42 | 49 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
43 | 50 | ||
44 | 51 | ||
46 | 53 | ||
47 | 54 | ||
48 | 55 | func getAdminVote (prefix,admin) = { | |
49 | - | let voteKey = | |
56 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
50 | 57 | valueOrElse(getInteger(voteKey), 0) | |
51 | 58 | } | |
52 | 59 | ||
64 | 71 | func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP) | |
65 | 72 | ||
66 | 73 | ||
67 | - | func isInAdminList (address) = match indexOf(getAdminsList(), address) { | |
68 | - | case t: Int => | |
69 | - | true | |
70 | - | case _ => | |
71 | - | false | |
72 | - | } | |
74 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
73 | 75 | ||
74 | 76 | ||
75 | 77 | func genVotesKeysHelper (a,adminAddress) = { | |
76 | - | let $ | |
77 | - | let result = $ | |
78 | - | let prefix = $ | |
79 | - | $Tuple2((result :+ | |
78 | + | let $t021982222 = a | |
79 | + | let result = $t021982222._1 | |
80 | + | let prefix = $t021982222._2 | |
81 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
80 | 82 | } | |
81 | 83 | ||
82 | 84 | ||
138 | 140 | ||
139 | 141 | ||
140 | 142 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
141 | - | let voteKey = | |
143 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
142 | 144 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
143 | 145 | let err = if (!(isInAdminList(callerAddressString))) | |
144 | 146 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
180 | 182 | ||
181 | 183 | ||
182 | 184 | @Callable(i) | |
183 | - | func | |
185 | + | func voteForNewManager (newManagerPublicKey) = { | |
184 | 186 | let callerAddressString = toBase58String(i.caller.bytes) | |
185 | 187 | let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey) | |
186 | 188 | let quorum = 2 | |
219 | 221 | let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress) | |
220 | 222 | let quorum = 2 | |
221 | 223 | let currentAdminList = getAdminsList() | |
222 | - | let err = if ((size(currentAdminList) >= MAX_ADMIN_ | |
223 | - | then throwErr((("MAX_ADMIN_ | |
224 | + | let err = if ((size(currentAdminList) >= MAX_ADMIN_LIST_SIZE)) | |
225 | + | then throwErr((("MAX_ADMIN_LIST_SIZE (" + toString(MAX_ADMIN_LIST_SIZE)) + ") is exceeded")) | |
224 | 226 | else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH)) | |
225 | 227 | then throwErr((newAdminAddress + " is not valid Address")) | |
226 | 228 | else unit | |
262 | 264 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
263 | 265 | let quorum = 2 | |
264 | 266 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
265 | - | let err = if ((size(fromBase58String(txId)) != | |
267 | + | let err = if ((size(fromBase58String(txId)) != TXID_BYTES_LENGTH)) | |
266 | 268 | then throwErr((txId + " not valid txId")) | |
267 | 269 | else unit | |
268 | 270 | if ((err == err)) | |
281 | 283 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
282 | 284 | case _ => | |
283 | 285 | let currentAdminList = getAdminsList() | |
284 | - | if ((size(currentAdminList) >= | |
286 | + | if ((size(currentAdminList) >= MIN_ADMIN_LIST_SIZE)) | |
285 | 287 | then (tx.id == allowedTxId) | |
286 | 288 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
287 | 289 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | let contractFilename = "manager_vault.ride" | |
7 | 7 | ||
8 | - | let MAX_ADMIN_COUNT = 10 | |
8 | + | let MAX_ADMIN_LIST_SIZE = 10 | |
9 | + | ||
10 | + | let MIN_ADMIN_LIST_SIZE = 2 | |
9 | 11 | ||
10 | 12 | let ADDRESS_BYTES_LENGTH = 26 | |
13 | + | ||
14 | + | let TXID_BYTES_LENGTH = 32 | |
11 | 15 | ||
12 | 16 | func throwErr (s) = throw(((contractFilename + ": ") + s)) | |
13 | 17 | ||
14 | 18 | ||
15 | 19 | func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP) | |
16 | 20 | ||
17 | 21 | ||
18 | 22 | func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP) | |
19 | 23 | ||
20 | 24 | ||
21 | 25 | func keyCurrentManagerPublicKey () = makeString(["%s", "currentManagerPublicKey"], SEP) | |
22 | 26 | ||
23 | 27 | ||
24 | 28 | func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP) | |
25 | 29 | ||
26 | 30 | ||
27 | 31 | func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP) | |
28 | 32 | ||
29 | 33 | ||
30 | 34 | func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP) | |
31 | 35 | ||
32 | 36 | ||
33 | 37 | func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP) | |
34 | 38 | ||
35 | 39 | ||
36 | 40 | func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP) | |
37 | 41 | ||
38 | 42 | ||
39 | 43 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
40 | 44 | ||
41 | 45 | ||
46 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
47 | + | ||
48 | + | ||
42 | 49 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
43 | 50 | ||
44 | 51 | ||
45 | 52 | func keyAllowedTxId () = makeString(["%s", "TXID"], SEP) | |
46 | 53 | ||
47 | 54 | ||
48 | 55 | func getAdminVote (prefix,admin) = { | |
49 | - | let voteKey = | |
56 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
50 | 57 | valueOrElse(getInteger(voteKey), 0) | |
51 | 58 | } | |
52 | 59 | ||
53 | 60 | ||
54 | 61 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
55 | 62 | case s: String => | |
56 | 63 | fromBase58String(s) | |
57 | 64 | case _: Unit => | |
58 | 65 | unit | |
59 | 66 | case _ => | |
60 | 67 | throw("Match error") | |
61 | 68 | } | |
62 | 69 | ||
63 | 70 | ||
64 | 71 | func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP) | |
65 | 72 | ||
66 | 73 | ||
67 | - | func isInAdminList (address) = match indexOf(getAdminsList(), address) { | |
68 | - | case t: Int => | |
69 | - | true | |
70 | - | case _ => | |
71 | - | false | |
72 | - | } | |
74 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
73 | 75 | ||
74 | 76 | ||
75 | 77 | func genVotesKeysHelper (a,adminAddress) = { | |
76 | - | let $ | |
77 | - | let result = $ | |
78 | - | let prefix = $ | |
79 | - | $Tuple2((result :+ | |
78 | + | let $t021982222 = a | |
79 | + | let result = $t021982222._1 | |
80 | + | let prefix = $t021982222._2 | |
81 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
80 | 82 | } | |
81 | 83 | ||
82 | 84 | ||
83 | 85 | func genVotesKeys (keyPrefix) = { | |
84 | 86 | let adminList = keyAdminAddressList() | |
85 | 87 | let $l = getAdminsList() | |
86 | 88 | let $s = size($l) | |
87 | 89 | let $acc0 = $Tuple2(nil, keyPrefix) | |
88 | 90 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
89 | 91 | then $a | |
90 | 92 | else genVotesKeysHelper($a, $l[$i]) | |
91 | 93 | ||
92 | 94 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
93 | 95 | then $a | |
94 | 96 | else throw("List size exceeds 20") | |
95 | 97 | ||
96 | 98 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
97 | 99 | } | |
98 | 100 | ||
99 | 101 | ||
100 | 102 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
101 | 103 | ||
102 | 104 | ||
103 | 105 | func countVotes (prefix) = { | |
104 | 106 | let votes = genVotesKeys(prefix)._1 | |
105 | 107 | let $l = votes | |
106 | 108 | let $s = size($l) | |
107 | 109 | let $acc0 = 0 | |
108 | 110 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
109 | 111 | then $a | |
110 | 112 | else countVotesHelper($a, $l[$i]) | |
111 | 113 | ||
112 | 114 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
113 | 115 | then $a | |
114 | 116 | else throw("List size exceeds 20") | |
115 | 117 | ||
116 | 118 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
117 | 119 | } | |
118 | 120 | ||
119 | 121 | ||
120 | 122 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
121 | 123 | ||
122 | 124 | ||
123 | 125 | func getClearVoteEntries (prefix) = { | |
124 | 126 | let votes = genVotesKeys(prefix)._1 | |
125 | 127 | let $l = votes | |
126 | 128 | let $s = size($l) | |
127 | 129 | let $acc0 = nil | |
128 | 130 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
129 | 131 | then $a | |
130 | 132 | else clearVotesHelper($a, $l[$i]) | |
131 | 133 | ||
132 | 134 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
133 | 135 | then $a | |
134 | 136 | else throw("List size exceeds 20") | |
135 | 137 | ||
136 | 138 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
137 | 139 | } | |
138 | 140 | ||
139 | 141 | ||
140 | 142 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
141 | - | let voteKey = | |
143 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
142 | 144 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
143 | 145 | let err = if (!(isInAdminList(callerAddressString))) | |
144 | 146 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
145 | 147 | else if ((adminCurrentVote == 1)) | |
146 | 148 | then throwErr((voteKey + " you already voted")) | |
147 | 149 | else unit | |
148 | 150 | if ((err == err)) | |
149 | 151 | then { | |
150 | 152 | let votes = countVotes(keyPrefix) | |
151 | 153 | if (((votes + 1) >= minVotes)) | |
152 | 154 | then { | |
153 | 155 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
154 | 156 | (clearVoteEntries ++ voteResult) | |
155 | 157 | } | |
156 | 158 | else [IntegerEntry(voteKey, 1)] | |
157 | 159 | } | |
158 | 160 | else throw("Strict value is not equal to itself.") | |
159 | 161 | } | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | @Callable(i) | |
163 | 165 | func confirmManager () = { | |
164 | 166 | let pm = pendingManagerPublicKeyOrUnit() | |
165 | 167 | let hasPM = if (isDefined(pm)) | |
166 | 168 | then true | |
167 | 169 | else throwErr("no pending manager") | |
168 | 170 | if ((hasPM == hasPM)) | |
169 | 171 | then { | |
170 | 172 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
171 | 173 | then true | |
172 | 174 | else throwErr("you are not pending manager") | |
173 | 175 | if ((checkPM == checkPM)) | |
174 | 176 | then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm))), StringEntry(keyActiveManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
175 | 177 | else throw("Strict value is not equal to itself.") | |
176 | 178 | } | |
177 | 179 | else throw("Strict value is not equal to itself.") | |
178 | 180 | } | |
179 | 181 | ||
180 | 182 | ||
181 | 183 | ||
182 | 184 | @Callable(i) | |
183 | - | func | |
185 | + | func voteForNewManager (newManagerPublicKey) = { | |
184 | 186 | let callerAddressString = toBase58String(i.caller.bytes) | |
185 | 187 | let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey) | |
186 | 188 | let quorum = 2 | |
187 | 189 | let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)] | |
188 | 190 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
189 | 191 | } | |
190 | 192 | ||
191 | 193 | ||
192 | 194 | ||
193 | 195 | @Callable(i) | |
194 | 196 | func deactivateManager () = { | |
195 | 197 | let callerAddressString = toBase58String(i.caller.bytes) | |
196 | 198 | let keyPrefix = keyDeactivateManagerVotePrefix() | |
197 | 199 | let quorum = 1 | |
198 | 200 | let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")] | |
199 | 201 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
200 | 202 | } | |
201 | 203 | ||
202 | 204 | ||
203 | 205 | ||
204 | 206 | @Callable(i) | |
205 | 207 | func activateManager () = { | |
206 | 208 | let callerAddressString = toBase58String(i.caller.bytes) | |
207 | 209 | let keyPrefix = keyActivateManagerVotePrefix() | |
208 | 210 | let quorum = 2 | |
209 | 211 | let currentManagerString = getStringValue(keyCurrentManagerPublicKey()) | |
210 | 212 | let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)] | |
211 | 213 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
212 | 214 | } | |
213 | 215 | ||
214 | 216 | ||
215 | 217 | ||
216 | 218 | @Callable(i) | |
217 | 219 | func addNewAdmin (newAdminAddress) = { | |
218 | 220 | let callerAddressString = toBase58String(i.caller.bytes) | |
219 | 221 | let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress) | |
220 | 222 | let quorum = 2 | |
221 | 223 | let currentAdminList = getAdminsList() | |
222 | - | let err = if ((size(currentAdminList) >= MAX_ADMIN_ | |
223 | - | then throwErr((("MAX_ADMIN_ | |
224 | + | let err = if ((size(currentAdminList) >= MAX_ADMIN_LIST_SIZE)) | |
225 | + | then throwErr((("MAX_ADMIN_LIST_SIZE (" + toString(MAX_ADMIN_LIST_SIZE)) + ") is exceeded")) | |
224 | 226 | else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH)) | |
225 | 227 | then throwErr((newAdminAddress + " is not valid Address")) | |
226 | 228 | else unit | |
227 | 229 | if ((err == err)) | |
228 | 230 | then match indexOf(currentAdminList, newAdminAddress) { | |
229 | 231 | case a: Int => | |
230 | 232 | throwErr((newAdminAddress + " already in Admin List")) | |
231 | 233 | case _ => | |
232 | 234 | let newAdminList = (currentAdminList :+ newAdminAddress) | |
233 | 235 | let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))] | |
234 | 236 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
235 | 237 | } | |
236 | 238 | else throw("Strict value is not equal to itself.") | |
237 | 239 | } | |
238 | 240 | ||
239 | 241 | ||
240 | 242 | ||
241 | 243 | @Callable(i) | |
242 | 244 | func removeAdmin (removeCandidate) = { | |
243 | 245 | let callerAddressString = toBase58String(i.caller.bytes) | |
244 | 246 | let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate) | |
245 | 247 | let quorum = 2 | |
246 | 248 | let currentAdminList = getAdminsList() | |
247 | 249 | match indexOf(currentAdminList, removeCandidate) { | |
248 | 250 | case index: Int => | |
249 | 251 | let newAdminList = removeByIndex(currentAdminList, index) | |
250 | 252 | let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))] | |
251 | 253 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
252 | 254 | case _ => | |
253 | 255 | throwErr((removeCandidate + " not found in Admin List")) | |
254 | 256 | } | |
255 | 257 | } | |
256 | 258 | ||
257 | 259 | ||
258 | 260 | ||
259 | 261 | @Callable(i) | |
260 | 262 | func voteForTxId (txId) = { | |
261 | 263 | let callerAddressString = toBase58String(i.caller.bytes) | |
262 | 264 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
263 | 265 | let quorum = 2 | |
264 | 266 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
265 | - | let err = if ((size(fromBase58String(txId)) != | |
267 | + | let err = if ((size(fromBase58String(txId)) != TXID_BYTES_LENGTH)) | |
266 | 268 | then throwErr((txId + " not valid txId")) | |
267 | 269 | else unit | |
268 | 270 | if ((err == err)) | |
269 | 271 | then voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
270 | 272 | else throw("Strict value is not equal to itself.") | |
271 | 273 | } | |
272 | 274 | ||
273 | 275 | ||
274 | 276 | @Verifier(tx) | |
275 | 277 | func verify () = { | |
276 | 278 | let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId())) | |
277 | 279 | match tx { | |
278 | 280 | case t: SetScriptTransaction => | |
279 | 281 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
280 | 282 | case t: DataTransaction => | |
281 | 283 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
282 | 284 | case _ => | |
283 | 285 | let currentAdminList = getAdminsList() | |
284 | - | if ((size(currentAdminList) >= | |
286 | + | if ((size(currentAdminList) >= MIN_ADMIN_LIST_SIZE)) | |
285 | 287 | then (tx.id == allowedTxId) | |
286 | 288 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
287 | 289 | } | |
288 | 290 | } | |
289 | 291 |
github/deemru/w8io/026f985 50.16 ms ◑