tx · AWXpGLVBTpVYL7fFxs5F8XsA8zeTMwevVJv2WxLAWLeK 3N3vjjwCXWsTfu2w6biwcPhZe3v17HGY3tR: -0.01300000 Waves 2023.07.21 09:34 [2675443] smart account 3N3vjjwCXWsTfu2w6biwcPhZe3v17HGY3tR > SELF 0.00000000 Waves
{ "type": 13, "id": "AWXpGLVBTpVYL7fFxs5F8XsA8zeTMwevVJv2WxLAWLeK", "fee": 1300000, "feeAssetId": null, "timestamp": 1689932194618, "version": 2, "chainId": 84, "sender": "3N3vjjwCXWsTfu2w6biwcPhZe3v17HGY3tR", "senderPublicKey": "B2SJ1BXVdLQeEg3kiwBCznf5t6GjLEz81mEWEV3fs2vF", "proofs": [ "SHoWs6xYgavfXKSp2JiEbqvEU1dEsCDUEsPCRHF5hKDvEpv9X2HCumvahng1mDNgpdSxbLKq1yHi44FLfdyGhmR" ], "script": "base64:BgIgCAISBgoECAgBARIECgIBBBIDCgEBEgQKAgEEEgMKAQESAANTRVACAl9fARBibG9ja0hlaWdodEVycm9yAAkAAgECL1RoZSBibG9jaydzIGhlaWdodCBpcyB0b28gYmlnIGZvciB0aGlzIHByb3Bvc2FsARBhbHJlYWR5Vm90ZUVycm9yAAkAAgECFllvdSBoYXZlIGFscmVhZHkgdm90ZWQBC25vVm90ZUVycm9yAAkAAgECGllvdSBoYXZlIG5vdCBhbHJlYWR5IHZvdGVkARJnd3hDb250cmFjdEFkZHJlc3MACQC5CQIJAMwIAgICJXMJAMwIAgISZ3d4Q29udHJhY3RBZGRyZXNzBQNuaWwFA1NFUAEPa2V5Q3VycmVudEluZGV4AAkAuQkCCQDMCAICAiVzCQDMCAICDGN1cnJlbnRJbmRleAUDbmlsBQNTRVABD2tleVByb3Bvc2FsSW5mbwEGbnVtYmVyCQC5CQIJAMwIAgIEJXMlZAkAzAgCAgxwcm9wb3NhbEluZm8JAMwIAgkApAMBBQZudW1iZXIFA25pbAUDU0VQARVrZXlVc2VyVm90ZU9uUHJvcG9zYWwCBm51bWJlc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atus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BdRa4ufo2T9cM8ao4PsPeJ1sN1mtnEcmymotY5cmr4n9 Next: 2fXW4pocuqYC4MXZpcgPddsiXTUsyXXmivCAur1qf4Xq Diff:
Old | New | Differences | |
---|---|---|---|
21 | 21 | func keyProposalInfo (number) = makeString(["%s%d", "proposalInfo", toString(number)], SEP) | |
22 | 22 | ||
23 | 23 | ||
24 | - | func keyProposalDescription (number) = makeString(["%s%d", "proposalDescription", toString(number)], SEP) | |
25 | - | ||
26 | - | ||
27 | 24 | func keyUserVoteOnProposal (number,user) = makeString(["%s%d%s", "userVoteOnProposal", toString(number), user], SEP) | |
28 | 25 | ||
29 | 26 | ||
44 | 41 | } | |
45 | 42 | ||
46 | 43 | ||
47 | - | func formatProposalInfo (name,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d", name, end, quorumNumber, positiveVotes, negativeVotes], SEP) | |
44 | + | func formatProposalInfo (name,description,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d%d", name, description, end, quorumNumber, positiveVotes, negativeVotes], SEP) | |
48 | 45 | ||
49 | 46 | ||
50 | 47 | func formatUserVoteOnProposal (vote,gwxNumber) = makeString(["%d%d", vote, gwxNumber], SEP) | |
92 | 89 | if ((checks == checks)) | |
93 | 90 | then { | |
94 | 91 | let theIndex = getCurrentIndex() | |
95 | - | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")) | |
92 | + | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, description, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0"))] | |
96 | 93 | } | |
97 | 94 | else throw("Strict value is not equal to itself.") | |
98 | 95 | } | |
107 | 104 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
108 | 105 | let checks = [if ((voteInfo != EMPTY)) | |
109 | 106 | then true | |
110 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
107 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
111 | 108 | then true | |
112 | 109 | else blockHeightError(), if ((userVoteInfo == EMPTY)) | |
113 | 110 | then true | |
114 | 111 | else alreadyVoteError()] | |
115 | 112 | if ((checks == checks)) | |
116 | 113 | then { | |
117 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[ | |
118 | - | let $ | |
114 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
115 | + | let $t034354523 = if (choice) | |
119 | 116 | then { | |
120 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
117 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber)), voteInfoArray[6])) | |
121 | 118 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
122 | 119 | $Tuple2(action1, action2) | |
123 | 120 | } | |
124 | 121 | else { | |
125 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[ | |
122 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) + gwxNumber)))) | |
126 | 123 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
127 | 124 | $Tuple2(action1, action2) | |
128 | 125 | } | |
129 | - | let action1 = $ | |
130 | - | let action2 = $ | |
126 | + | let action1 = $t034354523._1 | |
127 | + | let action2 = $t034354523._2 | |
131 | 128 | [action1, action2] | |
132 | 129 | } | |
133 | 130 | else throw("Strict value is not equal to itself.") | |
144 | 141 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
145 | 142 | let checks = [if ((voteInfo != EMPTY)) | |
146 | 143 | then true | |
147 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
144 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
148 | 145 | then true | |
149 | 146 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
150 | 147 | then true | |
152 | 149 | if ((checks == checks)) | |
153 | 150 | then { | |
154 | 151 | let action = if ((userVoteInfoArray[1] == "1")) | |
155 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
156 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[ | |
152 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[6])) | |
153 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2])))))) | |
157 | 154 | [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))] | |
158 | 155 | } | |
159 | 156 | else throw("Strict value is not equal to itself.") | |
170 | 167 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
171 | 168 | let checks = [if ((voteInfo != EMPTY)) | |
172 | 169 | then true | |
173 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
170 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
174 | 171 | then true | |
175 | 172 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
176 | 173 | then true | |
178 | 175 | if ((checks == checks)) | |
179 | 176 | then { | |
180 | 177 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
181 | - | let $ | |
178 | + | let $t067437082 = if (choice) | |
182 | 179 | then { | |
183 | 180 | let forNumber = gwxNumber | |
184 | 181 | let againstNumber = 0 | |
191 | 188 | let choiceInteger = 0 | |
192 | 189 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
193 | 190 | } | |
194 | - | let userPowerFor = $ | |
195 | - | let userPowerAgainst = $ | |
196 | - | let choiceInt = $ | |
191 | + | let userPowerFor = $t067437082._1 | |
192 | + | let userPowerAgainst = $t067437082._2 | |
193 | + | let choiceInt = $t067437082._3 | |
197 | 194 | let action = if ((userVoteInfoArray[1] == "1")) | |
198 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString(((value(parseInt(voteInfoArray[ | |
199 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
195 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString(((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))) + userPowerFor)), toString((value(parseInt(voteInfoArray[6])) + userPowerAgainst)))) | |
196 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + userPowerFor)), toString(((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2]))) + userPowerAgainst)))) | |
200 | 197 | [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))] | |
201 | 198 | } | |
202 | 199 | else throw("Strict value is not equal to itself.") | |
214 | 211 | else throw("No such vote")] | |
215 | 212 | if ((checks == checks)) | |
216 | 213 | then { | |
217 | - | let | |
218 | - | let | |
219 | - | let | |
214 | + | let positiveVotes = voteInfoArray[5] | |
215 | + | let negativeVotes = voteInfoArray[6] | |
216 | + | let quorumNumber = voteInfoArray[4] | |
220 | 217 | $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber]) | |
221 | 218 | } | |
222 | 219 | else throw("Strict value is not equal to itself.") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func blockHeightError () = throw("The block's height is too big for this proposal") | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func alreadyVoteError () = throw("You have already voted") | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func noVoteError () = throw("You have not already voted") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func gwxContractAddress () = makeString(["%s", "gwxContractAddress"], SEP) | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func keyCurrentIndex () = makeString(["%s", "currentIndex"], SEP) | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func keyProposalInfo (number) = makeString(["%s%d", "proposalInfo", toString(number)], SEP) | |
22 | 22 | ||
23 | 23 | ||
24 | - | func keyProposalDescription (number) = makeString(["%s%d", "proposalDescription", toString(number)], SEP) | |
25 | - | ||
26 | - | ||
27 | 24 | func keyUserVoteOnProposal (number,user) = makeString(["%s%d%s", "userVoteOnProposal", toString(number), user], SEP) | |
28 | 25 | ||
29 | 26 | ||
30 | 27 | func keyManagerPublicKey () = "%s__managerPublicKey" | |
31 | 28 | ||
32 | 29 | ||
33 | 30 | func keyManagerVaultAddress () = "%s__managerVaultAddress" | |
34 | 31 | ||
35 | 32 | ||
36 | 33 | func getCurrentIndex () = getIntegerValue(this, keyCurrentIndex()) | |
37 | 34 | ||
38 | 35 | ||
39 | 36 | func getManagerVaultAddressOrThis () = match getString(keyManagerVaultAddress()) { | |
40 | 37 | case s: String => | |
41 | 38 | addressFromStringValue(s) | |
42 | 39 | case _ => | |
43 | 40 | this | |
44 | 41 | } | |
45 | 42 | ||
46 | 43 | ||
47 | - | func formatProposalInfo (name,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d", name, end, quorumNumber, positiveVotes, negativeVotes], SEP) | |
44 | + | func formatProposalInfo (name,description,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d%d", name, description, end, quorumNumber, positiveVotes, negativeVotes], SEP) | |
48 | 45 | ||
49 | 46 | ||
50 | 47 | func formatUserVoteOnProposal (vote,gwxNumber) = makeString(["%d%d", vote, gwxNumber], SEP) | |
51 | 48 | ||
52 | 49 | ||
53 | 50 | func asInt (val) = match val { | |
54 | 51 | case valInt: Int => | |
55 | 52 | valInt | |
56 | 53 | case _ => | |
57 | 54 | throw("fail to cast into Int") | |
58 | 55 | } | |
59 | 56 | ||
60 | 57 | ||
61 | 58 | func managerPublicKeyOrUnit () = { | |
62 | 59 | let managerVaultAddress = getManagerVaultAddressOrThis() | |
63 | 60 | match getString(managerVaultAddress, keyManagerPublicKey()) { | |
64 | 61 | case s: String => | |
65 | 62 | fromBase58String(s) | |
66 | 63 | case _: Unit => | |
67 | 64 | unit | |
68 | 65 | case _ => | |
69 | 66 | throw("Match error") | |
70 | 67 | } | |
71 | 68 | } | |
72 | 69 | ||
73 | 70 | ||
74 | 71 | func isManager (i) = match managerPublicKeyOrUnit() { | |
75 | 72 | case pk: ByteVector => | |
76 | 73 | (i.callerPublicKey == pk) | |
77 | 74 | case _: Unit => | |
78 | 75 | (i.caller == this) | |
79 | 76 | case _ => | |
80 | 77 | throw("Match error") | |
81 | 78 | } | |
82 | 79 | ||
83 | 80 | ||
84 | 81 | func mustManager (i) = if (isManager(i)) | |
85 | 82 | then true | |
86 | 83 | else throw("permission denied") | |
87 | 84 | ||
88 | 85 | ||
89 | 86 | @Callable(i) | |
90 | 87 | func startNewVote (name,description,expirationHeight,quorumNumber) = { | |
91 | 88 | let checks = [mustManager(i)] | |
92 | 89 | if ((checks == checks)) | |
93 | 90 | then { | |
94 | 91 | let theIndex = getCurrentIndex() | |
95 | - | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")) | |
92 | + | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, description, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0"))] | |
96 | 93 | } | |
97 | 94 | else throw("Strict value is not equal to itself.") | |
98 | 95 | } | |
99 | 96 | ||
100 | 97 | ||
101 | 98 | ||
102 | 99 | @Callable(i) | |
103 | 100 | func voteFor (proposalIndex,choice) = { | |
104 | 101 | let EMPTY = "EMPTY" | |
105 | 102 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
106 | 103 | let voteInfoArray = split(voteInfo, SEP) | |
107 | 104 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
108 | 105 | let checks = [if ((voteInfo != EMPTY)) | |
109 | 106 | then true | |
110 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
107 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
111 | 108 | then true | |
112 | 109 | else blockHeightError(), if ((userVoteInfo == EMPTY)) | |
113 | 110 | then true | |
114 | 111 | else alreadyVoteError()] | |
115 | 112 | if ((checks == checks)) | |
116 | 113 | then { | |
117 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[ | |
118 | - | let $ | |
114 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
115 | + | let $t034354523 = if (choice) | |
119 | 116 | then { | |
120 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
117 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber)), voteInfoArray[6])) | |
121 | 118 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
122 | 119 | $Tuple2(action1, action2) | |
123 | 120 | } | |
124 | 121 | else { | |
125 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[ | |
122 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) + gwxNumber)))) | |
126 | 123 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
127 | 124 | $Tuple2(action1, action2) | |
128 | 125 | } | |
129 | - | let action1 = $ | |
130 | - | let action2 = $ | |
126 | + | let action1 = $t034354523._1 | |
127 | + | let action2 = $t034354523._2 | |
131 | 128 | [action1, action2] | |
132 | 129 | } | |
133 | 130 | else throw("Strict value is not equal to itself.") | |
134 | 131 | } | |
135 | 132 | ||
136 | 133 | ||
137 | 134 | ||
138 | 135 | @Callable(i) | |
139 | 136 | func deleteVote (proposalIndex) = { | |
140 | 137 | let EMPTY = "EMPTY" | |
141 | 138 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
142 | 139 | let voteInfoArray = split(voteInfo, SEP) | |
143 | 140 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
144 | 141 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
145 | 142 | let checks = [if ((voteInfo != EMPTY)) | |
146 | 143 | then true | |
147 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
144 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
148 | 145 | then true | |
149 | 146 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
150 | 147 | then true | |
151 | 148 | else noVoteError()] | |
152 | 149 | if ((checks == checks)) | |
153 | 150 | then { | |
154 | 151 | let action = if ((userVoteInfoArray[1] == "1")) | |
155 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
156 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[ | |
152 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[6])) | |
153 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2])))))) | |
157 | 154 | [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))] | |
158 | 155 | } | |
159 | 156 | else throw("Strict value is not equal to itself.") | |
160 | 157 | } | |
161 | 158 | ||
162 | 159 | ||
163 | 160 | ||
164 | 161 | @Callable(i) | |
165 | 162 | func changeVote (proposalIndex,choice) = { | |
166 | 163 | let EMPTY = "EMPTY" | |
167 | 164 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
168 | 165 | let voteInfoArray = split(voteInfo, SEP) | |
169 | 166 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
170 | 167 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
171 | 168 | let checks = [if ((voteInfo != EMPTY)) | |
172 | 169 | then true | |
173 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
170 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
174 | 171 | then true | |
175 | 172 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
176 | 173 | then true | |
177 | 174 | else noVoteError()] | |
178 | 175 | if ((checks == checks)) | |
179 | 176 | then { | |
180 | 177 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
181 | - | let $ | |
178 | + | let $t067437082 = if (choice) | |
182 | 179 | then { | |
183 | 180 | let forNumber = gwxNumber | |
184 | 181 | let againstNumber = 0 | |
185 | 182 | let choiceInteger = 1 | |
186 | 183 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
187 | 184 | } | |
188 | 185 | else { | |
189 | 186 | let forNumber = 0 | |
190 | 187 | let againstNumber = gwxNumber | |
191 | 188 | let choiceInteger = 0 | |
192 | 189 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
193 | 190 | } | |
194 | - | let userPowerFor = $ | |
195 | - | let userPowerAgainst = $ | |
196 | - | let choiceInt = $ | |
191 | + | let userPowerFor = $t067437082._1 | |
192 | + | let userPowerAgainst = $t067437082._2 | |
193 | + | let choiceInt = $t067437082._3 | |
197 | 194 | let action = if ((userVoteInfoArray[1] == "1")) | |
198 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString(((value(parseInt(voteInfoArray[ | |
199 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[ | |
195 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString(((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2]))) + userPowerFor)), toString((value(parseInt(voteInfoArray[6])) + userPowerAgainst)))) | |
196 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + userPowerFor)), toString(((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2]))) + userPowerAgainst)))) | |
200 | 197 | [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))] | |
201 | 198 | } | |
202 | 199 | else throw("Strict value is not equal to itself.") | |
203 | 200 | } | |
204 | 201 | ||
205 | 202 | ||
206 | 203 | ||
207 | 204 | @Callable(i) | |
208 | 205 | func getResultREADONLY (proposalIndex) = { | |
209 | 206 | let EMPTY = "EMPTY" | |
210 | 207 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
211 | 208 | let voteInfoArray = split(voteInfo, SEP) | |
212 | 209 | let checks = [if ((voteInfo != EMPTY)) | |
213 | 210 | then true | |
214 | 211 | else throw("No such vote")] | |
215 | 212 | if ((checks == checks)) | |
216 | 213 | then { | |
217 | - | let | |
218 | - | let | |
219 | - | let | |
214 | + | let positiveVotes = voteInfoArray[5] | |
215 | + | let negativeVotes = voteInfoArray[6] | |
216 | + | let quorumNumber = voteInfoArray[4] | |
220 | 217 | $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber]) | |
221 | 218 | } | |
222 | 219 | else throw("Strict value is not equal to itself.") | |
223 | 220 | } | |
224 | 221 | ||
225 | 222 | ||
226 | 223 | @Verifier(tx) | |
227 | 224 | func verify () = { | |
228 | 225 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
229 | 226 | case pk: ByteVector => | |
230 | 227 | pk | |
231 | 228 | case _: Unit => | |
232 | 229 | tx.senderPublicKey | |
233 | 230 | case _ => | |
234 | 231 | throw("Match error") | |
235 | 232 | } | |
236 | 233 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
237 | 234 | } | |
238 | 235 |
github/deemru/w8io/169f3d6 117.11 ms ◑