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