tx · 7gShWbxXeGEHPD7bhARcBjud47w6DTRcPddq47HYDjSp 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.01300000 Waves 2024.02.12 14:28 [2972977] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "7gShWbxXeGEHPD7bhARcBjud47w6DTRcPddq47HYDjSp", "fee": 1300000, "feeAssetId": null, "timestamp": 1707737294970, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "2pSJDkRN6V62Xdhi8WCHcR4szfMYG9fBx2GmpbZvNNaZKN9kHYVRArPHMgWzvhuDZaprRkdBeEFA7UgzAtt65CJJ" ], "script": "base64:BgIqCAISAwoBARIDCgEIEgQKAggIEgMKAQgSBAoCCAESBAoCCAESAwoBARIAJAAMY29udHJhY3RGaWxlAhFsMm1wX2xlYXNpbmcucmlkZQADU0VQAgJfXwAGc2NhbGU4AIDC1y8BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJAgkAzAgCAgIlcwkAzAgCAgxwZXJpb2RMZW5ndGgFA25pbAUDU0VQAA5wZXJpb2RPZmZzZXRJZAkBC3ZhbHVlT3JFbHNlAgkAmggCBQR0aGlzBRFrZXlQZXJpb2RPZmZzZXRJZAAAAAx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kcmVzcwULdXNlckFkZHJlc3MFAWkBaQEFc3Rha2UBC25vZGVBZGRyZXNzBAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJAQ9nZXRTdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFAWkBaQERc3Rha2VGcm9tVW5sb2NrZWQCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQEbZ2V0U3Rha2VGcm9tVW5sb2NrZWRBY3Rpb25zAwULbm9kZUFkZHJlc3MFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQEHdW5zdGFrZQILbm9kZUFkZHJlc3MGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARFnZXRVbnN0YWtlQWN0aW9ucwMFC25vZGVBZGRyZXNzBQt1c2VyQWRkcmVzcwUGYW1vdW50AWkBBWNsYWltAQZhbW91bnQEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgkBF2dldENsYWltVW5sb2NrZWRBY3Rpb25zAgULdXNlckFkZHJlc3MFBmFtb3VudAFpAQhjbGFpbUFsbAAEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQNJHQwMTI5OTUxMzA1NQkBFWdldFVzZXJUb0NsYWltQmFsYW5jZQEFC3VzZXJBZGRyZXNzBAd0b0NsYWltCAUNJHQwMTI5OTUxMzA1NQJfMQQIdG9VbmxvY2sIBQ0kdDAxMjk5NTEzMDU1Al8yCQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQAJX1KE", "height": 2972977, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4bqmQ7FBJubFQ1x7VGeeiTsrhHD8zohN3tShLrDLe9PJ Next: HY2sn8wwEwNKgiUNvRnAM8xrbXAjHwBviFTHw9tncSVC Diff:
Old | New | Differences | |
---|---|---|---|
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | - | func getUserLeasingEntry (nodeAddress,userAddress, | |
88 | - | let valueString = makeString(["%d%d%d%d", toString( | |
87 | + | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
88 | + | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
89 | 89 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
90 | 90 | } | |
91 | 91 | ||
100 | 100 | let userNextPeriod = parseIntValue(dataList[3]) | |
101 | 101 | let userNextLeased = parseIntValue(dataList[4]) | |
102 | 102 | if ((userNextPeriod > height)) | |
103 | - | then $ | |
104 | - | else $ | |
103 | + | then $Tuple2(userCurrentLeased, userNextLeased) | |
104 | + | else $Tuple2(userNextLeased, userNextLeased) | |
105 | 105 | case _ => | |
106 | - | $ | |
106 | + | $Tuple2(0, 0) | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | - | func getUserToClaimEntry (userAddress, | |
112 | - | let valueString = makeString(["%d%d%d%d", toString( | |
111 | + | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
112 | + | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
113 | 113 | StringEntry(keyUserToClaim(userAddress), valueString) | |
114 | 114 | } | |
115 | 115 | ||
124 | 124 | let nextPeriod = parseIntValue(dataList[3]) | |
125 | 125 | let toUnlock = parseIntValue(dataList[4]) | |
126 | 126 | if ((nextPeriod > height)) | |
127 | - | then $ | |
128 | - | else $ | |
127 | + | then $Tuple2(toClaim, toUnlock) | |
128 | + | else $Tuple2((toClaim + toUnlock), 0) | |
129 | 129 | case _ => | |
130 | - | $ | |
130 | + | $Tuple2(0, 0) | |
131 | 131 | } | |
132 | 132 | } | |
133 | 133 | ||
181 | 181 | if ((checks == checks)) | |
182 | 182 | then { | |
183 | 183 | let userLeasingAmount = i.payments[0].amount | |
184 | - | let $ | |
185 | - | let nodeCurrentLeased = $ | |
186 | - | let nodeNextLeased = $ | |
184 | + | let $t066986771 = getLeasingNodeData(nodeAddress) | |
185 | + | let nodeCurrentLeased = $t066986771._1 | |
186 | + | let nodeNextLeased = $t066986771._2 | |
187 | 187 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
188 | - | let $t070757196 = getUserLeasingData(nodeAddress, userAddress) | |
189 | - | let userCurrentPeriod = $t070757196._1 | |
190 | - | let userCurrentLeased = $t070757196._2 | |
191 | - | let userNextPeriod = $t070757196._3 | |
192 | - | let userNextLeased = $t070757196._4 | |
188 | + | let $t068396925 = getUserLeasingData(nodeAddress, userAddress) | |
189 | + | let userCurrentLeased = $t068396925._1 | |
190 | + | let userNextLeased = $t068396925._2 | |
193 | 191 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
194 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, | |
192 | + | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))] | |
195 | 193 | } | |
196 | 194 | else throw("Strict value is not equal to itself.") | |
197 | 195 | } | |
198 | 196 | ||
199 | 197 | ||
200 | 198 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
201 | - | let $t078497922 = getLeasingNodeData(nodeAddress) | |
202 | - | let nodeCurrentLeased = $t078497922._1 | |
203 | - | let nodeNextLeased = $t078497922._2 | |
204 | - | let $t079278048 = getUserLeasingData(nodeAddress, userAddress) | |
205 | - | let userCurrentPeriod = $t079278048._1 | |
206 | - | let userCurrentLeased = $t079278048._2 | |
207 | - | let userNextPeriod = $t079278048._3 | |
208 | - | let userNextLeased = $t079278048._4 | |
199 | + | let $t075437616 = getLeasingNodeData(nodeAddress) | |
200 | + | let nodeCurrentLeased = $t075437616._1 | |
201 | + | let nodeNextLeased = $t075437616._2 | |
202 | + | let $t076217707 = getUserLeasingData(nodeAddress, userAddress) | |
203 | + | let userCurrentLeased = $t076217707._1 | |
204 | + | let userNextLeased = $t076217707._2 | |
209 | 205 | let checks = [if ((unstakeAmount > 0)) | |
210 | 206 | then true | |
211 | 207 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
221 | 217 | then { | |
222 | 218 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
223 | 219 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
224 | - | let $t087418873 = getUserToClaimBalance(userAddress) | |
225 | - | let currentPeriod = $t087418873._1 | |
226 | - | let toClaim = $t087418873._2 | |
227 | - | let nextPeriod = $t087418873._3 | |
228 | - | let toUnlock = $t087418873._4 | |
220 | + | let $t084008505 = getUserToClaimBalance(userAddress) | |
221 | + | let toClaim = $t084008505._1 | |
222 | + | let toUnlock = $t084008505._2 | |
229 | 223 | let newToUnlock = (toUnlock + unstakeAmount) | |
230 | 224 | let removeNodeActions = if ((newUserNextLeased == 0)) | |
231 | 225 | then [getUserNodeListEntry(userAddress, removeNodeFromNodeList(userAddress, nodeAddress))] | |
232 | 226 | else nil | |
233 | - | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, | |
227 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock)] ++ removeNodeActions) | |
234 | 228 | } | |
235 | 229 | else throw("Strict value is not equal to itself.") | |
236 | 230 | } | |
237 | 231 | ||
238 | 232 | ||
239 | 233 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
240 | - | let $t095059592 = getUserToClaimBalance(userAddress) | |
241 | - | let currentPeriod = $t095059592._1 | |
242 | - | let toClaim = $t095059592._2 | |
243 | - | let nextPeriod = $t095059592._3 | |
244 | - | let toUnlock = $t095059592._4 | |
234 | + | let $t090759135 = getUserToClaimBalance(userAddress) | |
235 | + | let toClaim = $t090759135._1 | |
236 | + | let toUnlock = $t090759135._2 | |
245 | 237 | let checks = [if ((claimAmount > 0)) | |
246 | 238 | then true | |
247 | 239 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
252 | 244 | if ((checks == checks)) | |
253 | 245 | then { | |
254 | 246 | let newToClaim = (toClaim - claimAmount) | |
255 | - | [getUserToClaimEntry(userAddress, | |
247 | + | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
256 | 248 | } | |
257 | 249 | else throw("Strict value is not equal to itself.") | |
258 | 250 | } | |
259 | 251 | ||
260 | 252 | ||
261 | 253 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
262 | - | let $t01025910346 = getUserToClaimBalance(userAddress) | |
263 | - | let currentPeriod = $t01025910346._1 | |
264 | - | let toClaim = $t01025910346._2 | |
265 | - | let nextPeriod = $t01025910346._3 | |
266 | - | let toUnlock = $t01025910346._4 | |
254 | + | let $t097759835 = getUserToClaimBalance(userAddress) | |
255 | + | let toClaim = $t097759835._1 | |
256 | + | let toUnlock = $t097759835._2 | |
267 | 257 | let available = (toUnlock + toClaim) | |
268 | 258 | let checks = [if ((userLeasingAmount > 0)) | |
269 | 259 | then true | |
276 | 266 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
277 | 267 | if ((checks == checks)) | |
278 | 268 | then { | |
279 | - | let $ | |
280 | - | let nodeCurrentLeased = $ | |
281 | - | let nodeNextLeased = $ | |
269 | + | let $t01031210385 = getLeasingNodeData(nodeAddress) | |
270 | + | let nodeCurrentLeased = $t01031210385._1 | |
271 | + | let nodeNextLeased = $t01031210385._2 | |
282 | 272 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
283 | - | let $t01096411085 = getUserLeasingData(nodeAddress, userAddress) | |
284 | - | let userCurrentPeriod = $t01096411085._1 | |
285 | - | let userCurrentLeased = $t01096411085._2 | |
286 | - | let userNextPeriod = $t01096411085._3 | |
287 | - | let userNextLeased = $t01096411085._4 | |
273 | + | let $t01045310539 = getUserLeasingData(nodeAddress, userAddress) | |
274 | + | let userCurrentLeased = $t01045310539._1 | |
275 | + | let userNextLeased = $t01045310539._2 | |
288 | 276 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
289 | 277 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
290 | 278 | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
291 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, nodeNextLeased), getUserLeasingEntry(nodeAddress, userAddress, | |
279 | + | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, nodeNextLeased), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))] | |
292 | 280 | } | |
293 | 281 | else throw("Strict value is not equal to itself.") | |
294 | 282 | } | |
317 | 305 | ||
318 | 306 | @Callable(i) | |
319 | 307 | func getUserData (userAddress) = { | |
320 | - | let $t01260712694 = getUserToClaimBalance(userAddress) | |
321 | - | let currentPeriod = $t01260712694._1 | |
322 | - | let toClaim = $t01260712694._2 | |
323 | - | let nextPeriod = $t01260712694._3 | |
324 | - | let toUnlock = $t01260712694._4 | |
308 | + | let $t01199912059 = getUserToClaimBalance(userAddress) | |
309 | + | let toClaim = $t01199912059._1 | |
310 | + | let toUnlock = $t01199912059._2 | |
325 | 311 | let nodeList = getUserLeasingNodeList(userAddress) | |
326 | - | $Tuple2(nil, $ | |
312 | + | $Tuple2(nil, $Tuple3(toClaim, toUnlock, nodeList)) | |
327 | 313 | } | |
328 | 314 | ||
329 | 315 | ||
368 | 354 | @Callable(i) | |
369 | 355 | func claimAll () = { | |
370 | 356 | let userAddress = toString(i.caller) | |
371 | - | let $t01365213739 = getUserToClaimBalance(userAddress) | |
372 | - | let currentPeriod = $t01365213739._1 | |
373 | - | let toClaim = $t01365213739._2 | |
374 | - | let nextPeriod = $t01365213739._3 | |
375 | - | let toUnlock = $t01365213739._4 | |
357 | + | let $t01299513055 = getUserToClaimBalance(userAddress) | |
358 | + | let toClaim = $t01299513055._1 | |
359 | + | let toUnlock = $t01299513055._2 | |
376 | 360 | getClaimUnlockedActions(userAddress, toClaim) | |
377 | 361 | } | |
378 | 362 |
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 scale8 = 100000000 | |
9 | 9 | ||
10 | 10 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
11 | 11 | ||
12 | 12 | ||
13 | 13 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
14 | 14 | ||
15 | 15 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
16 | 16 | ||
17 | 17 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
18 | 18 | ||
19 | 19 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
20 | 20 | ||
21 | 21 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
22 | 22 | ||
23 | 23 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
24 | 24 | ||
25 | 25 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
26 | 26 | ||
27 | 27 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
28 | 28 | then (periodOffsetHeight != -1) | |
29 | 29 | else false) | |
30 | 30 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
31 | 31 | else max([0, (periodOffsetId - 1)]) | |
32 | 32 | ||
33 | 33 | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
34 | 34 | ||
35 | 35 | let nextPeriodHeight = (currentPeriodHeight + periodLength) | |
36 | 36 | ||
37 | 37 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func keyUserLeasingNodeList (userAddress) = makeString(["%s%s", "userLeasingNodeList", userAddress], SEP) | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
47 | 47 | ||
48 | 48 | ||
49 | 49 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
50 | 50 | ||
51 | 51 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
52 | 52 | then unit | |
53 | 53 | else fromBase58String(assetIdString) | |
54 | 54 | ||
55 | 55 | func isValidAddress (address) = match addressFromString(address) { | |
56 | 56 | case a: Address => | |
57 | 57 | true | |
58 | 58 | case _ => | |
59 | 59 | false | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
64 | 64 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
65 | 65 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
66 | 66 | } | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func getLeasingNodeData (nodeAddress) = { | |
70 | 70 | let leasingDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
71 | 71 | match leasingDataStringRaw { | |
72 | 72 | case ds: String => | |
73 | 73 | let dataList = split(ds, SEP) | |
74 | 74 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
75 | 75 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
76 | 76 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
77 | 77 | let nodeNextLeased = parseIntValue(dataList[4]) | |
78 | 78 | if ((nodeNextPeriod > height)) | |
79 | 79 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
80 | 80 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
81 | 81 | case _ => | |
82 | 82 | $Tuple2(0, 0) | |
83 | 83 | } | |
84 | 84 | } | |
85 | 85 | ||
86 | 86 | ||
87 | - | func getUserLeasingEntry (nodeAddress,userAddress, | |
88 | - | let valueString = makeString(["%d%d%d%d", toString( | |
87 | + | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
88 | + | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
89 | 89 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
90 | 90 | } | |
91 | 91 | ||
92 | 92 | ||
93 | 93 | func getUserLeasingData (nodeAddress,userAddress) = { | |
94 | 94 | let leasingDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
95 | 95 | match leasingDataStringRaw { | |
96 | 96 | case ds: String => | |
97 | 97 | let dataList = split(ds, SEP) | |
98 | 98 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
99 | 99 | let userCurrentLeased = parseIntValue(dataList[2]) | |
100 | 100 | let userNextPeriod = parseIntValue(dataList[3]) | |
101 | 101 | let userNextLeased = parseIntValue(dataList[4]) | |
102 | 102 | if ((userNextPeriod > height)) | |
103 | - | then $ | |
104 | - | else $ | |
103 | + | then $Tuple2(userCurrentLeased, userNextLeased) | |
104 | + | else $Tuple2(userNextLeased, userNextLeased) | |
105 | 105 | case _ => | |
106 | - | $ | |
106 | + | $Tuple2(0, 0) | |
107 | 107 | } | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | - | func getUserToClaimEntry (userAddress, | |
112 | - | let valueString = makeString(["%d%d%d%d", toString( | |
111 | + | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
112 | + | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
113 | 113 | StringEntry(keyUserToClaim(userAddress), valueString) | |
114 | 114 | } | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func getUserToClaimBalance (userAddress) = { | |
118 | 118 | let userToClaimDataRaw = getString(this, keyUserToClaim(userAddress)) | |
119 | 119 | match userToClaimDataRaw { | |
120 | 120 | case ds: String => | |
121 | 121 | let dataList = split(ds, SEP) | |
122 | 122 | let currentPeriod = parseIntValue(dataList[1]) | |
123 | 123 | let toClaim = parseIntValue(dataList[2]) | |
124 | 124 | let nextPeriod = parseIntValue(dataList[3]) | |
125 | 125 | let toUnlock = parseIntValue(dataList[4]) | |
126 | 126 | if ((nextPeriod > height)) | |
127 | - | then $ | |
128 | - | else $ | |
127 | + | then $Tuple2(toClaim, toUnlock) | |
128 | + | else $Tuple2((toClaim + toUnlock), 0) | |
129 | 129 | case _ => | |
130 | - | $ | |
130 | + | $Tuple2(0, 0) | |
131 | 131 | } | |
132 | 132 | } | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func getUserLeasingNodeList (userAddress) = { | |
136 | 136 | let leasingDataStringRaw = getString(this, keyUserLeasingNodeList(userAddress)) | |
137 | 137 | match leasingDataStringRaw { | |
138 | 138 | case ds: String => | |
139 | 139 | let dataList = split_51C(ds, SEP) | |
140 | 140 | dataList | |
141 | 141 | case _ => | |
142 | 142 | nil | |
143 | 143 | } | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getUserNodeListEntry (userAddress,nodeList) = if ((size(nodeList) == 0)) | |
148 | 148 | then DeleteEntry(keyUserLeasingNodeList(userAddress)) | |
149 | 149 | else StringEntry(keyUserLeasingNodeList(userAddress), makeString_11C(nodeList, SEP)) | |
150 | 150 | ||
151 | 151 | ||
152 | 152 | func addNodeToNodeList (userAddress,nodeAddress) = { | |
153 | 153 | let nodeList = getUserLeasingNodeList(userAddress) | |
154 | 154 | if (containsElement(nodeList, nodeAddress)) | |
155 | 155 | then nodeList | |
156 | 156 | else (nodeList :+ nodeAddress) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 | ||
160 | 160 | func removeNodeFromNodeList (userAddress,nodeAddress) = { | |
161 | 161 | let nodeList = getUserLeasingNodeList(userAddress) | |
162 | 162 | match indexOf(nodeList, nodeAddress) { | |
163 | 163 | case index: Int => | |
164 | 164 | removeByIndex(nodeList, index) | |
165 | 165 | case _ => | |
166 | 166 | nodeList | |
167 | 167 | } | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func getStakeActions (nodeAddress,userAddress,i) = { | |
172 | 172 | let checks = [if ((size(i.payments) == 1)) | |
173 | 173 | then true | |
174 | 174 | else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes)) | |
175 | 175 | then true | |
176 | 176 | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress)) | |
177 | 177 | then true | |
178 | 178 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
179 | 179 | then true | |
180 | 180 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
181 | 181 | if ((checks == checks)) | |
182 | 182 | then { | |
183 | 183 | let userLeasingAmount = i.payments[0].amount | |
184 | - | let $ | |
185 | - | let nodeCurrentLeased = $ | |
186 | - | let nodeNextLeased = $ | |
184 | + | let $t066986771 = getLeasingNodeData(nodeAddress) | |
185 | + | let nodeCurrentLeased = $t066986771._1 | |
186 | + | let nodeNextLeased = $t066986771._2 | |
187 | 187 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
188 | - | let $t070757196 = getUserLeasingData(nodeAddress, userAddress) | |
189 | - | let userCurrentPeriod = $t070757196._1 | |
190 | - | let userCurrentLeased = $t070757196._2 | |
191 | - | let userNextPeriod = $t070757196._3 | |
192 | - | let userNextLeased = $t070757196._4 | |
188 | + | let $t068396925 = getUserLeasingData(nodeAddress, userAddress) | |
189 | + | let userCurrentLeased = $t068396925._1 | |
190 | + | let userNextLeased = $t068396925._2 | |
193 | 191 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
194 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, | |
192 | + | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))] | |
195 | 193 | } | |
196 | 194 | else throw("Strict value is not equal to itself.") | |
197 | 195 | } | |
198 | 196 | ||
199 | 197 | ||
200 | 198 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
201 | - | let $t078497922 = getLeasingNodeData(nodeAddress) | |
202 | - | let nodeCurrentLeased = $t078497922._1 | |
203 | - | let nodeNextLeased = $t078497922._2 | |
204 | - | let $t079278048 = getUserLeasingData(nodeAddress, userAddress) | |
205 | - | let userCurrentPeriod = $t079278048._1 | |
206 | - | let userCurrentLeased = $t079278048._2 | |
207 | - | let userNextPeriod = $t079278048._3 | |
208 | - | let userNextLeased = $t079278048._4 | |
199 | + | let $t075437616 = getLeasingNodeData(nodeAddress) | |
200 | + | let nodeCurrentLeased = $t075437616._1 | |
201 | + | let nodeNextLeased = $t075437616._2 | |
202 | + | let $t076217707 = getUserLeasingData(nodeAddress, userAddress) | |
203 | + | let userCurrentLeased = $t076217707._1 | |
204 | + | let userNextLeased = $t076217707._2 | |
209 | 205 | let checks = [if ((unstakeAmount > 0)) | |
210 | 206 | then true | |
211 | 207 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
212 | 208 | then true | |
213 | 209 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
214 | 210 | then true | |
215 | 211 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
216 | 212 | then true | |
217 | 213 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
218 | 214 | then true | |
219 | 215 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
220 | 216 | if ((checks == checks)) | |
221 | 217 | then { | |
222 | 218 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
223 | 219 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
224 | - | let $t087418873 = getUserToClaimBalance(userAddress) | |
225 | - | let currentPeriod = $t087418873._1 | |
226 | - | let toClaim = $t087418873._2 | |
227 | - | let nextPeriod = $t087418873._3 | |
228 | - | let toUnlock = $t087418873._4 | |
220 | + | let $t084008505 = getUserToClaimBalance(userAddress) | |
221 | + | let toClaim = $t084008505._1 | |
222 | + | let toUnlock = $t084008505._2 | |
229 | 223 | let newToUnlock = (toUnlock + unstakeAmount) | |
230 | 224 | let removeNodeActions = if ((newUserNextLeased == 0)) | |
231 | 225 | then [getUserNodeListEntry(userAddress, removeNodeFromNodeList(userAddress, nodeAddress))] | |
232 | 226 | else nil | |
233 | - | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, | |
227 | + | ([getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock)] ++ removeNodeActions) | |
234 | 228 | } | |
235 | 229 | else throw("Strict value is not equal to itself.") | |
236 | 230 | } | |
237 | 231 | ||
238 | 232 | ||
239 | 233 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
240 | - | let $t095059592 = getUserToClaimBalance(userAddress) | |
241 | - | let currentPeriod = $t095059592._1 | |
242 | - | let toClaim = $t095059592._2 | |
243 | - | let nextPeriod = $t095059592._3 | |
244 | - | let toUnlock = $t095059592._4 | |
234 | + | let $t090759135 = getUserToClaimBalance(userAddress) | |
235 | + | let toClaim = $t090759135._1 | |
236 | + | let toUnlock = $t090759135._2 | |
245 | 237 | let checks = [if ((claimAmount > 0)) | |
246 | 238 | then true | |
247 | 239 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
248 | 240 | then true | |
249 | 241 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
250 | 242 | then true | |
251 | 243 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
252 | 244 | if ((checks == checks)) | |
253 | 245 | then { | |
254 | 246 | let newToClaim = (toClaim - claimAmount) | |
255 | - | [getUserToClaimEntry(userAddress, | |
247 | + | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
256 | 248 | } | |
257 | 249 | else throw("Strict value is not equal to itself.") | |
258 | 250 | } | |
259 | 251 | ||
260 | 252 | ||
261 | 253 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
262 | - | let $t01025910346 = getUserToClaimBalance(userAddress) | |
263 | - | let currentPeriod = $t01025910346._1 | |
264 | - | let toClaim = $t01025910346._2 | |
265 | - | let nextPeriod = $t01025910346._3 | |
266 | - | let toUnlock = $t01025910346._4 | |
254 | + | let $t097759835 = getUserToClaimBalance(userAddress) | |
255 | + | let toClaim = $t097759835._1 | |
256 | + | let toUnlock = $t097759835._2 | |
267 | 257 | let available = (toUnlock + toClaim) | |
268 | 258 | let checks = [if ((userLeasingAmount > 0)) | |
269 | 259 | then true | |
270 | 260 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
271 | 261 | then true | |
272 | 262 | else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress)) | |
273 | 263 | then true | |
274 | 264 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
275 | 265 | then true | |
276 | 266 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
277 | 267 | if ((checks == checks)) | |
278 | 268 | then { | |
279 | - | let $ | |
280 | - | let nodeCurrentLeased = $ | |
281 | - | let nodeNextLeased = $ | |
269 | + | let $t01031210385 = getLeasingNodeData(nodeAddress) | |
270 | + | let nodeCurrentLeased = $t01031210385._1 | |
271 | + | let nodeNextLeased = $t01031210385._2 | |
282 | 272 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
283 | - | let $t01096411085 = getUserLeasingData(nodeAddress, userAddress) | |
284 | - | let userCurrentPeriod = $t01096411085._1 | |
285 | - | let userCurrentLeased = $t01096411085._2 | |
286 | - | let userNextPeriod = $t01096411085._3 | |
287 | - | let userNextLeased = $t01096411085._4 | |
273 | + | let $t01045310539 = getUserLeasingData(nodeAddress, userAddress) | |
274 | + | let userCurrentLeased = $t01045310539._1 | |
275 | + | let userNextLeased = $t01045310539._2 | |
288 | 276 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
289 | 277 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
290 | 278 | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
291 | - | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, nodeNextLeased), getUserLeasingEntry(nodeAddress, userAddress, | |
279 | + | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, nodeNextLeased), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))] | |
292 | 280 | } | |
293 | 281 | else throw("Strict value is not equal to itself.") | |
294 | 282 | } | |
295 | 283 | ||
296 | 284 | ||
297 | 285 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
298 | 286 | let check = [if ((newPeriodLength > 0)) | |
299 | 287 | then true | |
300 | 288 | else throwErr("period length should be greater than 0")] | |
301 | 289 | if ((check == check)) | |
302 | 290 | then if ((periodOffsetHeight == -1)) | |
303 | 291 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
304 | 292 | else { | |
305 | 293 | let newPeriodOffsetId = (currentPeriodId + 1) | |
306 | 294 | let newOffsetHeight = ((periodLength * (newPeriodOffsetId - periodOffsetId)) + periodOffsetHeight) | |
307 | 295 | [IntegerEntry(keyPeriodOffsetId, newPeriodOffsetId), IntegerEntry(keyPeriodOffsetHeight, newOffsetHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
308 | 296 | } | |
309 | 297 | else throw("Strict value is not equal to itself.") | |
310 | 298 | } | |
311 | 299 | ||
312 | 300 | ||
313 | 301 | @Callable(i) | |
314 | 302 | func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength) | |
315 | 303 | ||
316 | 304 | ||
317 | 305 | ||
318 | 306 | @Callable(i) | |
319 | 307 | func getUserData (userAddress) = { | |
320 | - | let $t01260712694 = getUserToClaimBalance(userAddress) | |
321 | - | let currentPeriod = $t01260712694._1 | |
322 | - | let toClaim = $t01260712694._2 | |
323 | - | let nextPeriod = $t01260712694._3 | |
324 | - | let toUnlock = $t01260712694._4 | |
308 | + | let $t01199912059 = getUserToClaimBalance(userAddress) | |
309 | + | let toClaim = $t01199912059._1 | |
310 | + | let toUnlock = $t01199912059._2 | |
325 | 311 | let nodeList = getUserLeasingNodeList(userAddress) | |
326 | - | $Tuple2(nil, $ | |
312 | + | $Tuple2(nil, $Tuple3(toClaim, toUnlock, nodeList)) | |
327 | 313 | } | |
328 | 314 | ||
329 | 315 | ||
330 | 316 | ||
331 | 317 | @Callable(i) | |
332 | 318 | func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i) | |
333 | 319 | ||
334 | 320 | ||
335 | 321 | ||
336 | 322 | @Callable(i) | |
337 | 323 | func stake (nodeAddress) = { | |
338 | 324 | let userAddress = toString(i.caller) | |
339 | 325 | getStakeActions(nodeAddress, userAddress, i) | |
340 | 326 | } | |
341 | 327 | ||
342 | 328 | ||
343 | 329 | ||
344 | 330 | @Callable(i) | |
345 | 331 | func stakeFromUnlocked (nodeAddress,amount) = { | |
346 | 332 | let userAddress = toString(i.caller) | |
347 | 333 | getStakeFromUnlockedActions(nodeAddress, userAddress, amount) | |
348 | 334 | } | |
349 | 335 | ||
350 | 336 | ||
351 | 337 | ||
352 | 338 | @Callable(i) | |
353 | 339 | func unstake (nodeAddress,amount) = { | |
354 | 340 | let userAddress = toString(i.caller) | |
355 | 341 | getUnstakeActions(nodeAddress, userAddress, amount) | |
356 | 342 | } | |
357 | 343 | ||
358 | 344 | ||
359 | 345 | ||
360 | 346 | @Callable(i) | |
361 | 347 | func claim (amount) = { | |
362 | 348 | let userAddress = toString(i.caller) | |
363 | 349 | getClaimUnlockedActions(userAddress, amount) | |
364 | 350 | } | |
365 | 351 | ||
366 | 352 | ||
367 | 353 | ||
368 | 354 | @Callable(i) | |
369 | 355 | func claimAll () = { | |
370 | 356 | let userAddress = toString(i.caller) | |
371 | - | let $t01365213739 = getUserToClaimBalance(userAddress) | |
372 | - | let currentPeriod = $t01365213739._1 | |
373 | - | let toClaim = $t01365213739._2 | |
374 | - | let nextPeriod = $t01365213739._3 | |
375 | - | let toUnlock = $t01365213739._4 | |
357 | + | let $t01299513055 = getUserToClaimBalance(userAddress) | |
358 | + | let toClaim = $t01299513055._1 | |
359 | + | let toUnlock = $t01299513055._2 | |
376 | 360 | getClaimUnlockedActions(userAddress, toClaim) | |
377 | 361 | } | |
378 | 362 | ||
379 | 363 |
github/deemru/w8io/169f3d6 74.71 ms ◑