tx · 2QF3YFjKo3NFapttqniLW3RFvHWQ5bNs2co4kzeT9cEk

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.19 11:30 [2541204] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "2QF3YFjKo3NFapttqniLW3RFvHWQ5bNs2co4kzeT9cEk", "fee": 1000000, "feeAssetId": null, "timestamp": 1681893088824, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2ZCJqnUgunXNtrjFUfAudRxCnLMuywrpMqm4wD4KeM1tHxzYu3naDa2MCmsHvJDDmSoesZb5d3hxvSVfE4BcYQQ8" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBkAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBGWtleUFjdGl2ZU1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5Q3VycmVudE1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIXY3VycmVudE1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlTZXROZXdNYW5hZ2VyVm90ZVByZWZpeAEQbWFuYWdlclB1YmxpY0tleQkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAgpzZXRNYW5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GmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAQGcmVzdWx0CQDMCAIJAQtTdHJpbmdFbnRyeQIJAQ5rZXlBbGxvd2VkVHhJZAAFBHR4SWQFA25pbAkBDHZvdGVJTlRFUk5BTAQFE2NhbGxlckFkZHJlc3NTdHJpbmcFCWtleVByZWZpeAUIbWluVm90ZXMFBnJlc3VsdABwsB0K", "height": 2541204, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EV5YW1beov4z2RbLv43sHGzkXaLY4NP94ukUEubTz7Np Next: HwWXuo7m8vuqmiFCKSmqiYCbHmN7ffcSPeqHqSaGA7GA Diff:
OldNewDifferences
2020 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2121
2222
23-func keySetNewManagerVote (managerPublicKey,admin) = makeString([keySetNewManagerVotePrefix(managerPublicKey), admin], SEP)
24-
25-
26-func getSetNewManagerVote (managerPublicKey,admin) = valueOrElse(getInteger(keySetNewManagerVote(managerPublicKey, admin)), 0)
27-
28-
2923 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
30-
31-
32-func keyDeactivateManagerVote (admin) = makeString([keyDeactivateManagerVotePrefix(), admin], SEP)
33-
34-
35-func getDeactivateManagerVote (admin) = valueOrElse(getInteger(keyDeactivateManagerVote(admin)), 0)
3624
3725
3826 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
3927
4028
41-func keyActivateManagerVote (admin) = makeString([keyActivateManagerVotePrefix(), admin], SEP)
42-
43-
44-func getActivateManagerVote (admin) = valueOrElse(getInteger(keyActivateManagerVote(admin)), 0)
45-
46-
4729 func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
48-
49-
50-func keyAddNewAdminVote (adminCandidate,admin) = makeString([keyAddNewAdminVotePrefix(adminCandidate), admin], SEP)
51-
52-
53-func getAddNewAdminVote (adminCandidate,admin) = valueOrElse(getInteger(keyAddNewAdminVote(adminCandidate, admin)), 0)
5430
5531
5632 func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
5733
5834
59-func keyRemoveAdminVote (removeCandidate,admin) = makeString([keyRemoveAdminVotePrefix(removeCandidate), admin], SEP)
60-
61-
62-func getRemoveAdminVote (removeCandidate,admin) = valueOrElse(getInteger(keyRemoveAdminVote(removeCandidate, admin)), 0)
63-
64-
65-func keyUnlockVerifierVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
66-
67-
68-func keyUnlockVerifierVote (admin) = makeString([keyUnlockVerifierVotePrefix(), admin], SEP)
69-
70-
71-func getUnlockVerifierVote (admin) = valueOrElse(getInteger(keyUnlockVerifierVote(admin)), 0)
35+func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
7236
7337
7438 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
39+
40+
41+func keyAllowedTxId () = makeString(["%s", "TXID"], SEP)
42+
43+
44+func getAdminVote (prefix,admin) = {
45+ let voteKey = makeString([prefix, admin], SEP)
46+ valueOrElse(getInteger(voteKey), 0)
47+ }
7548
7649
7750 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
9669
9770
9871 func genVotesKeysHelper (a,adminAddress) = {
99- let $t033583382 = a
100- let result = $t033583382._1
101- let prefix = $t033583382._2
72+ let $t020142038 = a
73+ let result = $t020142038._1
74+ let prefix = $t020142038._2
10275 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
10376 }
10477
160133 }
161134
162135
163-func voteINTERNAL (callerAddressString,adminCurrentVote,keyPrefix,minVotes,voteResult) = {
136+func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
164137 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
138+ let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
165139 if (isInAdminList(callerAddressString))
166140 then if ((adminCurrentVote == 1))
167141 then throwErr((voteKey + " you already voted"))
202176 func voteForNewManger (newManagerPublicKey) = {
203177 let callerAddressString = toBase58String(i.caller.bytes)
204178 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
205- let adminCurrentVote = getSetNewManagerVote(newManagerPublicKey, callerAddressString)
206179 let minVotes = 2
207180 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
208- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
181+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
209182 }
210183
211184
214187 func deactivateManager () = {
215188 let callerAddressString = toBase58String(i.caller.bytes)
216189 let keyPrefix = keyDeactivateManagerVotePrefix()
217- let adminCurrentVote = getDeactivateManagerVote(callerAddressString)
218190 let minVotes = 1
219191 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
220- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
192+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
221193 }
222194
223195
226198 func activateManager () = {
227199 let callerAddressString = toBase58String(i.caller.bytes)
228200 let keyPrefix = keyActivateManagerVotePrefix()
229- let adminCurrentVote = getActivateManagerVote(callerAddressString)
230201 let minVotes = 2
231202 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
232203 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
233- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
204+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
234205 }
235206
236207
239210 func addNewAdmin (newAdminAddress) = {
240211 let callerAddressString = toBase58String(i.caller.bytes)
241212 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
242- let adminCurrentVote = getAddNewAdminVote(newAdminAddress, callerAddressString)
243213 let minVotes = 2
244214 let currentAdminList = getAdminsList()
245215 match indexOf(currentAdminList, newAdminAddress) {
248218 case _ =>
249219 let newAdminList = (currentAdminList :+ newAdminAddress)
250220 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
251- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
221+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
252222 }
253223 }
254224
258228 func removeAdmin (removeCandidate) = {
259229 let callerAddressString = toBase58String(i.caller.bytes)
260230 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
261- let adminCurrentVote = getRemoveAdminVote(removeCandidate, callerAddressString)
262231 let minVotes = 2
263232 let currentAdminList = getAdminsList()
264233 match indexOf(currentAdminList, removeCandidate) {
265234 case index: Int =>
266235 let newAdminList = removeByIndex(currentAdminList, index)
267236 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
268- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
237+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
269238 case _ =>
270239 throwErr((removeCandidate + " not found in Admin List"))
271240 }
274243
275244
276245 @Callable(i)
277-func unlockVarifier () = {
246+func voteForTxId (txId) = {
278247 let callerAddressString = toBase58String(i.caller.bytes)
279- let keyPrefix = keyActivateManagerVotePrefix()
280- let adminCurrentVote = getActivateManagerVote(callerAddressString)
248+ let keyPrefix = keyAllowedTxIdVotePrefix(txId)
281249 let minVotes = 2
282250 let pendingManagerString = getStringValue(keyPendingManagerPublicKey())
283- let result = [StringEntry(keyActiveManagerPublicKey(), pendingManagerString)]
284- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
251+ let result = [StringEntry(keyAllowedTxId(), txId)]
252+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
285253 }
286254
287255
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let contractFilename = "manager_vault.ride"
77
88 func throwErr (s) = throw(((contractFilename + ": ") + s))
99
1010
1111 func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1212
1313
1414 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1515
1616
1717 func keyCurrentManagerPublicKey () = makeString(["%s", "currentManagerPublicKey"], SEP)
1818
1919
2020 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2121
2222
23-func keySetNewManagerVote (managerPublicKey,admin) = makeString([keySetNewManagerVotePrefix(managerPublicKey), admin], SEP)
24-
25-
26-func getSetNewManagerVote (managerPublicKey,admin) = valueOrElse(getInteger(keySetNewManagerVote(managerPublicKey, admin)), 0)
27-
28-
2923 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
30-
31-
32-func keyDeactivateManagerVote (admin) = makeString([keyDeactivateManagerVotePrefix(), admin], SEP)
33-
34-
35-func getDeactivateManagerVote (admin) = valueOrElse(getInteger(keyDeactivateManagerVote(admin)), 0)
3624
3725
3826 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
3927
4028
41-func keyActivateManagerVote (admin) = makeString([keyActivateManagerVotePrefix(), admin], SEP)
42-
43-
44-func getActivateManagerVote (admin) = valueOrElse(getInteger(keyActivateManagerVote(admin)), 0)
45-
46-
4729 func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
48-
49-
50-func keyAddNewAdminVote (adminCandidate,admin) = makeString([keyAddNewAdminVotePrefix(adminCandidate), admin], SEP)
51-
52-
53-func getAddNewAdminVote (adminCandidate,admin) = valueOrElse(getInteger(keyAddNewAdminVote(adminCandidate, admin)), 0)
5430
5531
5632 func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
5733
5834
59-func keyRemoveAdminVote (removeCandidate,admin) = makeString([keyRemoveAdminVotePrefix(removeCandidate), admin], SEP)
60-
61-
62-func getRemoveAdminVote (removeCandidate,admin) = valueOrElse(getInteger(keyRemoveAdminVote(removeCandidate, admin)), 0)
63-
64-
65-func keyUnlockVerifierVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
66-
67-
68-func keyUnlockVerifierVote (admin) = makeString([keyUnlockVerifierVotePrefix(), admin], SEP)
69-
70-
71-func getUnlockVerifierVote (admin) = valueOrElse(getInteger(keyUnlockVerifierVote(admin)), 0)
35+func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
7236
7337
7438 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
39+
40+
41+func keyAllowedTxId () = makeString(["%s", "TXID"], SEP)
42+
43+
44+func getAdminVote (prefix,admin) = {
45+ let voteKey = makeString([prefix, admin], SEP)
46+ valueOrElse(getInteger(voteKey), 0)
47+ }
7548
7649
7750 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
7851 case s: String =>
7952 fromBase58String(s)
8053 case _: Unit =>
8154 unit
8255 case _ =>
8356 throw("Match error")
8457 }
8558
8659
8760 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
8861
8962
9063 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
9164 case t: Int =>
9265 true
9366 case _ =>
9467 false
9568 }
9669
9770
9871 func genVotesKeysHelper (a,adminAddress) = {
99- let $t033583382 = a
100- let result = $t033583382._1
101- let prefix = $t033583382._2
72+ let $t020142038 = a
73+ let result = $t020142038._1
74+ let prefix = $t020142038._2
10275 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
10376 }
10477
10578
10679 func genVotesKeys (keyPrefix) = {
10780 let adminList = keyAdminAddressList()
10881 let $l = getAdminsList()
10982 let $s = size($l)
11083 let $acc0 = $Tuple2(nil, keyPrefix)
11184 func $f0_1 ($a,$i) = if (($i >= $s))
11285 then $a
11386 else genVotesKeysHelper($a, $l[$i])
11487
11588 func $f0_2 ($a,$i) = if (($i >= $s))
11689 then $a
11790 else throw("List size exceeds 10")
11891
11992 $f0_2($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)
12093 }
12194
12295
12396 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
12497
12598
12699 func countVotes (prefix) = {
127100 let votes = genVotesKeys(prefix)._1
128101 let $l = votes
129102 let $s = size($l)
130103 let $acc0 = 0
131104 func $f0_1 ($a,$i) = if (($i >= $s))
132105 then $a
133106 else countVotesHelper($a, $l[$i])
134107
135108 func $f0_2 ($a,$i) = if (($i >= $s))
136109 then $a
137110 else throw("List size exceeds 10")
138111
139112 $f0_2($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)
140113 }
141114
142115
143116 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
144117
145118
146119 func getClearVotesEntries (prefix) = {
147120 let votes = genVotesKeys(prefix)._1
148121 let $l = votes
149122 let $s = size($l)
150123 let $acc0 = nil
151124 func $f0_1 ($a,$i) = if (($i >= $s))
152125 then $a
153126 else clearVotesHelper($a, $l[$i])
154127
155128 func $f0_2 ($a,$i) = if (($i >= $s))
156129 then $a
157130 else throw("List size exceeds 10")
158131
159132 $f0_2($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)
160133 }
161134
162135
163-func voteINTERNAL (callerAddressString,adminCurrentVote,keyPrefix,minVotes,voteResult) = {
136+func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
164137 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
138+ let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
165139 if (isInAdminList(callerAddressString))
166140 then if ((adminCurrentVote == 1))
167141 then throwErr((voteKey + " you already voted"))
168142 else {
169143 let votes = countVotes(keyPrefix)
170144 if (((votes + 1) >= minVotes))
171145 then {
172146 let clearVotesEntries = getClearVotesEntries(keyPrefix)
173147 (clearVotesEntries ++ voteResult)
174148 }
175149 else [IntegerEntry(voteKey, 1)]
176150 }
177151 else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
178152 }
179153
180154
181155 @Callable(i)
182156 func confirmManager () = {
183157 let pm = pendingManagerPublicKeyOrUnit()
184158 let hasPM = if (isDefined(pm))
185159 then true
186160 else throwErr("no pending manager")
187161 if ((hasPM == hasPM))
188162 then {
189163 let checkPM = if ((i.callerPublicKey == value(pm)))
190164 then true
191165 else throwErr("you are not pending manager")
192166 if ((checkPM == checkPM))
193167 then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm)))]
194168 else throw("Strict value is not equal to itself.")
195169 }
196170 else throw("Strict value is not equal to itself.")
197171 }
198172
199173
200174
201175 @Callable(i)
202176 func voteForNewManger (newManagerPublicKey) = {
203177 let callerAddressString = toBase58String(i.caller.bytes)
204178 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
205- let adminCurrentVote = getSetNewManagerVote(newManagerPublicKey, callerAddressString)
206179 let minVotes = 2
207180 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
208- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
181+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
209182 }
210183
211184
212185
213186 @Callable(i)
214187 func deactivateManager () = {
215188 let callerAddressString = toBase58String(i.caller.bytes)
216189 let keyPrefix = keyDeactivateManagerVotePrefix()
217- let adminCurrentVote = getDeactivateManagerVote(callerAddressString)
218190 let minVotes = 1
219191 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
220- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
192+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
221193 }
222194
223195
224196
225197 @Callable(i)
226198 func activateManager () = {
227199 let callerAddressString = toBase58String(i.caller.bytes)
228200 let keyPrefix = keyActivateManagerVotePrefix()
229- let adminCurrentVote = getActivateManagerVote(callerAddressString)
230201 let minVotes = 2
231202 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
232203 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
233- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
204+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
234205 }
235206
236207
237208
238209 @Callable(i)
239210 func addNewAdmin (newAdminAddress) = {
240211 let callerAddressString = toBase58String(i.caller.bytes)
241212 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
242- let adminCurrentVote = getAddNewAdminVote(newAdminAddress, callerAddressString)
243213 let minVotes = 2
244214 let currentAdminList = getAdminsList()
245215 match indexOf(currentAdminList, newAdminAddress) {
246216 case a: Int =>
247217 throwErr((newAdminAddress + " already in Admin List"))
248218 case _ =>
249219 let newAdminList = (currentAdminList :+ newAdminAddress)
250220 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
251- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
221+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
252222 }
253223 }
254224
255225
256226
257227 @Callable(i)
258228 func removeAdmin (removeCandidate) = {
259229 let callerAddressString = toBase58String(i.caller.bytes)
260230 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
261- let adminCurrentVote = getRemoveAdminVote(removeCandidate, callerAddressString)
262231 let minVotes = 2
263232 let currentAdminList = getAdminsList()
264233 match indexOf(currentAdminList, removeCandidate) {
265234 case index: Int =>
266235 let newAdminList = removeByIndex(currentAdminList, index)
267236 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
268- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
237+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
269238 case _ =>
270239 throwErr((removeCandidate + " not found in Admin List"))
271240 }
272241 }
273242
274243
275244
276245 @Callable(i)
277-func unlockVarifier () = {
246+func voteForTxId (txId) = {
278247 let callerAddressString = toBase58String(i.caller.bytes)
279- let keyPrefix = keyActivateManagerVotePrefix()
280- let adminCurrentVote = getActivateManagerVote(callerAddressString)
248+ let keyPrefix = keyAllowedTxIdVotePrefix(txId)
281249 let minVotes = 2
282250 let pendingManagerString = getStringValue(keyPendingManagerPublicKey())
283- let result = [StringEntry(keyActiveManagerPublicKey(), pendingManagerString)]
284- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
251+ let result = [StringEntry(keyAllowedTxId(), txId)]
252+ voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
285253 }
286254
287255

github/deemru/w8io/026f985 
79.26 ms