tx · A6sTKhNUTqP25qpY3ZPPWi9siUF7KqaHvctGjiWXWn3Q

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01200000 Waves

2023.04.20 14:22 [2542806] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "A6sTKhNUTqP25qpY3ZPPWi9siUF7KqaHvctGjiWXWn3Q", "fee": 1200000, "feeAssetId": null, "timestamp": 1681989766947, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "3kVyswR3q49SRLZcyUv1tAJEV9DxbNXEVV44sg7JSRAKfYjNdtVxoGxv1DoEy75giZKzNA4d4doYR2AJoAU4ZQZy" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCB4AA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQATTUFYX0FETUlOX0xJU1RfU0laRQAKABNNSU5fQURNSU5fTElTVF9TSVpFAAIAFEFERFJFU1NfQllURVNfTEVOR1RIABoAEVRYSURfQllURVNfTEVOR1RIACABCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwF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NLZXnNOy6F", "height": 2542806, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ho3tpYsfYse6LouWWjoVg73p6EhCakdSDf8wBKRrrSqV Next: FDPpxPPdueCYML14qes544JqGwPcPSJLeD4TnXptmcQM Diff:
OldNewDifferences
55
66 let contractFilename = "manager_vault.ride"
77
8-let MAX_ADMIN_COUNT = 10
8+let MAX_ADMIN_LIST_SIZE = 10
9+
10+let MIN_ADMIN_LIST_SIZE = 2
911
1012 let ADDRESS_BYTES_LENGTH = 26
13+
14+let TXID_BYTES_LENGTH = 32
1115
1216 func throwErr (s) = throw(((contractFilename + ": ") + s))
1317
3943 func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
4044
4145
46+func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP)
47+
48+
4249 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
4350
4451
4653
4754
4855 func getAdminVote (prefix,admin) = {
49- let voteKey = makeString([prefix, admin], SEP)
56+ let voteKey = keyFullAdminVote(prefix, admin)
5057 valueOrElse(getInteger(voteKey), 0)
5158 }
5259
6471 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6572
6673
67-func isInAdminList (address) = match indexOf(getAdminsList(), address) {
68- case t: Int =>
69- true
70- case _ =>
71- false
72-}
74+func isInAdminList (address) = containsElement(getAdminsList(), address)
7375
7476
7577 func genVotesKeysHelper (a,adminAddress) = {
76- let $t020692093 = a
77- let result = $t020692093._1
78- let prefix = $t020692093._2
79- $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
78+ let $t021982222 = a
79+ let result = $t021982222._1
80+ let prefix = $t021982222._2
81+ $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix)
8082 }
8183
8284
138140
139141
140142 func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
141- let voteKey = makeString([keyPrefix, callerAddressString], SEP)
143+ let voteKey = keyFullAdminVote(keyPrefix, callerAddressString)
142144 let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
143145 let err = if (!(isInAdminList(callerAddressString)))
144146 then throwErr((("Address: " + callerAddressString) + " not in Admin list"))
180182
181183
182184 @Callable(i)
183-func voteForNewManger (newManagerPublicKey) = {
185+func voteForNewManager (newManagerPublicKey) = {
184186 let callerAddressString = toBase58String(i.caller.bytes)
185187 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
186188 let quorum = 2
219221 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
220222 let quorum = 2
221223 let currentAdminList = getAdminsList()
222- let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
223- then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
224+ let err = if ((size(currentAdminList) >= MAX_ADMIN_LIST_SIZE))
225+ then throwErr((("MAX_ADMIN_LIST_SIZE (" + toString(MAX_ADMIN_LIST_SIZE)) + ") is exceeded"))
224226 else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH))
225227 then throwErr((newAdminAddress + " is not valid Address"))
226228 else unit
262264 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
263265 let quorum = 2
264266 let result = [StringEntry(keyAllowedTxId(), txId)]
265- let err = if ((size(fromBase58String(txId)) != 32))
267+ let err = if ((size(fromBase58String(txId)) != TXID_BYTES_LENGTH))
266268 then throwErr((txId + " not valid txId"))
267269 else unit
268270 if ((err == err))
281283 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
282284 case _ =>
283285 let currentAdminList = getAdminsList()
284- if ((size(currentAdminList) >= 3))
286+ if ((size(currentAdminList) >= MIN_ADMIN_LIST_SIZE))
285287 then (tx.id == allowedTxId)
286288 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
287289 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let contractFilename = "manager_vault.ride"
77
8-let MAX_ADMIN_COUNT = 10
8+let MAX_ADMIN_LIST_SIZE = 10
9+
10+let MIN_ADMIN_LIST_SIZE = 2
911
1012 let ADDRESS_BYTES_LENGTH = 26
13+
14+let TXID_BYTES_LENGTH = 32
1115
1216 func throwErr (s) = throw(((contractFilename + ": ") + s))
1317
1418
1519 func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1620
1721
1822 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1923
2024
2125 func keyCurrentManagerPublicKey () = makeString(["%s", "currentManagerPublicKey"], SEP)
2226
2327
2428 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2529
2630
2731 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
2832
2933
3034 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
3135
3236
3337 func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
3438
3539
3640 func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
3741
3842
3943 func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
4044
4145
46+func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP)
47+
48+
4249 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
4350
4451
4552 func keyAllowedTxId () = makeString(["%s", "TXID"], SEP)
4653
4754
4855 func getAdminVote (prefix,admin) = {
49- let voteKey = makeString([prefix, admin], SEP)
56+ let voteKey = keyFullAdminVote(prefix, admin)
5057 valueOrElse(getInteger(voteKey), 0)
5158 }
5259
5360
5461 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5562 case s: String =>
5663 fromBase58String(s)
5764 case _: Unit =>
5865 unit
5966 case _ =>
6067 throw("Match error")
6168 }
6269
6370
6471 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6572
6673
67-func isInAdminList (address) = match indexOf(getAdminsList(), address) {
68- case t: Int =>
69- true
70- case _ =>
71- false
72-}
74+func isInAdminList (address) = containsElement(getAdminsList(), address)
7375
7476
7577 func genVotesKeysHelper (a,adminAddress) = {
76- let $t020692093 = a
77- let result = $t020692093._1
78- let prefix = $t020692093._2
79- $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
78+ let $t021982222 = a
79+ let result = $t021982222._1
80+ let prefix = $t021982222._2
81+ $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix)
8082 }
8183
8284
8385 func genVotesKeys (keyPrefix) = {
8486 let adminList = keyAdminAddressList()
8587 let $l = getAdminsList()
8688 let $s = size($l)
8789 let $acc0 = $Tuple2(nil, keyPrefix)
8890 func $f0_1 ($a,$i) = if (($i >= $s))
8991 then $a
9092 else genVotesKeysHelper($a, $l[$i])
9193
9294 func $f0_2 ($a,$i) = if (($i >= $s))
9395 then $a
9496 else throw("List size exceeds 20")
9597
9698 $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)
9799 }
98100
99101
100102 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
101103
102104
103105 func countVotes (prefix) = {
104106 let votes = genVotesKeys(prefix)._1
105107 let $l = votes
106108 let $s = size($l)
107109 let $acc0 = 0
108110 func $f0_1 ($a,$i) = if (($i >= $s))
109111 then $a
110112 else countVotesHelper($a, $l[$i])
111113
112114 func $f0_2 ($a,$i) = if (($i >= $s))
113115 then $a
114116 else throw("List size exceeds 20")
115117
116118 $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)
117119 }
118120
119121
120122 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
121123
122124
123125 func getClearVoteEntries (prefix) = {
124126 let votes = genVotesKeys(prefix)._1
125127 let $l = votes
126128 let $s = size($l)
127129 let $acc0 = nil
128130 func $f0_1 ($a,$i) = if (($i >= $s))
129131 then $a
130132 else clearVotesHelper($a, $l[$i])
131133
132134 func $f0_2 ($a,$i) = if (($i >= $s))
133135 then $a
134136 else throw("List size exceeds 20")
135137
136138 $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)
137139 }
138140
139141
140142 func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
141- let voteKey = makeString([keyPrefix, callerAddressString], SEP)
143+ let voteKey = keyFullAdminVote(keyPrefix, callerAddressString)
142144 let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
143145 let err = if (!(isInAdminList(callerAddressString)))
144146 then throwErr((("Address: " + callerAddressString) + " not in Admin list"))
145147 else if ((adminCurrentVote == 1))
146148 then throwErr((voteKey + " you already voted"))
147149 else unit
148150 if ((err == err))
149151 then {
150152 let votes = countVotes(keyPrefix)
151153 if (((votes + 1) >= minVotes))
152154 then {
153155 let clearVoteEntries = getClearVoteEntries(keyPrefix)
154156 (clearVoteEntries ++ voteResult)
155157 }
156158 else [IntegerEntry(voteKey, 1)]
157159 }
158160 else throw("Strict value is not equal to itself.")
159161 }
160162
161163
162164 @Callable(i)
163165 func confirmManager () = {
164166 let pm = pendingManagerPublicKeyOrUnit()
165167 let hasPM = if (isDefined(pm))
166168 then true
167169 else throwErr("no pending manager")
168170 if ((hasPM == hasPM))
169171 then {
170172 let checkPM = if ((i.callerPublicKey == value(pm)))
171173 then true
172174 else throwErr("you are not pending manager")
173175 if ((checkPM == checkPM))
174176 then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm))), StringEntry(keyActiveManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())]
175177 else throw("Strict value is not equal to itself.")
176178 }
177179 else throw("Strict value is not equal to itself.")
178180 }
179181
180182
181183
182184 @Callable(i)
183-func voteForNewManger (newManagerPublicKey) = {
185+func voteForNewManager (newManagerPublicKey) = {
184186 let callerAddressString = toBase58String(i.caller.bytes)
185187 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
186188 let quorum = 2
187189 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
188190 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
189191 }
190192
191193
192194
193195 @Callable(i)
194196 func deactivateManager () = {
195197 let callerAddressString = toBase58String(i.caller.bytes)
196198 let keyPrefix = keyDeactivateManagerVotePrefix()
197199 let quorum = 1
198200 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
199201 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
200202 }
201203
202204
203205
204206 @Callable(i)
205207 func activateManager () = {
206208 let callerAddressString = toBase58String(i.caller.bytes)
207209 let keyPrefix = keyActivateManagerVotePrefix()
208210 let quorum = 2
209211 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
210212 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
211213 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
212214 }
213215
214216
215217
216218 @Callable(i)
217219 func addNewAdmin (newAdminAddress) = {
218220 let callerAddressString = toBase58String(i.caller.bytes)
219221 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
220222 let quorum = 2
221223 let currentAdminList = getAdminsList()
222- let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
223- then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
224+ let err = if ((size(currentAdminList) >= MAX_ADMIN_LIST_SIZE))
225+ then throwErr((("MAX_ADMIN_LIST_SIZE (" + toString(MAX_ADMIN_LIST_SIZE)) + ") is exceeded"))
224226 else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH))
225227 then throwErr((newAdminAddress + " is not valid Address"))
226228 else unit
227229 if ((err == err))
228230 then match indexOf(currentAdminList, newAdminAddress) {
229231 case a: Int =>
230232 throwErr((newAdminAddress + " already in Admin List"))
231233 case _ =>
232234 let newAdminList = (currentAdminList :+ newAdminAddress)
233235 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
234236 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
235237 }
236238 else throw("Strict value is not equal to itself.")
237239 }
238240
239241
240242
241243 @Callable(i)
242244 func removeAdmin (removeCandidate) = {
243245 let callerAddressString = toBase58String(i.caller.bytes)
244246 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
245247 let quorum = 2
246248 let currentAdminList = getAdminsList()
247249 match indexOf(currentAdminList, removeCandidate) {
248250 case index: Int =>
249251 let newAdminList = removeByIndex(currentAdminList, index)
250252 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
251253 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
252254 case _ =>
253255 throwErr((removeCandidate + " not found in Admin List"))
254256 }
255257 }
256258
257259
258260
259261 @Callable(i)
260262 func voteForTxId (txId) = {
261263 let callerAddressString = toBase58String(i.caller.bytes)
262264 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
263265 let quorum = 2
264266 let result = [StringEntry(keyAllowedTxId(), txId)]
265- let err = if ((size(fromBase58String(txId)) != 32))
267+ let err = if ((size(fromBase58String(txId)) != TXID_BYTES_LENGTH))
266268 then throwErr((txId + " not valid txId"))
267269 else unit
268270 if ((err == err))
269271 then voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
270272 else throw("Strict value is not equal to itself.")
271273 }
272274
273275
274276 @Verifier(tx)
275277 func verify () = {
276278 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
277279 match tx {
278280 case t: SetScriptTransaction =>
279281 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
280282 case t: DataTransaction =>
281283 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
282284 case _ =>
283285 let currentAdminList = getAdminsList()
284- if ((size(currentAdminList) >= 3))
286+ if ((size(currentAdminList) >= MIN_ADMIN_LIST_SIZE))
285287 then (tx.id == allowedTxId)
286288 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
287289 }
288290 }
289291

github/deemru/w8io/026f985 
50.16 ms