tx · HbTaV4m18QtbJqqQB2zknMAGofx1V9t2EEG57oGxBwRo

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01100000 Waves

2023.04.19 12:33 [2541263] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "HbTaV4m18QtbJqqQB2zknMAGofx1V9t2EEG57oGxBwRo", "fee": 1100000, "feeAssetId": null, "timestamp": 1681896841102, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "3Wa6sBHkPJT6R5gR3SWbXE4iHWowKJSrnw7kZuTzoGnvKE7gK61n94EuJw6xbi94zwzZ2L198Hidj5dZ9rSqaYov" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBoAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQAPTUFYX0FETUlOX0NPVU5UAAoBCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5U2V0TmV3TWFuYWdlclZvdGVQcmVmaXgBEG1hbmFnZXJQdWJsaWNLZXkJALkJAgkAzAgCAgYlcyVzJ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VyUHVibGljS2V5AwkAAQIFByRtYXRjaDACD0RhdGFUcmFuc2FjdGlvbgQBdAUHJG1hdGNoMAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQQQY3VycmVudEFkbWluTGlzdAkBDWdldEFkbWluc0xpc3QAAwkAZwIJAJADAQUQY3VycmVudEFkbWluTGlzdAADCQAAAggFAnR4AmlkBQthbGxvd2VkVHhJZAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleT5o+3k=", "height": 2541263, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: J8eXxeZThKDDw1WEZ9EBziSoar1DzUYQ14uFZnPgNgHk Next: Ccx1dN6oBSXoTFuSQRE57epjPyMu3BkFfiQmYUdJbfn7 Diff:
OldNewDifferences
252252 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
253253 let quorum = 2
254254 let result = [StringEntry(keyAllowedTxId(), txId)]
255- voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
255+ let err = if ((size(fromBase58String(txId)) != 32))
256+ then throwErr((txId + " not valid txId"))
257+ else unit
258+ if ((err == err))
259+ then voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
260+ else throw("Strict value is not equal to itself.")
256261 }
257262
258263
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
88 let MAX_ADMIN_COUNT = 10
99
1010 func throwErr (s) = throw(((contractFilename + ": ") + s))
1111
1212
1313 func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1414
1515
1616 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1717
1818
1919 func keyCurrentManagerPublicKey () = makeString(["%s", "currentManagerPublicKey"], SEP)
2020
2121
2222 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2323
2424
2525 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
2626
2727
2828 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
2929
3030
3131 func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
3232
3333
3434 func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
3535
3636
3737 func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
3838
3939
4040 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
4141
4242
4343 func keyAllowedTxId () = makeString(["%s", "TXID"], SEP)
4444
4545
4646 func getAdminVote (prefix,admin) = {
4747 let voteKey = makeString([prefix, admin], SEP)
4848 valueOrElse(getInteger(voteKey), 0)
4949 }
5050
5151
5252 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5353 case s: String =>
5454 fromBase58String(s)
5555 case _: Unit =>
5656 unit
5757 case _ =>
5858 throw("Match error")
5959 }
6060
6161
6262 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6363
6464
6565 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
6666 case t: Int =>
6767 true
6868 case _ =>
6969 false
7070 }
7171
7272
7373 func genVotesKeysHelper (a,adminAddress) = {
7474 let $t020392063 = a
7575 let result = $t020392063._1
7676 let prefix = $t020392063._2
7777 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
7878 }
7979
8080
8181 func genVotesKeys (keyPrefix) = {
8282 let adminList = keyAdminAddressList()
8383 let $l = getAdminsList()
8484 let $s = size($l)
8585 let $acc0 = $Tuple2(nil, keyPrefix)
8686 func $f0_1 ($a,$i) = if (($i >= $s))
8787 then $a
8888 else genVotesKeysHelper($a, $l[$i])
8989
9090 func $f0_2 ($a,$i) = if (($i >= $s))
9191 then $a
9292 else throw("List size exceeds 20")
9393
9494 $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)
9595 }
9696
9797
9898 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
9999
100100
101101 func countVotes (prefix) = {
102102 let votes = genVotesKeys(prefix)._1
103103 let $l = votes
104104 let $s = size($l)
105105 let $acc0 = 0
106106 func $f0_1 ($a,$i) = if (($i >= $s))
107107 then $a
108108 else countVotesHelper($a, $l[$i])
109109
110110 func $f0_2 ($a,$i) = if (($i >= $s))
111111 then $a
112112 else throw("List size exceeds 20")
113113
114114 $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)
115115 }
116116
117117
118118 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
119119
120120
121121 func getClearVoteEntries (prefix) = {
122122 let votes = genVotesKeys(prefix)._1
123123 let $l = votes
124124 let $s = size($l)
125125 let $acc0 = nil
126126 func $f0_1 ($a,$i) = if (($i >= $s))
127127 then $a
128128 else clearVotesHelper($a, $l[$i])
129129
130130 func $f0_2 ($a,$i) = if (($i >= $s))
131131 then $a
132132 else throw("List size exceeds 20")
133133
134134 $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)
135135 }
136136
137137
138138 func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
139139 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
140140 let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
141141 if (isInAdminList(callerAddressString))
142142 then if ((adminCurrentVote == 1))
143143 then throwErr((voteKey + " you already voted"))
144144 else {
145145 let votes = countVotes(keyPrefix)
146146 if (((votes + 1) >= minVotes))
147147 then {
148148 let clearVoteEntries = getClearVoteEntries(keyPrefix)
149149 (clearVoteEntries ++ voteResult)
150150 }
151151 else [IntegerEntry(voteKey, 1)]
152152 }
153153 else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
154154 }
155155
156156
157157 @Callable(i)
158158 func confirmManager () = {
159159 let pm = pendingManagerPublicKeyOrUnit()
160160 let hasPM = if (isDefined(pm))
161161 then true
162162 else throwErr("no pending manager")
163163 if ((hasPM == hasPM))
164164 then {
165165 let checkPM = if ((i.callerPublicKey == value(pm)))
166166 then true
167167 else throwErr("you are not pending manager")
168168 if ((checkPM == checkPM))
169169 then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm)))]
170170 else throw("Strict value is not equal to itself.")
171171 }
172172 else throw("Strict value is not equal to itself.")
173173 }
174174
175175
176176
177177 @Callable(i)
178178 func voteForNewManger (newManagerPublicKey) = {
179179 let callerAddressString = toBase58String(i.caller.bytes)
180180 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
181181 let quorum = 2
182182 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
183183 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
184184 }
185185
186186
187187
188188 @Callable(i)
189189 func deactivateManager () = {
190190 let callerAddressString = toBase58String(i.caller.bytes)
191191 let keyPrefix = keyDeactivateManagerVotePrefix()
192192 let quorum = 1
193193 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
194194 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
195195 }
196196
197197
198198
199199 @Callable(i)
200200 func activateManager () = {
201201 let callerAddressString = toBase58String(i.caller.bytes)
202202 let keyPrefix = keyActivateManagerVotePrefix()
203203 let quorum = 2
204204 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
205205 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
206206 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
207207 }
208208
209209
210210
211211 @Callable(i)
212212 func addNewAdmin (newAdminAddress) = {
213213 let callerAddressString = toBase58String(i.caller.bytes)
214214 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
215215 let quorum = 2
216216 let currentAdminList = getAdminsList()
217217 if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
218218 then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
219219 else match indexOf(currentAdminList, newAdminAddress) {
220220 case a: Int =>
221221 throwErr((newAdminAddress + " already in Admin List"))
222222 case _ =>
223223 let newAdminList = (currentAdminList :+ newAdminAddress)
224224 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
225225 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
226226 }
227227 }
228228
229229
230230
231231 @Callable(i)
232232 func removeAdmin (removeCandidate) = {
233233 let callerAddressString = toBase58String(i.caller.bytes)
234234 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
235235 let quorum = 2
236236 let currentAdminList = getAdminsList()
237237 match indexOf(currentAdminList, removeCandidate) {
238238 case index: Int =>
239239 let newAdminList = removeByIndex(currentAdminList, index)
240240 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
241241 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
242242 case _ =>
243243 throwErr((removeCandidate + " not found in Admin List"))
244244 }
245245 }
246246
247247
248248
249249 @Callable(i)
250250 func voteForTxId (txId) = {
251251 let callerAddressString = toBase58String(i.caller.bytes)
252252 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
253253 let quorum = 2
254254 let result = [StringEntry(keyAllowedTxId(), txId)]
255- voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
255+ let err = if ((size(fromBase58String(txId)) != 32))
256+ then throwErr((txId + " not valid txId"))
257+ else unit
258+ if ((err == err))
259+ then voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
260+ else throw("Strict value is not equal to itself.")
256261 }
257262
258263
259264 @Verifier(tx)
260265 func verify () = {
261266 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
262267 match tx {
263268 case t: SetScriptTransaction =>
264269 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
265270 case t: DataTransaction =>
266271 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
267272 case _ =>
268273 let currentAdminList = getAdminsList()
269274 if ((size(currentAdminList) >= 3))
270275 then (tx.id == allowedTxId)
271276 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
272277 }
273278 }
274279

github/deemru/w8io/169f3d6 
53.35 ms