tx · 9q1aqEZwcGtKrjvCYgSR24VDMucCCqvG8CRyAPAV4gdi 3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy: -0.14000000 Waves 2021.11.10 09:02 [1784531] smart account 3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy > SELF 0.00000000 Waves
{ "type": 13, "id": "9q1aqEZwcGtKrjvCYgSR24VDMucCCqvG8CRyAPAV4gdi", "fee": 14000000, "feeAssetId": null, "timestamp": 1636524173467, "version": 2, "chainId": 84, "sender": "3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy", "senderPublicKey": "9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq", "proofs": [ "2ks8ESLzx3nigLc8XBw6XYvrb3PRfVyNiBMuUd9CjiNUcPQfcRbfawWqAPfCxUXXeD1rNfRHdchhfgxaCKL3j4mD", "2YB9h6C9vTc1euvNXy6vHSaZS7JfVhtV4WFQf6wwnDF5Qmv16CTWs7xtAbcSLUSxm2jyEJGHWjkrjkTFHGaogDNy" ], "script": "base64:AAIFAAAAAAAAACkIAhIAEgQKAggIEgQKAgEBEgMKAQESAwoBARIAEgMKAQESABIAEgASAAAAAB4AAAAADGFkbWluUHViS2V5MQEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAADGFkbWluUHViS2V5MgEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAADGFkbWluUHViS2V5MwEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACB8WGt7UsWljWcca/SparQip5nE5Sy5e44NxDRBaM1QeAAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAACGtleUNhdXNlAgAAAA5zaHV0ZG93bl9jYXVzZQAAAAAMa2V5Vm90ZVN0YXJ0AgAAABF2b3RlX3N0YXJ0X2hlaWdodAAAAAAKa2V5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AAAGcHJvb2ZzAAAAAAAAAAABBQAAAAxhZG1pblB1YktleTIAAAAAAAAAAAEAAAAAAAAAAAAEAAAAEmFkbWluUHViS2V5M1NpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAAxhZG1pblB1YktleTMAAAAAAAAAAAEAAAAAAAAAAAAJAABnAAAAAgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAIT70M/", "height": 1784531, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EhJpCDTLCjqP38hYoxDQTegcF1ZzkwQekKcsvp64sVe2 Next: AhG99GKKe4byLuucnHXMsy2aQoyZamU7wZvkbgwqCjto Diff:
Old | New | Differences | |
---|---|---|---|
205 | 205 | else { | |
206 | 206 | let userENNOLocked = getUserENNOLocked(i.caller) | |
207 | 207 | let availableToWithdraw = (userENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted))) | |
208 | - | if (( | |
208 | + | if ((withdrawAmount > availableToWithdraw)) | |
209 | 209 | then throw("Your Enno is locked") | |
210 | 210 | else if ((0 >= withdrawAmount)) | |
211 | 211 | then throw("withdrawAmount <= 0") |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let adminPubKey1 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
5 | 5 | ||
6 | 6 | let adminPubKey2 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
7 | 7 | ||
8 | 8 | let adminPubKey3 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
9 | 9 | ||
10 | 10 | let adminPubKeyStartStop = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
11 | 11 | ||
12 | 12 | let keyActive = "active" | |
13 | 13 | ||
14 | 14 | let keyCause = "shutdown_cause" | |
15 | 15 | ||
16 | 16 | let keyVoteStart = "vote_start_height" | |
17 | 17 | ||
18 | 18 | let keyVoteEnd = "vote_end_height" | |
19 | 19 | ||
20 | 20 | let keyVoteYes = "yes_amount" | |
21 | 21 | ||
22 | 22 | let keyUserENNOVoted = "_ENNO_vote" | |
23 | 23 | ||
24 | 24 | let keyUserENNOVotedHeight = "_ENNO_vote_height" | |
25 | 25 | ||
26 | 26 | let keyUserENNOVotedValue = "_ENNO_vote_value" | |
27 | 27 | ||
28 | 28 | let keyUserENNOVotedYESValue = "_ENNO_vote_yes_share" | |
29 | 29 | ||
30 | 30 | let keyTotalYesVoted = "total_ENNO_vote_yes" | |
31 | 31 | ||
32 | 32 | let keyUserENNOLocked = "_ENNO_amount" | |
33 | 33 | ||
34 | 34 | let keyTotalENNOLocked = "total_ENNO_amount" | |
35 | 35 | ||
36 | 36 | let keyUserENNOClaimedAmount = "_ENNO_claimed_amount" | |
37 | 37 | ||
38 | 38 | let keyUserENNOLastClaimedAmount = "_ENNO_last_claimed_amount" | |
39 | 39 | ||
40 | 40 | let keyUserENNOLockedTag = "share_" | |
41 | 41 | ||
42 | 42 | let isActive = valueOrElse(getBoolean(this, keyActive), true) | |
43 | 43 | ||
44 | 44 | let shareData = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq' | |
45 | 45 | ||
46 | 46 | let ENNO = base58'6TmLfry3GRQoVSaesGSnp6NtZKveYgEopTLsjaGgXoso' | |
47 | 47 | ||
48 | 48 | func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)] | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func getUserENNOLocked (user) = valueOrElse(getInteger(this, (toString(user) + keyUserENNOLocked)), 0) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func getTotalENNOLocked () = valueOrElse(getInteger(this, keyTotalENNOLocked), 0) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | func getUserVoteData (user,key) = valueOrElse(getInteger(this, (toString(user) + key)), 0) | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | func getVal (key) = valueOrElse(getInteger(this, key), 0) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getCallerShare (caller) = { | |
64 | 64 | let callerShare = getInteger(addressFromPublicKey(shareData), (keyUserENNOLockedTag + toString(caller))) | |
65 | 65 | let callerShareAmount = match callerShare { | |
66 | 66 | case share: Int => | |
67 | 67 | share | |
68 | 68 | case share: Unit => | |
69 | 69 | throw("Only governance qualifiers can call this function.") | |
70 | 70 | case _ => | |
71 | 71 | throw("Match error") | |
72 | 72 | } | |
73 | 73 | callerShareAmount | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func getClaimedAmount (caller) = { | |
78 | 78 | let callerWithdrawn = getInteger(this, (toString(caller) + keyUserENNOClaimedAmount)) | |
79 | 79 | let callerWithdrawnAmount = match callerWithdrawn { | |
80 | 80 | case share: Int => | |
81 | 81 | share | |
82 | 82 | case share: Unit => | |
83 | 83 | 0 | |
84 | 84 | case _ => | |
85 | 85 | throw("Match error") | |
86 | 86 | } | |
87 | 87 | callerWithdrawnAmount | |
88 | 88 | } | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func setShare (amount) = { | |
92 | 92 | let deltaHeight = (getVal(keyVoteEnd) - height) | |
93 | 93 | let share = fraction(amount, deltaHeight, 100000000) | |
94 | 94 | share | |
95 | 95 | } | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | @Callable(i) | |
99 | 99 | func claimAirdrop () = if (!(isActive)) | |
100 | 100 | then throw("DApp is inactive at this moment") | |
101 | 101 | else { | |
102 | 102 | let share = getVal((toString(i.caller) + keyUserENNOVotedYESValue)) | |
103 | 103 | if ((0 >= share)) | |
104 | 104 | then throw("You already claimed or you have not participated.") | |
105 | 105 | else { | |
106 | 106 | let total = getVal(keyTotalYesVoted) | |
107 | 107 | let result = fraction(share, 100000000, total) | |
108 | 108 | [IntegerEntry((toString(i.caller) + "_airdrop"), result), DeleteEntry((toString(i.caller) + keyUserENNOVotedYESValue)), DeleteEntry((toString(i.caller) + keyUserENNOVoted))] | |
109 | 109 | } | |
110 | 110 | } | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | ||
114 | 114 | @Callable(i) | |
115 | 115 | func deleteEntry (address1,address2) = if (!(isActive)) | |
116 | 116 | then throw("DApp is inactive at this moment") | |
117 | 117 | else [DeleteEntry((address1 + "_airdrop")), DeleteEntry((address1 + keyUserENNOVotedYESValue)), DeleteEntry((address1 + keyUserENNOVoted)), DeleteEntry((address2 + "_airdrop")), DeleteEntry((address2 + keyUserENNOVotedYESValue)), DeleteEntry((address2 + keyUserENNOVoted))] | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | ||
121 | 121 | @Callable(i) | |
122 | 122 | func initVote (start,end) = if (!(isActive)) | |
123 | 123 | then throw("DApp is inactive at this moment") | |
124 | 124 | else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalYesVoted, 0)] | |
125 | 125 | ||
126 | 126 | ||
127 | 127 | ||
128 | 128 | @Callable(i) | |
129 | 129 | func unvote (voteAmount) = if (!(isActive)) | |
130 | 130 | then throw("DApp is inactive at this moment") | |
131 | 131 | else if ((getVal(keyVoteStart) > height)) | |
132 | 132 | then throw("Voting has not started yet.") | |
133 | 133 | else if ((height > getVal(keyVoteEnd))) | |
134 | 134 | then throw("Voting has already ended.") | |
135 | 135 | else { | |
136 | 136 | let totalYes = getVal(keyTotalYesVoted) | |
137 | 137 | let userVotedYes = getUserVoteData(i.caller, keyUserENNOVotedYESValue) | |
138 | 138 | let userENNOVoted = getUserVoteData(i.caller, keyUserENNOVoted) | |
139 | 139 | let userENNOVotedNew = (userENNOVoted - voteAmount) | |
140 | 140 | if ((0 > userENNOVotedNew)) | |
141 | 141 | then throw("Vote amount is less than available.") | |
142 | 142 | else { | |
143 | 143 | let userVoteValue = setShare(voteAmount) | |
144 | 144 | let userENNOVotedNewShare = (userVotedYes - userVoteValue) | |
145 | 145 | let newTotalYesVoted = (totalYes - userVoteValue) | |
146 | 146 | [IntegerEntry((toString(i.caller) + keyUserENNOVotedYESValue), userENNOVotedNewShare), IntegerEntry((toString(i.caller) + keyUserENNOVoted), userENNOVotedNew), IntegerEntry(keyTotalYesVoted, newTotalYesVoted)] | |
147 | 147 | } | |
148 | 148 | } | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | @Callable(i) | |
153 | 153 | func vote (voteAmount) = if (!(isActive)) | |
154 | 154 | then throw("DApp is inactive at this moment") | |
155 | 155 | else if ((getVal(keyVoteStart) > height)) | |
156 | 156 | then throw("Voting has not started yet.") | |
157 | 157 | else if ((height > getVal(keyVoteEnd))) | |
158 | 158 | then throw("Voting has already ended.") | |
159 | 159 | else { | |
160 | 160 | let totalYes = getVal(keyTotalYesVoted) | |
161 | 161 | let userVotedYes = getUserVoteData(i.caller, keyUserENNOVotedYESValue) | |
162 | 162 | let userENNOVoted = getUserVoteData(i.caller, keyUserENNOVoted) | |
163 | 163 | let userENNOLocked = getUserVoteData(i.caller, keyUserENNOLocked) | |
164 | 164 | let userENNOVotedNew = (userENNOVoted + voteAmount) | |
165 | 165 | if ((0 > userENNOVotedNew)) | |
166 | 166 | then throw("Vote amount is more than available.") | |
167 | 167 | else { | |
168 | 168 | let availableVote = (userENNOLocked - userENNOVoted) | |
169 | 169 | let userVoteValue = setShare(voteAmount) | |
170 | 170 | if ((voteAmount > availableVote)) | |
171 | 171 | then throw("Vote amount is more than available.") | |
172 | 172 | else { | |
173 | 173 | let userENNOVotedNewShare = (userVotedYes + userVoteValue) | |
174 | 174 | let newTotalYesVoted = (totalYes + userVoteValue) | |
175 | 175 | [IntegerEntry((toString(i.caller) + keyUserENNOVotedYESValue), userENNOVotedNewShare), IntegerEntry((toString(i.caller) + keyUserENNOVoted), userENNOVotedNew), IntegerEntry(keyTotalYesVoted, newTotalYesVoted)] | |
176 | 176 | } | |
177 | 177 | } | |
178 | 178 | } | |
179 | 179 | ||
180 | 180 | ||
181 | 181 | ||
182 | 182 | @Callable(i) | |
183 | 183 | func lockENNO () = if (!(isActive)) | |
184 | 184 | then throw("DApp is inactive at this moment") | |
185 | 185 | else { | |
186 | 186 | let $t065816656 = $Tuple2(i.payments[0].amount, i.payments[0].assetId) | |
187 | 187 | let pmtAmount = $t065816656._1 | |
188 | 188 | let pmtAssetId = $t065816656._2 | |
189 | 189 | if ((pmtAssetId != ENNO)) | |
190 | 190 | then throw("Incorrect payment assetId only Enno Cash is allowed.") | |
191 | 191 | else { | |
192 | 192 | let userENNOLocked = getUserENNOLocked(i.caller) | |
193 | 193 | let userENNOLockedNew = (userENNOLocked + pmtAmount) | |
194 | 194 | let totalENNOLocked = getTotalENNOLocked() | |
195 | 195 | let totalENNOLockedNew = (totalENNOLocked + pmtAmount) | |
196 | 196 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)] | |
197 | 197 | } | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | ||
202 | 202 | @Callable(i) | |
203 | 203 | func withdrawENNO (withdrawAmount) = if (!(isActive)) | |
204 | 204 | then throw("DApp is inactive at this moment") | |
205 | 205 | else { | |
206 | 206 | let userENNOLocked = getUserENNOLocked(i.caller) | |
207 | 207 | let availableToWithdraw = (userENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted))) | |
208 | - | if (( | |
208 | + | if ((withdrawAmount > availableToWithdraw)) | |
209 | 209 | then throw("Your Enno is locked") | |
210 | 210 | else if ((0 >= withdrawAmount)) | |
211 | 211 | then throw("withdrawAmount <= 0") | |
212 | 212 | else { | |
213 | 213 | let totalENNOLocked = getTotalENNOLocked() | |
214 | 214 | if ((withdrawAmount > totalENNOLocked)) | |
215 | 215 | then throw("withdrawAmount is more than available to withdraw") | |
216 | 216 | else if ((withdrawAmount > userENNOLocked)) | |
217 | 217 | then throw("You are trying to unstake more than you have staked.") | |
218 | 218 | else { | |
219 | 219 | let totalENNOLockedNew = (totalENNOLocked - withdrawAmount) | |
220 | 220 | let userENNOamountNew = (userENNOLocked - withdrawAmount) | |
221 | 221 | [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOamountNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew), ScriptTransfer(i.caller, withdrawAmount, ENNO)] | |
222 | 222 | } | |
223 | 223 | } | |
224 | 224 | } | |
225 | 225 | ||
226 | 226 | ||
227 | 227 | ||
228 | 228 | @Callable(i) | |
229 | 229 | func claimAndWithdrawENNO () = if (!(isActive)) | |
230 | 230 | then throw("DApp is inactive at this moment") | |
231 | 231 | else { | |
232 | 232 | let userShare = getCallerShare(i.originCaller) | |
233 | 233 | let userClaimedAmount = getClaimedAmount(i.originCaller) | |
234 | 234 | let claimAmount = (userShare - userClaimedAmount) | |
235 | 235 | let totalENNOLocked = getTotalENNOLocked() | |
236 | 236 | if ((claimAmount > totalENNOLocked)) | |
237 | 237 | then throw("claimAmount is more than available to withdraw") | |
238 | 238 | else if ((0 >= claimAmount)) | |
239 | 239 | then throw("Claim amount must be bigger than 0") | |
240 | 240 | else { | |
241 | 241 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
242 | 242 | [IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), ScriptTransfer(i.originCaller, claimAmount, ENNO)] | |
243 | 243 | } | |
244 | 244 | } | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | ||
248 | 248 | @Callable(i) | |
249 | 249 | func claimAndStakeENNO () = if (!(isActive)) | |
250 | 250 | then throw("DApp is inactive at this moment") | |
251 | 251 | else { | |
252 | 252 | let userShare = getCallerShare(i.originCaller) | |
253 | 253 | let userClaimedAmount = getClaimedAmount(i.originCaller) | |
254 | 254 | let claimAmount = (userShare - userClaimedAmount) | |
255 | 255 | if ((0 >= claimAmount)) | |
256 | 256 | then throw("Claim amount must be bigger than 0") | |
257 | 257 | else { | |
258 | 258 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
259 | 259 | let userENNOLocked = getUserENNOLocked(i.originCaller) | |
260 | 260 | let userENNOLockedNew = (userENNOLocked + claimAmount) | |
261 | 261 | let totalENNOLocked = getTotalENNOLocked() | |
262 | 262 | let totalENNOLockedNew = (totalENNOLocked + claimAmount) | |
263 | 263 | [IntegerEntry((toString(i.originCaller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)] | |
264 | 264 | } | |
265 | 265 | } | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | ||
269 | 269 | @Callable(i) | |
270 | 270 | func shutdown () = if (!(isActive)) | |
271 | 271 | then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified"))) | |
272 | 272 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
273 | 273 | then throw("Only admin can call this function") | |
274 | 274 | else suspend("Paused by admin") | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | ||
278 | 278 | @Callable(i) | |
279 | 279 | func activate () = if (isActive) | |
280 | 280 | then throw("DApp is already active") | |
281 | 281 | else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey))) | |
282 | 282 | then throw("Only admin can call this function") | |
283 | 283 | else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)] | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | @Verifier(tx) | |
287 | 287 | func verify () = { | |
288 | 288 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
289 | 289 | then 1 | |
290 | 290 | else 0 | |
291 | 291 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
292 | 292 | then 1 | |
293 | 293 | else 0 | |
294 | 294 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
295 | 295 | then 1 | |
296 | 296 | else 0 | |
297 | 297 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
298 | 298 | } | |
299 | 299 |
github/deemru/w8io/169f3d6 35.84 ms ◑