tx · 3MVtRpXPGEtT51DfrhhESej2Hx2Ug3iuTb38gjQRjvRG

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01200000 Waves

2023.04.19 13:20 [2541305] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
113.46 ms