tx · 2LWdK7r7uoez56TT8bc4tiDad1gybJAZASphcLrmif9g

3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy:  -0.14000000 Waves

2021.11.10 08:56 [1784526] smart account 3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy > SELF 0.00000000 Waves

{ "type": 13, "id": "2LWdK7r7uoez56TT8bc4tiDad1gybJAZASphcLrmif9g", "fee": 14000000, "feeAssetId": null, "timestamp": 1636523758722, "version": 2, "chainId": 84, "sender": "3N4LqYvK8toVfW83bVrzvm4VoA55PB21Bmy", "senderPublicKey": "9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq", "proofs": [ "2vMm1cwZFFGJBZdNHnzkQTqydMvhL2ZjgDHdSZnrGrWhQiHoRANqkSRZbJW9CEUhgg9oS5cfqSKF2NtcAMq8HL9Q", "uE1MvtNGtWGNVACW54t5eYDHfMx95Qax5m1U3CbcqP7TKokxJ2YMHQ7mAMTvjiCXRhT1o78mnjpPVLcyyNLLgZ2" ], "script": "base64:AAIFAAAAAAAAACkIAhIAEgQKAggIEgQKAgEBEgMKAQESAwoBARIAEgMKAQESABIAEgASAAAAAB4AAAAADGFkbWluUHViS2V5MQEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAADGFkbWluUHViS2V5MgEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAADGFkbWluUHViS2V5MwEAAAAgfFhre1LFpY1nHGv0qWq0IqeZxOUsuXuODcQ0QWjNUHgAAAAAFGFkbWluUHViS2V5U3RhcnRTdG9wAQAAACB8WGt7UsWljWcca/SparQip5nE5Sy5e44NxDRBaM1QeAAAAAAJa2V5QWN0aXZlAgAAAAZhY3RpdmUAAAAACGtleUNhdXNlAgAAAA5zaHV0ZG93bl9jYXVzZQAAAAAMa2V5Vm90ZVN0YXJ0AgAAABF2b3RlX3N0YXJ0X2hlaWdodAAAAAAKa2V5Vm90ZUV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FkbWluUHViS2V5MQAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkyU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAEFAAAADGFkbWluUHViS2V5MgAAAAAAAAAAAQAAAAAAAAAAAAQAAAASYWRtaW5QdWJLZXkzU2lnbmVkAwkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAIFAAAADGFkbWluUHViS2V5MwAAAAAAAAAAAQAAAAAAAAAAAAkAAGcAAAACCQAAZAAAAAIJAABkAAAAAgUAAAASYWRtaW5QdWJLZXkxU2lnbmVkBQAAABJhZG1pblB1YktleTJTaWduZWQFAAAAEmFkbWluUHViS2V5M1NpZ25lZAAAAAAAAAAAAn7mjGM=", "height": 1784526, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B1B6KvePp4gbFQBM4KBaSwhkGzWJxfY2S4jLNApuCrqQ Next: EhJpCDTLCjqP38hYoxDQTegcF1ZzkwQekKcsvp64sVe2 Diff:
OldNewDifferences
203203 func withdrawENNO (withdrawAmount) = if (!(isActive))
204204 then throw("DApp is inactive at this moment")
205205 else {
206- let totalENNOLocked = getTotalENNOLocked()
207- let availableToWithdraw = (totalENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted)))
206+ let userENNOLocked = getUserENNOLocked(i.caller)
207+ let availableToWithdraw = (userENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted)))
208208 let finalWithdrawAmount = (availableToWithdraw - withdrawAmount)
209209 if ((0 >= finalWithdrawAmount))
210210 then throw("Your Enno is locked")
211211 else if ((0 >= finalWithdrawAmount))
212212 then throw("withdrawAmount <= 0")
213213 else {
214- let userENNOLocked = getUserENNOLocked(i.caller)
214+ let totalENNOLocked = getTotalENNOLocked()
215215 if ((finalWithdrawAmount > totalENNOLocked))
216216 then throw("withdrawAmount is more than available to withdraw")
217217 else if ((finalWithdrawAmount > userENNOLocked))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminPubKey1 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq'
55
66 let adminPubKey2 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq'
77
88 let adminPubKey3 = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq'
99
1010 let adminPubKeyStartStop = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq'
1111
1212 let keyActive = "active"
1313
1414 let keyCause = "shutdown_cause"
1515
1616 let keyVoteStart = "vote_start_height"
1717
1818 let keyVoteEnd = "vote_end_height"
1919
2020 let keyVoteYes = "yes_amount"
2121
2222 let keyUserENNOVoted = "_ENNO_vote"
2323
2424 let keyUserENNOVotedHeight = "_ENNO_vote_height"
2525
2626 let keyUserENNOVotedValue = "_ENNO_vote_value"
2727
2828 let keyUserENNOVotedYESValue = "_ENNO_vote_yes_share"
2929
3030 let keyTotalYesVoted = "total_ENNO_vote_yes"
3131
3232 let keyUserENNOLocked = "_ENNO_amount"
3333
3434 let keyTotalENNOLocked = "total_ENNO_amount"
3535
3636 let keyUserENNOClaimedAmount = "_ENNO_claimed_amount"
3737
3838 let keyUserENNOLastClaimedAmount = "_ENNO_last_claimed_amount"
3939
4040 let keyUserENNOLockedTag = "share_"
4141
4242 let isActive = valueOrElse(getBoolean(this, keyActive), true)
4343
4444 let shareData = base58'9NPkhjF6pssidKGhnMzHn9auzo5q5fPBaabRQBx7CaFq'
4545
4646 let ENNO = base58'6TmLfry3GRQoVSaesGSnp6NtZKveYgEopTLsjaGgXoso'
4747
4848 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
4949
5050
5151 func getUserENNOLocked (user) = valueOrElse(getInteger(this, (toString(user) + keyUserENNOLocked)), 0)
5252
5353
5454 func getTotalENNOLocked () = valueOrElse(getInteger(this, keyTotalENNOLocked), 0)
5555
5656
5757 func getUserVoteData (user,key) = valueOrElse(getInteger(this, (toString(user) + key)), 0)
5858
5959
6060 func getVal (key) = valueOrElse(getInteger(this, key), 0)
6161
6262
6363 func getCallerShare (caller) = {
6464 let callerShare = getInteger(addressFromPublicKey(shareData), (keyUserENNOLockedTag + toString(caller)))
6565 let callerShareAmount = match callerShare {
6666 case share: Int =>
6767 share
6868 case share: Unit =>
6969 throw("Only governance qualifiers can call this function.")
7070 case _ =>
7171 throw("Match error")
7272 }
7373 callerShareAmount
7474 }
7575
7676
7777 func getClaimedAmount (caller) = {
7878 let callerWithdrawn = getInteger(this, (toString(caller) + keyUserENNOClaimedAmount))
7979 let callerWithdrawnAmount = match callerWithdrawn {
8080 case share: Int =>
8181 share
8282 case share: Unit =>
8383 0
8484 case _ =>
8585 throw("Match error")
8686 }
8787 callerWithdrawnAmount
8888 }
8989
9090
9191 func setShare (amount) = {
9292 let deltaHeight = (getVal(keyVoteEnd) - height)
9393 let share = fraction(amount, deltaHeight, 100000000)
9494 share
9595 }
9696
9797
9898 @Callable(i)
9999 func claimAirdrop () = if (!(isActive))
100100 then throw("DApp is inactive at this moment")
101101 else {
102102 let share = getVal((toString(i.caller) + keyUserENNOVotedYESValue))
103103 if ((0 >= share))
104104 then throw("You already claimed or you have not participated.")
105105 else {
106106 let total = getVal(keyTotalYesVoted)
107107 let result = fraction(share, 100000000, total)
108108 [IntegerEntry((toString(i.caller) + "_airdrop"), result), DeleteEntry((toString(i.caller) + keyUserENNOVotedYESValue)), DeleteEntry((toString(i.caller) + keyUserENNOVoted))]
109109 }
110110 }
111111
112112
113113
114114 @Callable(i)
115115 func deleteEntry (address1,address2) = if (!(isActive))
116116 then throw("DApp is inactive at this moment")
117117 else [DeleteEntry((address1 + "_airdrop")), DeleteEntry((address1 + keyUserENNOVotedYESValue)), DeleteEntry((address1 + keyUserENNOVoted)), DeleteEntry((address2 + "_airdrop")), DeleteEntry((address2 + keyUserENNOVotedYESValue)), DeleteEntry((address2 + keyUserENNOVoted))]
118118
119119
120120
121121 @Callable(i)
122122 func initVote (start,end) = if (!(isActive))
123123 then throw("DApp is inactive at this moment")
124124 else [IntegerEntry(keyVoteStart, start), IntegerEntry(keyVoteEnd, end), IntegerEntry(keyTotalYesVoted, 0)]
125125
126126
127127
128128 @Callable(i)
129129 func unvote (voteAmount) = if (!(isActive))
130130 then throw("DApp is inactive at this moment")
131131 else if ((getVal(keyVoteStart) > height))
132132 then throw("Voting has not started yet.")
133133 else if ((height > getVal(keyVoteEnd)))
134134 then throw("Voting has already ended.")
135135 else {
136136 let totalYes = getVal(keyTotalYesVoted)
137137 let userVotedYes = getUserVoteData(i.caller, keyUserENNOVotedYESValue)
138138 let userENNOVoted = getUserVoteData(i.caller, keyUserENNOVoted)
139139 let userENNOVotedNew = (userENNOVoted - voteAmount)
140140 if ((0 > userENNOVotedNew))
141141 then throw("Vote amount is less than available.")
142142 else {
143143 let userVoteValue = setShare(voteAmount)
144144 let userENNOVotedNewShare = (userVotedYes - userVoteValue)
145145 let newTotalYesVoted = (totalYes - userVoteValue)
146146 [IntegerEntry((toString(i.caller) + keyUserENNOVotedYESValue), userENNOVotedNewShare), IntegerEntry((toString(i.caller) + keyUserENNOVoted), userENNOVotedNew), IntegerEntry(keyTotalYesVoted, newTotalYesVoted)]
147147 }
148148 }
149149
150150
151151
152152 @Callable(i)
153153 func vote (voteAmount) = if (!(isActive))
154154 then throw("DApp is inactive at this moment")
155155 else if ((getVal(keyVoteStart) > height))
156156 then throw("Voting has not started yet.")
157157 else if ((height > getVal(keyVoteEnd)))
158158 then throw("Voting has already ended.")
159159 else {
160160 let totalYes = getVal(keyTotalYesVoted)
161161 let userVotedYes = getUserVoteData(i.caller, keyUserENNOVotedYESValue)
162162 let userENNOVoted = getUserVoteData(i.caller, keyUserENNOVoted)
163163 let userENNOLocked = getUserVoteData(i.caller, keyUserENNOLocked)
164164 let userENNOVotedNew = (userENNOVoted + voteAmount)
165165 if ((0 > userENNOVotedNew))
166166 then throw("Vote amount is more than available.")
167167 else {
168168 let availableVote = (userENNOLocked - userENNOVoted)
169169 let userVoteValue = setShare(voteAmount)
170170 if ((voteAmount > availableVote))
171171 then throw("Vote amount is more than available.")
172172 else {
173173 let userENNOVotedNewShare = (userVotedYes + userVoteValue)
174174 let newTotalYesVoted = (totalYes + userVoteValue)
175175 [IntegerEntry((toString(i.caller) + keyUserENNOVotedYESValue), userENNOVotedNewShare), IntegerEntry((toString(i.caller) + keyUserENNOVoted), userENNOVotedNew), IntegerEntry(keyTotalYesVoted, newTotalYesVoted)]
176176 }
177177 }
178178 }
179179
180180
181181
182182 @Callable(i)
183183 func lockENNO () = if (!(isActive))
184184 then throw("DApp is inactive at this moment")
185185 else {
186186 let $t065816656 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
187187 let pmtAmount = $t065816656._1
188188 let pmtAssetId = $t065816656._2
189189 if ((pmtAssetId != ENNO))
190190 then throw("Incorrect payment assetId only Enno Cash is allowed.")
191191 else {
192192 let userENNOLocked = getUserENNOLocked(i.caller)
193193 let userENNOLockedNew = (userENNOLocked + pmtAmount)
194194 let totalENNOLocked = getTotalENNOLocked()
195195 let totalENNOLockedNew = (totalENNOLocked + pmtAmount)
196196 [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)]
197197 }
198198 }
199199
200200
201201
202202 @Callable(i)
203203 func withdrawENNO (withdrawAmount) = if (!(isActive))
204204 then throw("DApp is inactive at this moment")
205205 else {
206- let totalENNOLocked = getTotalENNOLocked()
207- let availableToWithdraw = (totalENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted)))
206+ let userENNOLocked = getUserENNOLocked(i.caller)
207+ let availableToWithdraw = (userENNOLocked - getVal((toString(i.caller) + keyUserENNOVoted)))
208208 let finalWithdrawAmount = (availableToWithdraw - withdrawAmount)
209209 if ((0 >= finalWithdrawAmount))
210210 then throw("Your Enno is locked")
211211 else if ((0 >= finalWithdrawAmount))
212212 then throw("withdrawAmount <= 0")
213213 else {
214- let userENNOLocked = getUserENNOLocked(i.caller)
214+ let totalENNOLocked = getTotalENNOLocked()
215215 if ((finalWithdrawAmount > totalENNOLocked))
216216 then throw("withdrawAmount is more than available to withdraw")
217217 else if ((finalWithdrawAmount > userENNOLocked))
218218 then throw("You are trying to unstake more than you have staked.")
219219 else {
220220 let totalENNOLockedNew = (totalENNOLocked - finalWithdrawAmount)
221221 let userENNOamountNew = (userENNOLocked - finalWithdrawAmount)
222222 [IntegerEntry((toString(i.caller) + keyUserENNOLocked), userENNOamountNew), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew), ScriptTransfer(i.caller, finalWithdrawAmount, ENNO)]
223223 }
224224 }
225225 }
226226
227227
228228
229229 @Callable(i)
230230 func claimAndWithdrawENNO () = if (!(isActive))
231231 then throw("DApp is inactive at this moment")
232232 else {
233233 let userShare = getCallerShare(i.originCaller)
234234 let userClaimedAmount = getClaimedAmount(i.originCaller)
235235 let claimAmount = (userShare - userClaimedAmount)
236236 let totalENNOLocked = getTotalENNOLocked()
237237 if ((claimAmount > totalENNOLocked))
238238 then throw("claimAmount is more than available to withdraw")
239239 else if ((0 >= claimAmount))
240240 then throw("Claim amount must be bigger than 0")
241241 else {
242242 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
243243 [IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), ScriptTransfer(i.originCaller, claimAmount, ENNO)]
244244 }
245245 }
246246
247247
248248
249249 @Callable(i)
250250 func claimAndStakeENNO () = if (!(isActive))
251251 then throw("DApp is inactive at this moment")
252252 else {
253253 let userShare = getCallerShare(i.originCaller)
254254 let userClaimedAmount = getClaimedAmount(i.originCaller)
255255 let claimAmount = (userShare - userClaimedAmount)
256256 if ((0 >= claimAmount))
257257 then throw("Claim amount must be bigger than 0")
258258 else {
259259 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
260260 let userENNOLocked = getUserENNOLocked(i.originCaller)
261261 let userENNOLockedNew = (userENNOLocked + claimAmount)
262262 let totalENNOLocked = getTotalENNOLocked()
263263 let totalENNOLockedNew = (totalENNOLocked + claimAmount)
264264 [IntegerEntry((toString(i.originCaller) + keyUserENNOLocked), userENNOLockedNew), IntegerEntry((toString(i.originCaller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.originCaller) + keyUserENNOLastClaimedAmount), claimAmount), IntegerEntry(keyTotalENNOLocked, totalENNOLockedNew)]
265265 }
266266 }
267267
268268
269269
270270 @Callable(i)
271271 func shutdown () = if (!(isActive))
272272 then throw(("DApp is already suspended. Cause: " + valueOrElse(getString(this, keyCause), "the cause wasn't specified")))
273273 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey)))
274274 then throw("Only admin can call this function")
275275 else suspend("Paused by admin")
276276
277277
278278
279279 @Callable(i)
280280 func activate () = if (isActive)
281281 then throw("DApp is already active")
282282 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStartStop], i.callerPublicKey)))
283283 then throw("Only admin can call this function")
284284 else [BooleanEntry(keyActive, true), DeleteEntry(keyCause)]
285285
286286
287287 @Verifier(tx)
288288 func verify () = {
289289 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
290290 then 1
291291 else 0
292292 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
293293 then 1
294294 else 0
295295 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
296296 then 1
297297 else 0
298298 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
299299 }
300300

github/deemru/w8io/169f3d6 
46.26 ms