tx · 7mZrmwvKersWKeDmFSf7bYaKxS6iWvcC5JBHqyV7HKMZ

3Mu2Rf9Lq4qKYnDt7zKJ4fa8tXvaAQVwJVE:  -0.01000000 Waves

2023.07.23 18:32 [2678681] smart account 3Mu2Rf9Lq4qKYnDt7zKJ4fa8tXvaAQVwJVE > SELF 0.00000000 Waves

{ "type": 13, "id": "7mZrmwvKersWKeDmFSf7bYaKxS6iWvcC5JBHqyV7HKMZ", "fee": 1000000, "feeAssetId": null, "timestamp": 1690126418961, "version": 2, "chainId": 84, "sender": "3Mu2Rf9Lq4qKYnDt7zKJ4fa8tXvaAQVwJVE", "senderPublicKey": "5ijzyZ48KXTRHdsMMmAhd26WNdWJeMvGb7uh9jZHBkqb", "proofs": [ "42PKwvqtHSKg7NzePRK12WQDd67Ks8cqyv3VaARSKpS6eCqsqwCMtN2DBXZRvhNrpVP4DKyqg12AjH2zGpDiUXB4" ], "script": "base64:BgIgCAISBgoECAgBARIECgIBBBIDCgEBEgQKAgEEEgMKAQETAANTRVACAl9fARBibG9ja0hlaWdodEVycm9yAAkAAgECL1RoZSBibG9jaydzIGhlaWdodCBpcyB0b28gYmlnIGZvciB0aGlzIHByb3Bvc2FsARBhbHJlYWR5Vm90ZUVycm9yAAkAAgECFllvdSBoYXZlIGFscmVhZHkgdm90ZWQBC25vVm90ZUVycm9yAAkAAgECGllvdSBoYXZlIG5vdCBhbHJlYWR5IHZvdGVkARJnd3hDb250cmFjdEFkZHJlc3MACQC5CQIJAMwIAgICJXMJAMwIAgISZ3d4Q29udHJhY3RBZGRyZXNzBQNuaWwFA1NFUAEPa2V5Q3VycmVudEluZGV4AAkAuQkCCQDMCAICAiVzCQDMCAICDGN1cnJlbnRJbmRleAUDbmlsBQNTRVABD2tleVByb3Bvc2FsSW5mbwEGbnVtYmVyCQC5CQIJAMwIAgIEJXMlZAkAzAgCAgxwcm9wb3NhbEluZm8JAMwIAgkApAMBBQZudW1iZXIFA25pbAUDU0VQARZrZXlQcm9wb3NhbERl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1QVFkCBUVNUFRZBAh2b3RlSW5mbwkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzCQEPa2V5UHJvcG9zYWxJbmZvAQUNcHJvcG9zYWxJbmRleAUFRU1QVFkEDXZvdGVJbmZvQXJyYXkJALUJAgUIdm90ZUluZm8FA1NFUAQGY2hlY2tzCQDMCAIDCQECIT0CBQh2b3RlSW5mbwUFRU1QVFkGCQACAQIMTm8gc3VjaCB2b3RlBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MEDHF1b3J1bU51bWJlcgkAkQMCBQ12b3RlSW5mb0FycmF5AAMEDXBvc2l0aXZlVm90ZXMJAJEDAgUNdm90ZUluZm9BcnJheQAEBA1uZWdhdGl2ZVZvdGVzCQCRAwIFDXZvdGVJbmZvQXJyYXkABQkAlAoCBQNuaWwJAMwIAgUNcG9zaXRpdmVWb3RlcwkAzAgCBQ1uZWdhdGl2ZVZvdGVzCQDMCAIFDHF1b3J1bU51bWJlcgUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAD8DwCg=", "height": 2678681, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HiRWTGLFXhvd4rcWzgjLj84pgXAYbvRknDuib86Tcswv Next: J1nDFoPMsnY56ZbtcBHMHYWsFDRsYQQYoX2iT93iZ9SW Diff:
OldNewDifferences
8888
8989 @Callable(i)
9090 func startNewVote (name,description,expirationHeight,quorumNumber) = {
91- let theIndex = getCurrentIndex()
91+ let theIndex = 0
9292 [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)]
9393 }
9494
110110 if ((checks == checks))
111111 then {
112112 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil))
113- let $t035134549 = if (choice)
113+ let $t035164552 = if (choice)
114114 then {
115115 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5]))
116116 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber)))
121121 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber)))
122122 $Tuple2(action1, action2)
123123 }
124- let action1 = $t035134549._1
125- let action2 = $t035134549._2
124+ let action1 = $t035164552._1
125+ let action2 = $t035164552._2
126126 [action1, action2]
127127 }
128128 else throw("Strict value is not equal to itself.")
173173 if ((checks == checks))
174174 then {
175175 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil))
176- let $t067177056 = if (choice)
176+ let $t067207059 = if (choice)
177177 then {
178178 let forNumber = gwxNumber
179179 let againstNumber = 0
186186 let choiceInteger = 0
187187 $Tuple3(forNumber, againstNumber, choiceInteger)
188188 }
189- let userPowerFor = $t067177056._1
190- let userPowerAgainst = $t067177056._2
191- let choiceInt = $t067177056._3
189+ let userPowerFor = $t067207059._1
190+ let userPowerAgainst = $t067207059._2
191+ let choiceInt = $t067207059._3
192192 let action = if ((userVoteInfoArray[1] == "1"))
193193 then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString(((value(parseInt(voteInfoArray[4])) - value(parseInt(userVoteInfoArray[2]))) + userPowerFor)), toString((value(parseInt(voteInfoArray[5])) + userPowerAgainst))))
194194 else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + userPowerFor)), toString(((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))) + userPowerAgainst))))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 func blockHeightError () = throw("The block's height is too big for this proposal")
77
88
99 func alreadyVoteError () = throw("You have already voted")
1010
1111
1212 func noVoteError () = throw("You have not already voted")
1313
1414
1515 func gwxContractAddress () = makeString(["%s", "gwxContractAddress"], SEP)
1616
1717
1818 func keyCurrentIndex () = makeString(["%s", "currentIndex"], SEP)
1919
2020
2121 func keyProposalInfo (number) = makeString(["%s%d", "proposalInfo", toString(number)], SEP)
2222
2323
2424 func keyProposalDescription (number) = makeString(["%s%d", "proposalDescription", toString(number)], SEP)
2525
2626
2727 func keyUserVoteOnProposal (number,user) = makeString(["%s%d%s", "userVoteOnProposal", toString(number), user], SEP)
2828
2929
3030 func keyManagerPublicKey () = "%s__managerPublicKey"
3131
3232
3333 func keyManagerVaultAddress () = "%s__managerVaultAddress"
3434
3535
3636 func getCurrentIndex () = getIntegerValue(this, keyCurrentIndex())
3737
3838
3939 func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) {
4040 case s: String =>
4141 addressFromStringValue(s)
4242 case _ =>
4343 this
4444 }
4545
4646
4747 func formatProposalInfo (name,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d", name, end, quorumNumber, positiveVotes, negativeVotes], SEP)
4848
4949
5050 func formatUserVoteOnProposal (vote,gwxNumber) = makeString(["%d%d", vote, gwxNumber], SEP)
5151
5252
5353 func asInt (val) = match val {
5454 case valInt: Int =>
5555 valInt
5656 case _ =>
5757 throw("fail to cast into Int")
5858 }
5959
6060
6161 func managerPublicKeyOrUnit () = {
6262 let managerVaultAddress = getManagerVaultAddressOrThis()
6363 match getString(managerVaultAddress, keyManagerPublicKey()) {
6464 case s: String =>
6565 fromBase58String(s)
6666 case _: Unit =>
6767 unit
6868 case _ =>
6969 throw("Match error")
7070 }
7171 }
7272
7373
7474 func isManager (i) = match managerPublicKeyOrUnit() {
7575 case pk: ByteVector =>
7676 (i.callerPublicKey == pk)
7777 case _: Unit =>
7878 (i.caller == this)
7979 case _ =>
8080 throw("Match error")
8181 }
8282
8383
8484 func mustManager (i) = if (isManager(i))
8585 then true
8686 else throw("permission denied")
8787
8888
8989 @Callable(i)
9090 func startNewVote (name,description,expirationHeight,quorumNumber) = {
91- let theIndex = getCurrentIndex()
91+ let theIndex = 0
9292 [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)]
9393 }
9494
9595
9696
9797 @Callable(i)
9898 func voteFor (proposalIndex,choice) = {
9999 let EMPTY = "EMPTY"
100100 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
101101 let voteInfoArray = split(voteInfo, SEP)
102102 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
103103 let checks = [if ((voteInfo != EMPTY))
104104 then true
105105 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
106106 then true
107107 else blockHeightError(), if ((userVoteInfo == EMPTY))
108108 then true
109109 else alreadyVoteError()]
110110 if ((checks == checks))
111111 then {
112112 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil))
113- let $t035134549 = if (choice)
113+ let $t035164552 = if (choice)
114114 then {
115115 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5]))
116116 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber)))
117117 $Tuple2(action1, action2)
118118 }
119119 else {
120120 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber))))
121121 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber)))
122122 $Tuple2(action1, action2)
123123 }
124- let action1 = $t035134549._1
125- let action2 = $t035134549._2
124+ let action1 = $t035164552._1
125+ let action2 = $t035164552._2
126126 [action1, action2]
127127 }
128128 else throw("Strict value is not equal to itself.")
129129 }
130130
131131
132132
133133 @Callable(i)
134134 func deleteVote (proposalIndex) = {
135135 let EMPTY = "EMPTY"
136136 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
137137 let voteInfoArray = split(voteInfo, SEP)
138138 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
139139 let userVoteInfoArray = split(userVoteInfo, SEP)
140140 let checks = [if ((voteInfo != EMPTY))
141141 then true
142142 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
143143 then true
144144 else blockHeightError(), if ((userVoteInfo != EMPTY))
145145 then true
146146 else noVoteError()]
147147 if ((checks == checks))
148148 then {
149149 let action = if ((userVoteInfoArray[1] == "1"))
150150 then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[5]))
151151 else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))))))
152152 [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))]
153153 }
154154 else throw("Strict value is not equal to itself.")
155155 }
156156
157157
158158
159159 @Callable(i)
160160 func changeVote (proposalIndex,choice) = {
161161 let EMPTY = "EMPTY"
162162 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
163163 let voteInfoArray = split(voteInfo, SEP)
164164 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
165165 let userVoteInfoArray = split(userVoteInfo, SEP)
166166 let checks = [if ((voteInfo != EMPTY))
167167 then true
168168 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
169169 then true
170170 else blockHeightError(), if ((userVoteInfo != EMPTY))
171171 then true
172172 else noVoteError()]
173173 if ((checks == checks))
174174 then {
175175 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil))
176- let $t067177056 = if (choice)
176+ let $t067207059 = if (choice)
177177 then {
178178 let forNumber = gwxNumber
179179 let againstNumber = 0
180180 let choiceInteger = 1
181181 $Tuple3(forNumber, againstNumber, choiceInteger)
182182 }
183183 else {
184184 let forNumber = 0
185185 let againstNumber = gwxNumber
186186 let choiceInteger = 0
187187 $Tuple3(forNumber, againstNumber, choiceInteger)
188188 }
189- let userPowerFor = $t067177056._1
190- let userPowerAgainst = $t067177056._2
191- let choiceInt = $t067177056._3
189+ let userPowerFor = $t067207059._1
190+ let userPowerAgainst = $t067207059._2
191+ let choiceInt = $t067207059._3
192192 let action = if ((userVoteInfoArray[1] == "1"))
193193 then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString(((value(parseInt(voteInfoArray[4])) - value(parseInt(userVoteInfoArray[2]))) + userPowerFor)), toString((value(parseInt(voteInfoArray[5])) + userPowerAgainst))))
194194 else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + userPowerFor)), toString(((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))) + userPowerAgainst))))
195195 [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))]
196196 }
197197 else throw("Strict value is not equal to itself.")
198198 }
199199
200200
201201
202202 @Callable(i)
203203 func getResultREADONLY (proposalIndex) = {
204204 let EMPTY = "EMPTY"
205205 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
206206 let voteInfoArray = split(voteInfo, SEP)
207207 let checks = [if ((voteInfo != EMPTY))
208208 then true
209209 else throw("No such vote")]
210210 if ((checks == checks))
211211 then {
212212 let quorumNumber = voteInfoArray[3]
213213 let positiveVotes = voteInfoArray[4]
214214 let negativeVotes = voteInfoArray[5]
215215 $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber])
216216 }
217217 else throw("Strict value is not equal to itself.")
218218 }
219219
220220

github/deemru/w8io/fabc49c 
36.89 ms