tx · 14mZMMtP6knjarfWVxSygk3Pb7U1kuhq9VVFQxMx1ibh

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.19 10:35 [2541156] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "14mZMMtP6knjarfWVxSygk3Pb7U1kuhq9VVFQxMx1ibh", "fee": 1000000, "feeAssetId": null, "timestamp": 1681889754050, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "3jtaCMuzeA5sHavBmFuqwWtPUC7rj1tuKNYKpa6yHXbY6ARkN3i453wiY4Zp1rAZHBjxRSwQ6XUm7UrUUq2zWfir" ], "script": "base64:BgIXCAISABIDCgEIEgASABIDCgEIEgMKAQgfAANTRVACAl9fABBjb250cmFjdEZpbGVuYW1lAhJtYW5hZ2VyX3ZhdWx0LnJpZGUBCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleVNldE5ld01hbmFnZXJWb3RlUHJlZml4ARBtYW5hZ2VyUHVibGljS2V5CQC5CQIJAMwIAgIGJXMlcyVzCQDMCAICCnNldE1hbmFnZXIJAMwIAgUQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABFGtleVNldE5ld01hbmFnZXJWb3RlAhBtYW5hZ2VyUHVibGljS2V5BWFkbWluCQC5CQIJAMwIAgk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QC5CQIFDG5ld0FkbWluTGlzdAUDU0VQBQNuaWwJAQx2b3RlSU5URVJOQUwFBRNjYWxsZXJBZGRyZXNzU3RyaW5nBRBhZG1pbkN1cnJlbnRWb3RlBQlrZXlQcmVmaXgFCG1pblZvdGVzBQZyZXN1bHQJAQh0aHJvd0VycgEJAKwCAgUPcmVtb3ZlQ2FuZGlkYXRlAhggbm90IGZvdW5kIGluIEFkbWluIExpc3QAnAJZnQ==", "height": 2541156, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7EMmiyuuRuQAM5kJSwkW3wXL7hg1C9BZV52wmnsQ6vrm Next: EV5YW1beov4z2RbLv43sHGzkXaLY4NP94ukUEubTz7Np Diff:
OldNewDifferences
4141 func getActivateManagerVote (admin) = valueOrElse(getInteger(keyActivateManagerVote(admin)), 0)
4242
4343
44-func keyAddNewAdminVotePrefix (newAdmin) = makeString(["%s%s%s", "addAdmin", newAdmin], SEP)
44+func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
4545
4646
47-func keyAddNewAdminVote (newAdmin,admin) = makeString([keyAddNewAdminVotePrefix(newAdmin), admin], SEP)
47+func keyAddNewAdminVote (adminCandidate,admin) = makeString([keyAddNewAdminVotePrefix(adminCandidate), admin], SEP)
4848
4949
50-func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keyAddNewAdminVote(newAdmin, admin)), 0)
50+func getAddNewAdminVote (adminCandidate,admin) = valueOrElse(getInteger(keyAddNewAdminVote(adminCandidate, admin)), 0)
51+
52+
53+func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
54+
55+
56+func keyRemoveAdminVote (removeCandidate,admin) = makeString([keyRemoveAdminVotePrefix(removeCandidate), admin], SEP)
57+
58+
59+func getRemoveAdminVote (removeCandidate,admin) = valueOrElse(getInteger(keyRemoveAdminVote(removeCandidate, admin)), 0)
5160
5261
5362 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
7584
7685
7786 func genVotesKeysHelper (a,adminAddress) = {
78- let $t024952519 = a
79- let result = $t024952519._1
80- let prefix = $t024952519._2
87+ let $t029532977 = a
88+ let result = $t029532977._1
89+ let prefix = $t029532977._2
8190 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
8291 }
8392
232241 }
233242
234243
244+
245+@Callable(i)
246+func removeAdmin (removeCandidate) = {
247+ let callerAddressString = toBase58String(i.caller.bytes)
248+ let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
249+ let adminCurrentVote = getRemoveAdminVote(removeCandidate, callerAddressString)
250+ let minVotes = 2
251+ let currentAdminList = getAdminsList()
252+ match indexOf(currentAdminList, removeCandidate) {
253+ case index: Int =>
254+ let newAdminList = removeByIndex(currentAdminList, index)
255+ let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
256+ voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
257+ case _ =>
258+ throwErr((removeCandidate + " not found in Admin List"))
259+ }
260+ }
261+
262+
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
44-func keyAddNewAdminVotePrefix (newAdmin) = makeString(["%s%s%s", "addAdmin", newAdmin], SEP)
44+func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
4545
4646
47-func keyAddNewAdminVote (newAdmin,admin) = makeString([keyAddNewAdminVotePrefix(newAdmin), admin], SEP)
47+func keyAddNewAdminVote (adminCandidate,admin) = makeString([keyAddNewAdminVotePrefix(adminCandidate), admin], SEP)
4848
4949
50-func getAddNewAdminVote (newAdmin,admin) = valueOrElse(getInteger(keyAddNewAdminVote(newAdmin, admin)), 0)
50+func getAddNewAdminVote (adminCandidate,admin) = valueOrElse(getInteger(keyAddNewAdminVote(adminCandidate, admin)), 0)
51+
52+
53+func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
54+
55+
56+func keyRemoveAdminVote (removeCandidate,admin) = makeString([keyRemoveAdminVotePrefix(removeCandidate), admin], SEP)
57+
58+
59+func getRemoveAdminVote (removeCandidate,admin) = valueOrElse(getInteger(keyRemoveAdminVote(removeCandidate, admin)), 0)
5160
5261
5362 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
5463
5564
5665 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5766 case s: String =>
5867 fromBase58String(s)
5968 case _: Unit =>
6069 unit
6170 case _ =>
6271 throw("Match error")
6372 }
6473
6574
6675 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6776
6877
6978 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
7079 case t: Int =>
7180 true
7281 case _ =>
7382 false
7483 }
7584
7685
7786 func genVotesKeysHelper (a,adminAddress) = {
78- let $t024952519 = a
79- let result = $t024952519._1
80- let prefix = $t024952519._2
87+ let $t029532977 = a
88+ let result = $t029532977._1
89+ let prefix = $t029532977._2
8190 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
8291 }
8392
8493
8594 func genVotesKeys (keyPrefix) = {
8695 let adminList = keyAdminAddressList()
8796 let $l = getAdminsList()
8897 let $s = size($l)
8998 let $acc0 = $Tuple2(nil, keyPrefix)
9099 func $f0_1 ($a,$i) = if (($i >= $s))
91100 then $a
92101 else genVotesKeysHelper($a, $l[$i])
93102
94103 func $f0_2 ($a,$i) = if (($i >= $s))
95104 then $a
96105 else throw("List size exceeds 10")
97106
98107 $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)
99108 }
100109
101110
102111 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
103112
104113
105114 func countVotes (prefix) = {
106115 let votes = genVotesKeys(prefix)._1
107116 let $l = votes
108117 let $s = size($l)
109118 let $acc0 = 0
110119 func $f0_1 ($a,$i) = if (($i >= $s))
111120 then $a
112121 else countVotesHelper($a, $l[$i])
113122
114123 func $f0_2 ($a,$i) = if (($i >= $s))
115124 then $a
116125 else throw("List size exceeds 10")
117126
118127 $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)
119128 }
120129
121130
122131 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
123132
124133
125134 func getClearVotesEntries (prefix) = {
126135 let votes = genVotesKeys(prefix)._1
127136 let $l = votes
128137 let $s = size($l)
129138 let $acc0 = nil
130139 func $f0_1 ($a,$i) = if (($i >= $s))
131140 then $a
132141 else clearVotesHelper($a, $l[$i])
133142
134143 func $f0_2 ($a,$i) = if (($i >= $s))
135144 then $a
136145 else throw("List size exceeds 10")
137146
138147 $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)
139148 }
140149
141150
142151 func voteINTERNAL (callerAddressString,adminCurrentVote,keyPrefix,minVotes,voteResult) = {
143152 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
144153 if (isInAdminList(callerAddressString))
145154 then if ((adminCurrentVote == 1))
146155 then throwErr((voteKey + " you already voted"))
147156 else {
148157 let votes = countVotes(keyPrefix)
149158 if (((votes + 1) >= minVotes))
150159 then {
151160 let clearVotesEntries = getClearVotesEntries(keyPrefix)
152161 (clearVotesEntries ++ voteResult)
153162 }
154163 else [IntegerEntry(voteKey, 1)]
155164 }
156165 else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
157166 }
158167
159168
160169 @Callable(i)
161170 func confirmManager () = {
162171 let pm = pendingManagerPublicKeyOrUnit()
163172 let hasPM = if (isDefined(pm))
164173 then true
165174 else throwErr("no pending manager")
166175 if ((hasPM == hasPM))
167176 then {
168177 let checkPM = if ((i.callerPublicKey == value(pm)))
169178 then true
170179 else throwErr("you are not pending manager")
171180 if ((checkPM == checkPM))
172181 then [StringEntry(keyActiveManagerPublicKey(), toBase58String(value(pm)))]
173182 else throw("Strict value is not equal to itself.")
174183 }
175184 else throw("Strict value is not equal to itself.")
176185 }
177186
178187
179188
180189 @Callable(i)
181190 func voteForNewManger (newManagerPublicKey) = {
182191 let callerAddressString = toBase58String(i.caller.bytes)
183192 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
184193 let adminCurrentVote = getSetNewManagerVote(newManagerPublicKey, callerAddressString)
185194 let minVotes = 2
186195 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
187196 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
188197 }
189198
190199
191200
192201 @Callable(i)
193202 func deactivateManager () = {
194203 let callerAddressString = toBase58String(i.caller.bytes)
195204 let keyPrefix = keyDeactivateManagerVotePrefix()
196205 let adminCurrentVote = getDeactivateManagerVote(callerAddressString)
197206 let minVotes = 1
198207 let result = [DeleteEntry(keyActiveManagerPublicKey())]
199208 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
200209 }
201210
202211
203212
204213 @Callable(i)
205214 func activateManager () = {
206215 let callerAddressString = toBase58String(i.caller.bytes)
207216 let keyPrefix = keyActivateManagerVotePrefix()
208217 let adminCurrentVote = getActivateManagerVote(callerAddressString)
209218 let minVotes = 2
210219 let pendingManagerString = getStringValue(keyPendingManagerPublicKey())
211220 let result = [StringEntry(keyActiveManagerPublicKey(), pendingManagerString)]
212221 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
213222 }
214223
215224
216225
217226 @Callable(i)
218227 func addNewAdmin (newAdminAddress) = {
219228 let callerAddressString = toBase58String(i.caller.bytes)
220229 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
221230 let adminCurrentVote = getAddNewAdminVote(newAdminAddress, callerAddressString)
222231 let minVotes = 2
223232 let currentAdminList = getAdminsList()
224233 match indexOf(currentAdminList, newAdminAddress) {
225234 case a: Int =>
226235 throwErr((newAdminAddress + " already in Admin List"))
227236 case _ =>
228237 let newAdminList = (currentAdminList :+ newAdminAddress)
229238 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
230239 voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
231240 }
232241 }
233242
234243
244+
245+@Callable(i)
246+func removeAdmin (removeCandidate) = {
247+ let callerAddressString = toBase58String(i.caller.bytes)
248+ let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
249+ let adminCurrentVote = getRemoveAdminVote(removeCandidate, callerAddressString)
250+ let minVotes = 2
251+ let currentAdminList = getAdminsList()
252+ match indexOf(currentAdminList, removeCandidate) {
253+ case index: Int =>
254+ let newAdminList = removeByIndex(currentAdminList, index)
255+ let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
256+ voteINTERNAL(callerAddressString, adminCurrentVote, keyPrefix, minVotes, result)
257+ case _ =>
258+ throwErr((removeCandidate + " not found in Admin List"))
259+ }
260+ }
261+
262+

github/deemru/w8io/026f985 
39.68 ms