tx · 9zGTEQEbiEoghPBeaxnVGUGK299DNztiy5Zypb4YWedX 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.02700000 Waves 2024.10.21 16:13 [3336653] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "9zGTEQEbiEoghPBeaxnVGUGK299DNztiy5Zypb4YWedX", "fee": 2700000, "feeAssetId": null, "timestamp": 1729516427103, "version": 1, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "oFawzsUFeE5hqtEz2aSjk2KJT4CiR8EhScsoESW7nDqQtj96FVDynrhwNTpv7ko4wLjgd61PvvD8HPCZMdGv4Zg" ], "script": "base64:BgJQCAISAwoBARIAEgMKAQQSAwoBBBIDCgEIEgQKAggIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgASAwoBCBIDCgEBEgMKAQhOAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fABJCTE9DS1NfSU5fSU5URVJWQUwA6AcABnNjYWxlOACAwtcvAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAMa2V5TDJBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAD2tleUZvcmNlT3V0U3RvcAkAuQkCCQDMCAICAiVzCQDMCAICDGZvcmNlT3V0U3RvcAUDbmlsBQNTRVAAD2tleVVuaXRzQXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICDHVuaXRzQXNzZXRJZAUDbmlsBQNTRVAAFmtleVVuaXRzUGVyQmxvY2tTY2FsZTgJALkJ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qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5AwUIYnlBZG1pbnMGBQdieU93bmVyJr41Aw==", "chainId": 84, "height": 3336653, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DQwoQdAjHDhhiD7S1vW8Jg5vBr9tEH4dgB6gJCgJxc2M Next: 4mfmucrfLYY4DZbuAa3tZvDYz9f5Gsj1dzz1boPzd6bF Diff:
Old | New | Differences | |
---|---|---|---|
360 | 360 | let amountStaked = getUserTotalLocked(userAddress) | |
361 | 361 | let l2ToBurn = fraction(amountStaked, blocksPassed, unitsClaimInterval) | |
362 | 362 | let unitsToClaimNow = fraction(l2ToBurn, unitsPerBlockScale8, (scale8 * scale8)) | |
363 | - | $Tuple3(unitsToClaimNow, l2ToBurn, | |
363 | + | $Tuple3(unitsToClaimNow, l2ToBurn, currentBlock) | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
372 | 372 | let $t01132911414 = calculateUnitsToClaim(userAddress) | |
373 | 373 | let unitsToClaimNow = $t01132911414._1 | |
374 | 374 | let l2ToBurnNow = $t01132911414._2 | |
375 | - | let | |
375 | + | let currentBlock = $t01132911414._3 | |
376 | 376 | if ((0 >= unitsToClaimNow)) | |
377 | 377 | then nil | |
378 | - | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), | |
378 | + | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), currentBlock), IntegerEntry(kL2ToBurn, (l2ToBurn + l2ToBurnNow)), IntegerEntry(kUnlockedUnits, (unlockedUnits + unitsToClaimNow))] | |
379 | 379 | } | |
380 | 380 | ||
381 | 381 | ||
541 | 541 | let $t01860118686 = calculateUnitsToClaim(userAddress) | |
542 | 542 | let unlockedUnitNow = $t01860118686._1 | |
543 | 543 | let l2ToBurnNow = $t01860118686._2 | |
544 | - | let | |
544 | + | let currentBlock = $t01860118686._3 | |
545 | 545 | let unlockedUnitsPrev = valueOrElse(getInteger(this, keyUnlockedUnits(userAddress)), 0) | |
546 | 546 | let unitsToSend = (unlockedUnitNow + unlockedUnitsPrev) | |
547 | 547 | let l2ToBurnPrev = valueOrElse(getInteger(this, keyL2ToBurn(userAddress)), 0) | |
548 | 548 | let l2ToBurn = (l2ToBurnPrev + l2ToBurnNow) | |
549 | 549 | let totalUnitsClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
550 | 550 | let totalL2Burned = valueOrElse(getInteger(this, keyL2BurnedTotal(userAddress)), 0) | |
551 | - | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, | |
551 | + | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, currentBlock) | |
552 | 552 | } | |
553 | 553 | ||
554 | 554 |
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 | let BLOCKS_IN_INTERVAL = 1000 | |
9 | 9 | ||
10 | 10 | let scale8 = 100000000 | |
11 | 11 | ||
12 | 12 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | let keyL2AssetId = makeString(["%s", "assetId"], SEP) | |
16 | 16 | ||
17 | 17 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
18 | 18 | ||
19 | 19 | let keyForceOutStop = makeString(["%s", "forceOutStop"], SEP) | |
20 | 20 | ||
21 | 21 | let keyUnitsAssetId = makeString(["%s", "unitsAssetId"], SEP) | |
22 | 22 | ||
23 | 23 | let keyUnitsPerBlockScale8 = makeString(["%s", "unitsPerBlock"], SEP) | |
24 | 24 | ||
25 | 25 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
26 | 26 | ||
27 | 27 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
28 | 28 | ||
29 | 29 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
30 | 30 | ||
31 | 31 | let keyUnitsClaimStartHeight = makeString(["%s", "unitsClaimStartHeight"], SEP) | |
32 | 32 | ||
33 | 33 | let keyUnitsClaimInterval = makeString(["%s", "unitsClaimInterval"], SEP) | |
34 | 34 | ||
35 | 35 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
36 | 36 | ||
37 | 37 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
38 | 38 | ||
39 | 39 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
40 | 40 | ||
41 | 41 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
42 | 42 | then (periodOffsetHeight != -1) | |
43 | 43 | else false) | |
44 | 44 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
45 | 45 | else max([0, (periodOffsetId - 1)]) | |
46 | 46 | ||
47 | 47 | let currentPeriodHeight = if (if ((periodOffsetHeight == -1)) | |
48 | 48 | then true | |
49 | 49 | else if ((currentPeriodId == 0)) | |
50 | 50 | then (periodOffsetHeight > height) | |
51 | 51 | else false) | |
52 | 52 | then 0 | |
53 | 53 | else (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
54 | 54 | ||
55 | 55 | let nextPeriodHeight = if (if ((periodOffsetHeight == -1)) | |
56 | 56 | then true | |
57 | 57 | else if ((currentPeriodId == 0)) | |
58 | 58 | then (periodOffsetHeight > height) | |
59 | 59 | else false) | |
60 | 60 | then 0 | |
61 | 61 | else (currentPeriodHeight + periodLength) | |
62 | 62 | ||
63 | 63 | let unitsClaimStartHeight = valueOrElse(getInteger(this, keyUnitsClaimStartHeight), height) | |
64 | 64 | ||
65 | 65 | let unitsClaimInterval = valueOrElse(getInteger(this, keyUnitsClaimInterval), 0) | |
66 | 66 | ||
67 | 67 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
71 | 71 | ||
72 | 72 | ||
73 | 73 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | func keyUnitsClaimedBlock (userAddress) = makeString(["%s%s", "unitsClaimedBlock", userAddress], SEP) | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | func keyUnlockedUnits (userAddress) = makeString(["%s%s", "unlockedUnits", userAddress], SEP) | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func keyTotalUnitsClaimed (userAddress) = makeString(["%s%s", "totalUnitsClaimed", userAddress], SEP) | |
86 | 86 | ||
87 | 87 | ||
88 | 88 | func keyL2ToBurn (userAddress) = makeString(["%s%s", "l2ToBurn", userAddress], SEP) | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func keyL2BurnedTotal (userAddress) = makeString(["%s%s", "l2BurnedTotal", userAddress], SEP) | |
92 | 92 | ||
93 | 93 | ||
94 | 94 | func keyNodeLeasingByHeight (nodeAddress) = { | |
95 | 95 | let h = if ((periodOffsetHeight == -1)) | |
96 | 96 | then 0 | |
97 | 97 | else height | |
98 | 98 | makeString(["%s%d", nodeAddress, toString(h)], SEP) | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func keyUserLeasingByHeight (nodeAddress,userAddress) = { | |
103 | 103 | let h = if ((periodOffsetHeight == -1)) | |
104 | 104 | then 0 | |
105 | 105 | else height | |
106 | 106 | makeString(["%s%s%d", nodeAddress, userAddress, toString(h)], SEP) | |
107 | 107 | } | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func assetStringToBytes (assetIdString) = if ((assetIdString == "WAVES")) | |
111 | 111 | then unit | |
112 | 112 | else fromBase58String(assetIdString) | |
113 | 113 | ||
114 | 114 | ||
115 | 115 | func assetBytesToString (assetId) = match assetId { | |
116 | 116 | case a: ByteVector => | |
117 | 117 | toBase58String(a) | |
118 | 118 | case _ => | |
119 | 119 | "WAVES" | |
120 | 120 | } | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | let l2AssetIdString = valueOrElse(getString(this, keyL2AssetId), "WAVES") | |
124 | 124 | ||
125 | 125 | let unitsAssetIdString = valueOrElse(getString(this, keyUnitsAssetId), "WAVES") | |
126 | 126 | ||
127 | 127 | let l2AssetIdBytes = assetStringToBytes(l2AssetIdString) | |
128 | 128 | ||
129 | 129 | let unitsAssetIdBytes = assetStringToBytes(unitsAssetIdString) | |
130 | 130 | ||
131 | 131 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
132 | 132 | ||
133 | 133 | let isForceOutStop = valueOrElse(getBoolean(this, keyForceOutStop), false) | |
134 | 134 | ||
135 | 135 | func isValidAddress (address) = match addressFromString(address) { | |
136 | 136 | case a: Address => | |
137 | 137 | true | |
138 | 138 | case _ => | |
139 | 139 | false | |
140 | 140 | } | |
141 | 141 | ||
142 | 142 | ||
143 | 143 | let ADMIN_LIST_SIZE = 5 | |
144 | 144 | ||
145 | 145 | let QUORUM = 3 | |
146 | 146 | ||
147 | 147 | let TXID_BYTES_LENGTH = 32 | |
148 | 148 | ||
149 | 149 | func keyAllowedTxIdVotePrefix (txId) = makeString(["%s%s%s", "allowTxId", txId], SEP) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func keyFullAdminVote (prefix,adminAddress) = makeString([prefix, adminAddress], SEP) | |
153 | 153 | ||
154 | 154 | ||
155 | 155 | func keyAdminAddressList () = makeString(["%s", "adminAddressList"], SEP) | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func keyAllowedTxId () = makeString(["%s", "txId"], SEP) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func getAdminVote (prefix,admin) = { | |
162 | 162 | let voteKey = keyFullAdminVote(prefix, admin) | |
163 | 163 | valueOrElse(getInteger(voteKey), 0) | |
164 | 164 | } | |
165 | 165 | ||
166 | 166 | ||
167 | 167 | func getAdminsList () = match getString(this, keyAdminAddressList()) { | |
168 | 168 | case s: String => | |
169 | 169 | split(s, SEP) | |
170 | 170 | case _ => | |
171 | 171 | nil | |
172 | 172 | } | |
173 | 173 | ||
174 | 174 | ||
175 | 175 | func isInAdminList (address) = containsElement(getAdminsList(), address) | |
176 | 176 | ||
177 | 177 | ||
178 | 178 | func genVotesKeysHelper (a,adminAddress) = { | |
179 | 179 | let $t051475171 = a | |
180 | 180 | let result = $t051475171._1 | |
181 | 181 | let prefix = $t051475171._2 | |
182 | 182 | $Tuple2((result :+ keyFullAdminVote(prefix, adminAddress)), prefix) | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func genVotesKeys (keyPrefix) = { | |
187 | 187 | let adminList = keyAdminAddressList() | |
188 | 188 | let $t053185402 = { | |
189 | 189 | let $l = getAdminsList() | |
190 | 190 | let $s = size($l) | |
191 | 191 | let $acc0 = $Tuple2(nil, keyPrefix) | |
192 | 192 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
193 | 193 | then $a | |
194 | 194 | else genVotesKeysHelper($a, $l[$i]) | |
195 | 195 | ||
196 | 196 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
197 | 197 | then $a | |
198 | 198 | else throw("List size exceeds 5") | |
199 | 199 | ||
200 | 200 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
201 | 201 | } | |
202 | 202 | let result = $t053185402._1 | |
203 | 203 | let prefix = $t053185402._2 | |
204 | 204 | result | |
205 | 205 | } | |
206 | 206 | ||
207 | 207 | ||
208 | 208 | func countVotesHelper (result,voteKey) = (result + valueOrElse(getInteger(voteKey), 0)) | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func countVotes (prefix) = { | |
212 | 212 | let votes = genVotesKeys(prefix) | |
213 | 213 | let $l = votes | |
214 | 214 | let $s = size($l) | |
215 | 215 | let $acc0 = 0 | |
216 | 216 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
217 | 217 | then $a | |
218 | 218 | else countVotesHelper($a, $l[$i]) | |
219 | 219 | ||
220 | 220 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
221 | 221 | then $a | |
222 | 222 | else throw("List size exceeds 5") | |
223 | 223 | ||
224 | 224 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
225 | 225 | } | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func clearVotesHelper (result,key) = (result :+ DeleteEntry(key)) | |
229 | 229 | ||
230 | 230 | ||
231 | 231 | func getClearVoteEntries (prefix) = { | |
232 | 232 | let votes = genVotesKeys(prefix) | |
233 | 233 | let $l = votes | |
234 | 234 | let $s = size($l) | |
235 | 235 | let $acc0 = nil | |
236 | 236 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
237 | 237 | then $a | |
238 | 238 | else clearVotesHelper($a, $l[$i]) | |
239 | 239 | ||
240 | 240 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
241 | 241 | then $a | |
242 | 242 | else throw("List size exceeds 5") | |
243 | 243 | ||
244 | 244 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5) | |
245 | 245 | } | |
246 | 246 | ||
247 | 247 | ||
248 | 248 | func voteINTERNAL (callerAddressString,keyPrefix,minVotes,voteResult) = { | |
249 | 249 | let voteKey = keyFullAdminVote(keyPrefix, callerAddressString) | |
250 | 250 | let adminCurrentVote = getAdminVote(keyPrefix, callerAddressString) | |
251 | 251 | let err = if (!(isInAdminList(callerAddressString))) | |
252 | 252 | then throwErr((("Address: " + callerAddressString) + " not in Admin list")) | |
253 | 253 | else if ((adminCurrentVote == 1)) | |
254 | 254 | then throwErr((voteKey + " you already voted")) | |
255 | 255 | else unit | |
256 | 256 | if ((err == err)) | |
257 | 257 | then { | |
258 | 258 | let votes = countVotes(keyPrefix) | |
259 | 259 | if (((votes + 1) >= minVotes)) | |
260 | 260 | then { | |
261 | 261 | let clearVoteEntries = getClearVoteEntries(keyPrefix) | |
262 | 262 | (clearVoteEntries ++ voteResult) | |
263 | 263 | } | |
264 | 264 | else [IntegerEntry(voteKey, 1)] | |
265 | 265 | } | |
266 | 266 | else throw("Strict value is not equal to itself.") | |
267 | 267 | } | |
268 | 268 | ||
269 | 269 | ||
270 | 270 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
271 | 271 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
272 | 272 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
273 | 273 | } | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | func getLeasingNodeData (nodeAddress) = { | |
277 | 277 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
278 | 278 | match leasingNodeDataStringRaw { | |
279 | 279 | case ds: String => | |
280 | 280 | let dataList = split(ds, SEP) | |
281 | 281 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
282 | 282 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
283 | 283 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
284 | 284 | let nodeNextLeased = parseIntValue(dataList[4]) | |
285 | 285 | if (if ((nodeNextPeriod > height)) | |
286 | 286 | then true | |
287 | 287 | else (periodOffsetHeight == -1)) | |
288 | 288 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
289 | 289 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
290 | 290 | case _ => | |
291 | 291 | $Tuple2(0, 0) | |
292 | 292 | } | |
293 | 293 | } | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
297 | 297 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
298 | 298 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
299 | 299 | } | |
300 | 300 | ||
301 | 301 | ||
302 | 302 | func getUserLeasingData (nodeAddress,userAddress) = { | |
303 | 303 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
304 | 304 | match leasingUserDataStringRaw { | |
305 | 305 | case ds: String => | |
306 | 306 | let dataList = split(ds, SEP) | |
307 | 307 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
308 | 308 | let userCurrentLeased = parseIntValue(dataList[2]) | |
309 | 309 | let userNextPeriod = parseIntValue(dataList[3]) | |
310 | 310 | let userNextLeased = parseIntValue(dataList[4]) | |
311 | 311 | if (if ((userNextPeriod > height)) | |
312 | 312 | then true | |
313 | 313 | else (periodOffsetHeight == -1)) | |
314 | 314 | then $Tuple2(userCurrentLeased, userNextLeased) | |
315 | 315 | else $Tuple2(userNextLeased, userNextLeased) | |
316 | 316 | case _ => | |
317 | 317 | $Tuple2(0, 0) | |
318 | 318 | } | |
319 | 319 | } | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
323 | 323 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
324 | 324 | StringEntry(keyUserToClaim(userAddress), valueString) | |
325 | 325 | } | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func getUserToClaimBalance (userAddress) = { | |
329 | 329 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
330 | 330 | match userToClaimDataStringRaw { | |
331 | 331 | case ds: String => | |
332 | 332 | let dataList = split(ds, SEP) | |
333 | 333 | let currentPeriod = parseIntValue(dataList[1]) | |
334 | 334 | let toClaim = parseIntValue(dataList[2]) | |
335 | 335 | let nextPeriod = parseIntValue(dataList[3]) | |
336 | 336 | let toUnlock = parseIntValue(dataList[4]) | |
337 | 337 | if (if ((nextPeriod > height)) | |
338 | 338 | then true | |
339 | 339 | else (currentPeriodId == 0)) | |
340 | 340 | then $Tuple2(toClaim, toUnlock) | |
341 | 341 | else $Tuple2((toClaim + toUnlock), 0) | |
342 | 342 | case _ => | |
343 | 343 | $Tuple2(0, 0) | |
344 | 344 | } | |
345 | 345 | } | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked) | |
349 | 349 | ||
350 | 350 | ||
351 | 351 | func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0) | |
352 | 352 | ||
353 | 353 | ||
354 | 354 | func calculateUnitsToClaim (userAddress) = { | |
355 | 355 | let claimedBlockKey = keyUnitsClaimedBlock(userAddress) | |
356 | 356 | let claimedBlock = valueOrElse(getInteger(this, claimedBlockKey), unitsClaimStartHeight) | |
357 | 357 | let unitsPerBlockScale8 = valueOrElse(getInteger(this, keyUnitsPerBlockScale8), 0) | |
358 | 358 | let currentBlock = min([(unitsClaimStartHeight + unitsClaimInterval), height]) | |
359 | 359 | let blocksPassed = (currentBlock - claimedBlock) | |
360 | 360 | let amountStaked = getUserTotalLocked(userAddress) | |
361 | 361 | let l2ToBurn = fraction(amountStaked, blocksPassed, unitsClaimInterval) | |
362 | 362 | let unitsToClaimNow = fraction(l2ToBurn, unitsPerBlockScale8, (scale8 * scale8)) | |
363 | - | $Tuple3(unitsToClaimNow, l2ToBurn, | |
363 | + | $Tuple3(unitsToClaimNow, l2ToBurn, currentBlock) | |
364 | 364 | } | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func getUnlockUnitsAction (userAddress) = { | |
368 | 368 | let kUnlockedUnits = keyUnlockedUnits(userAddress) | |
369 | 369 | let unlockedUnits = valueOrElse(getInteger(this, kUnlockedUnits), 0) | |
370 | 370 | let kL2ToBurn = keyL2ToBurn(userAddress) | |
371 | 371 | let l2ToBurn = valueOrElse(getInteger(this, kL2ToBurn), 0) | |
372 | 372 | let $t01132911414 = calculateUnitsToClaim(userAddress) | |
373 | 373 | let unitsToClaimNow = $t01132911414._1 | |
374 | 374 | let l2ToBurnNow = $t01132911414._2 | |
375 | - | let | |
375 | + | let currentBlock = $t01132911414._3 | |
376 | 376 | if ((0 >= unitsToClaimNow)) | |
377 | 377 | then nil | |
378 | - | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), | |
378 | + | else [IntegerEntry(keyUnitsClaimedBlock(userAddress), currentBlock), IntegerEntry(kL2ToBurn, (l2ToBurn + l2ToBurnNow)), IntegerEntry(kUnlockedUnits, (unlockedUnits + unitsToClaimNow))] | |
379 | 379 | } | |
380 | 380 | ||
381 | 381 | ||
382 | 382 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
383 | 383 | let $t01180911882 = getLeasingNodeData(nodeAddress) | |
384 | 384 | let nodeCurrentLeased = $t01180911882._1 | |
385 | 385 | let nodeNextLeased = $t01180911882._2 | |
386 | 386 | let $t01188711973 = getUserLeasingData(nodeAddress, userAddress) | |
387 | 387 | let userCurrentLeased = $t01188711973._1 | |
388 | 388 | let userNextLeased = $t01188711973._2 | |
389 | 389 | let checks = [if (!(isForceStop)) | |
390 | 390 | then true | |
391 | 391 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
392 | 392 | then true | |
393 | 393 | else throwErr("unstake is temporary disabled"), if ((unstakeAmount > 0)) | |
394 | 394 | then true | |
395 | 395 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
396 | 396 | then true | |
397 | 397 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
398 | 398 | then true | |
399 | 399 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
400 | 400 | then true | |
401 | 401 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
402 | 402 | then true | |
403 | 403 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
404 | 404 | if ((checks == checks)) | |
405 | 405 | then { | |
406 | 406 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
407 | 407 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
408 | 408 | let $t01285712917 = getUserToClaimBalance(userAddress) | |
409 | 409 | let toClaim = $t01285712917._1 | |
410 | 410 | let toUnlock = $t01285712917._2 | |
411 | 411 | let newToUnlock = (toUnlock + unstakeAmount) | |
412 | 412 | let userTotalLocked = getUserTotalLocked(userAddress) | |
413 | 413 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
414 | 414 | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
415 | 415 | ([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)] ++ unitsUnlockedActions) | |
416 | 416 | } | |
417 | 417 | else throw("Strict value is not equal to itself.") | |
418 | 418 | } | |
419 | 419 | ||
420 | 420 | ||
421 | 421 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
422 | 422 | let $t01373613796 = getUserToClaimBalance(userAddress) | |
423 | 423 | let toClaim = $t01373613796._1 | |
424 | 424 | let toUnlock = $t01373613796._2 | |
425 | 425 | let checks = [if (!(isForceStop)) | |
426 | 426 | then true | |
427 | 427 | else throwErr("contract is temporary stopped"), if (!(isForceOutStop)) | |
428 | 428 | then true | |
429 | 429 | else throwErr("claim is temporary disabled"), if ((claimAmount > 0)) | |
430 | 430 | then true | |
431 | 431 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
432 | 432 | then true | |
433 | 433 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
434 | 434 | then true | |
435 | 435 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
436 | 436 | if ((checks == checks)) | |
437 | 437 | then { | |
438 | 438 | let newToClaim = (toClaim - claimAmount) | |
439 | 439 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, l2AssetIdBytes)] | |
440 | 440 | } | |
441 | 441 | else throw("Strict value is not equal to itself.") | |
442 | 442 | } | |
443 | 443 | ||
444 | 444 | ||
445 | 445 | func getStakeForActions (userAddress,i) = { | |
446 | 446 | let $t01456214622 = getUserToClaimBalance(userAddress) | |
447 | 447 | let toClaim = $t01456214622._1 | |
448 | 448 | let toUnlock = $t01456214622._2 | |
449 | 449 | let checks = [if (!(isForceStop)) | |
450 | 450 | then true | |
451 | 451 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
452 | 452 | then true | |
453 | 453 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
454 | 454 | then true | |
455 | 455 | else (i.payments[0].assetId == l2AssetIdBytes)) | |
456 | 456 | then true | |
457 | 457 | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if (isValidAddress(userAddress)) | |
458 | 458 | then true | |
459 | 459 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
460 | 460 | if ((checks == checks)) | |
461 | 461 | then { | |
462 | 462 | let newToClaim = (toClaim + i.payments[0].amount) | |
463 | 463 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock)] | |
464 | 464 | } | |
465 | 465 | else throw("Strict value is not equal to itself.") | |
466 | 466 | } | |
467 | 467 | ||
468 | 468 | ||
469 | 469 | func getStakeActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
470 | 470 | let $t01535415414 = getUserToClaimBalance(userAddress) | |
471 | 471 | let toClaim = $t01535415414._1 | |
472 | 472 | let toUnlock = $t01535415414._2 | |
473 | 473 | let paymentAmount = if ((size(i.payments) == 0)) | |
474 | 474 | then 0 | |
475 | 475 | else i.payments[0].amount | |
476 | 476 | let available = ((toUnlock + toClaim) + paymentAmount) | |
477 | 477 | let checks = [if (!(isForceStop)) | |
478 | 478 | then true | |
479 | 479 | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
480 | 480 | then true | |
481 | 481 | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
482 | 482 | then true | |
483 | 483 | else (i.payments[0].assetId == l2AssetIdBytes)) | |
484 | 484 | then true | |
485 | 485 | else throwErr(makeString(["payment assetId should be:", l2AssetIdString], " ")), if ((userLeasingAmount > 0)) | |
486 | 486 | then true | |
487 | 487 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
488 | 488 | then true | |
489 | 489 | else throwErr("amount should be less or equal (payment + available) amount"), if ((userLeasingAmount >= paymentAmount)) | |
490 | 490 | then true | |
491 | 491 | else throw("amount should be greater or equal payment amount"), if (isValidAddress(nodeAddress)) | |
492 | 492 | then true | |
493 | 493 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
494 | 494 | then true | |
495 | 495 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
496 | 496 | if ((checks == checks)) | |
497 | 497 | then { | |
498 | 498 | let $t01648916562 = getLeasingNodeData(nodeAddress) | |
499 | 499 | let nodeCurrentLeased = $t01648916562._1 | |
500 | 500 | let nodeNextLeased = $t01648916562._2 | |
501 | 501 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
502 | 502 | let $t01663016716 = getUserLeasingData(nodeAddress, userAddress) | |
503 | 503 | let userCurrentLeased = $t01663016716._1 | |
504 | 504 | let userNextLeased = $t01663016716._2 | |
505 | 505 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
506 | 506 | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
507 | 507 | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
508 | 508 | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
509 | 509 | let userTotalLocked = getUserTotalLocked(userAddress) | |
510 | 510 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
511 | 511 | let unitsUnlockedActions = getUnlockUnitsAction(userAddress) | |
512 | 512 | ([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)] ++ unitsUnlockedActions) | |
513 | 513 | } | |
514 | 514 | else throw("Strict value is not equal to itself.") | |
515 | 515 | } | |
516 | 516 | ||
517 | 517 | ||
518 | 518 | func getStakeFromPaymentActions (nodeAddress,userAddress,i) = { | |
519 | 519 | let checks = [if ((size(i.payments) == 1)) | |
520 | 520 | then true | |
521 | 521 | else throwErr("payment size should be exactly 1")] | |
522 | 522 | if ((checks == checks)) | |
523 | 523 | then getStakeActions(nodeAddress, userAddress, i.payments[0].amount, i) | |
524 | 524 | else throw("Strict value is not equal to itself.") | |
525 | 525 | } | |
526 | 526 | ||
527 | 527 | ||
528 | 528 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
529 | 529 | let check = [if ((newPeriodLength > 0)) | |
530 | 530 | then true | |
531 | 531 | else throwErr("period length should be greater than 0")] | |
532 | 532 | if ((check == check)) | |
533 | 533 | then if ((periodOffsetHeight == -1)) | |
534 | 534 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
535 | 535 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
536 | 536 | else throw("Strict value is not equal to itself.") | |
537 | 537 | } | |
538 | 538 | ||
539 | 539 | ||
540 | 540 | func getUnitsClaimData (userAddress) = { | |
541 | 541 | let $t01860118686 = calculateUnitsToClaim(userAddress) | |
542 | 542 | let unlockedUnitNow = $t01860118686._1 | |
543 | 543 | let l2ToBurnNow = $t01860118686._2 | |
544 | - | let | |
544 | + | let currentBlock = $t01860118686._3 | |
545 | 545 | let unlockedUnitsPrev = valueOrElse(getInteger(this, keyUnlockedUnits(userAddress)), 0) | |
546 | 546 | let unitsToSend = (unlockedUnitNow + unlockedUnitsPrev) | |
547 | 547 | let l2ToBurnPrev = valueOrElse(getInteger(this, keyL2ToBurn(userAddress)), 0) | |
548 | 548 | let l2ToBurn = (l2ToBurnPrev + l2ToBurnNow) | |
549 | 549 | let totalUnitsClaimed = valueOrElse(getInteger(this, keyTotalUnitsClaimed(userAddress)), 0) | |
550 | 550 | let totalL2Burned = valueOrElse(getInteger(this, keyL2BurnedTotal(userAddress)), 0) | |
551 | - | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, | |
551 | + | $Tuple5(unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, currentBlock) | |
552 | 552 | } | |
553 | 553 | ||
554 | 554 | ||
555 | 555 | func getClaimUnitsActions (userAddress) = { | |
556 | 556 | let $t01927819386 = getUnitsClaimData(userAddress) | |
557 | 557 | let unitsToSend = $t01927819386._1 | |
558 | 558 | let totalUnitsClaimed = $t01927819386._2 | |
559 | 559 | let l2ToBurn = $t01927819386._3 | |
560 | 560 | let totalL2Burned = $t01927819386._4 | |
561 | 561 | let claimedBlock = $t01927819386._5 | |
562 | 562 | let check = [if ((unitsToSend > 0)) | |
563 | 563 | then true | |
564 | 564 | else throwErr("nothing to claim")] | |
565 | 565 | if ((check == check)) | |
566 | 566 | then { | |
567 | 567 | let burnAction = match l2AssetIdBytes { | |
568 | 568 | case id: ByteVector => | |
569 | 569 | [Burn(id, l2ToBurn)] | |
570 | 570 | case _ => | |
571 | 571 | nil | |
572 | 572 | } | |
573 | 573 | ([IntegerEntry(keyUnitsClaimedBlock(userAddress), claimedBlock), IntegerEntry(keyTotalUnitsClaimed(userAddress), (totalUnitsClaimed + unitsToSend)), IntegerEntry(keyL2BurnedTotal(userAddress), (totalL2Burned + l2ToBurn)), IntegerEntry(keyUnlockedUnits(userAddress), 0), IntegerEntry(keyL2ToBurn(userAddress), 0), ScriptTransfer(addressFromStringValue(userAddress), unitsToSend, unitsAssetIdBytes)] ++ burnAction) | |
574 | 574 | } | |
575 | 575 | else throw("Strict value is not equal to itself.") | |
576 | 576 | } | |
577 | 577 | ||
578 | 578 | ||
579 | 579 | @Callable(i) | |
580 | 580 | func setNewPeriodLength (newPeriodLength) = { | |
581 | 581 | let checks = [if (isInAdminList(toString(i.caller))) | |
582 | 582 | then true | |
583 | 583 | else throwErr("caller is not in adminList")] | |
584 | 584 | if ((checks == checks)) | |
585 | 585 | then getSetNewPeriodLengthActions(newPeriodLength) | |
586 | 586 | else throw("Strict value is not equal to itself.") | |
587 | 587 | } | |
588 | 588 | ||
589 | 589 | ||
590 | 590 | ||
591 | 591 | @Callable(i) | |
592 | 592 | func claimUnits () = { | |
593 | 593 | let userAddress = toString(i.caller) | |
594 | 594 | getClaimUnitsActions(userAddress) | |
595 | 595 | } | |
596 | 596 | ||
597 | 597 | ||
598 | 598 | ||
599 | 599 | @Callable(i) | |
600 | 600 | func setForceStopFlag (stop) = { | |
601 | 601 | let check = [if (isInAdminList(toString(i.caller))) | |
602 | 602 | then true | |
603 | 603 | else throwErr("caller is not in adminList")] | |
604 | 604 | if ((check == check)) | |
605 | 605 | then [BooleanEntry(keyForceStop, stop)] | |
606 | 606 | else throw("Strict value is not equal to itself.") | |
607 | 607 | } | |
608 | 608 | ||
609 | 609 | ||
610 | 610 | ||
611 | 611 | @Callable(i) | |
612 | 612 | func setForceOutStopFlag (stop) = { | |
613 | 613 | let check = [if (isInAdminList(toString(i.caller))) | |
614 | 614 | then true | |
615 | 615 | else throwErr("caller is not in adminList")] | |
616 | 616 | if ((check == check)) | |
617 | 617 | then [BooleanEntry(keyForceOutStop, stop)] | |
618 | 618 | else throw("Strict value is not equal to itself.") | |
619 | 619 | } | |
620 | 620 | ||
621 | 621 | ||
622 | 622 | ||
623 | 623 | @Callable(i) | |
624 | 624 | func getNodeDataREADONLY (nodeAddress) = { | |
625 | 625 | let $t02111821182 = getLeasingNodeData(nodeAddress) | |
626 | 626 | let currentLease = $t02111821182._1 | |
627 | 627 | let nextLeased = $t02111821182._2 | |
628 | 628 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
629 | 629 | } | |
630 | 630 | ||
631 | 631 | ||
632 | 632 | ||
633 | 633 | @Callable(i) | |
634 | 634 | func getUserLeasingDataREADONLY (nodeAddress,userAddress) = { | |
635 | 635 | let $t02155221629 = getUserLeasingData(nodeAddress, userAddress) | |
636 | 636 | let currentLease = $t02155221629._1 | |
637 | 637 | let nextLeased = $t02155221629._2 | |
638 | 638 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
639 | 639 | } | |
640 | 640 | ||
641 | 641 | ||
642 | 642 | ||
643 | 643 | @Callable(i) | |
644 | 644 | func getUserDataREADONLY (userAddress) = { | |
645 | 645 | let $t02214522205 = getUserToClaimBalance(userAddress) | |
646 | 646 | let toClaim = $t02214522205._1 | |
647 | 647 | let toUnlock = $t02214522205._2 | |
648 | 648 | let userTotalLocked = getUserTotalLocked(userAddress) | |
649 | 649 | let $t02226822376 = getUnitsClaimData(userAddress) | |
650 | 650 | let unitsToSend = $t02226822376._1 | |
651 | 651 | let totalUnitsClaimed = $t02226822376._2 | |
652 | 652 | let l2ToBurn = $t02226822376._3 | |
653 | 653 | let totalL2Burned = $t02226822376._4 | |
654 | 654 | let claimedBlock = $t02226822376._5 | |
655 | 655 | $Tuple2(nil, $Tuple11(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height, unitsToSend, totalUnitsClaimed, l2ToBurn, totalL2Burned, claimedBlock)) | |
656 | 656 | } | |
657 | 657 | ||
658 | 658 | ||
659 | 659 | ||
660 | 660 | @Callable(i) | |
661 | 661 | func leaseByAddress (nodeAddress,userAddress) = getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
662 | 662 | ||
663 | 663 | ||
664 | 664 | ||
665 | 665 | @Callable(i) | |
666 | 666 | func lease (nodeAddress) = { | |
667 | 667 | let userAddress = toString(i.caller) | |
668 | 668 | getStakeFromPaymentActions(nodeAddress, userAddress, i) | |
669 | 669 | } | |
670 | 670 | ||
671 | 671 | ||
672 | 672 | ||
673 | 673 | @Callable(i) | |
674 | 674 | func leaseFromLocked (nodeAddress,amount) = { | |
675 | 675 | let userAddress = toString(i.caller) | |
676 | 676 | getStakeActions(nodeAddress, userAddress, amount, i) | |
677 | 677 | } | |
678 | 678 | ||
679 | 679 | ||
680 | 680 | ||
681 | 681 | @Callable(i) | |
682 | 682 | func cancelLease (nodeAddress,amount) = { | |
683 | 683 | let userAddress = toString(i.caller) | |
684 | 684 | getUnstakeActions(nodeAddress, userAddress, amount) | |
685 | 685 | } | |
686 | 686 | ||
687 | 687 | ||
688 | 688 | ||
689 | 689 | @Callable(i) | |
690 | 690 | func claim (amount) = { | |
691 | 691 | let userAddress = toString(i.caller) | |
692 | 692 | getClaimUnlockedActions(userAddress, amount) | |
693 | 693 | } | |
694 | 694 | ||
695 | 695 | ||
696 | 696 | ||
697 | 697 | @Callable(i) | |
698 | 698 | func claimAll () = { | |
699 | 699 | let userAddress = toString(i.caller) | |
700 | 700 | let $t02356823628 = getUserToClaimBalance(userAddress) | |
701 | 701 | let toClaim = $t02356823628._1 | |
702 | 702 | let toUnlock = $t02356823628._2 | |
703 | 703 | let checks = [if ((toClaim > 0)) | |
704 | 704 | then true | |
705 | 705 | else throwErr("nothing to claim")] | |
706 | 706 | if ((checks == checks)) | |
707 | 707 | then getClaimUnlockedActions(userAddress, toClaim) | |
708 | 708 | else throw("Strict value is not equal to itself.") | |
709 | 709 | } | |
710 | 710 | ||
711 | 711 | ||
712 | 712 | ||
713 | 713 | @Callable(i) | |
714 | 714 | func stakeFor (userAddress) = getStakeForActions(userAddress, i) | |
715 | 715 | ||
716 | 716 | ||
717 | 717 | ||
718 | 718 | @Callable(i) | |
719 | 719 | func startUnitsVesting (unitsClaimInterval) = { | |
720 | 720 | let totalL2 = 100000000000000000 | |
721 | 721 | let totalUnits = i.payments[0].amount | |
722 | 722 | let unitsPerBlockScale8 = (fraction(totalL2, scale8, totalUnits) / unitsClaimInterval) | |
723 | 723 | let check = [if (isInAdminList(toString(i.caller))) | |
724 | 724 | then true | |
725 | 725 | else throwErr("caller is not in adminList"), if ((size(i.payments) == 1)) | |
726 | 726 | then true | |
727 | 727 | else throwErr("should be 1 payment"), if ((unitsPerBlockScale8 > 0)) | |
728 | 728 | then true | |
729 | 729 | else throwErr("units per block should be greated than 0")] | |
730 | 730 | if ((check == check)) | |
731 | 731 | then [IntegerEntry(keyUnitsPerBlockScale8, unitsPerBlockScale8), IntegerEntry(keyUnitsClaimStartHeight, height), IntegerEntry(keyUnitsClaimInterval, unitsClaimInterval), StringEntry(keyUnitsAssetId, assetBytesToString(i.payments[0].assetId))] | |
732 | 732 | else throw("Strict value is not equal to itself.") | |
733 | 733 | } | |
734 | 734 | ||
735 | 735 | ||
736 | 736 | ||
737 | 737 | @Callable(i) | |
738 | 738 | func voteForTxId (txId) = { | |
739 | 739 | let callerAddressString = toBase58String(i.caller.bytes) | |
740 | 740 | let keyPrefix = keyAllowedTxIdVotePrefix(txId) | |
741 | 741 | let result = [StringEntry(keyAllowedTxId(), txId)] | |
742 | 742 | let allowedTxIdOption = getString(this, keyAllowedTxId()) | |
743 | 743 | let err = [if ((size(fromBase58String(txId)) == TXID_BYTES_LENGTH)) | |
744 | 744 | then true | |
745 | 745 | else throwErr((txId + " is not valid txId")), if (if ((allowedTxIdOption == unit)) | |
746 | 746 | then true | |
747 | 747 | else (value(allowedTxIdOption) != txId)) | |
748 | 748 | then true | |
749 | 749 | else throwErr((txId + " is already allowed"))] | |
750 | 750 | if ((err == err)) | |
751 | 751 | then voteINTERNAL(callerAddressString, keyPrefix, QUORUM, result) | |
752 | 752 | else throw("Strict value is not equal to itself.") | |
753 | 753 | } | |
754 | 754 | ||
755 | 755 | ||
756 | 756 | @Verifier(tx) | |
757 | 757 | func verify () = { | |
758 | 758 | let byAdmins = (tx.id == fromBase58String(valueOrElse(getString(this, keyAllowedTxId()), ""))) | |
759 | 759 | let byOwner = if ((size(getAdminsList()) >= QUORUM)) | |
760 | 760 | then false | |
761 | 761 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
762 | 762 | if (byAdmins) | |
763 | 763 | then true | |
764 | 764 | else byOwner | |
765 | 765 | } | |
766 | 766 |
github/deemru/w8io/169f3d6 88.20 ms ◑