tx · 8X8nNMnERerJQigpD8uM2RhPMuyMH1ECmTHwMhiSZZtx

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01200000 Waves

2023.04.19 12:59 [2541288] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "8X8nNMnERerJQigpD8uM2RhPMuyMH1ECmTHwMhiSZZtx", "fee": 1200000, "feeAssetId": null, "timestamp": 1681898337641, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2kQeVKbahVbyjERj7u5UpN3G5CBUdAs9NGVJZvCDZbi4faGBKqnVEtoYDC8gZg7fTmpVQosAMHd4FMuZMwhRbLJv" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBsAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQAPTUFYX0FETUlOX0NPVU5UAAoAFEFERFJFU1NfQllURVNfTEVOR1RIABoBCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5U2V0TmV3TWFuYWdlclZvdGVQcmVmaXgBEG1hbmFnZXJQd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URVJOQUwEBRNjYWxsZXJBZGRyZXNzU3RyaW5nBQlrZXlQcmVmaXgFBnF1b3J1bQUGcmVzdWx0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQLYWxsb3dlZFR4SWQJANkEAQkBEUBleHRyTmF0aXZlKDEwNTgpAQkBDmtleUFsbG93ZWRUeElkAAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAXQFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkDCQABAgUHJG1hdGNoMAIPRGF0YVRyYW5zYWN0aW9uBAF0BQckbWF0Y2gwCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5BBBjdXJyZW50QWRtaW5MaXN0CQENZ2V0QWRtaW5zTGlzdAADCQBnAgkAkAMBBRBjdXJyZW50QWRtaW5MaXN0AAMJAAACCAUCdHgCaWQFC2FsbG93ZWRUeElkCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5CRn/xA==", "height": 2541288, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Ccx1dN6oBSXoTFuSQRE57epjPyMu3BkFfiQmYUdJbfn7 Next: 3MVtRpXPGEtT51DfrhhESej2Hx2Ug3iuTb38gjQRjvRG Diff:
OldNewDifferences
140140 func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
141141 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
142142 let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
143- if (isInAdminList(callerAddressString))
144- then if ((adminCurrentVote == 1))
143+ let err = if (!(isInAdminList(callerAddressString)))
144+ then throwErr((("Address: " + callerAddressString) + " not in Admin list"))
145+ else if ((adminCurrentVote == 1))
145146 then throwErr((voteKey + " you already voted"))
146- else {
147- let votes = countVotes(keyPrefix)
148- if (((votes + 1) >= minVotes))
149- then {
150- let clearVoteEntries = getClearVoteEntries(keyPrefix)
151- (clearVoteEntries ++ voteResult)
152- }
153- else [IntegerEntry(voteKey, 1)]
154- }
155- else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
147+ else unit
148+ if ((err == err))
149+ then {
150+ let votes = countVotes(keyPrefix)
151+ if (((votes + 1) >= minVotes))
152+ then {
153+ let clearVoteEntries = getClearVoteEntries(keyPrefix)
154+ (clearVoteEntries ++ voteResult)
155+ }
156+ else [IntegerEntry(voteKey, 1)]
157+ }
158+ else throw("Strict value is not equal to itself.")
156159 }
157160
158161
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)
143- if (isInAdminList(callerAddressString))
144- then if ((adminCurrentVote == 1))
143+ let err = if (!(isInAdminList(callerAddressString)))
144+ then throwErr((("Address: " + callerAddressString) + " not in Admin list"))
145+ else if ((adminCurrentVote == 1))
145146 then throwErr((voteKey + " you already voted"))
146- else {
147- let votes = countVotes(keyPrefix)
148- if (((votes + 1) >= minVotes))
149- then {
150- let clearVoteEntries = getClearVoteEntries(keyPrefix)
151- (clearVoteEntries ++ voteResult)
152- }
153- else [IntegerEntry(voteKey, 1)]
154- }
155- else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
147+ else unit
148+ if ((err == err))
149+ then {
150+ let votes = countVotes(keyPrefix)
151+ if (((votes + 1) >= minVotes))
152+ then {
153+ let clearVoteEntries = getClearVoteEntries(keyPrefix)
154+ (clearVoteEntries ++ voteResult)
155+ }
156+ else [IntegerEntry(voteKey, 1)]
157+ }
158+ else throw("Strict value is not equal to itself.")
156159 }
157160
158161
159162 @Callable(i)
160163 func confirmManager () = {
161164 let pm = pendingManagerPublicKeyOrUnit()
162165 let hasPM = if (isDefined(pm))
163166 then true
164167 else throwErr("no pending manager")
165168 if ((hasPM == hasPM))
166169 then {
167170 let checkPM = if ((i.callerPublicKey == value(pm)))
168171 then true
169172 else throwErr("you are not pending manager")
170173 if ((checkPM == checkPM))
171174 then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm)))]
172175 else throw("Strict value is not equal to itself.")
173176 }
174177 else throw("Strict value is not equal to itself.")
175178 }
176179
177180
178181
179182 @Callable(i)
180183 func voteForNewManger (newManagerPublicKey) = {
181184 let callerAddressString = toBase58String(i.caller.bytes)
182185 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
183186 let quorum = 2
184187 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
185188 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
186189 }
187190
188191
189192
190193 @Callable(i)
191194 func deactivateManager () = {
192195 let callerAddressString = toBase58String(i.caller.bytes)
193196 let keyPrefix = keyDeactivateManagerVotePrefix()
194197 let quorum = 1
195198 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
196199 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
197200 }
198201
199202
200203
201204 @Callable(i)
202205 func activateManager () = {
203206 let callerAddressString = toBase58String(i.caller.bytes)
204207 let keyPrefix = keyActivateManagerVotePrefix()
205208 let quorum = 2
206209 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
207210 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
208211 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
209212 }
210213
211214
212215
213216 @Callable(i)
214217 func addNewAdmin (newAdminAddress) = {
215218 let callerAddressString = toBase58String(i.caller.bytes)
216219 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
217220 let quorum = 2
218221 let currentAdminList = getAdminsList()
219222 let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
220223 then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
221224 else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH))
222225 then throwErr((newAdminAddress + " is not valid Address"))
223226 else unit
224227 if ((err == err))
225228 then match indexOf(currentAdminList, newAdminAddress) {
226229 case a: Int =>
227230 throwErr((newAdminAddress + " already in Admin List"))
228231 case _ =>
229232 let newAdminList = (currentAdminList :+ newAdminAddress)
230233 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
231234 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
232235 }
233236 else throw("Strict value is not equal to itself.")
234237 }
235238
236239
237240
238241 @Callable(i)
239242 func removeAdmin (removeCandidate) = {
240243 let callerAddressString = toBase58String(i.caller.bytes)
241244 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
242245 let quorum = 2
243246 let currentAdminList = getAdminsList()
244247 match indexOf(currentAdminList, removeCandidate) {
245248 case index: Int =>
246249 let newAdminList = removeByIndex(currentAdminList, index)
247250 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
248251 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
249252 case _ =>
250253 throwErr((removeCandidate + " not found in Admin List"))
251254 }
252255 }
253256
254257
255258
256259 @Callable(i)
257260 func voteForTxId (txId) = {
258261 let callerAddressString = toBase58String(i.caller.bytes)
259262 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
260263 let quorum = 2
261264 let result = [StringEntry(keyAllowedTxId(), txId)]
262265 let err = if ((size(fromBase58String(txId)) != 32))
263266 then throwErr((txId + " not valid txId"))
264267 else unit
265268 if ((err == err))
266269 then voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
267270 else throw("Strict value is not equal to itself.")
268271 }
269272
270273
271274 @Verifier(tx)
272275 func verify () = {
273276 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
274277 match tx {
275278 case t: SetScriptTransaction =>
276279 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
277280 case t: DataTransaction =>
278281 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
279282 case _ =>
280283 let currentAdminList = getAdminsList()
281284 if ((size(currentAdminList) >= 3))
282285 then (tx.id == allowedTxId)
283286 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
284287 }
285288 }
286289

github/deemru/w8io/169f3d6 
51.67 ms