tx · 4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK

3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h:  -0.01200000 Waves

2024.02.13 15:50 [2974489] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves

{ "type": 13, "id": "4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK", "fee": 1200000, "feeAssetId": null, "timestamp": 1707828632810, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "5GT1Mn8K2PabESb8xnNtSDDUs4hLyMNFmGT8KdEgipTGPbVZQEaZ7RzRXG8C9THveXYXeojXifr5APf2TUfKZGSf" ], "script": "base64:BgIvCAISAwoBARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgAjAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQAAxrZXlBZG1pbkxpc3QJALkJAgkAzAgCAgIlcwkAzAgCAglhZG1pbkxpc3QFA25pbAUDU0VQABFrZXlQZXJpb2RPZmZzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICCG9mZnNldElkBQNuaWwFA1NFUAAVa2V5UGVyaW9kT2Zmc2V0SGVpZ2h0CQC5CQIJAMwIAgICJXMJAMwIAgIMb2Zmc2V0SGVpZ2h0BQNuaWwFA1NFUAAPa2V5UGVyaW9kTGVuZ3RoCQC5CQIJAMwIAgICJXMJAMwIAgIMcGVyaW9kTGVuZ3RoBQNuaWwFA1NFUAAOcGVyaW9kT2Z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MFC25vZGVBZGRyZXNzBQt1c2VyQWRkcmVzcwUBaQFpARFsZWFzZUZyb21VbmxvY2tlZAILbm9kZUFkZHJlc3MGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARtnZXRTdGFrZUZyb21VbmxvY2tlZEFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQtjYW5jZWxMZWFzZQILbm9kZUFkZHJlc3MGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARFnZXRVbnN0YWtlQWN0aW9ucwMFC25vZGVBZGRyZXNzBQt1c2VyQWRkcmVzcwUGYW1vdW50AWkBBWNsYWltAQZhbW91bnQEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgkBF2dldENsYWltVW5sb2NrZWRBY3Rpb25zAgULdXNlckFkZHJlc3MFBmFtb3VudAFpAQhjbGFpbUFsbAAEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQNJHQwMTI3ODExMjg0MQkBFWdldFVzZXJUb0NsYWltQmFsYW5jZQEFC3VzZXJBZGRyZXNzBAd0b0NsYWltCAUNJHQwMTI3ODExMjg0MQJfMQQIdG9VbmxvY2sIBQ0kdDAxMjc4MTEyODQxAl8yBAZjaGVja3MJAMwIAgMJAGYCBQd0b0NsYWltAAAGCQEIdGhyb3dFcnIBAhBub3RoaW5nIHRvIGNsYWltBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQd0b0NsYWltCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuADxJ7/w=", "height": 2974489, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ovpcsZnbKjoEq79eq2Ycohf1Zj8USiv3BW2zLRdw1PQ Next: FracjSDzeGMWzndkyggfFQAiABE3YrdrNMmXpr579s6f Diff:
OldNewDifferences
99
1010
1111 let keyAssetId = makeString(["%s", "assetId"], SEP)
12+
13+let keyAdminList = makeString(["%s", "adminList"], SEP)
1214
1315 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1416
5254 let assetIdBytes = if ((assetIdString == "WAVES"))
5355 then unit
5456 else fromBase58String(assetIdString)
57+
58+let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
59+
60+func isAdmin (address) = containsElement(adminListRaw, address)
61+
5562
5663 func isValidAddress (address) = match addressFromString(address) {
5764 case a: Address =>
146153 if ((checks == checks))
147154 then {
148155 let userLeasingAmount = i.payments[0].amount
149- let $t057775850 = getLeasingNodeData(nodeAddress)
150- let nodeCurrentLeased = $t057775850._1
151- let nodeNextLeased = $t057775850._2
156+ let $t059886061 = getLeasingNodeData(nodeAddress)
157+ let nodeCurrentLeased = $t059886061._1
158+ let nodeNextLeased = $t059886061._2
152159 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
153- let $t059186004 = getUserLeasingData(nodeAddress, userAddress)
154- let userCurrentLeased = $t059186004._1
155- let userNextLeased = $t059186004._2
160+ let $t061296215 = getUserLeasingData(nodeAddress, userAddress)
161+ let userCurrentLeased = $t061296215._1
162+ let userNextLeased = $t061296215._2
156163 let newUserNextLeased = (userNextLeased + userLeasingAmount)
157164 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
158165 }
161168
162169
163170 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
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
171+ let $t067276800 = getLeasingNodeData(nodeAddress)
172+ let nodeCurrentLeased = $t067276800._1
173+ let nodeNextLeased = $t067276800._2
174+ let $t068056891 = getUserLeasingData(nodeAddress, userAddress)
175+ let userCurrentLeased = $t068056891._1
176+ let userNextLeased = $t068056891._2
170177 let checks = [if ((unstakeAmount > 0))
171178 then true
172179 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
182189 then {
183190 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
184191 let newUserNextLeased = (userNextLeased - unstakeAmount)
185- let $t073737478 = getUserToClaimBalance(userAddress)
186- let toClaim = $t073737478._1
187- let toUnlock = $t073737478._2
192+ let $t075847689 = getUserToClaimBalance(userAddress)
193+ let toClaim = $t075847689._1
194+ let toUnlock = $t075847689._2
188195 let newToUnlock = (toUnlock + unstakeAmount)
189196 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
190197 }
193200
194201
195202 func getClaimUnlockedActions (userAddress,claimAmount) = {
196- let $t080218081 = getUserToClaimBalance(userAddress)
197- let toClaim = $t080218081._1
198- let toUnlock = $t080218081._2
203+ let $t082328292 = getUserToClaimBalance(userAddress)
204+ let toClaim = $t082328292._1
205+ let toUnlock = $t082328292._2
199206 let checks = [if ((claimAmount > 0))
200207 then true
201208 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
213220
214221
215222 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
216- let $t087218781 = getUserToClaimBalance(userAddress)
217- let toClaim = $t087218781._1
218- let toUnlock = $t087218781._2
223+ let $t089328992 = getUserToClaimBalance(userAddress)
224+ let toClaim = $t089328992._1
225+ let toUnlock = $t089328992._2
219226 let available = (toUnlock + toClaim)
220227 let checks = [if ((userLeasingAmount > 0))
221228 then true
228235 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
229236 if ((checks == checks))
230237 then {
231- let $t092589331 = getLeasingNodeData(nodeAddress)
232- let nodeCurrentLeased = $t092589331._1
233- let nodeNextLeased = $t092589331._2
238+ let $t094699542 = getLeasingNodeData(nodeAddress)
239+ let nodeCurrentLeased = $t094699542._1
240+ let nodeNextLeased = $t094699542._2
234241 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
235- let $t093999485 = getUserLeasingData(nodeAddress, userAddress)
236- let userCurrentLeased = $t093999485._1
237- let userNextLeased = $t093999485._2
242+ let $t096109696 = getUserLeasingData(nodeAddress, userAddress)
243+ let userCurrentLeased = $t096109696._1
244+ let userNextLeased = $t096109696._2
238245 let newUserNextLeased = (userNextLeased + userLeasingAmount)
239246 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
240247 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
257264
258265
259266 @Callable(i)
260-func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
267+func setNewPeriodLength (newPeriodLength) = {
268+ let checks = [if (isAdmin(toString(i.caller)))
269+ then true
270+ else throwErr("i.caller is not in adminList")]
271+ if ((checks == checks))
272+ then getSetNewPeriodLengthActions(newPeriodLength)
273+ else throw("Strict value is not equal to itself.")
274+ }
261275
262276
263277
264278 @Callable(i)
265279 func getNodeDataREADONLY (nodeAddress) = {
266- let $t01088010944 = getLeasingNodeData(nodeAddress)
267- let currentLease = $t01088010944._1
268- let nextLeased = $t01088010944._2
280+ let $t01138011444 = getLeasingNodeData(nodeAddress)
281+ let currentLease = $t01138011444._1
282+ let nextLeased = $t01138011444._2
269283 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
270284 }
271285
273287
274288 @Callable(i)
275289 func getUserDataREADONLY (userAddress) = {
276- let $t01110011160 = getUserToClaimBalance(userAddress)
277- let toClaim = $t01110011160._1
278- let toUnlock = $t01110011160._2
290+ let $t01179311853 = getUserToClaimBalance(userAddress)
291+ let toClaim = $t01179311853._1
292+ let toUnlock = $t01179311853._2
279293 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
280294 }
281295
282296
283297
284298 @Callable(i)
285-func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
299+func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
286300
287301
288302
289303 @Callable(i)
290-func stake (nodeAddress) = {
304+func lease (nodeAddress) = {
291305 let userAddress = toString(i.caller)
292306 getStakeActions(nodeAddress, userAddress, i)
293307 }
295309
296310
297311 @Callable(i)
298-func stakeFromUnlocked (nodeAddress,amount) = {
312+func leaseFromUnlocked (nodeAddress,amount) = {
299313 let userAddress = toString(i.caller)
300314 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
301315 }
303317
304318
305319 @Callable(i)
306-func unstake (nodeAddress,amount) = {
320+func cancelLease (nodeAddress,amount) = {
307321 let userAddress = toString(i.caller)
308322 getUnstakeActions(nodeAddress, userAddress, amount)
309323 }
321335 @Callable(i)
322336 func claimAll () = {
323337 let userAddress = toString(i.caller)
324- let $t01207812138 = getUserToClaimBalance(userAddress)
325- let toClaim = $t01207812138._1
326- let toUnlock = $t01207812138._2
338+ let $t01278112841 = getUserToClaimBalance(userAddress)
339+ let toClaim = $t01278112841._1
340+ let toUnlock = $t01278112841._2
327341 let checks = [if ((toClaim > 0))
328342 then true
329343 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)
12+
13+let keyAdminList = makeString(["%s", "adminList"], SEP)
1214
1315 let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP)
1416
1517 let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP)
1618
1719 let keyPeriodLength = makeString(["%s", "periodLength"], SEP)
1820
1921 let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0)
2022
2123 let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000)
2224
2325 let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1)
2426
2527 let currentPeriodId = if (if ((height > periodOffsetHeight))
2628 then (periodOffsetHeight != -1)
2729 else false)
2830 then (((height - periodOffsetHeight) / periodLength) + periodOffsetId)
2931 else max([0, (periodOffsetId - 1)])
3032
3133 let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength))
3234
3335 let nextPeriodHeight = (currentPeriodHeight + periodLength)
3436
3537 func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP)
3638
3739
3840 func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP)
3941
4042
4143 func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP)
4244
4345
4446 func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP)
4547
4648
4749 func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP)
4850
4951
5052 let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES")
5153
5254 let assetIdBytes = if ((assetIdString == "WAVES"))
5355 then unit
5456 else fromBase58String(assetIdString)
57+
58+let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP)
59+
60+func isAdmin (address) = containsElement(adminListRaw, address)
61+
5562
5663 func isValidAddress (address) = match addressFromString(address) {
5764 case a: Address =>
5865 true
5966 case _ =>
6067 false
6168 }
6269
6370
6471 func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = {
6572 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP)
6673 StringEntry(keyLeasingNodeData(nodeAddress), valueString)
6774 }
6875
6976
7077 func getLeasingNodeData (nodeAddress) = {
7178 let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress))
7279 match leasingNodeDataStringRaw {
7380 case ds: String =>
7481 let dataList = split(ds, SEP)
7582 let nodeCurrentPeriod = parseIntValue(dataList[1])
7683 let nodeCurrentLeased = parseIntValue(dataList[2])
7784 let nodeNextPeriod = parseIntValue(dataList[3])
7885 let nodeNextLeased = parseIntValue(dataList[4])
7986 if ((nodeNextPeriod > height))
8087 then $Tuple2(nodeCurrentLeased, nodeNextLeased)
8188 else $Tuple2(nodeNextLeased, nodeNextLeased)
8289 case _ =>
8390 $Tuple2(0, 0)
8491 }
8592 }
8693
8794
8895 func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = {
8996 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP)
9097 StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString)
9198 }
9299
93100
94101 func getUserLeasingData (nodeAddress,userAddress) = {
95102 let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress))
96103 match leasingUserDataStringRaw {
97104 case ds: String =>
98105 let dataList = split(ds, SEP)
99106 let userCurrentPeriod = parseIntValue(dataList[1])
100107 let userCurrentLeased = parseIntValue(dataList[2])
101108 let userNextPeriod = parseIntValue(dataList[3])
102109 let userNextLeased = parseIntValue(dataList[4])
103110 if ((userNextPeriod > height))
104111 then $Tuple2(userCurrentLeased, userNextLeased)
105112 else $Tuple2(userNextLeased, userNextLeased)
106113 case _ =>
107114 $Tuple2(0, 0)
108115 }
109116 }
110117
111118
112119 func getUserToClaimEntry (userAddress,toClaim,toUnlock) = {
113120 let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP)
114121 StringEntry(keyUserToClaim(userAddress), valueString)
115122 }
116123
117124
118125 func getUserToClaimBalance (userAddress) = {
119126 let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress))
120127 match userToClaimDataStringRaw {
121128 case ds: String =>
122129 let dataList = split(ds, SEP)
123130 let currentPeriod = parseIntValue(dataList[1])
124131 let toClaim = parseIntValue(dataList[2])
125132 let nextPeriod = parseIntValue(dataList[3])
126133 let toUnlock = parseIntValue(dataList[4])
127134 if ((nextPeriod > height))
128135 then $Tuple2(toClaim, toUnlock)
129136 else $Tuple2((toClaim + toUnlock), 0)
130137 case _ =>
131138 $Tuple2(0, 0)
132139 }
133140 }
134141
135142
136143 func getStakeActions (nodeAddress,userAddress,i) = {
137144 let checks = [if ((size(i.payments) == 1))
138145 then true
139146 else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes))
140147 then true
141148 else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress))
142149 then true
143150 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
144151 then true
145152 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
146153 if ((checks == checks))
147154 then {
148155 let userLeasingAmount = i.payments[0].amount
149- let $t057775850 = getLeasingNodeData(nodeAddress)
150- let nodeCurrentLeased = $t057775850._1
151- let nodeNextLeased = $t057775850._2
156+ let $t059886061 = getLeasingNodeData(nodeAddress)
157+ let nodeCurrentLeased = $t059886061._1
158+ let nodeNextLeased = $t059886061._2
152159 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
153- let $t059186004 = getUserLeasingData(nodeAddress, userAddress)
154- let userCurrentLeased = $t059186004._1
155- let userNextLeased = $t059186004._2
160+ let $t061296215 = getUserLeasingData(nodeAddress, userAddress)
161+ let userCurrentLeased = $t061296215._1
162+ let userNextLeased = $t061296215._2
156163 let newUserNextLeased = (userNextLeased + userLeasingAmount)
157164 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
158165 }
159166 else throw("Strict value is not equal to itself.")
160167 }
161168
162169
163170 func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = {
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
171+ let $t067276800 = getLeasingNodeData(nodeAddress)
172+ let nodeCurrentLeased = $t067276800._1
173+ let nodeNextLeased = $t067276800._2
174+ let $t068056891 = getUserLeasingData(nodeAddress, userAddress)
175+ let userCurrentLeased = $t068056891._1
176+ let userNextLeased = $t068056891._2
170177 let checks = [if ((unstakeAmount > 0))
171178 then true
172179 else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount))
173180 then true
174181 else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount))
175182 then true
176183 else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress))
177184 then true
178185 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
179186 then true
180187 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
181188 if ((checks == checks))
182189 then {
183190 let newNodeNextLease = (nodeNextLeased - unstakeAmount)
184191 let newUserNextLeased = (userNextLeased - unstakeAmount)
185- let $t073737478 = getUserToClaimBalance(userAddress)
186- let toClaim = $t073737478._1
187- let toUnlock = $t073737478._2
192+ let $t075847689 = getUserToClaimBalance(userAddress)
193+ let toClaim = $t075847689._1
194+ let toUnlock = $t075847689._2
188195 let newToUnlock = (toUnlock + unstakeAmount)
189196 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, toClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
190197 }
191198 else throw("Strict value is not equal to itself.")
192199 }
193200
194201
195202 func getClaimUnlockedActions (userAddress,claimAmount) = {
196- let $t080218081 = getUserToClaimBalance(userAddress)
197- let toClaim = $t080218081._1
198- let toUnlock = $t080218081._2
203+ let $t082328292 = getUserToClaimBalance(userAddress)
204+ let toClaim = $t082328292._1
205+ let toUnlock = $t082328292._2
199206 let checks = [if ((claimAmount > 0))
200207 then true
201208 else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount))
202209 then true
203210 else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress))
204211 then true
205212 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
206213 if ((checks == checks))
207214 then {
208215 let newToClaim = (toClaim - claimAmount)
209216 [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)]
210217 }
211218 else throw("Strict value is not equal to itself.")
212219 }
213220
214221
215222 func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = {
216- let $t087218781 = getUserToClaimBalance(userAddress)
217- let toClaim = $t087218781._1
218- let toUnlock = $t087218781._2
223+ let $t089328992 = getUserToClaimBalance(userAddress)
224+ let toClaim = $t089328992._1
225+ let toUnlock = $t089328992._2
219226 let available = (toUnlock + toClaim)
220227 let checks = [if ((userLeasingAmount > 0))
221228 then true
222229 else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount))
223230 then true
224231 else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress))
225232 then true
226233 else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress))
227234 then true
228235 else throwErr(makeString(["user address is not valid:", userAddress], " "))]
229236 if ((checks == checks))
230237 then {
231- let $t092589331 = getLeasingNodeData(nodeAddress)
232- let nodeCurrentLeased = $t092589331._1
233- let nodeNextLeased = $t092589331._2
238+ let $t094699542 = getLeasingNodeData(nodeAddress)
239+ let nodeCurrentLeased = $t094699542._1
240+ let nodeNextLeased = $t094699542._2
234241 let newNodeNextLease = (nodeNextLeased + userLeasingAmount)
235- let $t093999485 = getUserLeasingData(nodeAddress, userAddress)
236- let userCurrentLeased = $t093999485._1
237- let userNextLeased = $t093999485._2
242+ let $t096109696 = getUserLeasingData(nodeAddress, userAddress)
243+ let userCurrentLeased = $t096109696._1
244+ let userNextLeased = $t096109696._2
238245 let newUserNextLeased = (userNextLeased + userLeasingAmount)
239246 let newToUnlock = max([0, (toUnlock - userLeasingAmount)])
240247 let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))])
241248 [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserToClaimEntry(userAddress, newToClaim, newToUnlock), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)]
242249 }
243250 else throw("Strict value is not equal to itself.")
244251 }
245252
246253
247254 func getSetNewPeriodLengthActions (newPeriodLength) = {
248255 let check = [if ((newPeriodLength > 0))
249256 then true
250257 else throwErr("period length should be greater than 0")]
251258 if ((check == check))
252259 then if ((periodOffsetHeight == -1))
253260 then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)]
254261 else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)]
255262 else throw("Strict value is not equal to itself.")
256263 }
257264
258265
259266 @Callable(i)
260-func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength)
267+func setNewPeriodLength (newPeriodLength) = {
268+ let checks = [if (isAdmin(toString(i.caller)))
269+ then true
270+ else throwErr("i.caller is not in adminList")]
271+ if ((checks == checks))
272+ then getSetNewPeriodLengthActions(newPeriodLength)
273+ else throw("Strict value is not equal to itself.")
274+ }
261275
262276
263277
264278 @Callable(i)
265279 func getNodeDataREADONLY (nodeAddress) = {
266- let $t01088010944 = getLeasingNodeData(nodeAddress)
267- let currentLease = $t01088010944._1
268- let nextLeased = $t01088010944._2
280+ let $t01138011444 = getLeasingNodeData(nodeAddress)
281+ let currentLease = $t01138011444._1
282+ let nextLeased = $t01138011444._2
269283 $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height))
270284 }
271285
272286
273287
274288 @Callable(i)
275289 func getUserDataREADONLY (userAddress) = {
276- let $t01110011160 = getUserToClaimBalance(userAddress)
277- let toClaim = $t01110011160._1
278- let toUnlock = $t01110011160._2
290+ let $t01179311853 = getUserToClaimBalance(userAddress)
291+ let toClaim = $t01179311853._1
292+ let toUnlock = $t01179311853._2
279293 $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height))
280294 }
281295
282296
283297
284298 @Callable(i)
285-func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
299+func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i)
286300
287301
288302
289303 @Callable(i)
290-func stake (nodeAddress) = {
304+func lease (nodeAddress) = {
291305 let userAddress = toString(i.caller)
292306 getStakeActions(nodeAddress, userAddress, i)
293307 }
294308
295309
296310
297311 @Callable(i)
298-func stakeFromUnlocked (nodeAddress,amount) = {
312+func leaseFromUnlocked (nodeAddress,amount) = {
299313 let userAddress = toString(i.caller)
300314 getStakeFromUnlockedActions(nodeAddress, userAddress, amount)
301315 }
302316
303317
304318
305319 @Callable(i)
306-func unstake (nodeAddress,amount) = {
320+func cancelLease (nodeAddress,amount) = {
307321 let userAddress = toString(i.caller)
308322 getUnstakeActions(nodeAddress, userAddress, amount)
309323 }
310324
311325
312326
313327 @Callable(i)
314328 func claim (amount) = {
315329 let userAddress = toString(i.caller)
316330 getClaimUnlockedActions(userAddress, amount)
317331 }
318332
319333
320334
321335 @Callable(i)
322336 func claimAll () = {
323337 let userAddress = toString(i.caller)
324- let $t01207812138 = getUserToClaimBalance(userAddress)
325- let toClaim = $t01207812138._1
326- let toUnlock = $t01207812138._2
338+ let $t01278112841 = getUserToClaimBalance(userAddress)
339+ let toClaim = $t01278112841._1
340+ let toUnlock = $t01278112841._2
327341 let checks = [if ((toClaim > 0))
328342 then true
329343 else throwErr("nothing to claim")]
330344 if ((checks == checks))
331345 then getClaimUnlockedActions(userAddress, toClaim)
332346 else throw("Strict value is not equal to itself.")
333347 }
334348
335349

github/deemru/w8io/026f985 
54.83 ms