tx · HwWXuo7m8vuqmiFCKSmqiYCbHmN7ffcSPeqHqSaGA7GA

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.19 11:38 [2541210] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
64.79 ms