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