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