tx · DcHiV3kYZomWmkQ9UsFEBFQPKqDpHrkXwYrfSkd472FG

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.19 10:23 [2541143] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "DcHiV3kYZomWmkQ9UsFEBFQPKqDpHrkXwYrfSkd472FG", "fee": 1000000, "feeAssetId": null, "timestamp": 1681889052398, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "4B1AEn4LP9VRnHGLUm3LhhDg6jVcWZBi5N3dXnNofodYHoBAfj5fyZ2i9tR7fyeBVWWRHwAQkppnpJLU8PpNzmYt" ], "script": "base64:BgISCAISABIDCgEIEgASABIDCgEIHAADU0VQAgJfXwAQY29udHJhY3RGaWxlbmFtZQISbWFuYWdlcl92YXVsdC5yaWRlAQh0aHJvd0VycgEBcwkAAgEJAKwCAgkArAICBRBjb250cmFjdEZpbGVuYW1lAgI6IAUBcwEZa2V5QWN0aXZlTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhBtYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIXcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlTZXROZXdNYW5hZ2VyVm90ZVByZWZpeAEQbWFuYWdlclB1YmxpY0tleQkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAgpzZXRNYW5hZ2VyCQDMCAIFEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARRrZXlTZXROZXdNYW5hZ2VyVm90ZQIQbWFuYWdlclB1YmxpY0tleQVhZG1pbgkAuQkCCQDMCA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VsdAkAzAgCCQELU3RyaW5nRW50cnkCCQEZa2V5QWN0aXZlTWFuYWdlclB1YmxpY0tleQAFFHBlbmRpbmdNYW5hZ2VyU3RyaW5nBQNuaWwJAQx2b3RlSU5URVJOQUwFBRNjYWxsZXJBZGRyZXNzU3RyaW5nBRBhZG1pbkN1cnJlbnRWb3RlBQlrZXlQcmVmaXgFCG1pblZvdGVzBQZyZXN1bHQBaQELYWRkTmV3QWRtaW4BD25ld0FkbWluQWRkcmVzcwQTY2FsbGVyQWRkcmVzc1N0cmluZwkA2AQBCAgFAWkGY2FsbGVyBWJ5dGVzBAlrZXlQcmVmaXgJARhrZXlBZGROZXdBZG1pblZvdGVQcmVmaXgBBQ9uZXdBZG1pbkFkZHJlc3MEEGFkbWluQ3VycmVudFZvdGUJARJnZXRBZGROZXdBZG1pblZvdGUCBQ9uZXdBZG1pbkFkZHJlc3MFE2NhbGxlckFkZHJlc3NTdHJpbmcECG1pblZvdGVzAAIEEGN1cnJlbnRBZG1pbkxpc3QJAQ1nZXRBZG1pbnNMaXN0AAQMbmV3QWRtaW5MaXN0CQDNCAIFEGN1cnJlbnRBZG1pbkxpc3QFD25ld0FkbWluQWRkcmVzcwQGcmVzdWx0CQDMCAIJAQtTdHJpbmdFbnRyeQIJARNrZXlBZG1pbkFkZHJlc3NMaXN0AAkAuQkCBQxuZXdBZG1pbkxpc3QFA1NFUAUDbmlsCQEMdm90ZUlOVEVSTkFMBQUTY2FsbGVyQWRkcmVzc1N0cmluZwUQYWRtaW5DdXJyZW50Vm90ZQUJa2V5UHJlZml4BQhtaW5Wb3RlcwUGcmVzdWx0ACQDSIU=", "height": 2541143, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AuvzskD8MwFkKqx5bFQTZaNAUMMDWoN3veyxzVpJpS9o Next: 7EMmiyuuRuQAM5kJSwkW3wXL7hg1C9BZV52wmnsQ6vrm Diff:
OldNewDifferences
4747 func keyAddNewAdminVote (newAdmin,admin) = makeString([keyAddNewAdminVotePrefix(newAdmin), admin], SEP)
4848
4949
50-func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keySetNewManagerVote(newAdmin, admin)), 0)
50+func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keyAddNewAdminVote(newAdmin, admin)), 0)
5151
5252
5353 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
7575
7676
7777 func genVotesKeysHelper (a,adminAddress) = {
78- let $t024972521 = a
79- let result = $t024972521._1
80- let prefix = $t024972521._2
78+ let $t024952519 = a
79+ let result = $t024952519._1
80+ let prefix = $t024952519._2
8181 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
8282 }
8383
221221 let adminCurrentVote = getAddNewAdminVote(newAdminAddress, callerAddressString)
222222 let minVotes = 2
223223 let currentAdminList = getAdminsList()
224- if ((currentAdminList == currentAdminList))
225- then {
226- let newAdminList = (currentAdminList :+ newAdminAddress)
227- let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
228- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
229- }
230- else throw("Strict value is not equal to itself.")
224+ let newAdminList = (currentAdminList :+ newAdminAddress)
225+ let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
226+ voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
231227 }
232228
233229
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 keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
1818
1919
2020 func keySetNewManagerVote (managerPublicKey,admin) = makeString([keySetNewManagerVotePrefix(managerPublicKey), admin], SEP)
2121
2222
2323 func getSetNewManagerVote (managerPublicKey,admin) = valueOrElse(getInteger(keySetNewManagerVote(managerPublicKey, admin)), 0)
2424
2525
2626 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
2727
2828
2929 func keyDeactivateManagerVote (admin) = makeString([keyDeactivateManagerVotePrefix(), admin], SEP)
3030
3131
3232 func getDeactivateManagerVote (admin) = valueOrElse(getInteger(keyDeactivateManagerVote(admin)), 0)
3333
3434
3535 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
3636
3737
3838 func keyActivateManagerVote (admin) = makeString([keyActivateManagerVotePrefix(), admin], SEP)
3939
4040
4141 func getActivateManagerVote (admin) = valueOrElse(getInteger(keyActivateManagerVote(admin)), 0)
4242
4343
4444 func keyAddNewAdminVotePrefix (newAdmin) = makeString(["%s%s%s", "addAdmin", newAdmin], SEP)
4545
4646
4747 func keyAddNewAdminVote (newAdmin,admin) = makeString([keyAddNewAdminVotePrefix(newAdmin), admin], SEP)
4848
4949
50-func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keySetNewManagerVote(newAdmin, admin)), 0)
50+func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keyAddNewAdminVote(newAdmin, admin)), 0)
5151
5252
5353 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
5454
5555
5656 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5757 case s: String =>
5858 fromBase58String(s)
5959 case _: Unit =>
6060 unit
6161 case _ =>
6262 throw("Match error")
6363 }
6464
6565
6666 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6767
6868
6969 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
7070 case t: Int =>
7171 true
7272 case _ =>
7373 false
7474 }
7575
7676
7777 func genVotesKeysHelper (a,adminAddress) = {
78- let $t024972521 = a
79- let result = $t024972521._1
80- let prefix = $t024972521._2
78+ let $t024952519 = a
79+ let result = $t024952519._1
80+ let prefix = $t024952519._2
8181 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
8282 }
8383
8484
8585 func genVotesKeys (keyPrefix) = {
8686 let adminList = keyAdminAddressList()
8787 let $l = getAdminsList()
8888 let $s = size($l)
8989 let $acc0 = $Tuple2(nil, keyPrefix)
9090 func $f0_1 ($a,$i) = if (($i >= $s))
9191 then $a
9292 else genVotesKeysHelper($a, $l[$i])
9393
9494 func $f0_2 ($a,$i) = if (($i >= $s))
9595 then $a
9696 else throw("List size exceeds 10")
9797
9898 $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)
9999 }
100100
101101
102102 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
103103
104104
105105 func countVotes (prefix) = {
106106 let votes = genVotesKeys(prefix)._1
107107 let $l = votes
108108 let $s = size($l)
109109 let $acc0 = 0
110110 func $f0_1 ($a,$i) = if (($i >= $s))
111111 then $a
112112 else countVotesHelper($a, $l[$i])
113113
114114 func $f0_2 ($a,$i) = if (($i >= $s))
115115 then $a
116116 else throw("List size exceeds 10")
117117
118118 $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)
119119 }
120120
121121
122122 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
123123
124124
125125 func getClearVotesEntries (prefix) = {
126126 let votes = genVotesKeys(prefix)._1
127127 let $l = votes
128128 let $s = size($l)
129129 let $acc0 = nil
130130 func $f0_1 ($a,$i) = if (($i >= $s))
131131 then $a
132132 else clearVotesHelper($a, $l[$i])
133133
134134 func $f0_2 ($a,$i) = if (($i >= $s))
135135 then $a
136136 else throw("List size exceeds 10")
137137
138138 $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)
139139 }
140140
141141
142142 func voteINTERNAL (callerAddressString,adminCurrentVote,keyPrefix,minVotes,voteResult) = {
143143 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
144144 if (isInAdminList(callerAddressString))
145145 then if ((adminCurrentVote == 1))
146146 then throwErr((voteKey + " you already voted"))
147147 else {
148148 let votes = countVotes(keyPrefix)
149149 if (((votes + 1) >= minVotes))
150150 then {
151151 let clearVotesEntries = getClearVotesEntries(keyPrefix)
152152 (clearVotesEntries ++ voteResult)
153153 }
154154 else [IntegerEntry(voteKey, 1)]
155155 }
156156 else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
157157 }
158158
159159
160160 @Callable(i)
161161 func confirmManager () = {
162162 let pm = pendingManagerPublicKeyOrUnit()
163163 let hasPM = if (isDefined(pm))
164164 then true
165165 else throwErr("no pending manager")
166166 if ((hasPM == hasPM))
167167 then {
168168 let checkPM = if ((i.callerPublicKey == value(pm)))
169169 then true
170170 else throwErr("you are not pending manager")
171171 if ((checkPM == checkPM))
172172 then [StringEntry(keyActiveManagerPublicKey(), toBase58String(value(pm)))]
173173 else throw("Strict value is not equal to itself.")
174174 }
175175 else throw("Strict value is not equal to itself.")
176176 }
177177
178178
179179
180180 @Callable(i)
181181 func voteForNewManger (newManagerPublicKey) = {
182182 let callerAddressString = toBase58String(i.caller.bytes)
183183 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
184184 let adminCurrentVote = getSetNewManagerVote(newManagerPublicKey, callerAddressString)
185185 let minVotes = 2
186186 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
187187 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
188188 }
189189
190190
191191
192192 @Callable(i)
193193 func deactivateManager () = {
194194 let callerAddressString = toBase58String(i.caller.bytes)
195195 let keyPrefix = keyDeactivateManagerVotePrefix()
196196 let adminCurrentVote = getDeactivateManagerVote(callerAddressString)
197197 let minVotes = 1
198198 let result = [DeleteEntry(keyActiveManagerPublicKey())]
199199 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
200200 }
201201
202202
203203
204204 @Callable(i)
205205 func activateManager () = {
206206 let callerAddressString = toBase58String(i.caller.bytes)
207207 let keyPrefix = keyActivateManagerVotePrefix()
208208 let adminCurrentVote = getActivateManagerVote(callerAddressString)
209209 let minVotes = 2
210210 let pendingManagerString = getStringValue(keyPendingManagerPublicKey())
211211 let result = [StringEntry(keyActiveManagerPublicKey(), pendingManagerString)]
212212 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
213213 }
214214
215215
216216
217217 @Callable(i)
218218 func addNewAdmin (newAdminAddress) = {
219219 let callerAddressString = toBase58String(i.caller.bytes)
220220 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
221221 let adminCurrentVote = getAddNewAdminVote(newAdminAddress, callerAddressString)
222222 let minVotes = 2
223223 let currentAdminList = getAdminsList()
224- if ((currentAdminList == currentAdminList))
225- then {
226- let newAdminList = (currentAdminList :+ newAdminAddress)
227- let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
228- voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
229- }
230- else throw("Strict value is not equal to itself.")
224+ let newAdminList = (currentAdminList :+ newAdminAddress)
225+ let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
226+ voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
231227 }
232228
233229

github/deemru/w8io/026f985 
35.77 ms