tx · E1GzyHZ2nBL1SktQ6c44DiCLogSHF7bLsXMDaFrTeyHj

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.19 11:45 [2541219] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "E1GzyHZ2nBL1SktQ6c44DiCLogSHF7bLsXMDaFrTeyHj", "fee": 1000000, "feeAssetId": null, "timestamp": 1681893970998, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "LU6KV8qvqs9BkcoszrLC9LaCMj4Esyi1BBkUp4X33BxHiK5SjiYVFWvsT9xvbH3UGXc1JzSw4TASuygULEUFrym" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBkAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBGWtleUFjdGl2ZU1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleVBlbmRpbmdNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF3BlbmRpbmdNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5Q3VycmVudE1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIXY3VycmVudE1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlTZXROZXdNYW5hZ2VyVm90ZVByZWZpeAEQbWFuYWdlclB1YmxpY0tleQkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAgpzZXRNYW5h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YWxsZXJBZGRyZXNzU3RyaW5nBQlrZXlQcmVmaXgFBnF1b3J1bQUGcmVzdWx0AQJ0eAEGdmVyaWZ5AAQLYWxsb3dlZFR4SWQJANkEAQkBEUBleHRyTmF0aXZlKDEwNTgpAQkBDmtleUFsbG93ZWRUeElkAAQHJG1hdGNoMAUCdHgDCQABAgUHJG1hdGNoMAIUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAXQFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkDCQABAgUHJG1hdGNoMAIPRGF0YVRyYW5zYWN0aW9uBAF0BQckbWF0Y2gwCQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5CQAAAggFAnR4AmlkBQthbGxvd2VkVHhJZDJOyrg=", "height": 2541219, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GG9XYpqFpVQLLSwi2m2fc7QA2A3EpmAVxk7mGpYiwWGu Next: J8eXxeZThKDDw1WEZ9EBziSoar1DzUYQ14uFZnPgNgHk Diff:
OldNewDifferences
176176 func voteForNewManger (newManagerPublicKey) = {
177177 let callerAddressString = toBase58String(i.caller.bytes)
178178 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
179- let minVotes = 2
179+ let quorum = 2
180180 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
181- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
181+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
182182 }
183183
184184
187187 func deactivateManager () = {
188188 let callerAddressString = toBase58String(i.caller.bytes)
189189 let keyPrefix = keyDeactivateManagerVotePrefix()
190- let minVotes = 1
190+ let quorum = 1
191191 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
192- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
192+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
193193 }
194194
195195
198198 func activateManager () = {
199199 let callerAddressString = toBase58String(i.caller.bytes)
200200 let keyPrefix = keyActivateManagerVotePrefix()
201- let minVotes = 2
201+ let quorum = 2
202202 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
203203 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
204- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
204+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
205205 }
206206
207207
210210 func addNewAdmin (newAdminAddress) = {
211211 let callerAddressString = toBase58String(i.caller.bytes)
212212 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
213- let minVotes = 2
213+ let quorum = 2
214214 let currentAdminList = getAdminsList()
215215 match indexOf(currentAdminList, newAdminAddress) {
216216 case a: Int =>
218218 case _ =>
219219 let newAdminList = (currentAdminList :+ newAdminAddress)
220220 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
221- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
221+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
222222 }
223223 }
224224
228228 func removeAdmin (removeCandidate) = {
229229 let callerAddressString = toBase58String(i.caller.bytes)
230230 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
231- let minVotes = 2
231+ let quorum = 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))]
237- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
237+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
238238 case _ =>
239239 throwErr((removeCandidate + " not found in Admin List"))
240240 }
246246 func voteForTxId (txId) = {
247247 let callerAddressString = toBase58String(i.caller.bytes)
248248 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
249- let minVotes = 2
249+ let quorum = 2
250250 let result = [StringEntry(keyAllowedTxId(), txId)]
251- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
251+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
252252 }
253253
254254
257257 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
258258 match tx {
259259 case t: SetScriptTransaction =>
260+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
261+ case t: DataTransaction =>
260262 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
261263 case _ =>
262264 (tx.id == allowedTxId)
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)
179- let minVotes = 2
179+ let quorum = 2
180180 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
181- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
181+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
182182 }
183183
184184
185185
186186 @Callable(i)
187187 func deactivateManager () = {
188188 let callerAddressString = toBase58String(i.caller.bytes)
189189 let keyPrefix = keyDeactivateManagerVotePrefix()
190- let minVotes = 1
190+ let quorum = 1
191191 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
192- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
192+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
193193 }
194194
195195
196196
197197 @Callable(i)
198198 func activateManager () = {
199199 let callerAddressString = toBase58String(i.caller.bytes)
200200 let keyPrefix = keyActivateManagerVotePrefix()
201- let minVotes = 2
201+ let quorum = 2
202202 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
203203 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
204- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
204+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
205205 }
206206
207207
208208
209209 @Callable(i)
210210 func addNewAdmin (newAdminAddress) = {
211211 let callerAddressString = toBase58String(i.caller.bytes)
212212 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
213- let minVotes = 2
213+ let quorum = 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))]
221- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
221+ voteINTERNAL(callerAddressString, keyPrefix, quorum, 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)
231- let minVotes = 2
231+ let quorum = 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))]
237- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
237+ voteINTERNAL(callerAddressString, keyPrefix, quorum, 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)
249- let minVotes = 2
249+ let quorum = 2
250250 let result = [StringEntry(keyAllowedTxId(), txId)]
251- voteINTERNAL(callerAddressString, keyPrefix, minVotes, result)
251+ voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
252252 }
253253
254254
255255 @Verifier(tx)
256256 func verify () = {
257257 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
258258 match tx {
259259 case t: SetScriptTransaction =>
260+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
261+ case t: DataTransaction =>
260262 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
261263 case _ =>
262264 (tx.id == allowedTxId)
263265 }
264266 }
265267

github/deemru/w8io/026f985 
57.88 ms