tx · Eh4JLzabPA8AzVPjEcfj9V8sMt8xCEzA8fRbiiqmRfY8

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01300000 Waves

2024.02.14 09:54 [2975559] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "Eh4JLzabPA8AzVPjEcfj9V8sMt8xCEzA8fRbiiqmRfY8", "fee": 1300000, "feeAssetId": null, "timestamp": 1707893655847, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "VSAfuztj954gxHaD8WXG9E2WDDRSdGXgWkqN92EsvvcYGiMPBQ9VQmtKucNqwjuCPAqdAQdLEHDtRzArFkHxNr6" ], "script": "base64:BgI0CAISAwoBARIDCgEEEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESACgADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUFkbWluTGlzdAkAuQkCCQDMCAICAiVzCQDMCAICCWFkbWluTGlzdAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJ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b2NrZWQCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQEbZ2V0U3Rha2VGcm9tVW5sb2NrZWRBY3Rpb25zAwULbm9kZUFkZHJlc3MFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQELY2FuY2VsTGVhc2UCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQERZ2V0VW5zdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQVjbGFpbQEGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQEIY2xhaW1BbGwABAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDE0NTU4MTQ2MTgJARVnZXRVc2VyVG9DbGFpbUJhbGFuY2UBBQt1c2VyQWRkcmVzcwQHdG9DbGFpbQgFDSR0MDE0NTU4MTQ2MTgCXzEECHRvVW5sb2NrCAUNJHQwMTQ1NTgxNDYxOAJfMgQGY2hlY2tzCQDMCAIDCQBmAgUHdG9DbGFpbQAABgkBCHRocm93RXJyAQIQbm90aGluZyB0byBjbGFpbQUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzCQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgB6Kn7f", "height": 2975559, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EHjWDZsTpFpnHRJcNvoFYUXwufcHiSSgN5ZQY6LN25up Next: 4QGBpEr1MLNb9nuazfRv9SPBRzZKUCdU3UwUCYA7JvAo Diff:
OldNewDifferences
3939 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
4040
4141
42+func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
43+
44+
4245 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
4346
4447
45-func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
48+func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP)
4649
4750
4851 func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
144147 }
145148
146149
150+func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked)
151+
152+
153+func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0)
154+
155+
147156 func getStakeActions (nodeAddress,userAddress,i) = {
148157 let checks = [if (!(isForceStop))
149158 then true
159168 if ((checks == checks))
160169 then {
161170 let userLeasingAmount = i.payments[0].amount
162- let $t061786251 = getLeasingNodeData(nodeAddress)
163- let nodeCurrentLeased = $t061786251._1
164- let nodeNextLeased = $t061786251._2
171+ let $t066206693 = getLeasingNodeData(nodeAddress)
172+ let nodeCurrentLeased = $t066206693._1
173+ let nodeNextLeased = $t066206693._2
165174 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
166- let $t063196405 = getUserLeasingData(nodeAddress, userAddress)
167- let userCurrentLeased = $t063196405._1
168- let userNextLeased = $t063196405._2
175+ let $t067616847 = getUserLeasingData(nodeAddress, userAddress)
176+ let userCurrentLeased = $t067616847._1
177+ let userNextLeased = $t067616847._2
169178 let newUserNextLeased = (userNextLeased + userLeasingAmount)
170-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
179+ let userTotalLocked = getUserTotalLocked(userAddress)
180+ let newUserTotalLocked = (userTotalLocked + userLeasingAmount)
181+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
171182 }
172183 else throw("Strict value is not equal to itself.")
173184 }
174185
175186
176187 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
177- let $t069176990 = getLeasingNodeData(nodeAddress)
178- let nodeCurrentLeased = $t069176990._1
179- let nodeNextLeased = $t069176990._2
180- let $t069957081 = getUserLeasingData(nodeAddress, userAddress)
181- let userCurrentLeased = $t069957081._1
182- let userNextLeased = $t069957081._2
188+ let $t075497622 = getLeasingNodeData(nodeAddress)
189+ let nodeCurrentLeased = $t075497622._1
190+ let nodeNextLeased = $t075497622._2
191+ let $t076277713 = getUserLeasingData(nodeAddress, userAddress)
192+ let userCurrentLeased = $t076277713._1
193+ let userNextLeased = $t076277713._2
183194 let checks = [if (!(isForceStop))
184195 then true
185196 else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0))
197208 then {
198209 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
199210 let newUserNextLeased = (userNextLeased - unstakeAmount)
200- let $t078427947 = getUserToClaimBalance(userAddress)
201- let toClaim = $t078427947._1
202- let toUnlock = $t078427947._2
211+ let $t085268586 = getUserToClaimBalance(userAddress)
212+ let toClaim = $t085268586._1
213+ let toUnlock = $t085268586._2
203214 let newToUnlock = (toUnlock + unstakeAmount)
204-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
215+ let userTotalLocked = getUserTotalLocked(userAddress)
216+ let newUserTotalLocked = (userTotalLocked - unstakeAmount)
217+[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)]
205218 }
206219 else throw("Strict value is not equal to itself.")
207220 }
208221
209222
210223 func getClaimUnlockedActions (userAddress,claimAmount) = {
211- let $t084908550 = getUserToClaimBalance(userAddress)
212- let toClaim = $t084908550._1
213- let toUnlock = $t084908550._2
224+ let $t093159375 = getUserToClaimBalance(userAddress)
225+ let toClaim = $t093159375._1
226+ let toUnlock = $t093159375._2
214227 let checks = [if (!(isForceStop))
215228 then true
216229 else throwErr("contract is temporary stopped"), if ((claimAmount > 0))
230243
231244
232245 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
233- let $t092589318 = getUserToClaimBalance(userAddress)
234- let toClaim = $t092589318._1
235- let toUnlock = $t092589318._2
246+ let $t01010910169 = getUserToClaimBalance(userAddress)
247+ let toClaim = $t01010910169._1
248+ let toUnlock = $t01010910169._2
236249 let available = (toUnlock + toClaim)
237250 let checks = [if (!(isForceStop))
238251 then true
240253 then true
241254 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
242255 then true
243- else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
256+ else throwErr("amount should be less or equal available amount"), if (isValidAddress(nodeAddress))
244257 then true
245258 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
246259 then true
247260 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
248261 if ((checks == checks))
249262 then {
250- let $t098639936 = getLeasingNodeData(nodeAddress)
251- let nodeCurrentLeased = $t098639936._1
252- let nodeNextLeased = $t098639936._2
263+ let $t01075710830 = getLeasingNodeData(nodeAddress)
264+ let nodeCurrentLeased = $t01075710830._1
265+ let nodeNextLeased = $t01075710830._2
253266 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
254- let $t01000410090 = getUserLeasingData(nodeAddress, userAddress)
255- let userCurrentLeased = $t01000410090._1
256- let userNextLeased = $t01000410090._2
267+ let $t01089810984 = getUserLeasingData(nodeAddress, userAddress)
268+ let userCurrentLeased = $t01089810984._1
269+ let userNextLeased = $t01089810984._2
257270 let newUserNextLeased = (userNextLeased + userLeasingAmount)
258271 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
259272 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
260-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
273+ let userTotalLocked = getUserTotalLocked(userAddress)
274+ let newUserTotalLocked = (userTotalLocked + userLeasingAmount)
275+[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)]
261276 }
262277 else throw("Strict value is not equal to itself.")
263278 }
301316
302317 @Callable(i)
303318 func getNodeDataREADONLY (nodeAddress) = {
304- let $t01198612050 = getLeasingNodeData(nodeAddress)
305- let currentLease = $t01198612050._1
306- let nextLeased = $t01198612050._2
319+ let $t01307013134 = getLeasingNodeData(nodeAddress)
320+ let currentLease = $t01307013134._1
321+ let nextLeased = $t01307013134._2
307322 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
308323 }
309324
311326
312327 @Callable(i)
313328 func getUserDataREADONLY (userAddress) = {
314- let $t01239912459 = getUserToClaimBalance(userAddress)
315- let toClaim = $t01239912459._1
316- let toUnlock = $t01239912459._2
317- $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
329+ let $t01349713557 = getUserToClaimBalance(userAddress)
330+ let toClaim = $t01349713557._1
331+ let toUnlock = $t01349713557._2
332+ let userTotalLocked = getUserTotalLocked(userAddress)
333+ $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height))
318334 }
319335
320336
333349
334350
335351 @Callable(i)
336-func leaseFromUnlocked (nodeAddress,amount) = {
352+func leaseFromLocked (nodeAddress,amount) = {
337353 let userAddress = toString(i.caller)
338354 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
339355 }
359375 @Callable(i)
360376 func claimAll () = {
361377 let userAddress = toString(i.caller)
362- let $t01338713447 = getUserToClaimBalance(userAddress)
363- let toClaim = $t01338713447._1
364- let toUnlock = $t01338713447._2
378+ let $t01455814618 = getUserToClaimBalance(userAddress)
379+ let toClaim = $t01455814618._1
380+ let toUnlock = $t01455814618._2
365381 let checks = [if ((toClaim > 0))
366382 then true
367383 else throwErr("nothing to claim")]
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let contractFile = "l2mp_leasing.ride"
55
66 let SEP = "__"
77
88 func throwErr (msg) = throw(((contractFile + ": ") + msg))
99
1010
1111 let keyAssetId = makeString(["%s", "assetId"], SEP)
1212
1313 let keyAdminList = makeString(["%s", "adminList"], SEP)
1414
1515 let keyForceStop = makeString(["%s", "forceStop"], SEP)
1616
1717 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1818
1919 let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP)
2020
2121 let keyPeriodLength = makeString(["%s", "periodLength"], SEP)
2222
2323 let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0)
2424
2525 let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000)
2626
2727 let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1)
2828
2929 let currentPeriodId = if (if ((height > periodOffsetHeight))
3030 then (periodOffsetHeight != -1)
3131 else false)
3232 then (((height - periodOffsetHeight) / periodLength) + periodOffsetId)
3333 else max([0, (periodOffsetId - 1)])
3434
3535 let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength))
3636
3737 let nextPeriodHeight = (currentPeriodHeight + periodLength)
3838
3939 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
4040
4141
42+func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
43+
44+
4245 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
4346
4447
45-func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
48+func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP)
4649
4750
4851 func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
4952
5053
5154 func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
5255
5356
5457 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
5558
5659 let assetIdBytes = if ((assetIdString == "WAVES"))
5760 then unit
5861 else fromBase58String(assetIdString)
5962
6063 let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
6164
6265 let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false)
6366
6467 func isAdmin (address) = containsElement(adminListRaw, address)
6568
6669
6770 func isValidAddress (address) = match addressFromString(address) {
6871 case a: Address =>
6972 true
7073 case _ =>
7174 false
7275 }
7376
7477
7578 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
7679 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
7780 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
7881 }
7982
8083
8184 func getLeasingNodeData (nodeAddress) = {
8285 let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
8386 match leasingNodeDataStringRaw {
8487 case ds: String =>
8588 let dataList = split(ds, SEP)
8689 let nodeCurrentPeriod = parseIntValue(dataList[1])
8790 let nodeCurrentLeased = parseIntValue(dataList[2])
8891 let nodeNextPeriod = parseIntValue(dataList[3])
8992 let nodeNextLeased = parseIntValue(dataList[4])
9093 if ((nodeNextPeriod > height))
9194 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
9295 else $Tuple2(nodeNextLeased, nodeNextLeased)
9396 case _ =>
9497 $Tuple2(0, 0)
9598 }
9699 }
97100
98101
99102 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
100103 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
101104 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
102105 }
103106
104107
105108 func getUserLeasingData (nodeAddress,userAddress) = {
106109 let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
107110 match leasingUserDataStringRaw {
108111 case ds: String =>
109112 let dataList = split(ds, SEP)
110113 let userCurrentPeriod = parseIntValue(dataList[1])
111114 let userCurrentLeased = parseIntValue(dataList[2])
112115 let userNextPeriod = parseIntValue(dataList[3])
113116 let userNextLeased = parseIntValue(dataList[4])
114117 if ((userNextPeriod > height))
115118 then $Tuple2(userCurrentLeased, userNextLeased)
116119 else $Tuple2(userNextLeased, userNextLeased)
117120 case _ =>
118121 $Tuple2(0, 0)
119122 }
120123 }
121124
122125
123126 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
124127 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
125128 StringEntry(keyUserToClaim(userAddress), valueString)
126129 }
127130
128131
129132 func getUserToClaimBalance (userAddress) = {
130133 let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress))
131134 match userToClaimDataStringRaw {
132135 case ds: String =>
133136 let dataList = split(ds, SEP)
134137 let currentPeriod = parseIntValue(dataList[1])
135138 let toClaim = parseIntValue(dataList[2])
136139 let nextPeriod = parseIntValue(dataList[3])
137140 let toUnlock = parseIntValue(dataList[4])
138141 if ((nextPeriod > height))
139142 then $Tuple2(toClaim, toUnlock)
140143 else $Tuple2((toClaim + toUnlock), 0)
141144 case _ =>
142145 $Tuple2(0, 0)
143146 }
144147 }
145148
146149
150+func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked)
151+
152+
153+func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0)
154+
155+
147156 func getStakeActions (nodeAddress,userAddress,i) = {
148157 let checks = [if (!(isForceStop))
149158 then true
150159 else throwErr("contract is temporary stopped"), if ((size(i.payments) == 1))
151160 then true
152161 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
153162 then true
154163 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
155164 then true
156165 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
157166 then true
158167 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
159168 if ((checks == checks))
160169 then {
161170 let userLeasingAmount = i.payments[0].amount
162- let $t061786251 = getLeasingNodeData(nodeAddress)
163- let nodeCurrentLeased = $t061786251._1
164- let nodeNextLeased = $t061786251._2
171+ let $t066206693 = getLeasingNodeData(nodeAddress)
172+ let nodeCurrentLeased = $t066206693._1
173+ let nodeNextLeased = $t066206693._2
165174 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
166- let $t063196405 = getUserLeasingData(nodeAddress, userAddress)
167- let userCurrentLeased = $t063196405._1
168- let userNextLeased = $t063196405._2
175+ let $t067616847 = getUserLeasingData(nodeAddress, userAddress)
176+ let userCurrentLeased = $t067616847._1
177+ let userNextLeased = $t067616847._2
169178 let newUserNextLeased = (userNextLeased + userLeasingAmount)
170-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
179+ let userTotalLocked = getUserTotalLocked(userAddress)
180+ let newUserTotalLocked = (userTotalLocked + userLeasingAmount)
181+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
171182 }
172183 else throw("Strict value is not equal to itself.")
173184 }
174185
175186
176187 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
177- let $t069176990 = getLeasingNodeData(nodeAddress)
178- let nodeCurrentLeased = $t069176990._1
179- let nodeNextLeased = $t069176990._2
180- let $t069957081 = getUserLeasingData(nodeAddress, userAddress)
181- let userCurrentLeased = $t069957081._1
182- let userNextLeased = $t069957081._2
188+ let $t075497622 = getLeasingNodeData(nodeAddress)
189+ let nodeCurrentLeased = $t075497622._1
190+ let nodeNextLeased = $t075497622._2
191+ let $t076277713 = getUserLeasingData(nodeAddress, userAddress)
192+ let userCurrentLeased = $t076277713._1
193+ let userNextLeased = $t076277713._2
183194 let checks = [if (!(isForceStop))
184195 then true
185196 else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0))
186197 then true
187198 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
188199 then true
189200 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
190201 then true
191202 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
192203 then true
193204 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
194205 then true
195206 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
196207 if ((checks == checks))
197208 then {
198209 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
199210 let newUserNextLeased = (userNextLeased - unstakeAmount)
200- let $t078427947 = getUserToClaimBalance(userAddress)
201- let toClaim = $t078427947._1
202- let toUnlock = $t078427947._2
211+ let $t085268586 = getUserToClaimBalance(userAddress)
212+ let toClaim = $t085268586._1
213+ let toUnlock = $t085268586._2
203214 let newToUnlock = (toUnlock + unstakeAmount)
204-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
215+ let userTotalLocked = getUserTotalLocked(userAddress)
216+ let newUserTotalLocked = (userTotalLocked - unstakeAmount)
217+[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)]
205218 }
206219 else throw("Strict value is not equal to itself.")
207220 }
208221
209222
210223 func getClaimUnlockedActions (userAddress,claimAmount) = {
211- let $t084908550 = getUserToClaimBalance(userAddress)
212- let toClaim = $t084908550._1
213- let toUnlock = $t084908550._2
224+ let $t093159375 = getUserToClaimBalance(userAddress)
225+ let toClaim = $t093159375._1
226+ let toUnlock = $t093159375._2
214227 let checks = [if (!(isForceStop))
215228 then true
216229 else throwErr("contract is temporary stopped"), if ((claimAmount > 0))
217230 then true
218231 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
219232 then true
220233 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
221234 then true
222235 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
223236 if ((checks == checks))
224237 then {
225238 let newToClaim = (toClaim - claimAmount)
226239 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
227240 }
228241 else throw("Strict value is not equal to itself.")
229242 }
230243
231244
232245 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
233- let $t092589318 = getUserToClaimBalance(userAddress)
234- let toClaim = $t092589318._1
235- let toUnlock = $t092589318._2
246+ let $t01010910169 = getUserToClaimBalance(userAddress)
247+ let toClaim = $t01010910169._1
248+ let toUnlock = $t01010910169._2
236249 let available = (toUnlock + toClaim)
237250 let checks = [if (!(isForceStop))
238251 then true
239252 else throwErr("contract is temporary stopped"), if ((userLeasingAmount > 0))
240253 then true
241254 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
242255 then true
243- else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
256+ else throwErr("amount should be less or equal available amount"), if (isValidAddress(nodeAddress))
244257 then true
245258 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
246259 then true
247260 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
248261 if ((checks == checks))
249262 then {
250- let $t098639936 = getLeasingNodeData(nodeAddress)
251- let nodeCurrentLeased = $t098639936._1
252- let nodeNextLeased = $t098639936._2
263+ let $t01075710830 = getLeasingNodeData(nodeAddress)
264+ let nodeCurrentLeased = $t01075710830._1
265+ let nodeNextLeased = $t01075710830._2
253266 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
254- let $t01000410090 = getUserLeasingData(nodeAddress, userAddress)
255- let userCurrentLeased = $t01000410090._1
256- let userNextLeased = $t01000410090._2
267+ let $t01089810984 = getUserLeasingData(nodeAddress, userAddress)
268+ let userCurrentLeased = $t01089810984._1
269+ let userNextLeased = $t01089810984._2
257270 let newUserNextLeased = (userNextLeased + userLeasingAmount)
258271 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
259272 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
260-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
273+ let userTotalLocked = getUserTotalLocked(userAddress)
274+ let newUserTotalLocked = (userTotalLocked + userLeasingAmount)
275+[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)]
261276 }
262277 else throw("Strict value is not equal to itself.")
263278 }
264279
265280
266281 func getSetNewPeriodLengthActions (newPeriodLength) = {
267282 let check = [if ((newPeriodLength > 0))
268283 then true
269284 else throwErr("period length should be greater than 0")]
270285 if ((check == check))
271286 then if ((periodOffsetHeight == -1))
272287 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
273288 else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
274289 else throw("Strict value is not equal to itself.")
275290 }
276291
277292
278293 @Callable(i)
279294 func setNewPeriodLength (newPeriodLength) = {
280295 let checks = [if (isAdmin(toString(i.caller)))
281296 then true
282297 else throwErr("caller is not in adminList")]
283298 if ((checks == checks))
284299 then getSetNewPeriodLengthActions(newPeriodLength)
285300 else throw("Strict value is not equal to itself.")
286301 }
287302
288303
289304
290305 @Callable(i)
291306 func setForceStopFlag (stop) = {
292307 let check = [if (isAdmin(toString(i.caller)))
293308 then true
294309 else throwErr("caller is not an admin")]
295310 if ((check == check))
296311 then [BooleanEntry(keyForceStop, stop)]
297312 else throw("Strict value is not equal to itself.")
298313 }
299314
300315
301316
302317 @Callable(i)
303318 func getNodeDataREADONLY (nodeAddress) = {
304- let $t01198612050 = getLeasingNodeData(nodeAddress)
305- let currentLease = $t01198612050._1
306- let nextLeased = $t01198612050._2
319+ let $t01307013134 = getLeasingNodeData(nodeAddress)
320+ let currentLease = $t01307013134._1
321+ let nextLeased = $t01307013134._2
307322 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
308323 }
309324
310325
311326
312327 @Callable(i)
313328 func getUserDataREADONLY (userAddress) = {
314- let $t01239912459 = getUserToClaimBalance(userAddress)
315- let toClaim = $t01239912459._1
316- let toUnlock = $t01239912459._2
317- $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
329+ let $t01349713557 = getUserToClaimBalance(userAddress)
330+ let toClaim = $t01349713557._1
331+ let toUnlock = $t01349713557._2
332+ let userTotalLocked = getUserTotalLocked(userAddress)
333+ $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height))
318334 }
319335
320336
321337
322338 @Callable(i)
323339 func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
324340
325341
326342
327343 @Callable(i)
328344 func lease (nodeAddress) = {
329345 let userAddress = toString(i.caller)
330346 getStakeActions(nodeAddress, userAddress, i)
331347 }
332348
333349
334350
335351 @Callable(i)
336-func leaseFromUnlocked (nodeAddress,amount) = {
352+func leaseFromLocked (nodeAddress,amount) = {
337353 let userAddress = toString(i.caller)
338354 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
339355 }
340356
341357
342358
343359 @Callable(i)
344360 func cancelLease (nodeAddress,amount) = {
345361 let userAddress = toString(i.caller)
346362 getUnstakeActions(nodeAddress, userAddress, amount)
347363 }
348364
349365
350366
351367 @Callable(i)
352368 func claim (amount) = {
353369 let userAddress = toString(i.caller)
354370 getClaimUnlockedActions(userAddress, amount)
355371 }
356372
357373
358374
359375 @Callable(i)
360376 func claimAll () = {
361377 let userAddress = toString(i.caller)
362- let $t01338713447 = getUserToClaimBalance(userAddress)
363- let toClaim = $t01338713447._1
364- let toUnlock = $t01338713447._2
378+ let $t01455814618 = getUserToClaimBalance(userAddress)
379+ let toClaim = $t01455814618._1
380+ let toUnlock = $t01455814618._2
365381 let checks = [if ((toClaim > 0))
366382 then true
367383 else throwErr("nothing to claim")]
368384 if ((checks == checks))
369385 then getClaimUnlockedActions(userAddress, toClaim)
370386 else throw("Strict value is not equal to itself.")
371387 }
372388
373389

github/deemru/w8io/026f985 
80.72 ms