tx · gVv5hJaArhFbBsUKqps4bptj8u8KXKzutApjxKinRqj 3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX: -0.01000000 Waves 2023.07.16 21:03 [2668750] smart account 3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX > SELF 0.00000000 Waves
{ "type": 13, "id": "gVv5hJaArhFbBsUKqps4bptj8u8KXKzutApjxKinRqj", "fee": 1000000, "feeAssetId": null, "timestamp": 1689530658832, "version": 2, "chainId": 84, "sender": "3N2wgB3PUJouKCSe9dULpKp5J3XGTmrDZZX", "senderPublicKey": "8tfd6Swf6ctN44RdASetvkFbWtHbPdfspowjcrVQ4iV8", "proofs": [ "4vG2dRpUeb8woXzxabVKDRZqs5gFFBDKEf1XX2BwCWPBSYdAsS6dEwUgunwgZtR1ntr7YmwGmwKLSCGAUBoG1Gtt" ], "script": "base64:BgIgCAISBgoECAgBARIECgIBBBIDCgEBEgQKAgEEEgMKAQESAANTRVACAl9fARBibG9ja0hlaWdodEVycm9yAAkAAgECL1RoZSBibG9jaydzIGhlaWdodCBpcyB0b28gYmlnIGZvciB0aGlzIHByb3Bvc2FsARBhbHJlYWR5Vm90ZUVycm9yAAkAAgECFllvdSBoYXZlIGFscmVhZHkgdm90ZWQBC25vVm90ZUVycm9yAAkAAgECGllvdSBoYXZlIG5vdCBhbHJlYWR5IHZvdGVkARJnd3hDb250cmFjdEFkZHJlc3MACQC5CQIJAMwIAgICJXMJAMwIAgISZ3d4Q29udHJhY3RBZGRyZXNzBQNuaWwFA1NFUAEPa2V5Q3VycmVudEluZGV4AAkAuQkCCQDMCAICAiVzCQDMCAICDGN1cnJlbnRJbmRleAUDbmlsBQNTRVABD2tleVByb3Bvc2FsSW5mbwEGbnVtYmVyCQC5CQIJAMwIAgIEJXMlZAkAzAgCAgxwcm9wb3NhbEluZm8JAMwIAgkApAMBBQZudW1iZXIFA25pbAUDU0VQARZrZXlQcm9wb3NhbERlc2NyaXB0aW9uAQZudW1iZXIJALkJAgkAzA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FRU1QVFkECHZvdGVJbmZvCQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMJAQ9rZXlQcm9wb3NhbEluZm8BBQ1wcm9wb3NhbEluZGV4BQVFTVBUWQQNdm90ZUluZm9BcnJheQkAtQkCBQh2b3RlSW5mbwUDU0VQBAZjaGVja3MJAMwIAgMJAQIhPQIFCHZvdGVJbmZvBQVFTVBUWQYJAAIBAgxObyBzdWNoIHZvdGUFA25pbAMJAAACBQZjaGVja3MFBmNoZWNrcwQMcXVvcnVtTnVtYmVyCQCRAwIFDXZvdGVJbmZvQXJyYXkAAwQNcG9zaXRpdmVWb3RlcwkAkQMCBQ12b3RlSW5mb0FycmF5AAQEDW5lZ2F0aXZlVm90ZXMJAJEDAgUNdm90ZUluZm9BcnJheQAFCQCUCgIFA25pbAkAzAgCBQ1wb3NpdGl2ZVZvdGVzCQDMCAIFDW5lZ2F0aXZlVm90ZXMJAMwIAgUMcXVvcnVtTnVtYmVyBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4Akkyw8Q==", "height": 2668750, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5cta6s7QcDkv2hwPNCmENr89sqAhbiFtNJ6ZnBbMqkVb Next: C2aEZn7CGoJPrSqtkCQ9FPyRcXE8WZqUhhS8j1nrEQaL Diff:
Old | New | Differences | |
---|---|---|---|
84 | 84 | @Callable(i) | |
85 | 85 | func startNewVote (name,description,expirationHeight,quorumNumber) = { | |
86 | 86 | let theIndex = getCurrentIndex() | |
87 | - | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)] | |
87 | + | [IntegerEntry(keyCurrentIndex(), 0), IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)] | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
105 | 105 | if ((checks == checks)) | |
106 | 106 | then { | |
107 | 107 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil)) | |
108 | - | let $ | |
108 | + | let $t035554591 = if (choice) | |
109 | 109 | then { | |
110 | 110 | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5])) | |
111 | 111 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
116 | 116 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
117 | 117 | $Tuple2(action1, action2) | |
118 | 118 | } | |
119 | - | let action1 = $ | |
120 | - | let action2 = $ | |
119 | + | let action1 = $t035554591._1 | |
120 | + | let action2 = $t035554591._2 | |
121 | 121 | [action1, action2] | |
122 | 122 | } | |
123 | 123 | else throw("Strict value is not equal to itself.") | |
168 | 168 | if ((checks == checks)) | |
169 | 169 | then { | |
170 | 170 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
171 | - | let $ | |
171 | + | let $t067597098 = if (choice) | |
172 | 172 | then { | |
173 | 173 | let forNumber = gwxNumber | |
174 | 174 | let againstNumber = 0 | |
181 | 181 | let choiceInteger = 0 | |
182 | 182 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
183 | 183 | } | |
184 | - | let userPowerFor = $ | |
185 | - | let userPowerAgainst = $ | |
186 | - | let choiceInt = $ | |
184 | + | let userPowerFor = $t067597098._1 | |
185 | + | let userPowerAgainst = $t067597098._2 | |
186 | + | let choiceInt = $t067597098._3 | |
187 | 187 | let action = if ((userVoteInfoArray[1] == "1")) | |
188 | 188 | 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)))) | |
189 | 189 | 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 | @Callable(i) | |
85 | 85 | func startNewVote (name,description,expirationHeight,quorumNumber) = { | |
86 | 86 | let theIndex = getCurrentIndex() | |
87 | - | [IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)] | |
87 | + | [IntegerEntry(keyCurrentIndex(), 0), IntegerEntry(keyCurrentIndex(), (theIndex + 1)), StringEntry(keyProposalInfo(theIndex), formatProposalInfo(name, toString((lastBlock.height + expirationHeight)), toString(quorumNumber), "0", "0")), StringEntry(keyProposalDescription(theIndex), description)] | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
92 | 92 | @Callable(i) | |
93 | 93 | func voteFor (proposalIndex,choice) = { | |
94 | 94 | let EMPTY = "EMPTY" | |
95 | 95 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
96 | 96 | let voteInfoArray = split(voteInfo, SEP) | |
97 | 97 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
98 | 98 | let checks = [if ((voteInfo != EMPTY)) | |
99 | 99 | then true | |
100 | 100 | else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height)) | |
101 | 101 | then true | |
102 | 102 | else blockHeightError(), if ((userVoteInfo == EMPTY)) | |
103 | 103 | then true | |
104 | 104 | else alreadyVoteError()] | |
105 | 105 | if ((checks == checks)) | |
106 | 106 | then { | |
107 | 107 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[2]))], nil)) | |
108 | - | let $ | |
108 | + | let $t035554591 = if (choice) | |
109 | 109 | then { | |
110 | 110 | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) + gwxNumber)), voteInfoArray[5])) | |
111 | 111 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("1", toString(gwxNumber))) | |
112 | 112 | $Tuple2(action1, action2) | |
113 | 113 | } | |
114 | 114 | else { | |
115 | 115 | let action1 = StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) + gwxNumber)))) | |
116 | 116 | let action2 = StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal("0", toString(gwxNumber))) | |
117 | 117 | $Tuple2(action1, action2) | |
118 | 118 | } | |
119 | - | let action1 = $ | |
120 | - | let action2 = $ | |
119 | + | let action1 = $t035554591._1 | |
120 | + | let action2 = $t035554591._2 | |
121 | 121 | [action1, action2] | |
122 | 122 | } | |
123 | 123 | else throw("Strict value is not equal to itself.") | |
124 | 124 | } | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | 129 | func deleteVote (proposalIndex) = { | |
130 | 130 | let EMPTY = "EMPTY" | |
131 | 131 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
132 | 132 | let voteInfoArray = split(voteInfo, SEP) | |
133 | 133 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
134 | 134 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
135 | 135 | let checks = [if ((voteInfo != EMPTY)) | |
136 | 136 | then true | |
137 | 137 | else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height)) | |
138 | 138 | then true | |
139 | 139 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
140 | 140 | then true | |
141 | 141 | else noVoteError()] | |
142 | 142 | if ((checks == checks)) | |
143 | 143 | then { | |
144 | 144 | let action = if ((userVoteInfoArray[1] == "1")) | |
145 | 145 | then StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], toString((value(parseInt(voteInfoArray[4])) - value(parseInt(userVoteInfoArray[2])))), voteInfoArray[5])) | |
146 | 146 | else StringEntry(keyProposalInfo(proposalIndex), formatProposalInfo(voteInfoArray[1], voteInfoArray[2], voteInfoArray[3], voteInfoArray[4], toString((value(parseInt(voteInfoArray[5])) - value(parseInt(userVoteInfoArray[2])))))) | |
147 | 147 | [action, DeleteEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)))] | |
148 | 148 | } | |
149 | 149 | else throw("Strict value is not equal to itself.") | |
150 | 150 | } | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | @Callable(i) | |
155 | 155 | func changeVote (proposalIndex,choice) = { | |
156 | 156 | let EMPTY = "EMPTY" | |
157 | 157 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
158 | 158 | let voteInfoArray = split(voteInfo, SEP) | |
159 | 159 | let userVoteInfo = valueOrElse(getString(this, keyUserVoteOnProposal(proposalIndex, toString(i.caller))), EMPTY) | |
160 | 160 | let userVoteInfoArray = split(userVoteInfo, SEP) | |
161 | 161 | let checks = [if ((voteInfo != EMPTY)) | |
162 | 162 | then true | |
163 | 163 | else throw("No such vote"), if ((value(parseInt(voteInfoArray[2])) > lastBlock.height)) | |
164 | 164 | then true | |
165 | 165 | else blockHeightError(), if ((userVoteInfo != EMPTY)) | |
166 | 166 | then true | |
167 | 167 | else noVoteError()] | |
168 | 168 | if ((checks == checks)) | |
169 | 169 | then { | |
170 | 170 | let gwxNumber = asInt(invoke(addressFromStringValue(getStringValue(gwxContractAddress())), "getUserGwxAmountAtHeightREADONLY", [toString(i.caller), value(parseInt(voteInfoArray[3]))], nil)) | |
171 | - | let $ | |
171 | + | let $t067597098 = if (choice) | |
172 | 172 | then { | |
173 | 173 | let forNumber = gwxNumber | |
174 | 174 | let againstNumber = 0 | |
175 | 175 | let choiceInteger = 1 | |
176 | 176 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
177 | 177 | } | |
178 | 178 | else { | |
179 | 179 | let forNumber = 0 | |
180 | 180 | let againstNumber = gwxNumber | |
181 | 181 | let choiceInteger = 0 | |
182 | 182 | $Tuple3(forNumber, againstNumber, choiceInteger) | |
183 | 183 | } | |
184 | - | let userPowerFor = $ | |
185 | - | let userPowerAgainst = $ | |
186 | - | let choiceInt = $ | |
184 | + | let userPowerFor = $t067597098._1 | |
185 | + | let userPowerAgainst = $t067597098._2 | |
186 | + | let choiceInt = $t067597098._3 | |
187 | 187 | let action = if ((userVoteInfoArray[1] == "1")) | |
188 | 188 | 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)))) | |
189 | 189 | 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)))) | |
190 | 190 | [action, StringEntry(keyUserVoteOnProposal(proposalIndex, toString(i.caller)), formatUserVoteOnProposal(toString(choiceInt), toString(gwxNumber)))] | |
191 | 191 | } | |
192 | 192 | else throw("Strict value is not equal to itself.") | |
193 | 193 | } | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | ||
197 | 197 | @Callable(i) | |
198 | 198 | func getResultREADONLY (proposalIndex) = { | |
199 | 199 | let EMPTY = "EMPTY" | |
200 | 200 | let voteInfo = valueOrElse(getString(this, keyProposalInfo(proposalIndex)), EMPTY) | |
201 | 201 | let voteInfoArray = split(voteInfo, SEP) | |
202 | 202 | let checks = [if ((voteInfo != EMPTY)) | |
203 | 203 | then true | |
204 | 204 | else throw("No such vote")] | |
205 | 205 | if ((checks == checks)) | |
206 | 206 | then { | |
207 | 207 | let quorumNumber = voteInfoArray[3] | |
208 | 208 | let positiveVotes = voteInfoArray[4] | |
209 | 209 | let negativeVotes = voteInfoArray[5] | |
210 | 210 | $Tuple2(nil, [positiveVotes, negativeVotes, quorumNumber]) | |
211 | 211 | } | |
212 | 212 | else throw("Strict value is not equal to itself.") | |
213 | 213 | } | |
214 | 214 | ||
215 | 215 |
github/deemru/w8io/169f3d6 48.13 ms ◑