tx · ovpcsZnbKjoEq79eq2Ycohf1Zj8USiv3BW2zLRdw1PQ

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01100000 Waves

2024.02.12 20:32 [2973341] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "ovpcsZnbKjoEq79eq2Ycohf1Zj8USiv3BW2zLRdw1PQ", "fee": 1100000, "feeAssetId": null, "timestamp": 1707759135464, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "2wb9qkSTgFrj7a8UMiJ7nJqHqMq4tkAgh5UCSEwk4t8RFQEmQxNNxzgBdCkvbz2jAyR4WJMVjYbDMLYqq9RnGRgh" ], "script": "base64:BgIvCAISAwoBARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgAgAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQABFrZXlQZXJpb2RPZmZzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICCG9mZnNldElkBQNuaWwFA1NFUAAVa2V5UGVyaW9kT2Zmc2V0SGVpZ2h0CQC5CQIJAMwIAgICJXMJAMwIAgIMb2Zmc2V0SGVpZ2h0BQNuaWwFA1NFUAAPa2V5UGVyaW9kTGVuZ3RoCQC5CQIJAMwIAgICJXMJAMwIAgIMcGVyaW9kTGVuZ3RoBQNuaWwFA1NFUAAOcGVyaW9kT2Zmc2V0SWQJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwURa2V5UGVyaW9kT2Zmc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b2NrZWRBY3Rpb25zAgULdXNlckFkZHJlc3MFBmFtb3VudAFpAQhjbGFpbUFsbAAEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQNJHQwMTIwNzgxMjEzOAkBFWdldFVzZXJUb0NsYWltQmFsYW5jZQEFC3VzZXJBZGRyZXNzBAd0b0NsYWltCAUNJHQwMTIwNzgxMjEzOAJfMQQIdG9VbmxvY2sIBQ0kdDAxMjA3ODEyMTM4Al8yBAZjaGVja3MJAMwIAgMJAGYCBQd0b0NsYWltAAAGCQEIdGhyb3dFcnIBAhBub3RoaW5nIHRvIGNsYWltBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQd0b0NsYWltCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAGDhSn0=", "height": 2973341, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BnxhjRvsFxx5GWYAGufgqtCv1BbJxM2tH3hs67eYkZd7 Next: 4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK Diff:
OldNewDifferences
3939
4040
4141 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
42+
43+
44+func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
45+
46+
47+func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
4248
4349
4450 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
140146 if ((checks == checks))
141147 then {
142148 let userLeasingAmount = i.payments[0].amount
143- let $t055095582 = getLeasingNodeData(nodeAddress)
144- let nodeCurrentLeased = $t055095582._1
145- let nodeNextLeased = $t055095582._2
149+ let $t057775850 = getLeasingNodeData(nodeAddress)
150+ let nodeCurrentLeased = $t057775850._1
151+ let nodeNextLeased = $t057775850._2
146152 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
147- let $t056505736 = getUserLeasingData(nodeAddress, userAddress)
148- let userCurrentLeased = $t056505736._1
149- let userNextLeased = $t056505736._2
153+ let $t059186004 = getUserLeasingData(nodeAddress, userAddress)
154+ let userCurrentLeased = $t059186004._1
155+ let userNextLeased = $t059186004._2
150156 let newUserNextLeased = (userNextLeased + userLeasingAmount)
151-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased)]
157+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
152158 }
153159 else throw("Strict value is not equal to itself.")
154160 }
155161
156162
157163 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
158- let $t060806153 = getLeasingNodeData(nodeAddress)
159- let nodeCurrentLeased = $t060806153._1
160- let nodeNextLeased = $t060806153._2
161- let $t061586244 = getUserLeasingData(nodeAddress, userAddress)
162- let userCurrentLeased = $t061586244._1
163- let userNextLeased = $t061586244._2
164+ let $t065166589 = getLeasingNodeData(nodeAddress)
165+ let nodeCurrentLeased = $t065166589._1
166+ let nodeNextLeased = $t065166589._2
167+ let $t065946680 = getUserLeasingData(nodeAddress, userAddress)
168+ let userCurrentLeased = $t065946680._1
169+ let userNextLeased = $t065946680._2
164170 let checks = [if ((unstakeAmount > 0))
165171 then true
166172 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
176182 then {
177183 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
178184 let newUserNextLeased = (userNextLeased - unstakeAmount)
179- let $t069377042 = getUserToClaimBalance(userAddress)
180- let toClaim = $t069377042._1
181- let toUnlock = $t069377042._2
185+ let $t073737478 = getUserToClaimBalance(userAddress)
186+ let toClaim = $t073737478._1
187+ let toUnlock = $t073737478._2
182188 let newToUnlock = (toUnlock + unstakeAmount)
183-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock)]
189+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
184190 }
185191 else throw("Strict value is not equal to itself.")
186192 }
187193
188194
189195 func getClaimUnlockedActions (userAddress,claimAmount) = {
190- let $t074177477 = getUserToClaimBalance(userAddress)
191- let toClaim = $t074177477._1
192- let toUnlock = $t074177477._2
196+ let $t080218081 = getUserToClaimBalance(userAddress)
197+ let toClaim = $t080218081._1
198+ let toUnlock = $t080218081._2
193199 let checks = [if ((claimAmount > 0))
194200 then true
195201 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
207213
208214
209215 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
210- let $t081178177 = getUserToClaimBalance(userAddress)
211- let toClaim = $t081178177._1
212- let toUnlock = $t081178177._2
216+ let $t087218781 = getUserToClaimBalance(userAddress)
217+ let toClaim = $t087218781._1
218+ let toUnlock = $t087218781._2
213219 let available = (toUnlock + toClaim)
214220 let checks = [if ((userLeasingAmount > 0))
215221 then true
222228 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
223229 if ((checks == checks))
224230 then {
225- let $t086548727 = getLeasingNodeData(nodeAddress)
226- let nodeCurrentLeased = $t086548727._1
227- let nodeNextLeased = $t086548727._2
231+ let $t092589331 = getLeasingNodeData(nodeAddress)
232+ let nodeCurrentLeased = $t092589331._1
233+ let nodeNextLeased = $t092589331._2
228234 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
229- let $t087958881 = getUserLeasingData(nodeAddress, userAddress)
230- let userCurrentLeased = $t087958881._1
231- let userNextLeased = $t087958881._2
235+ let $t093999485 = getUserLeasingData(nodeAddress, userAddress)
236+ let userCurrentLeased = $t093999485._1
237+ let userNextLeased = $t093999485._2
232238 let newUserNextLeased = (userNextLeased + userLeasingAmount)
233239 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
234240 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
235-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock)]
241+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
236242 }
237243 else throw("Strict value is not equal to itself.")
238244 }
257263
258264 @Callable(i)
259265 func getNodeDataREADONLY (nodeAddress) = {
260- let $t01010810172 = getLeasingNodeData(nodeAddress)
261- let currentLease = $t01010810172._1
262- let nextLeased = $t01010810172._2
266+ let $t01088010944 = getLeasingNodeData(nodeAddress)
267+ let currentLease = $t01088010944._1
268+ let nextLeased = $t01088010944._2
263269 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
264270 }
265271
267273
268274 @Callable(i)
269275 func getUserDataREADONLY (userAddress) = {
270- let $t01032810388 = getUserToClaimBalance(userAddress)
271- let toClaim = $t01032810388._1
272- let toUnlock = $t01032810388._2
276+ let $t01110011160 = getUserToClaimBalance(userAddress)
277+ let toClaim = $t01110011160._1
278+ let toUnlock = $t01110011160._2
273279 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
274280 }
275281
315321 @Callable(i)
316322 func claimAll () = {
317323 let userAddress = toString(i.caller)
318- let $t01130611366 = getUserToClaimBalance(userAddress)
319- let toClaim = $t01130611366._1
320- let toUnlock = $t01130611366._2
324+ let $t01207812138 = getUserToClaimBalance(userAddress)
325+ let toClaim = $t01207812138._1
326+ let toUnlock = $t01207812138._2
321327 let checks = [if ((toClaim > 0))
322328 then true
323329 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 keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1414
1515 let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP)
1616
1717 let keyPeriodLength = makeString(["%s", "periodLength"], SEP)
1818
1919 let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0)
2020
2121 let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000)
2222
2323 let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1)
2424
2525 let currentPeriodId = if (if ((height > periodOffsetHeight))
2626 then (periodOffsetHeight != -1)
2727 else false)
2828 then (((height - periodOffsetHeight) / periodLength) + periodOffsetId)
2929 else max([0, (periodOffsetId - 1)])
3030
3131 let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength))
3232
3333 let nextPeriodHeight = (currentPeriodHeight + periodLength)
3434
3535 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
3636
3737
3838 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
3939
4040
4141 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
42+
43+
44+func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
45+
46+
47+func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
4248
4349
4450 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
4551
4652 let assetIdBytes = if ((assetIdString == "WAVES"))
4753 then unit
4854 else fromBase58String(assetIdString)
4955
5056 func isValidAddress (address) = match addressFromString(address) {
5157 case a: Address =>
5258 true
5359 case _ =>
5460 false
5561 }
5662
5763
5864 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
5965 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
6066 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
6167 }
6268
6369
6470 func getLeasingNodeData (nodeAddress) = {
6571 let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
6672 match leasingNodeDataStringRaw {
6773 case ds: String =>
6874 let dataList = split(ds, SEP)
6975 let nodeCurrentPeriod = parseIntValue(dataList[1])
7076 let nodeCurrentLeased = parseIntValue(dataList[2])
7177 let nodeNextPeriod = parseIntValue(dataList[3])
7278 let nodeNextLeased = parseIntValue(dataList[4])
7379 if ((nodeNextPeriod > height))
7480 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
7581 else $Tuple2(nodeNextLeased, nodeNextLeased)
7682 case _ =>
7783 $Tuple2(0, 0)
7884 }
7985 }
8086
8187
8288 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
8389 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
8490 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
8591 }
8692
8793
8894 func getUserLeasingData (nodeAddress,userAddress) = {
8995 let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
9096 match leasingUserDataStringRaw {
9197 case ds: String =>
9298 let dataList = split(ds, SEP)
9399 let userCurrentPeriod = parseIntValue(dataList[1])
94100 let userCurrentLeased = parseIntValue(dataList[2])
95101 let userNextPeriod = parseIntValue(dataList[3])
96102 let userNextLeased = parseIntValue(dataList[4])
97103 if ((userNextPeriod > height))
98104 then $Tuple2(userCurrentLeased, userNextLeased)
99105 else $Tuple2(userNextLeased, userNextLeased)
100106 case _ =>
101107 $Tuple2(0, 0)
102108 }
103109 }
104110
105111
106112 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
107113 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
108114 StringEntry(keyUserToClaim(userAddress), valueString)
109115 }
110116
111117
112118 func getUserToClaimBalance (userAddress) = {
113119 let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress))
114120 match userToClaimDataStringRaw {
115121 case ds: String =>
116122 let dataList = split(ds, SEP)
117123 let currentPeriod = parseIntValue(dataList[1])
118124 let toClaim = parseIntValue(dataList[2])
119125 let nextPeriod = parseIntValue(dataList[3])
120126 let toUnlock = parseIntValue(dataList[4])
121127 if ((nextPeriod > height))
122128 then $Tuple2(toClaim, toUnlock)
123129 else $Tuple2((toClaim + toUnlock), 0)
124130 case _ =>
125131 $Tuple2(0, 0)
126132 }
127133 }
128134
129135
130136 func getStakeActions (nodeAddress,userAddress,i) = {
131137 let checks = [if ((size(i.payments) == 1))
132138 then true
133139 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
134140 then true
135141 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
136142 then true
137143 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
138144 then true
139145 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
140146 if ((checks == checks))
141147 then {
142148 let userLeasingAmount = i.payments[0].amount
143- let $t055095582 = getLeasingNodeData(nodeAddress)
144- let nodeCurrentLeased = $t055095582._1
145- let nodeNextLeased = $t055095582._2
149+ let $t057775850 = getLeasingNodeData(nodeAddress)
150+ let nodeCurrentLeased = $t057775850._1
151+ let nodeNextLeased = $t057775850._2
146152 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
147- let $t056505736 = getUserLeasingData(nodeAddress, userAddress)
148- let userCurrentLeased = $t056505736._1
149- let userNextLeased = $t056505736._2
153+ let $t059186004 = getUserLeasingData(nodeAddress, userAddress)
154+ let userCurrentLeased = $t059186004._1
155+ let userNextLeased = $t059186004._2
150156 let newUserNextLeased = (userNextLeased + userLeasingAmount)
151-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased)]
157+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
152158 }
153159 else throw("Strict value is not equal to itself.")
154160 }
155161
156162
157163 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
158- let $t060806153 = getLeasingNodeData(nodeAddress)
159- let nodeCurrentLeased = $t060806153._1
160- let nodeNextLeased = $t060806153._2
161- let $t061586244 = getUserLeasingData(nodeAddress, userAddress)
162- let userCurrentLeased = $t061586244._1
163- let userNextLeased = $t061586244._2
164+ let $t065166589 = getLeasingNodeData(nodeAddress)
165+ let nodeCurrentLeased = $t065166589._1
166+ let nodeNextLeased = $t065166589._2
167+ let $t065946680 = getUserLeasingData(nodeAddress, userAddress)
168+ let userCurrentLeased = $t065946680._1
169+ let userNextLeased = $t065946680._2
164170 let checks = [if ((unstakeAmount > 0))
165171 then true
166172 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
167173 then true
168174 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
169175 then true
170176 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
171177 then true
172178 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
173179 then true
174180 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
175181 if ((checks == checks))
176182 then {
177183 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
178184 let newUserNextLeased = (userNextLeased - unstakeAmount)
179- let $t069377042 = getUserToClaimBalance(userAddress)
180- let toClaim = $t069377042._1
181- let toUnlock = $t069377042._2
185+ let $t073737478 = getUserToClaimBalance(userAddress)
186+ let toClaim = $t073737478._1
187+ let toUnlock = $t073737478._2
182188 let newToUnlock = (toUnlock + unstakeAmount)
183-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock)]
189+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
184190 }
185191 else throw("Strict value is not equal to itself.")
186192 }
187193
188194
189195 func getClaimUnlockedActions (userAddress,claimAmount) = {
190- let $t074177477 = getUserToClaimBalance(userAddress)
191- let toClaim = $t074177477._1
192- let toUnlock = $t074177477._2
196+ let $t080218081 = getUserToClaimBalance(userAddress)
197+ let toClaim = $t080218081._1
198+ let toUnlock = $t080218081._2
193199 let checks = [if ((claimAmount > 0))
194200 then true
195201 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
196202 then true
197203 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
198204 then true
199205 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
200206 if ((checks == checks))
201207 then {
202208 let newToClaim = (toClaim - claimAmount)
203209 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
204210 }
205211 else throw("Strict value is not equal to itself.")
206212 }
207213
208214
209215 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
210- let $t081178177 = getUserToClaimBalance(userAddress)
211- let toClaim = $t081178177._1
212- let toUnlock = $t081178177._2
216+ let $t087218781 = getUserToClaimBalance(userAddress)
217+ let toClaim = $t087218781._1
218+ let toUnlock = $t087218781._2
213219 let available = (toUnlock + toClaim)
214220 let checks = [if ((userLeasingAmount > 0))
215221 then true
216222 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
217223 then true
218224 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
219225 then true
220226 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
221227 then true
222228 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
223229 if ((checks == checks))
224230 then {
225- let $t086548727 = getLeasingNodeData(nodeAddress)
226- let nodeCurrentLeased = $t086548727._1
227- let nodeNextLeased = $t086548727._2
231+ let $t092589331 = getLeasingNodeData(nodeAddress)
232+ let nodeCurrentLeased = $t092589331._1
233+ let nodeNextLeased = $t092589331._2
228234 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
229- let $t087958881 = getUserLeasingData(nodeAddress, userAddress)
230- let userCurrentLeased = $t087958881._1
231- let userNextLeased = $t087958881._2
235+ let $t093999485 = getUserLeasingData(nodeAddress, userAddress)
236+ let userCurrentLeased = $t093999485._1
237+ let userNextLeased = $t093999485._2
232238 let newUserNextLeased = (userNextLeased + userLeasingAmount)
233239 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
234240 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
235-[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock)]
241+[getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
236242 }
237243 else throw("Strict value is not equal to itself.")
238244 }
239245
240246
241247 func getSetNewPeriodLengthActions (newPeriodLength) = {
242248 let check = [if ((newPeriodLength > 0))
243249 then true
244250 else throwErr("period length should be greater than 0")]
245251 if ((check == check))
246252 then if ((periodOffsetHeight == -1))
247253 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
248254 else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
249255 else throw("Strict value is not equal to itself.")
250256 }
251257
252258
253259 @Callable(i)
254260 func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
255261
256262
257263
258264 @Callable(i)
259265 func getNodeDataREADONLY (nodeAddress) = {
260- let $t01010810172 = getLeasingNodeData(nodeAddress)
261- let currentLease = $t01010810172._1
262- let nextLeased = $t01010810172._2
266+ let $t01088010944 = getLeasingNodeData(nodeAddress)
267+ let currentLease = $t01088010944._1
268+ let nextLeased = $t01088010944._2
263269 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
264270 }
265271
266272
267273
268274 @Callable(i)
269275 func getUserDataREADONLY (userAddress) = {
270- let $t01032810388 = getUserToClaimBalance(userAddress)
271- let toClaim = $t01032810388._1
272- let toUnlock = $t01032810388._2
276+ let $t01110011160 = getUserToClaimBalance(userAddress)
277+ let toClaim = $t01110011160._1
278+ let toUnlock = $t01110011160._2
273279 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
274280 }
275281
276282
277283
278284 @Callable(i)
279285 func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
280286
281287
282288
283289 @Callable(i)
284290 func stake (nodeAddress) = {
285291 let userAddress = toString(i.caller)
286292 getStakeActions(nodeAddress, userAddress, i)
287293 }
288294
289295
290296
291297 @Callable(i)
292298 func stakeFromUnlocked (nodeAddress,amount) = {
293299 let userAddress = toString(i.caller)
294300 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
295301 }
296302
297303
298304
299305 @Callable(i)
300306 func unstake (nodeAddress,amount) = {
301307 let userAddress = toString(i.caller)
302308 getUnstakeActions(nodeAddress, userAddress, amount)
303309 }
304310
305311
306312
307313 @Callable(i)
308314 func claim (amount) = {
309315 let userAddress = toString(i.caller)
310316 getClaimUnlockedActions(userAddress, amount)
311317 }
312318
313319
314320
315321 @Callable(i)
316322 func claimAll () = {
317323 let userAddress = toString(i.caller)
318- let $t01130611366 = getUserToClaimBalance(userAddress)
319- let toClaim = $t01130611366._1
320- let toUnlock = $t01130611366._2
324+ let $t01207812138 = getUserToClaimBalance(userAddress)
325+ let toClaim = $t01207812138._1
326+ let toUnlock = $t01207812138._2
321327 let checks = [if ((toClaim > 0))
322328 then true
323329 else throwErr("nothing to claim")]
324330 if ((checks == checks))
325331 then getClaimUnlockedActions(userAddress, toClaim)
326332 else throw("Strict value is not equal to itself.")
327333 }
328334
329335

github/deemru/w8io/169f3d6 
80.54 ms