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