tx · DaJGW9caa5J6uc3y3Dks6eRGCqygsa5LpPiBCeNMtCdA

3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh:  -0.01000000 Waves

2023.04.18 16:29 [2540044] smart account 3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh > SELF 0.00000000 Waves

{ "type": 13, "id": "DaJGW9caa5J6uc3y3Dks6eRGCqygsa5LpPiBCeNMtCdA", "fee": 1000000, "feeAssetId": null, "timestamp": 1681824626400, "version": 2, "chainId": 84, "sender": "3N4ziXSMRverXyxHDUKKMR9MHXnB3TyU3Yh", "senderPublicKey": "EU9obW1yVhR8qug3EmXPeew3DMagvJFQzY5Ku8bmcsU7", "proofs": [ "2wyqk4AKbuvKc9ZykkBdY8XSu9HxaTgynAX6E28MEKquuSadwXonZWmoEQtS8ovtgVvskYp7dkVpwe98B75okyoc" ], "script": "base64:BgIHCAISAwoBCBIAA1NFUAICX18AEGNvbnRyYWN0RmlsZW5hbWUCCXRlc3QucmlkZQEIdGhyb3dFcnIBAXMJAAIBCQCsAgIJAKwCAgUQY29udHJhY3RGaWxlbmFtZQICOiAFAXMBGWtleUFjdGl2ZU1hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIQbWFuYWdlclB1YmxpY0tleQUDbmlsBQNTRVABGmtleUN1cnJlbnRNYW5hZ2VyUHVibGljS2V5AAkAuQkCCQDMCAICAiVzCQDMCAICEWtleUN1cnJlbnRNYW5hZ2VyBQNuaWwFA1NFUAEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkACQC5CQIJAMwIAgICJXMJAMwIAgIXcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0VQARprZXlTZXROZXdNYW5hZ2VyVm90ZVByZWZpeAEQbWFuYWdlclB1YmxpY0tleQkAuQkCCQDMCAICBiVzJXMlcwkAzAgCAgpzZXRNYW5hZ2VyCQDMCAIFEG1hbmFnZXJQdWJsaWNLZXkFA25pbAUDU0V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WFyVm90ZXNFbnRyaWVzCQDMCAIJAQtTdHJpbmdFbnRyeQIJARprZXlQZW5kaW5nTWFuYWdlclB1YmxpY0tleQAFE25ld01hbmFnZXJQdWJsaWNLZXkFA25pbAkAzAgCCQEMSW50ZWdlckVudHJ5AgkBFGtleVNldE5ld01hbmFnZXJWb3RlAgUTbmV3TWFuYWdlclB1YmxpY0tleQUTY2FsbGVyQWRkcmVzc1N0cmluZwABBQNuaWwJAQh0aHJvd0VycgEJAKwCAgUTY2FsbGVyQWRkcmVzc1N0cmluZwITOiBub3QgaW4gQWRtaW4gbGlzdAD+V0bJ", "height": 2540044, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GmW8Nv91v1FkF8BDZmyX7SJrpRk7tjaG7gGuT3pWLcZk Next: 4pNi8fwyVmUGrvB13YQSVJjJWRw1MJ56K5saNAbxj6v5 Diff:
OldNewDifferences
110110 let callerAddressString = toBase58String(i.caller.bytes)
111111 if (isInAdminList(callerAddressString))
112112 then if ((getSetNewManagerVote(callerAddressString, newManagerPublicKey) == 1))
113- then throwErr((((callerAddressString + ": ") + newManagerPublicKey) + ": voteForNewManger() already voted"))
113+ then throwErr((((callerAddressString + ": ") + newManagerPublicKey) + ": voteForNewManger() you already voted"))
114114 else {
115115 let votes = countVotes(keySetNewManagerVotePrefix(newManagerPublicKey))
116- if (((votes + 1) >= 1))
116+ if (((votes + 1) >= 2))
117117 then {
118118 let clearVotesEntries = getClearVotesEntries(keySetNewManagerVotePrefix(newManagerPublicKey))
119119 (clearVotesEntries ++ [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)])
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let contractFilename = "test.ride"
77
88 func throwErr (s) = throw(((contractFilename + ": ") + s))
99
1010
1111 func keyActiveManagerPublicKey () = makeString(["%s", "managerPublicKey"], SEP)
1212
1313
1414 func keyCurrentManagerPublicKey () = makeString(["%s", "keyCurrentManager"], SEP)
1515
1616
1717 func keyPendingManagerPublicKey () = makeString(["%s", "pendingManagerPublicKey"], SEP)
1818
1919
2020 func keySetNewManagerVotePrefix (managerPublicKey) = makeString(["%s%s%s", "setManager", managerPublicKey], SEP)
2121
2222
2323 func keySetNewManagerVote (managerPublicKey,admin) = makeString([keySetNewManagerVotePrefix(managerPublicKey), admin], SEP)
2424
2525
2626 func getSetNewManagerVote (admin,managerPublicKey) = valueOrElse(getInteger(keySetNewManagerVote(admin, managerPublicKey)), 0)
2727
2828
2929 func adminAdressList () = makeString(["%s", "adminAddressList"], SEP)
3030
3131
3232 func getAdminsList () = split(valueOrElse(getString(this, adminAdressList()), ""), SEP)
3333
3434
3535 func isInAdminList (address) = match indexOf(getAdminsList(), address) {
3636 case t: Int =>
3737 true
3838 case _ =>
3939 false
4040 }
4141
4242
4343 func genVotesKeysHelper (lst,adminAddress) = {
4444 let $t013191345 = lst
4545 let result = $t013191345._1
4646 let prefix = $t013191345._2
4747 $Tuple2((result :+ makeString([prefix, adminAddress], SEP)), prefix)
4848 }
4949
5050
5151 func genVotesKeys (keyPrefix) = {
5252 let adminList = adminAdressList()
5353 let $l = getAdminsList()
5454 let $s = size($l)
5555 let $acc0 = $Tuple2(nil, keyPrefix)
5656 func $f0_1 ($a,$i) = if (($i >= $s))
5757 then $a
5858 else genVotesKeysHelper($a, $l[$i])
5959
6060 func $f0_2 ($a,$i) = if (($i >= $s))
6161 then $a
6262 else throw("List size exceeds 10")
6363
6464 $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)
6565 }
6666
6767
6868 func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0))
6969
7070
7171 func countVotes (prefix) = {
7272 let votes = genVotesKeys(prefix)._1
7373 let $l = votes
7474 let $s = size($l)
7575 let $acc0 = 0
7676 func $f0_1 ($a,$i) = if (($i >= $s))
7777 then $a
7878 else countVotesHelper($a, $l[$i])
7979
8080 func $f0_2 ($a,$i) = if (($i >= $s))
8181 then $a
8282 else throw("List size exceeds 10")
8383
8484 $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)
8585 }
8686
8787
8888 func clearVotesHelper (result,key) = (result :+ DeleteEntry(key))
8989
9090
9191 func getClearVotesEntries (prefix) = {
9292 let votes = genVotesKeys(prefix)._1
9393 let $l = votes
9494 let $s = size($l)
9595 let $acc0 = nil
9696 func $f0_1 ($a,$i) = if (($i >= $s))
9797 then $a
9898 else clearVotesHelper($a, $l[$i])
9999
100100 func $f0_2 ($a,$i) = if (($i >= $s))
101101 then $a
102102 else throw("List size exceeds 10")
103103
104104 $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)
105105 }
106106
107107
108108 @Callable(i)
109109 func voteForNewManger (newManagerPublicKey) = {
110110 let callerAddressString = toBase58String(i.caller.bytes)
111111 if (isInAdminList(callerAddressString))
112112 then if ((getSetNewManagerVote(callerAddressString, newManagerPublicKey) == 1))
113- then throwErr((((callerAddressString + ": ") + newManagerPublicKey) + ": voteForNewManger() already voted"))
113+ then throwErr((((callerAddressString + ": ") + newManagerPublicKey) + ": voteForNewManger() you already voted"))
114114 else {
115115 let votes = countVotes(keySetNewManagerVotePrefix(newManagerPublicKey))
116- if (((votes + 1) >= 1))
116+ if (((votes + 1) >= 2))
117117 then {
118118 let clearVotesEntries = getClearVotesEntries(keySetNewManagerVotePrefix(newManagerPublicKey))
119119 (clearVotesEntries ++ [StringEntry(keyPendingManagerPublicKey(), newManagerPublicKey)])
120120 }
121121 else [IntegerEntry(keySetNewManagerVote(newManagerPublicKey, callerAddressString), 1)]
122122 }
123123 else throwErr((callerAddressString + ": not in Admin list"))
124124 }
125125
126126

github/deemru/w8io/026f985 
29.51 ms