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