tx · EMRCy21fuKruvfRCDpa6htHk1EtPuxcpgSYn1utXZD8u 3ND4t98zh5UHbMzcG68nRnJb547HLrHvYzz: -0.00800000 Waves 2022.09.28 00:23 [2248076] smart account 3ND4t98zh5UHbMzcG68nRnJb547HLrHvYzz > SELF 0.00000000 Waves
{ "type": 13, "id": "EMRCy21fuKruvfRCDpa6htHk1EtPuxcpgSYn1utXZD8u", "fee": 800000, "feeAssetId": null, "timestamp": 1664313840550, "version": 2, "chainId": 84, "sender": "3ND4t98zh5UHbMzcG68nRnJb547HLrHvYzz", "senderPublicKey": "G9WLT7NLFRCaJE1vUixFc3tu1fXn33Z4dLcUzQjhtvX7", "proofs": [ "5QZpoGXq7xccxQyrZCZkpajkxLvqG1mWVLFQQGMuVMTiczSi44eFr5toUxueN6eySeo6FJs9xdY988RWiPZ4dqgf" ], "script": "base64:BgIUCAISBwoFCAgBAQESABIDCgEIEgAWAA5pbml0aWFsaXplZEtleQILaW5pdGlhbGl6ZWQAE2F2YWlsYWJsZU9wdGlvbnNLZXkCEWF2YWlsYWJsZV9vcHRpb25zAA52b3RpbmdBc3NldEtleQIMdm90aW5nX2Fzc2V0AA5zdGFydEhlaWdodEtleQIMc3RhcnRfaGVpZ2h0AAxlbmRIZWlnaHRLZXkCCmVuZF9oZWlnaHQACHRvdGFsS2V5AgV0b3RhbAAQcXVvcnVtUGVyY2VudEtleQIOcXVvcnVtX3BlcmNlbnQACXF1b3J1bUtleQIGcXVvcnVtAAh2b3RlZEtleQIFdm90ZWQBD2dldFN0cmluZ09yRmFpbAEDa2V5CQETdmFsdWVPckVycm9yTWVzc2FnZQIJAJ0IAgUEdGhpcwUDa2V5Ag1LZXkgbm90IGV4aXN0AQxnZXRJbnRPckZhaWwBA2tleQkBE3ZhbHVlT3JFcnJvck1lc3NhZ2UCCQCaCAIFBHRoaXMFA2tleQINS2V5IG5vdCBleGlzdAEOZ2V0QXNzZXRPckZhaWwBBWFzc2V0CQETdmFsdWVPckVycm9yTWVzc2FnZ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t1c2VyQWRkcmVzcwQLdm90aW5nQXNzZXQJANkEAQkBD2dldFN0cmluZ09yRmFpbAEFDnZvdGluZ0Fzc2V0S2V5CQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgULdXNlckJhbGFuY2UFC3ZvdGluZ0Fzc2V0CQDMCAIJAQtEZWxldGVFbnRyeQEJAQ51c2VyQmFsYW5jZUtleQEFC3VzZXJBZGRyZXNzBQNuaWwBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5XOdWOg==", "height": 2248076, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: BWyzrQkU9VAZAKeEEF3UKkns8ipzmE9dsLmKn47XHsc4 Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let initializedKey = "initialized" | |
5 | + | ||
6 | + | let availableOptionsKey = "available_options" | |
7 | + | ||
8 | + | let votingAssetKey = "voting_asset" | |
9 | + | ||
10 | + | let startHeightKey = "start_height" | |
11 | + | ||
12 | + | let endHeightKey = "end_height" | |
13 | + | ||
14 | + | let totalKey = "total" | |
15 | + | ||
16 | + | let quorumPercentKey = "quorum_percent" | |
17 | + | ||
18 | + | let quorumKey = "quorum" | |
19 | + | ||
20 | + | let votedKey = "voted" | |
21 | + | ||
22 | + | func getStringOrFail (key) = valueOrErrorMessage(getString(this, key), "Key not exist") | |
23 | + | ||
24 | + | ||
25 | + | func getIntOrFail (key) = valueOrErrorMessage(getInteger(this, key), "Key not exist") | |
26 | + | ||
27 | + | ||
28 | + | func getAssetOrFail (asset) = valueOrErrorMessage(assetInfo(fromBase58String(asset)), "Asset not exist") | |
29 | + | ||
30 | + | ||
31 | + | func getBoolOrFalse (key) = valueOrElse(getBoolean(this, key), false) | |
32 | + | ||
33 | + | ||
34 | + | func getIntOrZero (key) = valueOrElse(getInteger(this, key), 0) | |
35 | + | ||
36 | + | ||
37 | + | func userBalanceKey (userAddress) = makeString(["balance", userAddress], "_") | |
38 | + | ||
39 | + | ||
40 | + | func userLastVoteKey (userAddress) = makeString(["last_vote", userAddress], "_") | |
41 | + | ||
42 | + | ||
43 | + | func userVotingPowerKey (userAddress) = makeString(["voting_power", userAddress], "_") | |
44 | + | ||
45 | + | ||
46 | + | func voteKey (option) = makeString(["vote", option], "_") | |
47 | + | ||
48 | + | ||
49 | + | func validateOptions (options) = { | |
50 | + | let containsSpace = contains(options, " ") | |
51 | + | let optionsList = split(options, ",") | |
52 | + | let containsEmpty = containsElement(optionsList, "") | |
53 | + | let containsEmptyGroup = containsElement(optionsList, ":") | |
54 | + | if (if (if (!(containsSpace)) | |
55 | + | then !(containsEmpty) | |
56 | + | else false) | |
57 | + | then !(containsEmptyGroup) | |
58 | + | else false) | |
59 | + | then (size(optionsList) > 1) | |
60 | + | else false | |
61 | + | } | |
62 | + | ||
63 | + | ||
64 | + | func getUserLastOptionOrUnit (userAddress,index) = match getString(userLastVoteKey(userAddress)) { | |
65 | + | case s: String => | |
66 | + | split(s, ":")[index] | |
67 | + | case _ => | |
68 | + | unit | |
69 | + | } | |
70 | + | ||
71 | + | ||
72 | + | func getUserOption (userBalance,userVotingPower,currentVote,lastVote) = match lastVote { | |
73 | + | case lastVoteValue: String => | |
74 | + | if ((currentVote == lastVoteValue)) | |
75 | + | then [IntegerEntry(voteKey(currentVote), ((getIntOrZero(voteKey(currentVote)) + userBalance) - userVotingPower))] | |
76 | + | else [IntegerEntry(voteKey(lastVoteValue), (getIntOrZero(voteKey(lastVoteValue)) - userVotingPower)), IntegerEntry(voteKey(currentVote), (getIntOrZero(voteKey(currentVote)) + userBalance))] | |
77 | + | case _ => | |
78 | + | [IntegerEntry(voteKey(currentVote), (getIntOrZero(voteKey(currentVote)) + userBalance))] | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func getUserOptions (userAddress,options) = { | |
83 | + | let optionsList = split(options, ":") | |
84 | + | let optionsListSize = size(optionsList) | |
85 | + | let userBalance = getIntOrZero(userBalanceKey(userAddress)) | |
86 | + | let userVotingPower = getIntOrZero(userVotingPowerKey(userAddress)) | |
87 | + | if ((optionsListSize == 1)) | |
88 | + | then getUserOption(userBalance, userVotingPower, optionsList[0], getUserLastOptionOrUnit(userAddress, 0)) | |
89 | + | else if ((optionsListSize == 2)) | |
90 | + | then (getUserOption(userBalance, userVotingPower, optionsList[0], getUserLastOptionOrUnit(userAddress, 0)) ++ getUserOption(userBalance, userVotingPower, optionsList[1], getUserLastOptionOrUnit(userAddress, 1))) | |
91 | + | else if ((optionsListSize == 3)) | |
92 | + | then ((getUserOption(userBalance, userVotingPower, optionsList[0], getUserLastOptionOrUnit(userAddress, 0)) ++ getUserOption(userBalance, userVotingPower, optionsList[1], getUserLastOptionOrUnit(userAddress, 1))) ++ getUserOption(userBalance, userVotingPower, optionsList[2], getUserLastOptionOrUnit(userAddress, 2))) | |
93 | + | else if ((optionsListSize == 4)) | |
94 | + | then (((getUserOption(userBalance, userVotingPower, optionsList[0], getUserLastOptionOrUnit(userAddress, 0)) ++ getUserOption(userBalance, userVotingPower, optionsList[1], getUserLastOptionOrUnit(userAddress, 1))) ++ getUserOption(userBalance, userVotingPower, optionsList[2], getUserLastOptionOrUnit(userAddress, 2))) ++ getUserOption(userBalance, userVotingPower, optionsList[3], getUserLastOptionOrUnit(userAddress, 3))) | |
95 | + | else if ((optionsListSize == 5)) | |
96 | + | then ((((getUserOption(userBalance, userVotingPower, optionsList[0], getUserLastOptionOrUnit(userAddress, 0)) ++ getUserOption(userBalance, userVotingPower, optionsList[1], getUserLastOptionOrUnit(userAddress, 1))) ++ getUserOption(userBalance, userVotingPower, optionsList[2], getUserLastOptionOrUnit(userAddress, 2))) ++ getUserOption(userBalance, userVotingPower, optionsList[3], getUserLastOptionOrUnit(userAddress, 3))) ++ getUserOption(userBalance, userVotingPower, optionsList[4], getUserLastOptionOrUnit(userAddress, 4))) | |
97 | + | else throw("Not supported") | |
98 | + | } | |
99 | + | ||
100 | + | ||
101 | + | @Callable(i) | |
102 | + | func constructor (availableOptions,votingAsset,startHeight,endHeight,quorumPercent) = { | |
103 | + | let payments = size(i.payments) | |
104 | + | let initialized = getBoolOrFalse(initializedKey) | |
105 | + | if ((i.caller != this)) | |
106 | + | then throw("Access denied") | |
107 | + | else if ((payments != 0)) | |
108 | + | then throw("Payments are prohibited") | |
109 | + | else if (!(validateOptions(availableOptions))) | |
110 | + | then throw("Options are not in valid format") | |
111 | + | else if (initialized) | |
112 | + | then throw("Already initialized") | |
113 | + | else if ((startHeight > endHeight)) | |
114 | + | then throw("Start height can't be larger than end height") | |
115 | + | else if (if ((1 > quorumPercent)) | |
116 | + | then true | |
117 | + | else (quorumPercent > 99)) | |
118 | + | then throw("Quorum percent should be in range [1, 99]") | |
119 | + | else { | |
120 | + | let votingAssetInfo = getAssetOrFail(votingAsset) | |
121 | + | let quorum = fraction(votingAssetInfo.quantity, quorumPercent, 100) | |
122 | + | [BooleanEntry(initializedKey, true), StringEntry(availableOptionsKey, availableOptions), StringEntry(votingAssetKey, votingAsset), IntegerEntry(startHeightKey, startHeight), IntegerEntry(endHeightKey, endHeight), IntegerEntry(totalKey, votingAssetInfo.quantity), IntegerEntry(quorumPercentKey, quorumPercent), IntegerEntry(quorumKey, quorum)] | |
123 | + | } | |
124 | + | } | |
125 | + | ||
126 | + | ||
127 | + | ||
128 | + | @Callable(i) | |
129 | + | func put () = { | |
130 | + | let payments = size(i.payments) | |
131 | + | let initialized = getBoolOrFalse(initializedKey) | |
132 | + | let payment = value(i.payments[0]) | |
133 | + | let votingAssetId = fromBase58String(getStringOrFail(votingAssetKey)) | |
134 | + | let startHeight = getIntOrFail(startHeightKey) | |
135 | + | let endHeight = getIntOrFail(endHeightKey) | |
136 | + | if ((i.caller == this)) | |
137 | + | then throw("Access denied") | |
138 | + | else if ((payments != 1)) | |
139 | + | then throw("Only one payment is allowed") | |
140 | + | else if (!(initialized)) | |
141 | + | then throw("Not initialized") | |
142 | + | else if ((payment.assetId != votingAssetId)) | |
143 | + | then throw("Wrong asset") | |
144 | + | else if ((startHeight > height)) | |
145 | + | then throw("Voting is not started") | |
146 | + | else if ((height > endHeight)) | |
147 | + | then throw("Voting is over") | |
148 | + | else { | |
149 | + | let userAddress = toString(i.caller) | |
150 | + | let currentUserBalance = getIntOrZero(userBalanceKey(userAddress)) | |
151 | + | let newUserBalance = (currentUserBalance + payment.amount) | |
152 | + | [IntegerEntry(userBalanceKey(userAddress), newUserBalance)] | |
153 | + | } | |
154 | + | } | |
155 | + | ||
156 | + | ||
157 | + | ||
158 | + | @Callable(i) | |
159 | + | func castVote (selectedOptions) = { | |
160 | + | let payments = size(i.payments) | |
161 | + | let initialized = getBoolOrFalse(initializedKey) | |
162 | + | let startHeight = getIntOrFail(startHeightKey) | |
163 | + | let endHeight = getIntOrFail(endHeightKey) | |
164 | + | let availableOptions = split(getStringOrFail(availableOptionsKey), ",") | |
165 | + | if ((i.caller == this)) | |
166 | + | then throw("Access denied") | |
167 | + | else if ((payments != 0)) | |
168 | + | then throw("Payments are prohibited") | |
169 | + | else if (!(initialized)) | |
170 | + | then throw("Not initialized") | |
171 | + | else if ((startHeight > height)) | |
172 | + | then throw("Voting is not started") | |
173 | + | else if ((height > endHeight)) | |
174 | + | then throw("Voting is over") | |
175 | + | else if (!(containsElement(availableOptions, selectedOptions))) | |
176 | + | then throw("Incorrect voting option") | |
177 | + | else { | |
178 | + | let userAddress = toString(i.caller) | |
179 | + | let currentUserVotingPower = getIntOrZero(userVotingPowerKey(userAddress)) | |
180 | + | let currentUserBalance = getIntOrZero(userBalanceKey(userAddress)) | |
181 | + | let voted = ((getIntOrZero(votedKey) + currentUserBalance) - currentUserVotingPower) | |
182 | + | let votingAssetInfo = getAssetOrFail(getStringOrFail(votingAssetKey)) | |
183 | + | let quorumPercent = getIntOrFail(quorumPercentKey) | |
184 | + | let quorum = fraction(votingAssetInfo.quantity, quorumPercent, 100) | |
185 | + | ([StringEntry(userLastVoteKey(userAddress), selectedOptions), IntegerEntry(userVotingPowerKey(userAddress), currentUserBalance), IntegerEntry(votedKey, voted), IntegerEntry(totalKey, votingAssetInfo.quantity), IntegerEntry(quorumKey, quorum)] ++ getUserOptions(userAddress, selectedOptions)) | |
186 | + | } | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | ||
191 | + | @Callable(i) | |
192 | + | func withdraw () = { | |
193 | + | let payments = size(i.payments) | |
194 | + | let initialized = getBoolOrFalse(initializedKey) | |
195 | + | let startHeight = getIntOrFail(startHeightKey) | |
196 | + | let endHeight = getIntOrFail(endHeightKey) | |
197 | + | if ((i.caller == this)) | |
198 | + | then throw("Access denied") | |
199 | + | else if ((payments != 0)) | |
200 | + | then throw("Payments are prohibited") | |
201 | + | else if (!(initialized)) | |
202 | + | then throw("Not initialized") | |
203 | + | else if ((startHeight > height)) | |
204 | + | then throw("Voting is not started") | |
205 | + | else if ((endHeight >= height)) | |
206 | + | then throw("Voting is not over") | |
207 | + | else { | |
208 | + | let userAddress = toString(i.caller) | |
209 | + | let userBalance = getIntOrFail(userBalanceKey(userAddress)) | |
210 | + | let votingAsset = fromBase58String(getStringOrFail(votingAssetKey)) | |
211 | + | [ScriptTransfer(i.caller, userBalance, votingAsset), DeleteEntry(userBalanceKey(userAddress))] | |
212 | + | } | |
213 | + | } | |
214 | + | ||
215 | + | ||
216 | + | @Verifier(tx) | |
217 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
218 | + |
github/deemru/w8io/026f985 23.22 ms ◑