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