tx · 8X8nNMnERerJQigpD8uM2RhPMuyMH1ECmTHwMhiSZZtx 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh: -0.01200000 Waves 2023.04.19 12:59 [2541288] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves
{ "type": 13, "id": "8X8nNMnERerJQigpD8uM2RhPMuyMH1ECmTHwMhiSZZtx", "fee": 1200000, "feeAssetId": null, "timestamp": 1681898337641, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2kQeVKbahVbyjERj7u5UpN3G5CBUdAs9NGVJZvCDZbi4faGBKqnVEtoYDC8gZg7fTmpVQosAMHd4FMuZMwhRbLJv" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBsAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQAPTUFYX0FETUlOX0NPVU5UAAoAFEFERFJFU1NfQllURVNfTEVOR1RIABoBCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5U2V0TmV3TWFuYWdlclZvdGVQcmVmaXgBEG1hbmFnZXJQdW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VJOQUwEBRNjYWxsZXJBZGRyZXNzU3RyaW5nBQlrZXlQcmVmaXgFBnF1b3J1bQUGcmVzdWx0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQLYWxsb3dlZFR4SWQJANkEAQkBEUBleHRyTmF0aXZlKDEwNTgpAQkBDmtleUFsbG93ZWRUeElkAAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAXQFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkDCQABAgUHJG1hdGNoMAIPRGF0YVRyYW5zYWN0aW9uBAF0BQckbWF0Y2gwCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BBBjdXJyZW50QWRtaW5MaXN0CQENZ2V0QWRtaW5zTGlzdAADCQBnAgkAkAMBBRBjdXJyZW50QWRtaW5MaXN0AAMJAAACCAUCdHgCaWQFC2FsbG93ZWRUeElkCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5CRn/xA==", "height": 2541288, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ccx1dN6oBSXoTFuSQRE57epjPyMu3BkFfiQmYUdJbfn7 Next: 3MVtRpXPGEtT51DfrhhESej2Hx2Ug3iuTb38gjQRjvRG Diff:
Old | New | Differences | |
---|---|---|---|
140 | 140 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
141 | 141 | let voteKey = makeString([keyPrefix, callerAddressString], SEP) | |
142 | 142 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
143 | - | if (isInAdminList(callerAddressString)) | |
144 | - | then if ((adminCurrentVote == 1)) | |
143 | + | let err = if (!(isInAdminList(callerAddressString))) | |
144 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
145 | + | else if ((adminCurrentVote == 1)) | |
145 | 146 | then throwErr((voteKey + " you already voted")) | |
146 | - | else { | |
147 | - | let votes = countVotes(keyPrefix) | |
148 | - | if (((votes + 1) >= minVotes)) | |
149 | - | then { | |
150 | - | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
151 | - | (clearVoteEntries ++ voteResult) | |
152 | - | } | |
153 | - | else [IntegerEntry(voteKey, 1)] | |
154 | - | } | |
155 | - | else throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
147 | + | else unit | |
148 | + | if ((err == err)) | |
149 | + | then { | |
150 | + | let votes = countVotes(keyPrefix) | |
151 | + | if (((votes + 1) >= minVotes)) | |
152 | + | then { | |
153 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
154 | + | (clearVoteEntries ++ voteResult) | |
155 | + | } | |
156 | + | else [IntegerEntry(voteKey, 1)] | |
157 | + | } | |
158 | + | else throw("Strict value is not equal to itself.") | |
156 | 159 | } | |
157 | 160 | ||
158 | 161 |
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 | - | if (isInAdminList(callerAddressString)) | |
144 | - | then if ((adminCurrentVote == 1)) | |
143 | + | let err = if (!(isInAdminList(callerAddressString))) | |
144 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
145 | + | else if ((adminCurrentVote == 1)) | |
145 | 146 | then throwErr((voteKey + " you already voted")) | |
146 | - | else { | |
147 | - | let votes = countVotes(keyPrefix) | |
148 | - | if (((votes + 1) >= minVotes)) | |
149 | - | then { | |
150 | - | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
151 | - | (clearVoteEntries ++ voteResult) | |
152 | - | } | |
153 | - | else [IntegerEntry(voteKey, 1)] | |
154 | - | } | |
155 | - | else throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
147 | + | else unit | |
148 | + | if ((err == err)) | |
149 | + | then { | |
150 | + | let votes = countVotes(keyPrefix) | |
151 | + | if (((votes + 1) >= minVotes)) | |
152 | + | then { | |
153 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
154 | + | (clearVoteEntries ++ voteResult) | |
155 | + | } | |
156 | + | else [IntegerEntry(voteKey, 1)] | |
157 | + | } | |
158 | + | else throw("Strict value is not equal to itself.") | |
156 | 159 | } | |
157 | 160 | ||
158 | 161 | ||
159 | 162 | @Callable(i) | |
160 | 163 | func confirmManager () = { | |
161 | 164 | let pm = pendingManagerPublicKeyOrUnit() | |
162 | 165 | let hasPM = if (isDefined(pm)) | |
163 | 166 | then true | |
164 | 167 | else throwErr("no pending manager") | |
165 | 168 | if ((hasPM == hasPM)) | |
166 | 169 | then { | |
167 | 170 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
168 | 171 | then true | |
169 | 172 | else throwErr("you are not pending manager") | |
170 | 173 | if ((checkPM == checkPM)) | |
171 | 174 | then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm)))] | |
172 | 175 | else throw("Strict value is not equal to itself.") | |
173 | 176 | } | |
174 | 177 | else throw("Strict value is not equal to itself.") | |
175 | 178 | } | |
176 | 179 | ||
177 | 180 | ||
178 | 181 | ||
179 | 182 | @Callable(i) | |
180 | 183 | func voteForNewManger (newManagerPublicKey) = { | |
181 | 184 | let callerAddressString = toBase58String(i.caller.bytes) | |
182 | 185 | let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey) | |
183 | 186 | let quorum = 2 | |
184 | 187 | let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)] | |
185 | 188 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
186 | 189 | } | |
187 | 190 | ||
188 | 191 | ||
189 | 192 | ||
190 | 193 | @Callable(i) | |
191 | 194 | func deactivateManager () = { | |
192 | 195 | let callerAddressString = toBase58String(i.caller.bytes) | |
193 | 196 | let keyPrefix = keyDeactivateManagerVotePrefix() | |
194 | 197 | let quorum = 1 | |
195 | 198 | let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")] | |
196 | 199 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
197 | 200 | } | |
198 | 201 | ||
199 | 202 | ||
200 | 203 | ||
201 | 204 | @Callable(i) | |
202 | 205 | func activateManager () = { | |
203 | 206 | let callerAddressString = toBase58String(i.caller.bytes) | |
204 | 207 | let keyPrefix = keyActivateManagerVotePrefix() | |
205 | 208 | let quorum = 2 | |
206 | 209 | let currentManagerString = getStringValue(keyCurrentManagerPublicKey()) | |
207 | 210 | let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)] | |
208 | 211 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
209 | 212 | } | |
210 | 213 | ||
211 | 214 | ||
212 | 215 | ||
213 | 216 | @Callable(i) | |
214 | 217 | func addNewAdmin (newAdminAddress) = { | |
215 | 218 | let callerAddressString = toBase58String(i.caller.bytes) | |
216 | 219 | let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress) | |
217 | 220 | let quorum = 2 | |
218 | 221 | let currentAdminList = getAdminsList() | |
219 | 222 | let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT)) | |
220 | 223 | then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded")) | |
221 | 224 | else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH)) | |
222 | 225 | then throwErr((newAdminAddress + " is not valid Address")) | |
223 | 226 | else unit | |
224 | 227 | if ((err == err)) | |
225 | 228 | then match indexOf(currentAdminList, newAdminAddress) { | |
226 | 229 | case a: Int => | |
227 | 230 | throwErr((newAdminAddress + " already in Admin List")) | |
228 | 231 | case _ => | |
229 | 232 | let newAdminList = (currentAdminList :+ newAdminAddress) | |
230 | 233 | let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))] | |
231 | 234 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
232 | 235 | } | |
233 | 236 | else throw("Strict value is not equal to itself.") | |
234 | 237 | } | |
235 | 238 | ||
236 | 239 | ||
237 | 240 | ||
238 | 241 | @Callable(i) | |
239 | 242 | func removeAdmin (removeCandidate) = { | |
240 | 243 | let callerAddressString = toBase58String(i.caller.bytes) | |
241 | 244 | let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate) | |
242 | 245 | let quorum = 2 | |
243 | 246 | let currentAdminList = getAdminsList() | |
244 | 247 | match indexOf(currentAdminList, removeCandidate) { | |
245 | 248 | case index: Int => | |
246 | 249 | let newAdminList = removeByIndex(currentAdminList, index) | |
247 | 250 | let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))] | |
248 | 251 | voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
249 | 252 | case _ => | |
250 | 253 | throwErr((removeCandidate + " not found in Admin List")) | |
251 | 254 | } | |
252 | 255 | } | |
253 | 256 | ||
254 | 257 | ||
255 | 258 | ||
256 | 259 | @Callable(i) | |
257 | 260 | func voteForTxId (txId) = { | |
258 | 261 | let callerAddressString = toBase58String(i.caller.bytes) | |
259 | 262 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
260 | 263 | let quorum = 2 | |
261 | 264 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
262 | 265 | let err = if ((size(fromBase58String(txId)) != 32)) | |
263 | 266 | then throwErr((txId + " not valid txId")) | |
264 | 267 | else unit | |
265 | 268 | if ((err == err)) | |
266 | 269 | then voteINTERNAL(callerAddressString, keyPrefix, quorum, result) | |
267 | 270 | else throw("Strict value is not equal to itself.") | |
268 | 271 | } | |
269 | 272 | ||
270 | 273 | ||
271 | 274 | @Verifier(tx) | |
272 | 275 | func verify () = { | |
273 | 276 | let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId())) | |
274 | 277 | match tx { | |
275 | 278 | case t: SetScriptTransaction => | |
276 | 279 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
277 | 280 | case t: DataTransaction => | |
278 | 281 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
279 | 282 | case _ => | |
280 | 283 | let currentAdminList = getAdminsList() | |
281 | 284 | if ((size(currentAdminList) >= 3)) | |
282 | 285 | then (tx.id == allowedTxId) | |
283 | 286 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
284 | 287 | } | |
285 | 288 | } | |
286 | 289 |
github/deemru/w8io/169f3d6 51.67 ms ◑