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