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