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