tx · kcqmwuotNHvUpxk9yU8BN1JzRvJm7qgaTiEAUmGiMHf 3MrqFfv385KAzAqqdQyprR7FMLSapeifggB: -0.01300000 Waves 2023.01.19 15:21 [2411806] smart account 3MrqFfv385KAzAqqdQyprR7FMLSapeifggB > SELF 0.00000000 Waves
{ "type": 13, "id": "kcqmwuotNHvUpxk9yU8BN1JzRvJm7qgaTiEAUmGiMHf", "fee": 1300000, "feeAssetId": null, "timestamp": 1674130918311, "version": 1, "sender": "3MrqFfv385KAzAqqdQyprR7FMLSapeifggB", "senderPublicKey": "8Tqc64F7G2nACr6yk8egBWCVAp9ZLxjTeWYdXoyQvMAN", "proofs": [ "aT4jugt2qi942F5sMXjH4wMwEvcKqKhKHpa6751A89HHpLe7QAwNGAUUUXKNaTiXoVtJs3WZwDDsxcEp5vRpkcF" ], "script": "base64:BgInCAISBgoECAgBARIECgIBBBIDCgEBEgQKAgEEEgMKAQESAwoBCBIAEgADU0VQAgJfXwETa2V5TWFuYWdlclB1YmxpY0tleQACFSVzX19tYW5hZ2VyUHVibGljcEtleQEaa2V5UGVuZGluZ01hbmFnZXJQdWJsaWNLZXkAAhslc19fcGVuZGluZ01hbmFnZXJQdWJsaWNLZXkBEGJsb2NrSGVpZ2h0RXJyb3IACQACAQIvVGhlIGJsb2NrJ3MgaGVpZ2h0IGlzIHRvbyBiaWcgZm9yIHRoaXMgcHJvcG9zYWwBEGFscmVhZHlWb3RlRXJyb3IACQACAQIWWW91IGhhdmUgYWxyZWFkeSB2b3RlZAELbm9Wb3RlRXJyb3IACQACAQIaWW91IGhhdmUgbm90IGFscmVhZHkgdm90ZWQBEmd3eENvbnRyYWN0QWRkcmVzcwAJALkJAgkAzAgCAgIlcwkAzAgCAhJnd3hDb250cmFjdEFkZHJlc3MFA25pbAUDU0VQAQ9rZXlDdXJyZW50SW5kZXgACQC5CQIJAMwIAgICJXMJAMwIAgIMY3VycmVudEluZGV4BQNuaWwFA1NFUAEPa2V5UHJvcG9zYWxJbmZvAQZud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DERQVDjE8R1vyHnmaJVykjTeQz4xvmwSAadY2eoicC2M Next: 5Pe8ULrrAtZJzcNbgMb61V3WsVUoB9icGCM1GULWDXgB Diff:
Old | New | Differences | |
---|---|---|---|
27 | 27 | func keyProposalInfo (number) = makeString(["%s%d", "proposalInfo", toString(number)], SEP) | |
28 | 28 | ||
29 | 29 | ||
30 | - | func keyUserVoteOnProposal (number,user) = makeString(["%s%d% | |
30 | + | func keyUserVoteOnProposal (number,user) = makeString(["%s%d%s", "userVoteOnProposal", toString(number), user], SEP) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getCurrentIndex () = getIntegerValue(this, keyCurrentIndex()) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | - | func constructor (gwxContractAddress) = { | |
87 | - | let check = mustManager(i) | |
88 | - | if ((check == check)) | |
89 | - | then [StringEntry(gwxContractAddress(), gwxContractAddress), IntegerEntry(keyCurrentIndex(), 0)] | |
90 | - | else throw("Strict value is not equal to itself.") | |
91 | - | } | |
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | @Callable(i) | |
96 | 86 | func startNewVote (name,description,expirationHeight,quorumNumber) = { | |
97 | 87 | let checks = [mustManager(i)] | |
98 | 88 | if ((checks == checks)) | |
113 | 103 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
114 | 104 | let checks = [if ((voteInfo != EMPTY)) | |
115 | 105 | then true | |
116 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
106 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
117 | 107 | then true | |
118 | 108 | else blockHeightError(), if ((userVoteInfo == EMPTY)) | |
119 | 109 | then true | |
120 | 110 | else alreadyVoteError()] | |
121 | 111 | if ((checks == checks)) | |
122 | 112 | then { | |
123 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), parseInt(voteInfoArray[ | |
124 | - | let $ | |
113 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
114 | + | let $t033524440 = if (choice) | |
125 | 115 | then { | |
126 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
116 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber)), voteInfoArray[6])) | |
127 | 117 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
128 | 118 | $Tuple2(action1, action2) | |
129 | 119 | } | |
130 | 120 | else { | |
131 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
121 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) + gwxNumber)))) | |
132 | 122 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
133 | 123 | $Tuple2(action1, action2) | |
134 | 124 | } | |
135 | - | let action1 = $ | |
136 | - | let action2 = $ | |
125 | + | let action1 = $t033524440._1 | |
126 | + | let action2 = $t033524440._2 | |
137 | 127 | [action1, action2] | |
138 | 128 | } | |
139 | 129 | else throw("Strict value is not equal to itself.") | |
147 | 137 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
148 | 138 | let voteInfoArray = split(voteInfo, SEP) | |
149 | 139 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
150 | - | let userVoteInfoArray = split( | |
140 | + | let userVoteInfoArray = split(userVoteInfo, SEP) | |
151 | 141 | let checks = [if ((voteInfo != EMPTY)) | |
152 | 142 | then true | |
153 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
143 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
154 | 144 | then true | |
155 | 145 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
156 | 146 | then true | |
157 | 147 | else noVoteError()] | |
158 | 148 | if ((checks == checks)) | |
159 | 149 | then { | |
160 | - | let action = if ((userVoteInfoArray[ | |
161 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
162 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
150 | + | let action = if ((userVoteInfoArray[1] == "1")) | |
151 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[6])) | |
152 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2])))))) | |
163 | 153 | [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))] | |
164 | 154 | } | |
165 | 155 | else throw("Strict value is not equal to itself.") | |
173 | 163 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
174 | 164 | let voteInfoArray = split(voteInfo, SEP) | |
175 | 165 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
176 | - | let userVoteInfoArray = split( | |
166 | + | let userVoteInfoArray = split(userVoteInfo, SEP) | |
177 | 167 | let checks = [if ((voteInfo != EMPTY)) | |
178 | 168 | then true | |
179 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
169 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
180 | 170 | then true | |
181 | 171 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
182 | 172 | then true | |
183 | 173 | else noVoteError()] | |
184 | 174 | if ((checks == checks)) | |
185 | 175 | then { | |
186 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), parseInt(voteInfoArray[ | |
187 | - | let $ | |
176 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
177 | + | let $t066606999 = if (choice) | |
188 | 178 | then { | |
189 | 179 | let forNumber = gwxNumber | |
190 | 180 | let againstNumber = 0 | |
197 | 187 | let choiceInteger = 0 | |
198 | 188 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
199 | 189 | } | |
200 | - | let userPowerFor = $ | |
201 | - | let userPowerAgainst = $ | |
202 | - | let choiceInt = $ | |
203 | - | let action = if ((userVoteInfoArray[ | |
204 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
205 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
190 | + | let userPowerFor = $t066606999._1 | |
191 | + | let userPowerAgainst = $t066606999._2 | |
192 | + | let choiceInt = $t066606999._3 | |
193 | + | let action = if ((userVoteInfoArray[1] == "1")) | |
194 | + | 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)))) | |
195 | + | 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)))) | |
206 | 196 | [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))] | |
207 | 197 | } | |
208 | 198 | else throw("Strict value is not equal to itself.") | |
220 | 210 | else throw("No such vote")] | |
221 | 211 | if ((checks == checks)) | |
222 | 212 | then { | |
223 | - | let positiveVotes = voteInfoArray[ | |
224 | - | let negativeVotes = voteInfoArray[ | |
225 | - | let quorumNumber = voteInfoArray[ | |
213 | + | let positiveVotes = voteInfoArray[5] | |
214 | + | let negativeVotes = voteInfoArray[6] | |
215 | + | let quorumNumber = voteInfoArray[4] | |
226 | 216 | $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber]) | |
227 | 217 | } | |
228 | 218 | 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 keyManagerPublicKey () = "%s__managerPublicpKey" | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyPendingManagerPublicKey () = "%s__pendingManagerPublicKey" | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func blockHeightError () = throw("The block's height is too big for this proposal") | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func alreadyVoteError () = throw("You have already voted") | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func noVoteError () = throw("You have not already voted") | |
19 | 19 | ||
20 | 20 | ||
21 | 21 | func gwxContractAddress () = makeString(["%s", "gwxContractAddress"], SEP) | |
22 | 22 | ||
23 | 23 | ||
24 | 24 | func keyCurrentIndex () = makeString(["%s", "currentIndex"], SEP) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func keyProposalInfo (number) = makeString(["%s%d", "proposalInfo", toString(number)], SEP) | |
28 | 28 | ||
29 | 29 | ||
30 | - | func keyUserVoteOnProposal (number,user) = makeString(["%s%d% | |
30 | + | func keyUserVoteOnProposal (number,user) = makeString(["%s%d%s", "userVoteOnProposal", toString(number), user], SEP) | |
31 | 31 | ||
32 | 32 | ||
33 | 33 | func getCurrentIndex () = getIntegerValue(this, keyCurrentIndex()) | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | func formatProposalInfo (name,description,end,quorumNumber,positiveVotes,negativeVotes) = makeString(["%d%d%d%d%d%d", name, description, end, quorumNumber, positiveVotes, negativeVotes], SEP) | |
37 | 37 | ||
38 | 38 | ||
39 | 39 | func formatUserVoteOnProposal (vote,gwxNumber) = makeString(["%d%d", vote, gwxNumber], SEP) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func asInt (val) = match val { | |
43 | 43 | case valInt: Int => | |
44 | 44 | valInt | |
45 | 45 | case _ => | |
46 | 46 | throw("fail to cast into Int") | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | func managerPublicKeyOrUnit () = match getString(keyManagerPublicKey()) { | |
51 | 51 | case s: String => | |
52 | 52 | fromBase58String(s) | |
53 | 53 | case _: Unit => | |
54 | 54 | unit | |
55 | 55 | case _ => | |
56 | 56 | throw("Match error") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func pendingManagerPublicKeyOrUnit () = match getString(keyPendingManagerPublicKey()) { | |
61 | 61 | case s: String => | |
62 | 62 | fromBase58String(s) | |
63 | 63 | case _: Unit => | |
64 | 64 | unit | |
65 | 65 | case _ => | |
66 | 66 | throw("Match error") | |
67 | 67 | } | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func isManager (i) = match managerPublicKeyOrUnit() { | |
71 | 71 | case pk: ByteVector => | |
72 | 72 | (i.callerPublicKey == pk) | |
73 | 73 | case _: Unit => | |
74 | 74 | (i.caller == this) | |
75 | 75 | case _ => | |
76 | 76 | throw("Match error") | |
77 | 77 | } | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func mustManager (i) = if (isManager(i)) | |
81 | 81 | then true | |
82 | 82 | else throw("permission denied") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | @Callable(i) | |
86 | - | func constructor (gwxContractAddress) = { | |
87 | - | let check = mustManager(i) | |
88 | - | if ((check == check)) | |
89 | - | then [StringEntry(gwxContractAddress(), gwxContractAddress), IntegerEntry(keyCurrentIndex(), 0)] | |
90 | - | else throw("Strict value is not equal to itself.") | |
91 | - | } | |
92 | - | ||
93 | - | ||
94 | - | ||
95 | - | @Callable(i) | |
96 | 86 | func startNewVote (name,description,expirationHeight,quorumNumber) = { | |
97 | 87 | let checks = [mustManager(i)] | |
98 | 88 | if ((checks == checks)) | |
99 | 89 | then { | |
100 | 90 | let theIndex = getCurrentIndex() | |
101 | 91 | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, description, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0"))] | |
102 | 92 | } | |
103 | 93 | else throw("Strict value is not equal to itself.") | |
104 | 94 | } | |
105 | 95 | ||
106 | 96 | ||
107 | 97 | ||
108 | 98 | @Callable(i) | |
109 | 99 | func voteFor (proposalIndex,choice) = { | |
110 | 100 | let EMPTY = "EMPTY" | |
111 | 101 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
112 | 102 | let voteInfoArray = split(voteInfo, SEP) | |
113 | 103 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
114 | 104 | let checks = [if ((voteInfo != EMPTY)) | |
115 | 105 | then true | |
116 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
106 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
117 | 107 | then true | |
118 | 108 | else blockHeightError(), if ((userVoteInfo == EMPTY)) | |
119 | 109 | then true | |
120 | 110 | else alreadyVoteError()] | |
121 | 111 | if ((checks == checks)) | |
122 | 112 | then { | |
123 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), parseInt(voteInfoArray[ | |
124 | - | let $ | |
113 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
114 | + | let $t033524440 = if (choice) | |
125 | 115 | then { | |
126 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
116 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber)), voteInfoArray[6])) | |
127 | 117 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
128 | 118 | $Tuple2(action1, action2) | |
129 | 119 | } | |
130 | 120 | else { | |
131 | - | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
121 | + | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) + gwxNumber)))) | |
132 | 122 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
133 | 123 | $Tuple2(action1, action2) | |
134 | 124 | } | |
135 | - | let action1 = $ | |
136 | - | let action2 = $ | |
125 | + | let action1 = $t033524440._1 | |
126 | + | let action2 = $t033524440._2 | |
137 | 127 | [action1, action2] | |
138 | 128 | } | |
139 | 129 | else throw("Strict value is not equal to itself.") | |
140 | 130 | } | |
141 | 131 | ||
142 | 132 | ||
143 | 133 | ||
144 | 134 | @Callable(i) | |
145 | 135 | func deleteVote (proposalIndex) = { | |
146 | 136 | let EMPTY = "EMPTY" | |
147 | 137 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
148 | 138 | let voteInfoArray = split(voteInfo, SEP) | |
149 | 139 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
150 | - | let userVoteInfoArray = split( | |
140 | + | let userVoteInfoArray = split(userVoteInfo, SEP) | |
151 | 141 | let checks = [if ((voteInfo != EMPTY)) | |
152 | 142 | then true | |
153 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
143 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
154 | 144 | then true | |
155 | 145 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
156 | 146 | then true | |
157 | 147 | else noVoteError()] | |
158 | 148 | if ((checks == checks)) | |
159 | 149 | then { | |
160 | - | let action = if ((userVoteInfoArray[ | |
161 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
162 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
150 | + | let action = if ((userVoteInfoArray[1] == "1")) | |
151 | + | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[6])) | |
152 | + | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], voteInfoArray[5], toString((value(parseInt(voteInfoArray[6])) - value(parseInt(userVoteInfoArray[2])))))) | |
163 | 153 | [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))] | |
164 | 154 | } | |
165 | 155 | else throw("Strict value is not equal to itself.") | |
166 | 156 | } | |
167 | 157 | ||
168 | 158 | ||
169 | 159 | ||
170 | 160 | @Callable(i) | |
171 | 161 | func changeVote (proposalIndex,choice) = { | |
172 | 162 | let EMPTY = "EMPTY" | |
173 | 163 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
174 | 164 | let voteInfoArray = split(voteInfo, SEP) | |
175 | 165 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
176 | - | let userVoteInfoArray = split( | |
166 | + | let userVoteInfoArray = split(userVoteInfo, SEP) | |
177 | 167 | let checks = [if ((voteInfo != EMPTY)) | |
178 | 168 | then true | |
179 | - | else throw("No such vote"), if ((value(parseInt(voteInfoArray[ | |
169 | + | else throw("No such vote"), if ((value(parseInt(voteInfoArray[3])) > lastBlock.height)) | |
180 | 170 | then true | |
181 | 171 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
182 | 172 | then true | |
183 | 173 | else noVoteError()] | |
184 | 174 | if ((checks == checks)) | |
185 | 175 | then { | |
186 | - | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), parseInt(voteInfoArray[ | |
187 | - | let $ | |
176 | + | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
177 | + | let $t066606999 = if (choice) | |
188 | 178 | then { | |
189 | 179 | let forNumber = gwxNumber | |
190 | 180 | let againstNumber = 0 | |
191 | 181 | let choiceInteger = 1 | |
192 | 182 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
193 | 183 | } | |
194 | 184 | else { | |
195 | 185 | let forNumber = 0 | |
196 | 186 | let againstNumber = gwxNumber | |
197 | 187 | let choiceInteger = 0 | |
198 | 188 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
199 | 189 | } | |
200 | - | let userPowerFor = $ | |
201 | - | let userPowerAgainst = $ | |
202 | - | let choiceInt = $ | |
203 | - | let action = if ((userVoteInfoArray[ | |
204 | - | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
205 | - | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[ | |
190 | + | let userPowerFor = $t066606999._1 | |
191 | + | let userPowerAgainst = $t066606999._2 | |
192 | + | let choiceInt = $t066606999._3 | |
193 | + | let action = if ((userVoteInfoArray[1] == "1")) | |
194 | + | 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)))) | |
195 | + | 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)))) | |
206 | 196 | [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))] | |
207 | 197 | } | |
208 | 198 | else throw("Strict value is not equal to itself.") | |
209 | 199 | } | |
210 | 200 | ||
211 | 201 | ||
212 | 202 | ||
213 | 203 | @Callable(i) | |
214 | 204 | func getResultREADONLY (proposalIndex) = { | |
215 | 205 | let EMPTY = "EMPTY" | |
216 | 206 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
217 | 207 | let voteInfoArray = split(voteInfo, SEP) | |
218 | 208 | let checks = [if ((voteInfo != EMPTY)) | |
219 | 209 | then true | |
220 | 210 | else throw("No such vote")] | |
221 | 211 | if ((checks == checks)) | |
222 | 212 | then { | |
223 | - | let positiveVotes = voteInfoArray[ | |
224 | - | let negativeVotes = voteInfoArray[ | |
225 | - | let quorumNumber = voteInfoArray[ | |
213 | + | let positiveVotes = voteInfoArray[5] | |
214 | + | let negativeVotes = voteInfoArray[6] | |
215 | + | let quorumNumber = voteInfoArray[4] | |
226 | 216 | $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber]) | |
227 | 217 | } | |
228 | 218 | else throw("Strict value is not equal to itself.") | |
229 | 219 | } | |
230 | 220 | ||
231 | 221 | ||
232 | 222 | ||
233 | 223 | @Callable(i) | |
234 | 224 | func setManager (pendingManagerPublicKey) = { | |
235 | 225 | let checkCaller = mustManager(i) | |
236 | 226 | if ((checkCaller == checkCaller)) | |
237 | 227 | then { | |
238 | 228 | let checkManagerPublicKey = fromBase58String(pendingManagerPublicKey) | |
239 | 229 | if ((checkManagerPublicKey == checkManagerPublicKey)) | |
240 | 230 | then [StringEntry(keyPendingManagerPublicKey(), pendingManagerPublicKey)] | |
241 | 231 | else throw("Strict value is not equal to itself.") | |
242 | 232 | } | |
243 | 233 | else throw("Strict value is not equal to itself.") | |
244 | 234 | } | |
245 | 235 | ||
246 | 236 | ||
247 | 237 | ||
248 | 238 | @Callable(i) | |
249 | 239 | func confirmManager () = { | |
250 | 240 | let pm = pendingManagerPublicKeyOrUnit() | |
251 | 241 | let hasPM = if (isDefined(pm)) | |
252 | 242 | then true | |
253 | 243 | else throw("no pending manager") | |
254 | 244 | if ((hasPM == hasPM)) | |
255 | 245 | then { | |
256 | 246 | let checkPM = if ((i.callerPublicKey == value(pm))) | |
257 | 247 | then true | |
258 | 248 | else throw("you are not pending manager") | |
259 | 249 | if ((checkPM == checkPM)) | |
260 | 250 | then [StringEntry(keyManagerPublicKey(), toBase58String(value(pm))), DeleteEntry(keyPendingManagerPublicKey())] | |
261 | 251 | else throw("Strict value is not equal to itself.") | |
262 | 252 | } | |
263 | 253 | else throw("Strict value is not equal to itself.") | |
264 | 254 | } | |
265 | 255 | ||
266 | 256 | ||
267 | 257 | @Verifier(tx) | |
268 | 258 | func verify () = { | |
269 | 259 | let targetPublicKey = match managerPublicKeyOrUnit() { | |
270 | 260 | case pk: ByteVector => | |
271 | 261 | pk | |
272 | 262 | case _: Unit => | |
273 | 263 | tx.senderPublicKey | |
274 | 264 | case _ => | |
275 | 265 | throw("Match error") | |
276 | 266 | } | |
277 | 267 | sigVerify(tx.bodyBytes, tx.proofs[0], targetPublicKey) | |
278 | 268 | } | |
279 | 269 |
github/deemru/w8io/026f985 71.95 ms ◑