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