tx · Ccx1dN6oBSXoTFuSQRE57epjPyMu3BkFfiQmYUdJbfn7

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01200000 Waves

2023.04.19 12:41 [2541269] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "Ccx1dN6oBSXoTFuSQRE57epjPyMu3BkFfiQmYUdJbfn7", "fee": 1200000, "feeAssetId": null, "timestamp": 1681897326942, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2DTE1tcMhctKW2nv4Bb852569BDLDfcr5LDq4XeFrPCJ4xfk86V4TedaejHAQBNWC5w276bC5VHgfQLqfxWtUn2u" ], "script": "base64:BgIcCAISABIDCgEIEgASABIDCgEIEgMKAQgSAwoBCBsAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCEm1hbmFnZXJfdmF1bHQucmlkZQAPTUFYX0FETUlOX0NPVU5UAAoAFEFERFJFU1NfQllURVNfTEVOR1RIABoBCHRocm93RXJyAQFzCQACAQkArAICCQCsAgIFEGNvbnRyYWN0RmlsZW5hbWUCAjogBQFzARlrZXlBY3RpdmVNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAJALkJAgkAzAgCAgIlcwkAzAgCAhdwZW5kaW5nTWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICF2N1cnJlbnRNYW5hZ2VyUHVibGljS2V5BQNuaWwFA1NFUAEaa2V5U2V0TmV3TWFuYWdlclZvdGVQcmVmaXgBEG1hbmFnZXJQdW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HJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAthbGxvd2VkVHhJZAkA2QQBCQERQGV4dHJOYXRpdmUoMTA1OCkBCQEOa2V5QWxsb3dlZFR4SWQABAckbWF0Y2gwBQJ0eAMJAAECBQckbWF0Y2gwAhRTZXRTY3JpcHRUcmFuc2FjdGlvbgQBdAUHJG1hdGNoMAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMJAAECBQckbWF0Y2gwAg9EYXRhVHJhbnNhY3Rpb24EAXQFByRtYXRjaDAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXkEEGN1cnJlbnRBZG1pbkxpc3QJAQ1nZXRBZG1pbnNMaXN0AAMJAGcCCQCQAwEFEGN1cnJlbnRBZG1pbkxpc3QAAwkAAAIIBQJ0eAJpZAULYWxsb3dlZFR4SWQJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXljSC/K", "height": 2541269, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HbTaV4m18QtbJqqQB2zknMAGofx1V9t2EEG57oGxBwRo Next: 8X8nNMnERerJQigpD8uM2RhPMuyMH1ECmTHwMhiSZZtx Diff:
OldNewDifferences
66 let contractFilename = "manager_vault.ride"
77
88 let MAX_ADMIN_COUNT = 10
9+
10+let ADDRESS_BYTES_LENGTH = 26
911
1012 func throwErr (s) = throw(((contractFilename + ": ") + s))
1113
7173
7274
7375 func genVotesKeysHelper (a,adminAddress) = {
74- let $t020392063 = a
75- let result = $t020392063._1
76- let prefix = $t020392063._2
76+ let $t020692093 = a
77+ let result = $t020692093._1
78+ let prefix = $t020692093._2
7779 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
7880 }
7981
214216 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
215217 let quorum = 2
216218 let currentAdminList = getAdminsList()
217- if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
219+ let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
218220 then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
219- else match indexOf(currentAdminList, newAdminAddress) {
221+ else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH))
222+ then throwErr((newAdminAddress + " is not valid Address"))
223+ else unit
224+ if ((err == err))
225+ then match indexOf(currentAdminList, newAdminAddress) {
220226 case a: Int =>
221227 throwErr((newAdminAddress + " already in Admin List"))
222228 case _ =>
224230 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
225231 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
226232 }
233+ else throw("Strict value is not equal to itself.")
227234 }
228235
229236
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
9+
10+let ADDRESS_BYTES_LENGTH = 26
911
1012 func throwErr (s) = throw(((contractFilename + ": ") + s))
1113
1214
1315 func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1416
1517
1618 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1719
1820
1921 func keyCurrentManagerPublicKey () = makeString(["%s", "currentManagerPublicKey"], SEP)
2022
2123
2224 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2325
2426
2527 func keyDeactivateManagerVotePrefix () = makeString(["%s%s", "deactivateManager"], SEP)
2628
2729
2830 func keyActivateManagerVotePrefix () = makeString(["%s%s", "activateManager"], SEP)
2931
3032
3133 func keyAddNewAdminVotePrefix (adminCandidate) = makeString(["%s%s%s", "addAdmin", adminCandidate], SEP)
3234
3335
3436 func keyRemoveAdminVotePrefix (removeCandidate) = makeString(["%s%s%s", "removeAdmin", removeCandidate], SEP)
3537
3638
3739 func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP)
3840
3941
4042 func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP)
4143
4244
4345 func keyAllowedTxId () = makeString(["%s", "TXID"], SEP)
4446
4547
4648 func getAdminVote (prefix,admin) = {
4749 let voteKey = makeString([prefix, admin], SEP)
4850 valueOrElse(getInteger(voteKey), 0)
4951 }
5052
5153
5254 func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) {
5355 case s: String =>
5456 fromBase58String(s)
5557 case _: Unit =>
5658 unit
5759 case _ =>
5860 throw("Match error")
5961 }
6062
6163
6264 func getAdminsList () = split(valueOrElse(getString(this, keyAdminAddressList()), ""), SEP)
6365
6466
6567 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
6668 case t: Int =>
6769 true
6870 case _ =>
6971 false
7072 }
7173
7274
7375 func genVotesKeysHelper (a,adminAddress) = {
74- let $t020392063 = a
75- let result = $t020392063._1
76- let prefix = $t020392063._2
76+ let $t020692093 = a
77+ let result = $t020692093._1
78+ let prefix = $t020692093._2
7779 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
7880 }
7981
8082
8183 func genVotesKeys (keyPrefix) = {
8284 let adminList = keyAdminAddressList()
8385 let $l = getAdminsList()
8486 let $s = size($l)
8587 let $acc0 = $Tuple2(nil, keyPrefix)
8688 func $f0_1 ($a,$i) = if (($i >= $s))
8789 then $a
8890 else genVotesKeysHelper($a, $l[$i])
8991
9092 func $f0_2 ($a,$i) = if (($i >= $s))
9193 then $a
9294 else throw("List size exceeds 20")
9395
9496 $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)
9597 }
9698
9799
98100 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
99101
100102
101103 func countVotes (prefix) = {
102104 let votes = genVotesKeys(prefix)._1
103105 let $l = votes
104106 let $s = size($l)
105107 let $acc0 = 0
106108 func $f0_1 ($a,$i) = if (($i >= $s))
107109 then $a
108110 else countVotesHelper($a, $l[$i])
109111
110112 func $f0_2 ($a,$i) = if (($i >= $s))
111113 then $a
112114 else throw("List size exceeds 20")
113115
114116 $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)
115117 }
116118
117119
118120 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
119121
120122
121123 func getClearVoteEntries (prefix) = {
122124 let votes = genVotesKeys(prefix)._1
123125 let $l = votes
124126 let $s = size($l)
125127 let $acc0 = nil
126128 func $f0_1 ($a,$i) = if (($i >= $s))
127129 then $a
128130 else clearVotesHelper($a, $l[$i])
129131
130132 func $f0_2 ($a,$i) = if (($i >= $s))
131133 then $a
132134 else throw("List size exceeds 20")
133135
134136 $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)
135137 }
136138
137139
138140 func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = {
139141 let voteKey = makeString([keyPrefix, callerAddressString], SEP)
140142 let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString)
141143 if (isInAdminList(callerAddressString))
142144 then if ((adminCurrentVote == 1))
143145 then throwErr((voteKey + " you already voted"))
144146 else {
145147 let votes = countVotes(keyPrefix)
146148 if (((votes + 1) >= minVotes))
147149 then {
148150 let clearVoteEntries = getClearVoteEntries(keyPrefix)
149151 (clearVoteEntries ++ voteResult)
150152 }
151153 else [IntegerEntry(voteKey, 1)]
152154 }
153155 else throwErr((("Address: " + callerAddressString) + " not in Admin list"))
154156 }
155157
156158
157159 @Callable(i)
158160 func confirmManager () = {
159161 let pm = pendingManagerPublicKeyOrUnit()
160162 let hasPM = if (isDefined(pm))
161163 then true
162164 else throwErr("no pending manager")
163165 if ((hasPM == hasPM))
164166 then {
165167 let checkPM = if ((i.callerPublicKey == value(pm)))
166168 then true
167169 else throwErr("you are not pending manager")
168170 if ((checkPM == checkPM))
169171 then [StringEntry(keyCurrentManagerPublicKey(), toBase58String(value(pm)))]
170172 else throw("Strict value is not equal to itself.")
171173 }
172174 else throw("Strict value is not equal to itself.")
173175 }
174176
175177
176178
177179 @Callable(i)
178180 func voteForNewManger (newManagerPublicKey) = {
179181 let callerAddressString = toBase58String(i.caller.bytes)
180182 let keyPrefix = keySetNewManagerVotePrefix(newManagerPublicKey)
181183 let quorum = 2
182184 let result = [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)]
183185 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
184186 }
185187
186188
187189
188190 @Callable(i)
189191 func deactivateManager () = {
190192 let callerAddressString = toBase58String(i.caller.bytes)
191193 let keyPrefix = keyDeactivateManagerVotePrefix()
192194 let quorum = 1
193195 let result = [StringEntry(keyActiveManagerPublicKey(), "disabled")]
194196 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
195197 }
196198
197199
198200
199201 @Callable(i)
200202 func activateManager () = {
201203 let callerAddressString = toBase58String(i.caller.bytes)
202204 let keyPrefix = keyActivateManagerVotePrefix()
203205 let quorum = 2
204206 let currentManagerString = getStringValue(keyCurrentManagerPublicKey())
205207 let result = [StringEntry(keyActiveManagerPublicKey(), currentManagerString)]
206208 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
207209 }
208210
209211
210212
211213 @Callable(i)
212214 func addNewAdmin (newAdminAddress) = {
213215 let callerAddressString = toBase58String(i.caller.bytes)
214216 let keyPrefix = keyAddNewAdminVotePrefix(newAdminAddress)
215217 let quorum = 2
216218 let currentAdminList = getAdminsList()
217- if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
219+ let err = if ((size(currentAdminList) >= MAX_ADMIN_COUNT))
218220 then throwErr((("MAX_ADMIN_COUNT (" + toString(MAX_ADMIN_COUNT)) + ") is exceeded"))
219- else match indexOf(currentAdminList, newAdminAddress) {
221+ else if ((size(fromBase58String(newAdminAddress)) != ADDRESS_BYTES_LENGTH))
222+ then throwErr((newAdminAddress + " is not valid Address"))
223+ else unit
224+ if ((err == err))
225+ then match indexOf(currentAdminList, newAdminAddress) {
220226 case a: Int =>
221227 throwErr((newAdminAddress + " already in Admin List"))
222228 case _ =>
223229 let newAdminList = (currentAdminList :+ newAdminAddress)
224230 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
225231 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
226232 }
233+ else throw("Strict value is not equal to itself.")
227234 }
228235
229236
230237
231238 @Callable(i)
232239 func removeAdmin (removeCandidate) = {
233240 let callerAddressString = toBase58String(i.caller.bytes)
234241 let keyPrefix = keyRemoveAdminVotePrefix(removeCandidate)
235242 let quorum = 2
236243 let currentAdminList = getAdminsList()
237244 match indexOf(currentAdminList, removeCandidate) {
238245 case index: Int =>
239246 let newAdminList = removeByIndex(currentAdminList, index)
240247 let result = [StringEntry(keyAdminAddressList(), makeString(newAdminList, SEP))]
241248 voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
242249 case _ =>
243250 throwErr((removeCandidate + " not found in Admin List"))
244251 }
245252 }
246253
247254
248255
249256 @Callable(i)
250257 func voteForTxId (txId) = {
251258 let callerAddressString = toBase58String(i.caller.bytes)
252259 let keyPrefix = keyAllowedTxIdVotePrefix(txId)
253260 let quorum = 2
254261 let result = [StringEntry(keyAllowedTxId(), txId)]
255262 let err = if ((size(fromBase58String(txId)) != 32))
256263 then throwErr((txId + " not valid txId"))
257264 else unit
258265 if ((err == err))
259266 then voteINTERNAL(callerAddressString, keyPrefix, quorum, result)
260267 else throw("Strict value is not equal to itself.")
261268 }
262269
263270
264271 @Verifier(tx)
265272 func verify () = {
266273 let allowedTxId = fromBase58String(getStringValue(keyAllowedTxId()))
267274 match tx {
268275 case t: SetScriptTransaction =>
269276 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
270277 case t: DataTransaction =>
271278 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
272279 case _ =>
273280 let currentAdminList = getAdminsList()
274281 if ((size(currentAdminList) >= 3))
275282 then (tx.id == allowedTxId)
276283 else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
277284 }
278285 }
279286

github/deemru/w8io/169f3d6 
44.61 ms