tx · EHjWDZsTpFpnHRJcNvoFYUXwufcHiSSgN5ZQY6LN25up

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01200000 Waves

2024.02.13 17:13 [2974566] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "EHjWDZsTpFpnHRJcNvoFYUXwufcHiSSgN5ZQY6LN25up", "fee": 1200000, "feeAssetId": null, "timestamp": 1707833634370, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "3pB5vXV5sr1CkPGwJRj2X7YUKoipBqUXL4Yxzq6sMqrveMeeetUA9SMQf9SjEX4zazQ8hghPoemFxXBQV9aLFES7" ], "script": "base64:BgI0CAISAwoBARIDCgEEEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESACUADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUFkbWluTGlzdAkAuQkCCQDMCAICAiVzCQDMCAICCWFkbWluTGlzdAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJALkJAgk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c3MFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQELY2FuY2VsTGVhc2UCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQERZ2V0VW5zdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQVjbGFpbQEGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQZhbW91bnQBaQEIY2xhaW1BbGwABAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIEDSR0MDEzMzg3MTM0NDcJARVnZXRVc2VyVG9DbGFpbUJhbGFuY2UBBQt1c2VyQWRkcmVzcwQHdG9DbGFpbQgFDSR0MDEzMzg3MTM0NDcCXzEECHRvVW5sb2NrCAUNJHQwMTMzODcxMzQ0NwJfMgQGY2hlY2tzCQDMCAIDCQBmAgUHdG9DbGFpbQAABgkBCHRocm93RXJyAQIQbm90aGluZyB0byBjbGFpbQUDbmlsAwkAAAIFBmNoZWNrcwUGY2hlY2tzCQEXZ2V0Q2xhaW1VbmxvY2tlZEFjdGlvbnMCBQt1c2VyQWRkcmVzcwUHdG9DbGFpbQkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAwfBbL", "height": 2974566, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FracjSDzeGMWzndkyggfFQAiABE3YrdrNMmXpr579s6f Next: Eh4JLzabPA8AzVPjEcfj9V8sMt8xCEzA8fRbiiqmRfY8 Diff:
OldNewDifferences
145145
146146
147147 func getStakeActions (nodeAddress,userAddress,i) = {
148- let checks = [if ((size(i.payments) == 1))
148+ let checks = [if (!(isForceStop))
149+ then true
150+ else throwErr("contract is temporary stopped"), if ((size(i.payments) == 1))
149151 then true
150152 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
151153 then true
153155 then true
154156 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
155157 then true
156- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
157- then true
158- else throwErr("contract is temporary stopped")]
158+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
159159 if ((checks == checks))
160160 then {
161161 let userLeasingAmount = i.payments[0].amount
180180 let $t069957081 = getUserLeasingData(nodeAddress, userAddress)
181181 let userCurrentLeased = $t069957081._1
182182 let userNextLeased = $t069957081._2
183- let checks = [if ((unstakeAmount > 0))
183+ let checks = [if (!(isForceStop))
184+ then true
185+ else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0))
184186 then true
185187 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
186188 then true
190192 then true
191193 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
192194 then true
193- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
194- then true
195- else throwErr("contract is temporary stopped")]
195+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
196196 if ((checks == checks))
197197 then {
198198 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
211211 let $t084908550 = getUserToClaimBalance(userAddress)
212212 let toClaim = $t084908550._1
213213 let toUnlock = $t084908550._2
214- let checks = [if ((claimAmount > 0))
214+ let checks = [if (!(isForceStop))
215+ then true
216+ else throwErr("contract is temporary stopped"), if ((claimAmount > 0))
215217 then true
216218 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
217219 then true
218220 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
219221 then true
220- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
221- then true
222- else throwErr("contract is temporary stopped")]
222+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
223223 if ((checks == checks))
224224 then {
225225 let newToClaim = (toClaim - claimAmount)
234234 let toClaim = $t092589318._1
235235 let toUnlock = $t092589318._2
236236 let available = (toUnlock + toClaim)
237- let checks = [if ((userLeasingAmount > 0))
237+ let checks = [if (!(isForceStop))
238+ then true
239+ else throwErr("contract is temporary stopped"), if ((userLeasingAmount > 0))
238240 then true
239241 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
240242 then true
242244 then true
243245 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
244246 then true
245- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
246- then true
247- else throwErr("contract is temporary stopped")]
247+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
248248 if ((checks == checks))
249249 then {
250250 let $t098639936 = getLeasingNodeData(nodeAddress)
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
4242 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
4343
4444
4545 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
4646
4747
4848 func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
4949
5050
5151 func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
5252
5353
5454 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
5555
5656 let assetIdBytes = if ((assetIdString == "WAVES"))
5757 then unit
5858 else fromBase58String(assetIdString)
5959
6060 let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
6161
6262 let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false)
6363
6464 func isAdmin (address) = containsElement(adminListRaw, address)
6565
6666
6767 func isValidAddress (address) = match addressFromString(address) {
6868 case a: Address =>
6969 true
7070 case _ =>
7171 false
7272 }
7373
7474
7575 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
7676 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
7777 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
7878 }
7979
8080
8181 func getLeasingNodeData (nodeAddress) = {
8282 let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
8383 match leasingNodeDataStringRaw {
8484 case ds: String =>
8585 let dataList = split(ds, SEP)
8686 let nodeCurrentPeriod = parseIntValue(dataList[1])
8787 let nodeCurrentLeased = parseIntValue(dataList[2])
8888 let nodeNextPeriod = parseIntValue(dataList[3])
8989 let nodeNextLeased = parseIntValue(dataList[4])
9090 if ((nodeNextPeriod > height))
9191 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
9292 else $Tuple2(nodeNextLeased, nodeNextLeased)
9393 case _ =>
9494 $Tuple2(0, 0)
9595 }
9696 }
9797
9898
9999 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
100100 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
101101 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
102102 }
103103
104104
105105 func getUserLeasingData (nodeAddress,userAddress) = {
106106 let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
107107 match leasingUserDataStringRaw {
108108 case ds: String =>
109109 let dataList = split(ds, SEP)
110110 let userCurrentPeriod = parseIntValue(dataList[1])
111111 let userCurrentLeased = parseIntValue(dataList[2])
112112 let userNextPeriod = parseIntValue(dataList[3])
113113 let userNextLeased = parseIntValue(dataList[4])
114114 if ((userNextPeriod > height))
115115 then $Tuple2(userCurrentLeased, userNextLeased)
116116 else $Tuple2(userNextLeased, userNextLeased)
117117 case _ =>
118118 $Tuple2(0, 0)
119119 }
120120 }
121121
122122
123123 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
124124 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
125125 StringEntry(keyUserToClaim(userAddress), valueString)
126126 }
127127
128128
129129 func getUserToClaimBalance (userAddress) = {
130130 let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress))
131131 match userToClaimDataStringRaw {
132132 case ds: String =>
133133 let dataList = split(ds, SEP)
134134 let currentPeriod = parseIntValue(dataList[1])
135135 let toClaim = parseIntValue(dataList[2])
136136 let nextPeriod = parseIntValue(dataList[3])
137137 let toUnlock = parseIntValue(dataList[4])
138138 if ((nextPeriod > height))
139139 then $Tuple2(toClaim, toUnlock)
140140 else $Tuple2((toClaim + toUnlock), 0)
141141 case _ =>
142142 $Tuple2(0, 0)
143143 }
144144 }
145145
146146
147147 func getStakeActions (nodeAddress,userAddress,i) = {
148- let checks = [if ((size(i.payments) == 1))
148+ let checks = [if (!(isForceStop))
149+ then true
150+ else throwErr("contract is temporary stopped"), if ((size(i.payments) == 1))
149151 then true
150152 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
151153 then true
152154 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
153155 then true
154156 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
155157 then true
156- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
157- then true
158- else throwErr("contract is temporary stopped")]
158+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
159159 if ((checks == checks))
160160 then {
161161 let userLeasingAmount = i.payments[0].amount
162162 let $t061786251 = getLeasingNodeData(nodeAddress)
163163 let nodeCurrentLeased = $t061786251._1
164164 let nodeNextLeased = $t061786251._2
165165 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
166166 let $t063196405 = getUserLeasingData(nodeAddress, userAddress)
167167 let userCurrentLeased = $t063196405._1
168168 let userNextLeased = $t063196405._2
169169 let newUserNextLeased = (userNextLeased + userLeasingAmount)
170170 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
171171 }
172172 else throw("Strict value is not equal to itself.")
173173 }
174174
175175
176176 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
177177 let $t069176990 = getLeasingNodeData(nodeAddress)
178178 let nodeCurrentLeased = $t069176990._1
179179 let nodeNextLeased = $t069176990._2
180180 let $t069957081 = getUserLeasingData(nodeAddress, userAddress)
181181 let userCurrentLeased = $t069957081._1
182182 let userNextLeased = $t069957081._2
183- let checks = [if ((unstakeAmount > 0))
183+ let checks = [if (!(isForceStop))
184+ then true
185+ else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0))
184186 then true
185187 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
186188 then true
187189 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
188190 then true
189191 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
190192 then true
191193 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
192194 then true
193- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
194- then true
195- else throwErr("contract is temporary stopped")]
195+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
196196 if ((checks == checks))
197197 then {
198198 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
199199 let newUserNextLeased = (userNextLeased - unstakeAmount)
200200 let $t078427947 = getUserToClaimBalance(userAddress)
201201 let toClaim = $t078427947._1
202202 let toUnlock = $t078427947._2
203203 let newToUnlock = (toUnlock + unstakeAmount)
204204 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
205205 }
206206 else throw("Strict value is not equal to itself.")
207207 }
208208
209209
210210 func getClaimUnlockedActions (userAddress,claimAmount) = {
211211 let $t084908550 = getUserToClaimBalance(userAddress)
212212 let toClaim = $t084908550._1
213213 let toUnlock = $t084908550._2
214- let checks = [if ((claimAmount > 0))
214+ let checks = [if (!(isForceStop))
215+ then true
216+ else throwErr("contract is temporary stopped"), if ((claimAmount > 0))
215217 then true
216218 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
217219 then true
218220 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
219221 then true
220- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
221- then true
222- else throwErr("contract is temporary stopped")]
222+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
223223 if ((checks == checks))
224224 then {
225225 let newToClaim = (toClaim - claimAmount)
226226 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
227227 }
228228 else throw("Strict value is not equal to itself.")
229229 }
230230
231231
232232 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
233233 let $t092589318 = getUserToClaimBalance(userAddress)
234234 let toClaim = $t092589318._1
235235 let toUnlock = $t092589318._2
236236 let available = (toUnlock + toClaim)
237- let checks = [if ((userLeasingAmount > 0))
237+ let checks = [if (!(isForceStop))
238+ then true
239+ else throwErr("contract is temporary stopped"), if ((userLeasingAmount > 0))
238240 then true
239241 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
240242 then true
241243 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
242244 then true
243245 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
244246 then true
245- else throwErr(makeString(["user address is not valid:", userAddress], " ")), if (!(isForceStop))
246- then true
247- else throwErr("contract is temporary stopped")]
247+ else throwErr(makeString(["user address is not valid:", userAddress], " "))]
248248 if ((checks == checks))
249249 then {
250250 let $t098639936 = getLeasingNodeData(nodeAddress)
251251 let nodeCurrentLeased = $t098639936._1
252252 let nodeNextLeased = $t098639936._2
253253 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
254254 let $t01000410090 = getUserLeasingData(nodeAddress, userAddress)
255255 let userCurrentLeased = $t01000410090._1
256256 let userNextLeased = $t01000410090._2
257257 let newUserNextLeased = (userNextLeased + userLeasingAmount)
258258 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
259259 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
260260 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
261261 }
262262 else throw("Strict value is not equal to itself.")
263263 }
264264
265265
266266 func getSetNewPeriodLengthActions (newPeriodLength) = {
267267 let check = [if ((newPeriodLength > 0))
268268 then true
269269 else throwErr("period length should be greater than 0")]
270270 if ((check == check))
271271 then if ((periodOffsetHeight == -1))
272272 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
273273 else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
274274 else throw("Strict value is not equal to itself.")
275275 }
276276
277277
278278 @Callable(i)
279279 func setNewPeriodLength (newPeriodLength) = {
280280 let checks = [if (isAdmin(toString(i.caller)))
281281 then true
282282 else throwErr("caller is not in adminList")]
283283 if ((checks == checks))
284284 then getSetNewPeriodLengthActions(newPeriodLength)
285285 else throw("Strict value is not equal to itself.")
286286 }
287287
288288
289289
290290 @Callable(i)
291291 func setForceStopFlag (stop) = {
292292 let check = [if (isAdmin(toString(i.caller)))
293293 then true
294294 else throwErr("caller is not an admin")]
295295 if ((check == check))
296296 then [BooleanEntry(keyForceStop, stop)]
297297 else throw("Strict value is not equal to itself.")
298298 }
299299
300300
301301
302302 @Callable(i)
303303 func getNodeDataREADONLY (nodeAddress) = {
304304 let $t01198612050 = getLeasingNodeData(nodeAddress)
305305 let currentLease = $t01198612050._1
306306 let nextLeased = $t01198612050._2
307307 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
308308 }
309309
310310
311311
312312 @Callable(i)
313313 func getUserDataREADONLY (userAddress) = {
314314 let $t01239912459 = getUserToClaimBalance(userAddress)
315315 let toClaim = $t01239912459._1
316316 let toUnlock = $t01239912459._2
317317 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
318318 }
319319
320320
321321
322322 @Callable(i)
323323 func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
324324
325325
326326
327327 @Callable(i)
328328 func lease (nodeAddress) = {
329329 let userAddress = toString(i.caller)
330330 getStakeActions(nodeAddress, userAddress, i)
331331 }
332332
333333
334334
335335 @Callable(i)
336336 func leaseFromUnlocked (nodeAddress,amount) = {
337337 let userAddress = toString(i.caller)
338338 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
339339 }
340340
341341
342342
343343 @Callable(i)
344344 func cancelLease (nodeAddress,amount) = {
345345 let userAddress = toString(i.caller)
346346 getUnstakeActions(nodeAddress, userAddress, amount)
347347 }
348348
349349
350350
351351 @Callable(i)
352352 func claim (amount) = {
353353 let userAddress = toString(i.caller)
354354 getClaimUnlockedActions(userAddress, amount)
355355 }
356356
357357
358358
359359 @Callable(i)
360360 func claimAll () = {
361361 let userAddress = toString(i.caller)
362362 let $t01338713447 = getUserToClaimBalance(userAddress)
363363 let toClaim = $t01338713447._1
364364 let toUnlock = $t01338713447._2
365365 let checks = [if ((toClaim > 0))
366366 then true
367367 else throwErr("nothing to claim")]
368368 if ((checks == checks))
369369 then getClaimUnlockedActions(userAddress, toClaim)
370370 else throw("Strict value is not equal to itself.")
371371 }
372372
373373

github/deemru/w8io/026f985 
44.46 ms