tx · Eq56WCGh3F9nBWG3GPZyzW4ZMkWDGdEu68J349QgDa5c 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.01600000 Waves 2024.02.28 10:34 [2995786] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "Eq56WCGh3F9nBWG3GPZyzW4ZMkWDGdEu68J349QgDa5c", "fee": 1600000, "feeAssetId": null, "timestamp": 1709105693689, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "42czbPAM5P5vZ7EHxdkMSJgT7WaF9PC8YpZp1qHb7EVRGX4VazgTWKDVJdBKJv2i99moNDvenyTYjRHnE8Up2CD6" ], "script": "base64:BgI/CAISAwoBARIDCgEEEgMKAQgSBAoCCAgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESABIDCgEINgAMY29udHJhY3RGaWxlAhFsMm1wX2xlYXNpbmcucmlkZQADU0VQAgJfXwEIdGhyb3dFcnIBA21zZwkAAgEJAKwCAgkArAICBQxjb250cmFjdEZpbGUCAjogBQNtc2cACmtleUFzc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAgdhc3NldElkBQNuaWwFA1NFUAAMa2V5Rm9yY2VTdG9wCQC5CQIJAMwIAgICJXMJAMwIAgIJZm9yY2VTdG9wBQNuaWwFA1NFUAARa2V5UGVyaW9kT2Zmc2V0SWQJALkJAgkAzAgCAgIlcwkAzAgCAghvZmZzZXRJZAUDbmlsBQNTRVAAFWtleVBlcmlvZE9mZnNldEhlaWdodAkAuQkCCQDMCAICAiVzCQDMCAICDG9mZnNldEhlaWdodAUDbmlsBQNTRVAAD2tleVBlcmlvZExlbmd0aAkAuQkCCQDMCAICAiVzCQDMCAICDHBlcmlvZExlbmd0aAUDbmlsBQNTRVAADnBlcmlvZE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sAgIFBHR4SWQCEyBpcyBhbHJlYWR5IGFsbG93ZWQFA25pbAMJAAACBQNlcnIFA2VycgkBDHZvdGVJTlRFUk5BTAQFE2NhbGxlckFkZHJlc3NTdHJpbmcFCWtleVByZWZpeAUGUVVPUlVNBQZyZXN1bHQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BAnR4AQZ2ZXJpZnkABAhieUFkbWlucwkAAAIIBQJ0eAJpZAkA2QQBCQELdmFsdWVPckVsc2UCCQCdCAIFBHRoaXMJAQ5rZXlBbGxvd2VkVHhJZAACAAQHYnlPd25lcgMJAGcCCQCQAwEJAQ1nZXRBZG1pbnNMaXN0AAUGUVVPUlVNBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleQMFCGJ5QWRtaW5zBgUHYnlPd25lctKcOwY=", "height": 2995786, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EfNQCoTHm9YAP7VzEjHtoExBcREZSCS4yEznwcr9z6pu Next: EC5cKbZcMw8SvPwc9G5Yaya3kyyGaF88bt4oEMT6zFiX Diff:
Old | New | Differences | |
---|---|---|---|
10 | 10 | ||
11 | 11 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
12 | 12 | ||
13 | - | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
14 | - | ||
15 | 13 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
16 | 14 | ||
17 | 15 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
19 | 17 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
20 | 18 | ||
21 | 19 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
22 | - | ||
23 | - | let keyMigrationPeriod = makeString(["%s", "migrationPeriod"], SEP) | |
24 | 20 | ||
25 | 21 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
26 | 22 | ||
34 | 30 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
35 | 31 | else max([0, (periodOffsetId - 1)]) | |
36 | 32 | ||
37 | - | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
33 | + | let currentPeriodHeight = if ((periodOffsetHeight == -1)) | |
34 | + | then 0 | |
35 | + | else (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
38 | 36 | ||
39 | - | let nextPeriodHeight = ( | |
40 | - | ||
41 | - | ||
37 | + | let nextPeriodHeight = if ((periodOffsetHeight == -1)) | |
38 | + | then 0 | |
39 | + | else (currentPeriodHeight + periodLength) | |
42 | 40 | ||
43 | 41 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
44 | 42 | ||
52 | 50 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
53 | 51 | ||
54 | 52 | ||
55 | - | func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP) | |
53 | + | func keyNodeLeasingByHeight (nodeAddress) = { | |
54 | + | let h = if ((periodOffsetHeight == -1)) | |
55 | + | then 0 | |
56 | + | else height | |
57 | + | makeString(["%s%d", nodeAddress, toString(h)], SEP) | |
58 | + | } | |
56 | 59 | ||
57 | 60 | ||
58 | - | func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP) | |
61 | + | func keyUserLeasingByHeight (nodeAddress,userAddress) = { | |
62 | + | let h = if ((periodOffsetHeight == -1)) | |
63 | + | then 0 | |
64 | + | else height | |
65 | + | makeString(["%s%s%d", nodeAddress, userAddress, toString(h)], SEP) | |
66 | + | } | |
59 | 67 | ||
60 | 68 | ||
61 | 69 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
64 | 72 | then unit | |
65 | 73 | else fromBase58String(assetIdString) | |
66 | 74 | ||
67 | - | let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP) | |
68 | - | ||
69 | 75 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
70 | - | ||
71 | - | func isAdmin (address) = containsElement(adminListRaw, address) | |
72 | - | ||
73 | 76 | ||
74 | 77 | func isValidAddress (address) = match addressFromString(address) { | |
75 | 78 | case a: Address => | |
77 | 80 | case _ => | |
78 | 81 | false | |
79 | 82 | } | |
83 | + | ||
84 | + | ||
85 | + | let ADMIN_LIST_SIZE = 5 | |
86 | + | ||
87 | + | let QUORUM = 3 | |
88 | + | ||
89 | + | let TXID_BYTES_LENGTH = 32 | |
90 | + | ||
91 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
92 | + | ||
93 | + | ||
94 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
95 | + | ||
96 | + | ||
97 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
98 | + | ||
99 | + | ||
100 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
101 | + | ||
102 | + | ||
103 | + | func getAdminVote (prefix,admin) = { | |
104 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
105 | + | valueOrElse(getInteger(voteKey), 0) | |
106 | + | } | |
107 | + | ||
108 | + | ||
109 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
110 | + | case s: String => | |
111 | + | split(s, SEP) | |
112 | + | case _ => | |
113 | + | nil | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
118 | + | ||
119 | + | ||
120 | + | func genVotesKeysHelper (a,adminAddress) = { | |
121 | + | let $t034483472 = a | |
122 | + | let result = $t034483472._1 | |
123 | + | let prefix = $t034483472._2 | |
124 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | func genVotesKeys (keyPrefix) = { | |
129 | + | let adminList = keyAdminAddressList() | |
130 | + | let $t036193703 = { | |
131 | + | let $l = getAdminsList() | |
132 | + | let $s = size($l) | |
133 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
134 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | + | then $a | |
136 | + | else genVotesKeysHelper($a, $l[$i]) | |
137 | + | ||
138 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | + | then $a | |
140 | + | else throw("List size exceeds 5") | |
141 | + | ||
142 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
143 | + | } | |
144 | + | let result = $t036193703._1 | |
145 | + | let prefix = $t036193703._2 | |
146 | + | result | |
147 | + | } | |
148 | + | ||
149 | + | ||
150 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
151 | + | ||
152 | + | ||
153 | + | func countVotes (prefix) = { | |
154 | + | let votes = genVotesKeys(prefix) | |
155 | + | let $l = votes | |
156 | + | let $s = size($l) | |
157 | + | let $acc0 = 0 | |
158 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
159 | + | then $a | |
160 | + | else countVotesHelper($a, $l[$i]) | |
161 | + | ||
162 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
163 | + | then $a | |
164 | + | else throw("List size exceeds 5") | |
165 | + | ||
166 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
167 | + | } | |
168 | + | ||
169 | + | ||
170 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
171 | + | ||
172 | + | ||
173 | + | func getClearVoteEntries (prefix) = { | |
174 | + | let votes = genVotesKeys(prefix) | |
175 | + | let $l = votes | |
176 | + | let $s = size($l) | |
177 | + | let $acc0 = nil | |
178 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
179 | + | then $a | |
180 | + | else clearVotesHelper($a, $l[$i]) | |
181 | + | ||
182 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
183 | + | then $a | |
184 | + | else throw("List size exceeds 5") | |
185 | + | ||
186 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
191 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
192 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
193 | + | let err = if (!(isInAdminList(callerAddressString))) | |
194 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
195 | + | else if ((adminCurrentVote == 1)) | |
196 | + | then throwErr((voteKey + " you already voted")) | |
197 | + | else unit | |
198 | + | if ((err == err)) | |
199 | + | then { | |
200 | + | let votes = countVotes(keyPrefix) | |
201 | + | if (((votes + 1) >= minVotes)) | |
202 | + | then { | |
203 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
204 | + | (clearVoteEntries ++ voteResult) | |
205 | + | } | |
206 | + | else [IntegerEntry(voteKey, 1)] | |
207 | + | } | |
208 | + | else throw("Strict value is not equal to itself.") | |
209 | + | } | |
80 | 210 | ||
81 | 211 | ||
82 | 212 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
96 | 226 | let nodeNextLeased = parseIntValue(dataList[4]) | |
97 | 227 | if (if ((nodeNextPeriod > height)) | |
98 | 228 | then true | |
99 | - | else if ((nodeNextPeriod == -1)) | |
100 | - | then (migrationPeriodHeight > height) | |
101 | - | else false) | |
229 | + | else (periodOffsetHeight == -1)) | |
102 | 230 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
103 | 231 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
104 | 232 | case _ => | |
124 | 252 | let userNextLeased = parseIntValue(dataList[4]) | |
125 | 253 | if (if ((userNextPeriod > height)) | |
126 | 254 | then true | |
127 | - | else if ((userNextPeriod == -1)) | |
128 | - | then (migrationPeriodHeight > height) | |
129 | - | else false) | |
255 | + | else (periodOffsetHeight == -1)) | |
130 | 256 | then $Tuple2(userCurrentLeased, userNextLeased) | |
131 | 257 | else $Tuple2(userNextLeased, userNextLeased) | |
132 | 258 | case _ => | |
150 | 276 | let toClaim = parseIntValue(dataList[2]) | |
151 | 277 | let nextPeriod = parseIntValue(dataList[3]) | |
152 | 278 | let toUnlock = parseIntValue(dataList[4]) | |
153 | - | if ((nextPeriod > height)) | |
279 | + | if (if ((nextPeriod > height)) | |
280 | + | then true | |
281 | + | else (periodOffsetHeight == -1)) | |
154 | 282 | then $Tuple2(toClaim, toUnlock) | |
155 | 283 | else $Tuple2((toClaim + toUnlock), 0) | |
156 | 284 | case _ => | |
166 | 294 | ||
167 | 295 | ||
168 | 296 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
169 | - | let $ | |
170 | - | let nodeCurrentLeased = $ | |
171 | - | let nodeNextLeased = $ | |
172 | - | let $ | |
173 | - | let userCurrentLeased = $ | |
174 | - | let userNextLeased = $ | |
297 | + | let $t087478820 = getLeasingNodeData(nodeAddress) | |
298 | + | let nodeCurrentLeased = $t087478820._1 | |
299 | + | let nodeNextLeased = $t087478820._2 | |
300 | + | let $t088258911 = getUserLeasingData(nodeAddress, userAddress) | |
301 | + | let userCurrentLeased = $t088258911._1 | |
302 | + | let userNextLeased = $t088258911._2 | |
175 | 303 | let checks = [if (!(isForceStop)) | |
176 | 304 | then true | |
177 | 305 | else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0)) | |
189 | 317 | then { | |
190 | 318 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
191 | 319 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
192 | - | let $ | |
193 | - | let toClaim = $ | |
194 | - | let toUnlock = $ | |
320 | + | let $t097249784 = getUserToClaimBalance(userAddress) | |
321 | + | let toClaim = $t097249784._1 | |
322 | + | let toUnlock = $t097249784._2 | |
195 | 323 | let newToUnlock = (toUnlock + unstakeAmount) | |
196 | 324 | let userTotalLocked = getUserTotalLocked(userAddress) | |
197 | 325 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
202 | 330 | ||
203 | 331 | ||
204 | 332 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
205 | - | let $ | |
206 | - | let toClaim = $ | |
207 | - | let toUnlock = $ | |
333 | + | let $t01051310573 = getUserToClaimBalance(userAddress) | |
334 | + | let toClaim = $t01051310573._1 | |
335 | + | let toUnlock = $t01051310573._2 | |
208 | 336 | let checks = [if (!(isForceStop)) | |
209 | 337 | then true | |
210 | 338 | else throwErr("contract is temporary stopped"), if ((claimAmount > 0)) | |
224 | 352 | ||
225 | 353 | ||
226 | 354 | func getStakeActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
227 | - | let $ | |
228 | - | let toClaim = $ | |
229 | - | let toUnlock = $ | |
355 | + | let $t01133411394 = getUserToClaimBalance(userAddress) | |
356 | + | let toClaim = $t01133411394._1 | |
357 | + | let toUnlock = $t01133411394._2 | |
230 | 358 | let paymentAmount = if ((size(i.payments) == 0)) | |
231 | 359 | then 0 | |
232 | 360 | else i.payments[0].amount | |
252 | 380 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
253 | 381 | if ((checks == checks)) | |
254 | 382 | then { | |
255 | - | let $ | |
256 | - | let nodeCurrentLeased = $ | |
257 | - | let nodeNextLeased = $ | |
383 | + | let $t01246512538 = getLeasingNodeData(nodeAddress) | |
384 | + | let nodeCurrentLeased = $t01246512538._1 | |
385 | + | let nodeNextLeased = $t01246512538._2 | |
258 | 386 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
259 | - | let $ | |
260 | - | let userCurrentLeased = $ | |
261 | - | let userNextLeased = $ | |
387 | + | let $t01260612692 = getUserLeasingData(nodeAddress, userAddress) | |
388 | + | let userCurrentLeased = $t01260612692._1 | |
389 | + | let userNextLeased = $t01260612692._2 | |
262 | 390 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
263 | 391 | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
264 | 392 | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
295 | 423 | ||
296 | 424 | @Callable(i) | |
297 | 425 | func setNewPeriodLength (newPeriodLength) = { | |
298 | - | let checks = [if ( | |
426 | + | let checks = [if (isInAdminList(toString(i.caller))) | |
299 | 427 | then true | |
300 | 428 | else throwErr("caller is not in adminList")] | |
301 | 429 | if ((checks == checks)) | |
307 | 435 | ||
308 | 436 | @Callable(i) | |
309 | 437 | func setForceStopFlag (stop) = { | |
310 | - | let check = [if ( | |
438 | + | let check = [if (isInAdminList(toString(i.caller))) | |
311 | 439 | then true | |
312 | - | else throwErr("caller is not | |
440 | + | else throwErr("caller is not in adminList")] | |
313 | 441 | if ((check == check)) | |
314 | 442 | then [BooleanEntry(keyForceStop, stop)] | |
315 | 443 | else throw("Strict value is not equal to itself.") | |
319 | 447 | ||
320 | 448 | @Callable(i) | |
321 | 449 | func getNodeDataREADONLY (nodeAddress) = { | |
322 | - | let $ | |
323 | - | let currentLease = $ | |
324 | - | let nextLeased = $ | |
450 | + | let $t01513515199 = getLeasingNodeData(nodeAddress) | |
451 | + | let currentLease = $t01513515199._1 | |
452 | + | let nextLeased = $t01513515199._2 | |
325 | 453 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
326 | 454 | } | |
327 | 455 | ||
329 | 457 | ||
330 | 458 | @Callable(i) | |
331 | 459 | func getUserLeasingDataREADONLY (nodeAddress,userAddress) = { | |
332 | - | let $ | |
333 | - | let currentLease = $ | |
334 | - | let nextLeased = $ | |
460 | + | let $t01556915646 = getUserLeasingData(nodeAddress, userAddress) | |
461 | + | let currentLease = $t01556915646._1 | |
462 | + | let nextLeased = $t01556915646._2 | |
335 | 463 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
336 | 464 | } | |
337 | 465 | ||
339 | 467 | ||
340 | 468 | @Callable(i) | |
341 | 469 | func getUserDataREADONLY (userAddress) = { | |
342 | - | let $ | |
343 | - | let toClaim = $ | |
344 | - | let toUnlock = $ | |
470 | + | let $t01600916069 = getUserToClaimBalance(userAddress) | |
471 | + | let toClaim = $t01600916069._1 | |
472 | + | let toUnlock = $t01600916069._2 | |
345 | 473 | let userTotalLocked = getUserTotalLocked(userAddress) | |
346 | 474 | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
347 | 475 | } | |
388 | 516 | @Callable(i) | |
389 | 517 | func claimAll () = { | |
390 | 518 | let userAddress = toString(i.caller) | |
391 | - | let $ | |
392 | - | let toClaim = $ | |
393 | - | let toUnlock = $ | |
519 | + | let $t01708317143 = getUserToClaimBalance(userAddress) | |
520 | + | let toClaim = $t01708317143._1 | |
521 | + | let toUnlock = $t01708317143._2 | |
394 | 522 | let checks = [if ((toClaim > 0)) | |
395 | 523 | then true | |
396 | 524 | else throwErr("nothing to claim")] | |
400 | 528 | } | |
401 | 529 | ||
402 | 530 | ||
531 | + | ||
532 | + | @Callable(i) | |
533 | + | func voteForTxId (txId) = { | |
534 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
535 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
536 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
537 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
538 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
539 | + | then true | |
540 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
541 | + | then true | |
542 | + | else (value(allowedTxIdOption) != txId)) | |
543 | + | then true | |
544 | + | else throwErr((txId + " is already allowed"))] | |
545 | + | if ((err == err)) | |
546 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
547 | + | else throw("Strict value is not equal to itself.") | |
548 | + | } | |
549 | + | ||
550 | + | ||
551 | + | @Verifier(tx) | |
552 | + | func verify () = { | |
553 | + | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
554 | + | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
555 | + | then false | |
556 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
557 | + | if (byAdmins) | |
558 | + | then true | |
559 | + | else byOwner | |
560 | + | } | |
561 | + |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "l2mp_leasing.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
12 | 12 | ||
13 | - | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
14 | - | ||
15 | 13 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
16 | 14 | ||
17 | 15 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
18 | 16 | ||
19 | 17 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
20 | 18 | ||
21 | 19 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
22 | - | ||
23 | - | let keyMigrationPeriod = makeString(["%s", "migrationPeriod"], SEP) | |
24 | 20 | ||
25 | 21 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
26 | 22 | ||
27 | 23 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
28 | 24 | ||
29 | 25 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
30 | 26 | ||
31 | 27 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
32 | 28 | then (periodOffsetHeight != -1) | |
33 | 29 | else false) | |
34 | 30 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
35 | 31 | else max([0, (periodOffsetId - 1)]) | |
36 | 32 | ||
37 | - | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
33 | + | let currentPeriodHeight = if ((periodOffsetHeight == -1)) | |
34 | + | then 0 | |
35 | + | else (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
38 | 36 | ||
39 | - | let nextPeriodHeight = ( | |
40 | - | ||
41 | - | ||
37 | + | let nextPeriodHeight = if ((periodOffsetHeight == -1)) | |
38 | + | then 0 | |
39 | + | else (currentPeriodHeight + periodLength) | |
42 | 40 | ||
43 | 41 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
44 | 42 | ||
45 | 43 | ||
46 | 44 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
47 | 45 | ||
48 | 46 | ||
49 | 47 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
50 | 48 | ||
51 | 49 | ||
52 | 50 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
53 | 51 | ||
54 | 52 | ||
55 | - | func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP) | |
53 | + | func keyNodeLeasingByHeight (nodeAddress) = { | |
54 | + | let h = if ((periodOffsetHeight == -1)) | |
55 | + | then 0 | |
56 | + | else height | |
57 | + | makeString(["%s%d", nodeAddress, toString(h)], SEP) | |
58 | + | } | |
56 | 59 | ||
57 | 60 | ||
58 | - | func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP) | |
61 | + | func keyUserLeasingByHeight (nodeAddress,userAddress) = { | |
62 | + | let h = if ((periodOffsetHeight == -1)) | |
63 | + | then 0 | |
64 | + | else height | |
65 | + | makeString(["%s%s%d", nodeAddress, userAddress, toString(h)], SEP) | |
66 | + | } | |
59 | 67 | ||
60 | 68 | ||
61 | 69 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
62 | 70 | ||
63 | 71 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
64 | 72 | then unit | |
65 | 73 | else fromBase58String(assetIdString) | |
66 | 74 | ||
67 | - | let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP) | |
68 | - | ||
69 | 75 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
70 | - | ||
71 | - | func isAdmin (address) = containsElement(adminListRaw, address) | |
72 | - | ||
73 | 76 | ||
74 | 77 | func isValidAddress (address) = match addressFromString(address) { | |
75 | 78 | case a: Address => | |
76 | 79 | true | |
77 | 80 | case _ => | |
78 | 81 | false | |
79 | 82 | } | |
83 | + | ||
84 | + | ||
85 | + | let ADMIN_LIST_SIZE = 5 | |
86 | + | ||
87 | + | let QUORUM = 3 | |
88 | + | ||
89 | + | let TXID_BYTES_LENGTH = 32 | |
90 | + | ||
91 | + | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
92 | + | ||
93 | + | ||
94 | + | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
95 | + | ||
96 | + | ||
97 | + | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
98 | + | ||
99 | + | ||
100 | + | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
101 | + | ||
102 | + | ||
103 | + | func getAdminVote (prefix,admin) = { | |
104 | + | let voteKey = keyFullAdminVote(prefix, admin) | |
105 | + | valueOrElse(getInteger(voteKey), 0) | |
106 | + | } | |
107 | + | ||
108 | + | ||
109 | + | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
110 | + | case s: String => | |
111 | + | split(s, SEP) | |
112 | + | case _ => | |
113 | + | nil | |
114 | + | } | |
115 | + | ||
116 | + | ||
117 | + | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
118 | + | ||
119 | + | ||
120 | + | func genVotesKeysHelper (a,adminAddress) = { | |
121 | + | let $t034483472 = a | |
122 | + | let result = $t034483472._1 | |
123 | + | let prefix = $t034483472._2 | |
124 | + | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
125 | + | } | |
126 | + | ||
127 | + | ||
128 | + | func genVotesKeys (keyPrefix) = { | |
129 | + | let adminList = keyAdminAddressList() | |
130 | + | let $t036193703 = { | |
131 | + | let $l = getAdminsList() | |
132 | + | let $s = size($l) | |
133 | + | let $acc0 = $Tuple2(nil, keyPrefix) | |
134 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
135 | + | then $a | |
136 | + | else genVotesKeysHelper($a, $l[$i]) | |
137 | + | ||
138 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
139 | + | then $a | |
140 | + | else throw("List size exceeds 5") | |
141 | + | ||
142 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
143 | + | } | |
144 | + | let result = $t036193703._1 | |
145 | + | let prefix = $t036193703._2 | |
146 | + | result | |
147 | + | } | |
148 | + | ||
149 | + | ||
150 | + | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
151 | + | ||
152 | + | ||
153 | + | func countVotes (prefix) = { | |
154 | + | let votes = genVotesKeys(prefix) | |
155 | + | let $l = votes | |
156 | + | let $s = size($l) | |
157 | + | let $acc0 = 0 | |
158 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
159 | + | then $a | |
160 | + | else countVotesHelper($a, $l[$i]) | |
161 | + | ||
162 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
163 | + | then $a | |
164 | + | else throw("List size exceeds 5") | |
165 | + | ||
166 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
167 | + | } | |
168 | + | ||
169 | + | ||
170 | + | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
171 | + | ||
172 | + | ||
173 | + | func getClearVoteEntries (prefix) = { | |
174 | + | let votes = genVotesKeys(prefix) | |
175 | + | let $l = votes | |
176 | + | let $s = size($l) | |
177 | + | let $acc0 = nil | |
178 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
179 | + | then $a | |
180 | + | else clearVotesHelper($a, $l[$i]) | |
181 | + | ||
182 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
183 | + | then $a | |
184 | + | else throw("List size exceeds 5") | |
185 | + | ||
186 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
191 | + | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
192 | + | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
193 | + | let err = if (!(isInAdminList(callerAddressString))) | |
194 | + | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
195 | + | else if ((adminCurrentVote == 1)) | |
196 | + | then throwErr((voteKey + " you already voted")) | |
197 | + | else unit | |
198 | + | if ((err == err)) | |
199 | + | then { | |
200 | + | let votes = countVotes(keyPrefix) | |
201 | + | if (((votes + 1) >= minVotes)) | |
202 | + | then { | |
203 | + | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
204 | + | (clearVoteEntries ++ voteResult) | |
205 | + | } | |
206 | + | else [IntegerEntry(voteKey, 1)] | |
207 | + | } | |
208 | + | else throw("Strict value is not equal to itself.") | |
209 | + | } | |
80 | 210 | ||
81 | 211 | ||
82 | 212 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
83 | 213 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
84 | 214 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
85 | 215 | } | |
86 | 216 | ||
87 | 217 | ||
88 | 218 | func getLeasingNodeData (nodeAddress) = { | |
89 | 219 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
90 | 220 | match leasingNodeDataStringRaw { | |
91 | 221 | case ds: String => | |
92 | 222 | let dataList = split(ds, SEP) | |
93 | 223 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
94 | 224 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
95 | 225 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
96 | 226 | let nodeNextLeased = parseIntValue(dataList[4]) | |
97 | 227 | if (if ((nodeNextPeriod > height)) | |
98 | 228 | then true | |
99 | - | else if ((nodeNextPeriod == -1)) | |
100 | - | then (migrationPeriodHeight > height) | |
101 | - | else false) | |
229 | + | else (periodOffsetHeight == -1)) | |
102 | 230 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
103 | 231 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
104 | 232 | case _ => | |
105 | 233 | $Tuple2(0, 0) | |
106 | 234 | } | |
107 | 235 | } | |
108 | 236 | ||
109 | 237 | ||
110 | 238 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
111 | 239 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
112 | 240 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
113 | 241 | } | |
114 | 242 | ||
115 | 243 | ||
116 | 244 | func getUserLeasingData (nodeAddress,userAddress) = { | |
117 | 245 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
118 | 246 | match leasingUserDataStringRaw { | |
119 | 247 | case ds: String => | |
120 | 248 | let dataList = split(ds, SEP) | |
121 | 249 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
122 | 250 | let userCurrentLeased = parseIntValue(dataList[2]) | |
123 | 251 | let userNextPeriod = parseIntValue(dataList[3]) | |
124 | 252 | let userNextLeased = parseIntValue(dataList[4]) | |
125 | 253 | if (if ((userNextPeriod > height)) | |
126 | 254 | then true | |
127 | - | else if ((userNextPeriod == -1)) | |
128 | - | then (migrationPeriodHeight > height) | |
129 | - | else false) | |
255 | + | else (periodOffsetHeight == -1)) | |
130 | 256 | then $Tuple2(userCurrentLeased, userNextLeased) | |
131 | 257 | else $Tuple2(userNextLeased, userNextLeased) | |
132 | 258 | case _ => | |
133 | 259 | $Tuple2(0, 0) | |
134 | 260 | } | |
135 | 261 | } | |
136 | 262 | ||
137 | 263 | ||
138 | 264 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
139 | 265 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
140 | 266 | StringEntry(keyUserToClaim(userAddress), valueString) | |
141 | 267 | } | |
142 | 268 | ||
143 | 269 | ||
144 | 270 | func getUserToClaimBalance (userAddress) = { | |
145 | 271 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
146 | 272 | match userToClaimDataStringRaw { | |
147 | 273 | case ds: String => | |
148 | 274 | let dataList = split(ds, SEP) | |
149 | 275 | let currentPeriod = parseIntValue(dataList[1]) | |
150 | 276 | let toClaim = parseIntValue(dataList[2]) | |
151 | 277 | let nextPeriod = parseIntValue(dataList[3]) | |
152 | 278 | let toUnlock = parseIntValue(dataList[4]) | |
153 | - | if ((nextPeriod > height)) | |
279 | + | if (if ((nextPeriod > height)) | |
280 | + | then true | |
281 | + | else (periodOffsetHeight == -1)) | |
154 | 282 | then $Tuple2(toClaim, toUnlock) | |
155 | 283 | else $Tuple2((toClaim + toUnlock), 0) | |
156 | 284 | case _ => | |
157 | 285 | $Tuple2(0, 0) | |
158 | 286 | } | |
159 | 287 | } | |
160 | 288 | ||
161 | 289 | ||
162 | 290 | func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked) | |
163 | 291 | ||
164 | 292 | ||
165 | 293 | func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0) | |
166 | 294 | ||
167 | 295 | ||
168 | 296 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
169 | - | let $ | |
170 | - | let nodeCurrentLeased = $ | |
171 | - | let nodeNextLeased = $ | |
172 | - | let $ | |
173 | - | let userCurrentLeased = $ | |
174 | - | let userNextLeased = $ | |
297 | + | let $t087478820 = getLeasingNodeData(nodeAddress) | |
298 | + | let nodeCurrentLeased = $t087478820._1 | |
299 | + | let nodeNextLeased = $t087478820._2 | |
300 | + | let $t088258911 = getUserLeasingData(nodeAddress, userAddress) | |
301 | + | let userCurrentLeased = $t088258911._1 | |
302 | + | let userNextLeased = $t088258911._2 | |
175 | 303 | let checks = [if (!(isForceStop)) | |
176 | 304 | then true | |
177 | 305 | else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0)) | |
178 | 306 | then true | |
179 | 307 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
180 | 308 | then true | |
181 | 309 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
182 | 310 | then true | |
183 | 311 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
184 | 312 | then true | |
185 | 313 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
186 | 314 | then true | |
187 | 315 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
188 | 316 | if ((checks == checks)) | |
189 | 317 | then { | |
190 | 318 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
191 | 319 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
192 | - | let $ | |
193 | - | let toClaim = $ | |
194 | - | let toUnlock = $ | |
320 | + | let $t097249784 = getUserToClaimBalance(userAddress) | |
321 | + | let toClaim = $t097249784._1 | |
322 | + | let toUnlock = $t097249784._2 | |
195 | 323 | let newToUnlock = (toUnlock + unstakeAmount) | |
196 | 324 | let userTotalLocked = getUserTotalLocked(userAddress) | |
197 | 325 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
198 | 326 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
199 | 327 | } | |
200 | 328 | else throw("Strict value is not equal to itself.") | |
201 | 329 | } | |
202 | 330 | ||
203 | 331 | ||
204 | 332 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
205 | - | let $ | |
206 | - | let toClaim = $ | |
207 | - | let toUnlock = $ | |
333 | + | let $t01051310573 = getUserToClaimBalance(userAddress) | |
334 | + | let toClaim = $t01051310573._1 | |
335 | + | let toUnlock = $t01051310573._2 | |
208 | 336 | let checks = [if (!(isForceStop)) | |
209 | 337 | then true | |
210 | 338 | else throwErr("contract is temporary stopped"), if ((claimAmount > 0)) | |
211 | 339 | then true | |
212 | 340 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
213 | 341 | then true | |
214 | 342 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
215 | 343 | then true | |
216 | 344 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
217 | 345 | if ((checks == checks)) | |
218 | 346 | then { | |
219 | 347 | let newToClaim = (toClaim - claimAmount) | |
220 | 348 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
221 | 349 | } | |
222 | 350 | else throw("Strict value is not equal to itself.") | |
223 | 351 | } | |
224 | 352 | ||
225 | 353 | ||
226 | 354 | func getStakeActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
227 | - | let $ | |
228 | - | let toClaim = $ | |
229 | - | let toUnlock = $ | |
355 | + | let $t01133411394 = getUserToClaimBalance(userAddress) | |
356 | + | let toClaim = $t01133411394._1 | |
357 | + | let toUnlock = $t01133411394._2 | |
230 | 358 | let paymentAmount = if ((size(i.payments) == 0)) | |
231 | 359 | then 0 | |
232 | 360 | else i.payments[0].amount | |
233 | 361 | let available = ((toUnlock + toClaim) + paymentAmount) | |
234 | 362 | let checks = [if (!(isForceStop)) | |
235 | 363 | then true | |
236 | 364 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
237 | 365 | then true | |
238 | 366 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
239 | 367 | then true | |
240 | 368 | else (i.payments[0].assetId == assetIdBytes)) | |
241 | 369 | then true | |
242 | 370 | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if ((userLeasingAmount > 0)) | |
243 | 371 | then true | |
244 | 372 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
245 | 373 | then true | |
246 | 374 | else throwErr("amount should be less or equal (payment + available) amount"), if ((userLeasingAmount >= paymentAmount)) | |
247 | 375 | then true | |
248 | 376 | else throw("amount should be greater or equal payment amount"), if (isValidAddress(nodeAddress)) | |
249 | 377 | then true | |
250 | 378 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
251 | 379 | then true | |
252 | 380 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
253 | 381 | if ((checks == checks)) | |
254 | 382 | then { | |
255 | - | let $ | |
256 | - | let nodeCurrentLeased = $ | |
257 | - | let nodeNextLeased = $ | |
383 | + | let $t01246512538 = getLeasingNodeData(nodeAddress) | |
384 | + | let nodeCurrentLeased = $t01246512538._1 | |
385 | + | let nodeNextLeased = $t01246512538._2 | |
258 | 386 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
259 | - | let $ | |
260 | - | let userCurrentLeased = $ | |
261 | - | let userNextLeased = $ | |
387 | + | let $t01260612692 = getUserLeasingData(nodeAddress, userAddress) | |
388 | + | let userCurrentLeased = $t01260612692._1 | |
389 | + | let userNextLeased = $t01260612692._2 | |
262 | 390 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
263 | 391 | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
264 | 392 | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
265 | 393 | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
266 | 394 | let userTotalLocked = getUserTotalLocked(userAddress) | |
267 | 395 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
268 | 396 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
269 | 397 | } | |
270 | 398 | else throw("Strict value is not equal to itself.") | |
271 | 399 | } | |
272 | 400 | ||
273 | 401 | ||
274 | 402 | func getStakeFromPaymentActions (nodeAddress,userAddress,i) = { | |
275 | 403 | let checks = [if ((size(i.payments) == 1)) | |
276 | 404 | then true | |
277 | 405 | else throwErr("payment size should be exactly 1")] | |
278 | 406 | if ((checks == checks)) | |
279 | 407 | then getStakeActions(nodeAddress, userAddress, i.payments[0].amount, i) | |
280 | 408 | else throw("Strict value is not equal to itself.") | |
281 | 409 | } | |
282 | 410 | ||
283 | 411 | ||
284 | 412 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
285 | 413 | let check = [if ((newPeriodLength > 0)) | |
286 | 414 | then true | |
287 | 415 | else throwErr("period length should be greater than 0")] | |
288 | 416 | if ((check == check)) | |
289 | 417 | then if ((periodOffsetHeight == -1)) | |
290 | 418 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
291 | 419 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
292 | 420 | else throw("Strict value is not equal to itself.") | |
293 | 421 | } | |
294 | 422 | ||
295 | 423 | ||
296 | 424 | @Callable(i) | |
297 | 425 | func setNewPeriodLength (newPeriodLength) = { | |
298 | - | let checks = [if ( | |
426 | + | let checks = [if (isInAdminList(toString(i.caller))) | |
299 | 427 | then true | |
300 | 428 | else throwErr("caller is not in adminList")] | |
301 | 429 | if ((checks == checks)) | |
302 | 430 | then getSetNewPeriodLengthActions(newPeriodLength) | |
303 | 431 | else throw("Strict value is not equal to itself.") | |
304 | 432 | } | |
305 | 433 | ||
306 | 434 | ||
307 | 435 | ||
308 | 436 | @Callable(i) | |
309 | 437 | func setForceStopFlag (stop) = { | |
310 | - | let check = [if ( | |
438 | + | let check = [if (isInAdminList(toString(i.caller))) | |
311 | 439 | then true | |
312 | - | else throwErr("caller is not | |
440 | + | else throwErr("caller is not in adminList")] | |
313 | 441 | if ((check == check)) | |
314 | 442 | then [BooleanEntry(keyForceStop, stop)] | |
315 | 443 | else throw("Strict value is not equal to itself.") | |
316 | 444 | } | |
317 | 445 | ||
318 | 446 | ||
319 | 447 | ||
320 | 448 | @Callable(i) | |
321 | 449 | func getNodeDataREADONLY (nodeAddress) = { | |
322 | - | let $ | |
323 | - | let currentLease = $ | |
324 | - | let nextLeased = $ | |
450 | + | let $t01513515199 = getLeasingNodeData(nodeAddress) | |
451 | + | let currentLease = $t01513515199._1 | |
452 | + | let nextLeased = $t01513515199._2 | |
325 | 453 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
326 | 454 | } | |
327 | 455 | ||
328 | 456 | ||
329 | 457 | ||
330 | 458 | @Callable(i) | |
331 | 459 | func getUserLeasingDataREADONLY (nodeAddress,userAddress) = { | |
332 | - | let $ | |
333 | - | let currentLease = $ | |
334 | - | let nextLeased = $ | |
460 | + | let $t01556915646 = getUserLeasingData(nodeAddress, userAddress) | |
461 | + | let currentLease = $t01556915646._1 | |
462 | + | let nextLeased = $t01556915646._2 | |
335 | 463 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
336 | 464 | } | |
337 | 465 | ||
338 | 466 | ||
339 | 467 | ||
340 | 468 | @Callable(i) | |
341 | 469 | func getUserDataREADONLY (userAddress) = { | |
342 | - | let $ | |
343 | - | let toClaim = $ | |
344 | - | let toUnlock = $ | |
470 | + | let $t01600916069 = getUserToClaimBalance(userAddress) | |
471 | + | let toClaim = $t01600916069._1 | |
472 | + | let toUnlock = $t01600916069._2 | |
345 | 473 | let userTotalLocked = getUserTotalLocked(userAddress) | |
346 | 474 | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
347 | 475 | } | |
348 | 476 | ||
349 | 477 | ||
350 | 478 | ||
351 | 479 | @Callable(i) | |
352 | 480 | func leaseByAddress (nodeAddress,userAddress) = getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
353 | 481 | ||
354 | 482 | ||
355 | 483 | ||
356 | 484 | @Callable(i) | |
357 | 485 | func lease (nodeAddress) = { | |
358 | 486 | let userAddress = toString(i.caller) | |
359 | 487 | getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
360 | 488 | } | |
361 | 489 | ||
362 | 490 | ||
363 | 491 | ||
364 | 492 | @Callable(i) | |
365 | 493 | func leaseFromLocked (nodeAddress,amount) = { | |
366 | 494 | let userAddress = toString(i.caller) | |
367 | 495 | getStakeActions(nodeAddress, userAddress, amount, i) | |
368 | 496 | } | |
369 | 497 | ||
370 | 498 | ||
371 | 499 | ||
372 | 500 | @Callable(i) | |
373 | 501 | func cancelLease (nodeAddress,amount) = { | |
374 | 502 | let userAddress = toString(i.caller) | |
375 | 503 | getUnstakeActions(nodeAddress, userAddress, amount) | |
376 | 504 | } | |
377 | 505 | ||
378 | 506 | ||
379 | 507 | ||
380 | 508 | @Callable(i) | |
381 | 509 | func claim (amount) = { | |
382 | 510 | let userAddress = toString(i.caller) | |
383 | 511 | getClaimUnlockedActions(userAddress, amount) | |
384 | 512 | } | |
385 | 513 | ||
386 | 514 | ||
387 | 515 | ||
388 | 516 | @Callable(i) | |
389 | 517 | func claimAll () = { | |
390 | 518 | let userAddress = toString(i.caller) | |
391 | - | let $ | |
392 | - | let toClaim = $ | |
393 | - | let toUnlock = $ | |
519 | + | let $t01708317143 = getUserToClaimBalance(userAddress) | |
520 | + | let toClaim = $t01708317143._1 | |
521 | + | let toUnlock = $t01708317143._2 | |
394 | 522 | let checks = [if ((toClaim > 0)) | |
395 | 523 | then true | |
396 | 524 | else throwErr("nothing to claim")] | |
397 | 525 | if ((checks == checks)) | |
398 | 526 | then getClaimUnlockedActions(userAddress, toClaim) | |
399 | 527 | else throw("Strict value is not equal to itself.") | |
400 | 528 | } | |
401 | 529 | ||
402 | 530 | ||
531 | + | ||
532 | + | @Callable(i) | |
533 | + | func voteForTxId (txId) = { | |
534 | + | let callerAddressString = toBase58String(i.caller.bytes) | |
535 | + | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
536 | + | let result = [StringEntry(keyAllowedTxId(), txId)] | |
537 | + | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
538 | + | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
539 | + | then true | |
540 | + | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
541 | + | then true | |
542 | + | else (value(allowedTxIdOption) != txId)) | |
543 | + | then true | |
544 | + | else throwErr((txId + " is already allowed"))] | |
545 | + | if ((err == err)) | |
546 | + | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
547 | + | else throw("Strict value is not equal to itself.") | |
548 | + | } | |
549 | + | ||
550 | + | ||
551 | + | @Verifier(tx) | |
552 | + | func verify () = { | |
553 | + | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
554 | + | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
555 | + | then false | |
556 | + | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
557 | + | if (byAdmins) | |
558 | + | then true | |
559 | + | else byOwner | |
560 | + | } | |
561 | + |
github/deemru/w8io/026f985 100.47 ms ◑