tx · oF47BGgE4iKkRBPBTLgqDgZd7N99fs3ubFoKiKUnVmr

3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX:  -0.01000000 Waves

2023.07.16 12:39 [2668246] smart account 3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX > SELF 0.00000000 Waves

{ "type": 13, "id": "oF47BGgE4iKkRBPBTLgqDgZd7N99fs3ubFoKiKUnVmr", "fee": 1000000, "feeAssetId": null, "timestamp": 1689500349902, "version": 2, "chainId": 84, "sender": "3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX", "senderPublicKey": "8tfd6Swf6ctN44RdASetvkFbWtHbPdfspowjcrVQ4iV8", "proofs": [ "5QgbJ9qbC1Gm75z37Z61kQkiCBG1vxNHWTRsqMwkyctCQkLcJQh7B41oajBiVutdBYcThK46jWpAQ5E4TcqwCrbK" ], "script": "base64:BgIgCAISBgoECAgBARIECgIBBBIDCgEBEgQKAgEEEgMKAQESAANTRVACAl9fARBibG9ja0hlaWdodEVycm9yAAkAAgECL1RoZSBibG9jaydzIGhlaWdodCBpcyB0b28gYmlnIGZvciB0aGlzIHByb3Bvc2FsARBhbHJlYWR5Vm90ZUVycm9yAAkAAgECFllvdSBoYXZlIGFscmVhZHkgdm90ZWQBC25vVm90ZUVycm9yAAkAAgECGllvdSBoYXZlIG5vdCBhbHJlYWR5IHZvdGVkARJnd3hDb250cmFjdEFkZHJlc3MACQC5CQIJAMwIAgICJXMJAMwIAgISZ3d4Q29udHJhY3RBZGRyZXNzBQNuaWwFA1NFUAEPa2V5Q3VycmVudEluZGV4AAkAuQkCCQDMCAICAiVzCQDMCAICDGN1cnJlbnRJbmRleAUDbmlsBQNTRVABD2tleVByb3Bvc2FsSW5mbwEGbnVtYmVyCQC5CQIJAMwIAgIEJXMlZAkAzAgCAgxwcm9wb3NhbEluZm8JAMwIAgkApAMBBQZudW1iZXIFA25pbAUDU0VQARZrZXlQcm9wb3NhbERlc2NyaXB0aW9uAQZudW1iZXIJALkJ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JvcG9zYWxJbmRleAQFRU1QVFkCBUVNUFRZBAh2b3RlSW5mbwkBC3ZhbHVlT3JFbHNlAgkAnQgCBQR0aGlzCQEPa2V5UHJvcG9zYWxJbmZvAQUNcHJvcG9zYWxJbmRleAUFRU1QVFkEDXZvdGVJbmZvQXJyYXkJALUJAgUIdm90ZUluZm8FA1NFUAQGY2hlY2tzCQDMCAIDCQECIT0CBQh2b3RlSW5mbwUFRU1QVFkGCQACAQIMTm8gc3VjaCB2b3RlBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MEDHF1b3J1bU51bWJlcgkAkQMCBQ12b3RlSW5mb0FycmF5AAMEDXBvc2l0aXZlVm90ZXMJAJEDAgUNdm90ZUluZm9BcnJheQAEBA1uZWdhdGl2ZVZvdGVzCQCRAwIFDXZvdGVJbmZvQXJyYXkABQkAlAoCBQNuaWwJAMwIAgUNcG9zaXRpdmVWb3RlcwkAzAgCBQ1uZWdhdGl2ZVZvdGVzCQDMCAIFDHF1b3J1bU51bWJlcgUDbmlsCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAFxbPKo=", "height": 2668246, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BAJc663sLhmh9AqdjyaM2GatrdrvSKraiQE4jTuCDLQE Next: 5cta6s7QcDkv2hwPNCmENr89sqAhbiFtNJ6ZnBbMqkVb Diff:
OldNewDifferences
8181 }
8282
8383
84-func mustManager (i) = if (isManager(i))
85- then true
86- else throw("permission denied")
87-
88-
8984 @Callable(i)
9085 func startNewVote (name,description,expirationHeight,quorumNumber) = {
91- let checks = [mustManager(i)]
86+ let checks = nil
9287 if ((checks == checks))
9388 then {
9489 let theIndex = getCurrentIndex()
115110 if ((checks == checks))
116111 then {
117112 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil))
118- let $t035104546 = if (choice)
113+ let $t035144550 = if (choice)
119114 then {
120115 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5]))
121116 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber)))
126121 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber)))
127122 $Tuple2(action1, action2)
128123 }
129- let action1 = $t035104546._1
130- let action2 = $t035104546._2
124+ let action1 = $t035144550._1
125+ let action2 = $t035144550._2
131126 [action1, action2]
132127 }
133128 else throw("Strict value is not equal to itself.")
178173 if ((checks == checks))
179174 then {
180175 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil))
181- let $t067147053 = if (choice)
176+ let $t067187057 = if (choice)
182177 then {
183178 let forNumber = gwxNumber
184179 let againstNumber = 0
191186 let choiceInteger = 0
192187 $Tuple3(forNumber, againstNumber, choiceInteger)
193188 }
194- let userPowerFor = $t067147053._1
195- let userPowerAgainst = $t067147053._2
196- let choiceInt = $t067147053._3
189+ let userPowerFor = $t067187057._1
190+ let userPowerAgainst = $t067187057._2
191+ let choiceInt = $t067187057._3
197192 let action = if ((userVoteInfoArray[1] == "1"))
198193 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))))
199194 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
84-func mustManager (i) = if (isManager(i))
85- then true
86- else throw("permission denied")
87-
88-
8984 @Callable(i)
9085 func startNewVote (name,description,expirationHeight,quorumNumber) = {
91- let checks = [mustManager(i)]
86+ let checks = nil
9287 if ((checks == checks))
9388 then {
9489 let theIndex = getCurrentIndex()
9590 [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)]
9691 }
9792 else throw("Strict value is not equal to itself.")
9893 }
9994
10095
10196
10297 @Callable(i)
10398 func voteFor (proposalIndex,choice) = {
10499 let EMPTY = "EMPTY"
105100 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
106101 let voteInfoArray = split(voteInfo, SEP)
107102 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
108103 let checks = [if ((voteInfo != EMPTY))
109104 then true
110105 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
111106 then true
112107 else blockHeightError(), if ((userVoteInfo == EMPTY))
113108 then true
114109 else alreadyVoteError()]
115110 if ((checks == checks))
116111 then {
117112 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil))
118- let $t035104546 = if (choice)
113+ let $t035144550 = if (choice)
119114 then {
120115 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5]))
121116 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber)))
122117 $Tuple2(action1, action2)
123118 }
124119 else {
125120 let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber))))
126121 let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber)))
127122 $Tuple2(action1, action2)
128123 }
129- let action1 = $t035104546._1
130- let action2 = $t035104546._2
124+ let action1 = $t035144550._1
125+ let action2 = $t035144550._2
131126 [action1, action2]
132127 }
133128 else throw("Strict value is not equal to itself.")
134129 }
135130
136131
137132
138133 @Callable(i)
139134 func deleteVote (proposalIndex) = {
140135 let EMPTY = "EMPTY"
141136 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
142137 let voteInfoArray = split(voteInfo, SEP)
143138 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
144139 let userVoteInfoArray = split(userVoteInfo, SEP)
145140 let checks = [if ((voteInfo != EMPTY))
146141 then true
147142 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
148143 then true
149144 else blockHeightError(), if ((userVoteInfo != EMPTY))
150145 then true
151146 else noVoteError()]
152147 if ((checks == checks))
153148 then {
154149 let action = if ((userVoteInfoArray[1] == "1"))
155150 then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[5]))
156151 else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))))))
157152 [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))]
158153 }
159154 else throw("Strict value is not equal to itself.")
160155 }
161156
162157
163158
164159 @Callable(i)
165160 func changeVote (proposalIndex,choice) = {
166161 let EMPTY = "EMPTY"
167162 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
168163 let voteInfoArray = split(voteInfo, SEP)
169164 let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY)
170165 let userVoteInfoArray = split(userVoteInfo, SEP)
171166 let checks = [if ((voteInfo != EMPTY))
172167 then true
173168 else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height))
174169 then true
175170 else blockHeightError(), if ((userVoteInfo != EMPTY))
176171 then true
177172 else noVoteError()]
178173 if ((checks == checks))
179174 then {
180175 let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil))
181- let $t067147053 = if (choice)
176+ let $t067187057 = if (choice)
182177 then {
183178 let forNumber = gwxNumber
184179 let againstNumber = 0
185180 let choiceInteger = 1
186181 $Tuple3(forNumber, againstNumber, choiceInteger)
187182 }
188183 else {
189184 let forNumber = 0
190185 let againstNumber = gwxNumber
191186 let choiceInteger = 0
192187 $Tuple3(forNumber, againstNumber, choiceInteger)
193188 }
194- let userPowerFor = $t067147053._1
195- let userPowerAgainst = $t067147053._2
196- let choiceInt = $t067147053._3
189+ let userPowerFor = $t067187057._1
190+ let userPowerAgainst = $t067187057._2
191+ let choiceInt = $t067187057._3
197192 let action = if ((userVoteInfoArray[1] == "1"))
198193 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))))
199194 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))))
200195 [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))]
201196 }
202197 else throw("Strict value is not equal to itself.")
203198 }
204199
205200
206201
207202 @Callable(i)
208203 func getResultREADONLY (proposalIndex) = {
209204 let EMPTY = "EMPTY"
210205 let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY)
211206 let voteInfoArray = split(voteInfo, SEP)
212207 let checks = [if ((voteInfo != EMPTY))
213208 then true
214209 else throw("No such vote")]
215210 if ((checks == checks))
216211 then {
217212 let quorumNumber = voteInfoArray[3]
218213 let positiveVotes = voteInfoArray[4]
219214 let negativeVotes = voteInfoArray[5]
220215 $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber])
221216 }
222217 else throw("Strict value is not equal to itself.")
223218 }
224219
225220

github/deemru/w8io/169f3d6 
42.10 ms