tx · 4QGBpEr1MLNb9nuazfRv9SPBRzZKUCdU3UwUCYA7JvAo 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.01400000 Waves 2024.02.16 10:30 [2978461] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "4QGBpEr1MLNb9nuazfRv9SPBRzZKUCdU3UwUCYA7JvAo", "fee": 1400000, "feeAssetId": null, "timestamp": 1708068617005, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "2sE3L86Y5wQk8TpTkgNCUkLBrV9vWhDZ1fAKfguUXee5bP7SDjwBQUqQ1yN3nvFj5vz9bbjXF7R2j1QAqUA8s5di" ], "script": "base64:BgI0CAISAwoBARIDCgEEEgMKAQgSAwoBCBIECgIICBIDCgEIEgQKAggBEgQKAggBEgMKAQESACgADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18BCHRocm93RXJyAQNtc2cJAAIBCQCsAgIJAKwCAgUMY29udHJhY3RGaWxlAgI6IAUDbXNnAAprZXlBc3NldElkCQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJZAUDbmlsBQNTRVAADGtleUFkbWluTGlzdAkAuQkCCQDMCAICAiVzCQDMCAICCWFkbWluTGlzdAUDbmlsBQNTRVAADGtleUZvcmNlU3RvcAkAuQkCCQDMCAICAiVzCQDMCAICCWZvcmNlU3RvcAUDbmlsBQNTRVAAEWtleVBlcmlvZE9mZnNldElkCQC5CQIJAMwIAgICJXMJAMwIAgIIb2Zmc2V0SWQFA25pbAUDU0VQABVrZXlQZXJpb2RPZmZzZXRIZWlnaHQJALkJAgkAzAgCAgIlcwkAzAgCAgxvZmZzZXRIZWlnaHQFA25pbAUDU0VQAA9rZXlQZXJpb2RMZW5ndGgJ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AgULdXNlckFkZHJlc3MFBmFtb3VudAFpAQhjbGFpbUFsbAAEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQNJHQwMTUxMjMxNTE4MwkBFWdldFVzZXJUb0NsYWltQmFsYW5jZQEFC3VzZXJBZGRyZXNzBAd0b0NsYWltCAUNJHQwMTUxMjMxNTE4MwJfMQQIdG9VbmxvY2sIBQ0kdDAxNTEyMzE1MTgzAl8yBAZjaGVja3MJAMwIAgMJAGYCBQd0b0NsYWltAAAGCQEIdGhyb3dFcnIBAhBub3RoaW5nIHRvIGNsYWltBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQd0b0NsYWltCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAFeoGik=", "height": 2978461, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Eh4JLzabPA8AzVPjEcfj9V8sMt8xCEzA8fRbiiqmRfY8 Next: 4NdZVT5TqqUqQVVYoF2PB4hRrXjeTdxvhchn2KA1WptP Diff:
Old | New | Differences | |
---|---|---|---|
242 | 242 | } | |
243 | 243 | ||
244 | 244 | ||
245 | - | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
246 | - | let $t01010910169 = getUserToClaimBalance(userAddress) | |
247 | - | let toClaim = $t01010910169._1 | |
248 | - | let toUnlock = $t01010910169._2 | |
249 | - | let available = (toUnlock + toClaim) | |
245 | + | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
246 | + | let $t01014810208 = getUserToClaimBalance(userAddress) | |
247 | + | let toClaim = $t01014810208._1 | |
248 | + | let toUnlock = $t01014810208._2 | |
249 | + | let paymentAmount = if ((size(i.payments) == 0)) | |
250 | + | then 0 | |
251 | + | else i.payments[0].amount | |
252 | + | let available = ((toUnlock + toClaim) + paymentAmount) | |
250 | 253 | let checks = [if (!(isForceStop)) | |
251 | 254 | then true | |
252 | - | else throwErr("contract is temporary stopped"), if ((userLeasingAmount > 0)) | |
255 | + | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
256 | + | then true | |
257 | + | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
258 | + | then true | |
259 | + | else (i.payments[0].assetId == assetIdBytes)) | |
260 | + | then true | |
261 | + | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if ((userLeasingAmount > 0)) | |
253 | 262 | then true | |
254 | 263 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
255 | 264 | then true | |
256 | - | else throwErr("amount should be less or equal available amount"), if (isValidAddress(nodeAddress)) | |
265 | + | else throwErr("amount should be less or equal (payment + available) amount"), if ((userLeasingAmount >= paymentAmount)) | |
266 | + | then true | |
267 | + | else throw("amount should be greater or equal payment amount"), if (isValidAddress(nodeAddress)) | |
257 | 268 | then true | |
258 | 269 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
259 | 270 | then true | |
260 | 271 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
261 | 272 | if ((checks == checks)) | |
262 | 273 | then { | |
263 | - | let $ | |
264 | - | let nodeCurrentLeased = $ | |
265 | - | let nodeNextLeased = $ | |
274 | + | let $t01125411327 = getLeasingNodeData(nodeAddress) | |
275 | + | let nodeCurrentLeased = $t01125411327._1 | |
276 | + | let nodeNextLeased = $t01125411327._2 | |
266 | 277 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
267 | - | let $ | |
268 | - | let userCurrentLeased = $ | |
269 | - | let userNextLeased = $ | |
278 | + | let $t01139511481 = getUserLeasingData(nodeAddress, userAddress) | |
279 | + | let userCurrentLeased = $t01139511481._1 | |
280 | + | let userNextLeased = $t01139511481._2 | |
270 | 281 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
271 | - | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
272 | - | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
282 | + | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
283 | + | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
284 | + | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
273 | 285 | let userTotalLocked = getUserTotalLocked(userAddress) | |
274 | 286 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
275 | 287 | [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)] | |
316 | 328 | ||
317 | 329 | @Callable(i) | |
318 | 330 | func getNodeDataREADONLY (nodeAddress) = { | |
319 | - | let $ | |
320 | - | let currentLease = $ | |
321 | - | let nextLeased = $ | |
331 | + | let $t01363213696 = getLeasingNodeData(nodeAddress) | |
332 | + | let currentLease = $t01363213696._1 | |
333 | + | let nextLeased = $t01363213696._2 | |
322 | 334 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
323 | 335 | } | |
324 | 336 | ||
326 | 338 | ||
327 | 339 | @Callable(i) | |
328 | 340 | func getUserDataREADONLY (userAddress) = { | |
329 | - | let $ | |
330 | - | let toClaim = $ | |
331 | - | let toUnlock = $ | |
341 | + | let $t01405914119 = getUserToClaimBalance(userAddress) | |
342 | + | let toClaim = $t01405914119._1 | |
343 | + | let toUnlock = $t01405914119._2 | |
332 | 344 | let userTotalLocked = getUserTotalLocked(userAddress) | |
333 | 345 | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
334 | 346 | } | |
351 | 363 | @Callable(i) | |
352 | 364 | func leaseFromLocked (nodeAddress,amount) = { | |
353 | 365 | let userAddress = toString(i.caller) | |
354 | - | getStakeFromUnlockedActions(nodeAddress, userAddress, amount) | |
366 | + | getStakeFromUnlockedActions(nodeAddress, userAddress, amount, i) | |
355 | 367 | } | |
356 | 368 | ||
357 | 369 | ||
375 | 387 | @Callable(i) | |
376 | 388 | func claimAll () = { | |
377 | 389 | let userAddress = toString(i.caller) | |
378 | - | let $ | |
379 | - | let toClaim = $ | |
380 | - | let toUnlock = $ | |
390 | + | let $t01512315183 = getUserToClaimBalance(userAddress) | |
391 | + | let toClaim = $t01512315183._1 | |
392 | + | let toUnlock = $t01512315183._2 | |
381 | 393 | let checks = [if ((toClaim > 0)) | |
382 | 394 | then true | |
383 | 395 | else throwErr("nothing to claim")] |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let contractFile = "l2mp_leasing.ride" | |
5 | 5 | ||
6 | 6 | let SEP = "__" | |
7 | 7 | ||
8 | 8 | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
9 | 9 | ||
10 | 10 | ||
11 | 11 | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
12 | 12 | ||
13 | 13 | let keyAdminList = makeString(["%s", "adminList"], SEP) | |
14 | 14 | ||
15 | 15 | let keyForceStop = makeString(["%s", "forceStop"], SEP) | |
16 | 16 | ||
17 | 17 | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
18 | 18 | ||
19 | 19 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
20 | 20 | ||
21 | 21 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
22 | 22 | ||
23 | 23 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
24 | 24 | ||
25 | 25 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
26 | 26 | ||
27 | 27 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
28 | 28 | ||
29 | 29 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
30 | 30 | then (periodOffsetHeight != -1) | |
31 | 31 | else false) | |
32 | 32 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
33 | 33 | else max([0, (periodOffsetId - 1)]) | |
34 | 34 | ||
35 | 35 | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
36 | 36 | ||
37 | 37 | let nextPeriodHeight = (currentPeriodHeight + periodLength) | |
38 | 38 | ||
39 | 39 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
40 | 40 | ||
41 | 41 | ||
42 | 42 | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", nodeAddress, userAddress], SEP) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | func keyUserTotalLocked (userAddress) = makeString(["%s%s", "userTotalLocked", userAddress], SEP) | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func keyNodeLeasingByHeight (nodeAddress) = makeString(["%s%d", nodeAddress, toString(height)], SEP) | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | func keyUserLeasingByHeight (nodeAddress,userAddress) = makeString(["%s%s%d", nodeAddress, userAddress, toString(height)], SEP) | |
55 | 55 | ||
56 | 56 | ||
57 | 57 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
58 | 58 | ||
59 | 59 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
60 | 60 | then unit | |
61 | 61 | else fromBase58String(assetIdString) | |
62 | 62 | ||
63 | 63 | let adminListRaw = split(valueOrElse(getString(this, keyAdminList), ""), SEP) | |
64 | 64 | ||
65 | 65 | let isForceStop = valueOrElse(getBoolean(this, keyForceStop), false) | |
66 | 66 | ||
67 | 67 | func isAdmin (address) = containsElement(adminListRaw, address) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | func isValidAddress (address) = match addressFromString(address) { | |
71 | 71 | case a: Address => | |
72 | 72 | true | |
73 | 73 | case _ => | |
74 | 74 | false | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
79 | 79 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
80 | 80 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
81 | 81 | } | |
82 | 82 | ||
83 | 83 | ||
84 | 84 | func getLeasingNodeData (nodeAddress) = { | |
85 | 85 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
86 | 86 | match leasingNodeDataStringRaw { | |
87 | 87 | case ds: String => | |
88 | 88 | let dataList = split(ds, SEP) | |
89 | 89 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
90 | 90 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
91 | 91 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
92 | 92 | let nodeNextLeased = parseIntValue(dataList[4]) | |
93 | 93 | if ((nodeNextPeriod > height)) | |
94 | 94 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
95 | 95 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
96 | 96 | case _ => | |
97 | 97 | $Tuple2(0, 0) | |
98 | 98 | } | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | ||
102 | 102 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
103 | 103 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
104 | 104 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
105 | 105 | } | |
106 | 106 | ||
107 | 107 | ||
108 | 108 | func getUserLeasingData (nodeAddress,userAddress) = { | |
109 | 109 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
110 | 110 | match leasingUserDataStringRaw { | |
111 | 111 | case ds: String => | |
112 | 112 | let dataList = split(ds, SEP) | |
113 | 113 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
114 | 114 | let userCurrentLeased = parseIntValue(dataList[2]) | |
115 | 115 | let userNextPeriod = parseIntValue(dataList[3]) | |
116 | 116 | let userNextLeased = parseIntValue(dataList[4]) | |
117 | 117 | if ((userNextPeriod > height)) | |
118 | 118 | then $Tuple2(userCurrentLeased, userNextLeased) | |
119 | 119 | else $Tuple2(userNextLeased, userNextLeased) | |
120 | 120 | case _ => | |
121 | 121 | $Tuple2(0, 0) | |
122 | 122 | } | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
127 | 127 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
128 | 128 | StringEntry(keyUserToClaim(userAddress), valueString) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func getUserToClaimBalance (userAddress) = { | |
133 | 133 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
134 | 134 | match userToClaimDataStringRaw { | |
135 | 135 | case ds: String => | |
136 | 136 | let dataList = split(ds, SEP) | |
137 | 137 | let currentPeriod = parseIntValue(dataList[1]) | |
138 | 138 | let toClaim = parseIntValue(dataList[2]) | |
139 | 139 | let nextPeriod = parseIntValue(dataList[3]) | |
140 | 140 | let toUnlock = parseIntValue(dataList[4]) | |
141 | 141 | if ((nextPeriod > height)) | |
142 | 142 | then $Tuple2(toClaim, toUnlock) | |
143 | 143 | else $Tuple2((toClaim + toUnlock), 0) | |
144 | 144 | case _ => | |
145 | 145 | $Tuple2(0, 0) | |
146 | 146 | } | |
147 | 147 | } | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func getUserTotalLockedEntry (userAddress,userTotalLocked) = IntegerEntry(keyUserTotalLocked(userAddress), userTotalLocked) | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func getUserTotalLocked (userAddress) = valueOrElse(getInteger(this, keyUserTotalLocked(userAddress)), 0) | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func getStakeActions (nodeAddress,userAddress,i) = { | |
157 | 157 | let checks = [if (!(isForceStop)) | |
158 | 158 | then true | |
159 | 159 | else throwErr("contract is temporary stopped"), if ((size(i.payments) == 1)) | |
160 | 160 | then true | |
161 | 161 | else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes)) | |
162 | 162 | then true | |
163 | 163 | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress)) | |
164 | 164 | then true | |
165 | 165 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
166 | 166 | then true | |
167 | 167 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
168 | 168 | if ((checks == checks)) | |
169 | 169 | then { | |
170 | 170 | let userLeasingAmount = i.payments[0].amount | |
171 | 171 | let $t066206693 = getLeasingNodeData(nodeAddress) | |
172 | 172 | let nodeCurrentLeased = $t066206693._1 | |
173 | 173 | let nodeNextLeased = $t066206693._2 | |
174 | 174 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
175 | 175 | let $t067616847 = getUserLeasingData(nodeAddress, userAddress) | |
176 | 176 | let userCurrentLeased = $t067616847._1 | |
177 | 177 | let userNextLeased = $t067616847._2 | |
178 | 178 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
179 | 179 | let userTotalLocked = getUserTotalLocked(userAddress) | |
180 | 180 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
181 | 181 | [getLeasingNodeEntry(nodeAddress, nodeCurrentLeased, newNodeNextLease), getUserLeasingEntry(nodeAddress, userAddress, userCurrentLeased, newUserNextLeased), getUserTotalLockedEntry(userAddress, newUserTotalLocked), IntegerEntry(keyNodeLeasingByHeight(nodeAddress), newNodeNextLease), IntegerEntry(keyUserLeasingByHeight(nodeAddress, userAddress), newUserNextLeased)] | |
182 | 182 | } | |
183 | 183 | else throw("Strict value is not equal to itself.") | |
184 | 184 | } | |
185 | 185 | ||
186 | 186 | ||
187 | 187 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
188 | 188 | let $t075497622 = getLeasingNodeData(nodeAddress) | |
189 | 189 | let nodeCurrentLeased = $t075497622._1 | |
190 | 190 | let nodeNextLeased = $t075497622._2 | |
191 | 191 | let $t076277713 = getUserLeasingData(nodeAddress, userAddress) | |
192 | 192 | let userCurrentLeased = $t076277713._1 | |
193 | 193 | let userNextLeased = $t076277713._2 | |
194 | 194 | let checks = [if (!(isForceStop)) | |
195 | 195 | then true | |
196 | 196 | else throwErr("contract is temporary stopped"), if ((unstakeAmount > 0)) | |
197 | 197 | then true | |
198 | 198 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
199 | 199 | then true | |
200 | 200 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
201 | 201 | then true | |
202 | 202 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
203 | 203 | then true | |
204 | 204 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
205 | 205 | then true | |
206 | 206 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
207 | 207 | if ((checks == checks)) | |
208 | 208 | then { | |
209 | 209 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
210 | 210 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
211 | 211 | let $t085268586 = getUserToClaimBalance(userAddress) | |
212 | 212 | let toClaim = $t085268586._1 | |
213 | 213 | let toUnlock = $t085268586._2 | |
214 | 214 | let newToUnlock = (toUnlock + unstakeAmount) | |
215 | 215 | let userTotalLocked = getUserTotalLocked(userAddress) | |
216 | 216 | let newUserTotalLocked = (userTotalLocked - unstakeAmount) | |
217 | 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)] | |
218 | 218 | } | |
219 | 219 | else throw("Strict value is not equal to itself.") | |
220 | 220 | } | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
224 | 224 | let $t093159375 = getUserToClaimBalance(userAddress) | |
225 | 225 | let toClaim = $t093159375._1 | |
226 | 226 | let toUnlock = $t093159375._2 | |
227 | 227 | let checks = [if (!(isForceStop)) | |
228 | 228 | then true | |
229 | 229 | else throwErr("contract is temporary stopped"), if ((claimAmount > 0)) | |
230 | 230 | then true | |
231 | 231 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
232 | 232 | then true | |
233 | 233 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
234 | 234 | then true | |
235 | 235 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
236 | 236 | if ((checks == checks)) | |
237 | 237 | then { | |
238 | 238 | let newToClaim = (toClaim - claimAmount) | |
239 | 239 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
240 | 240 | } | |
241 | 241 | else throw("Strict value is not equal to itself.") | |
242 | 242 | } | |
243 | 243 | ||
244 | 244 | ||
245 | - | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
246 | - | let $t01010910169 = getUserToClaimBalance(userAddress) | |
247 | - | let toClaim = $t01010910169._1 | |
248 | - | let toUnlock = $t01010910169._2 | |
249 | - | let available = (toUnlock + toClaim) | |
245 | + | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount,i) = { | |
246 | + | let $t01014810208 = getUserToClaimBalance(userAddress) | |
247 | + | let toClaim = $t01014810208._1 | |
248 | + | let toUnlock = $t01014810208._2 | |
249 | + | let paymentAmount = if ((size(i.payments) == 0)) | |
250 | + | then 0 | |
251 | + | else i.payments[0].amount | |
252 | + | let available = ((toUnlock + toClaim) + paymentAmount) | |
250 | 253 | let checks = [if (!(isForceStop)) | |
251 | 254 | then true | |
252 | - | else throwErr("contract is temporary stopped"), if ((userLeasingAmount > 0)) | |
255 | + | else throwErr("contract is temporary stopped"), if ((1 >= size(i.payments))) | |
256 | + | then true | |
257 | + | else throwErr("maximum 1 payment"), if (if ((size(i.payments) == 0)) | |
258 | + | then true | |
259 | + | else (i.payments[0].assetId == assetIdBytes)) | |
260 | + | then true | |
261 | + | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if ((userLeasingAmount > 0)) | |
253 | 262 | then true | |
254 | 263 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
255 | 264 | then true | |
256 | - | else throwErr("amount should be less or equal available amount"), if (isValidAddress(nodeAddress)) | |
265 | + | else throwErr("amount should be less or equal (payment + available) amount"), if ((userLeasingAmount >= paymentAmount)) | |
266 | + | then true | |
267 | + | else throw("amount should be greater or equal payment amount"), if (isValidAddress(nodeAddress)) | |
257 | 268 | then true | |
258 | 269 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
259 | 270 | then true | |
260 | 271 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
261 | 272 | if ((checks == checks)) | |
262 | 273 | then { | |
263 | - | let $ | |
264 | - | let nodeCurrentLeased = $ | |
265 | - | let nodeNextLeased = $ | |
274 | + | let $t01125411327 = getLeasingNodeData(nodeAddress) | |
275 | + | let nodeCurrentLeased = $t01125411327._1 | |
276 | + | let nodeNextLeased = $t01125411327._2 | |
266 | 277 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
267 | - | let $ | |
268 | - | let userCurrentLeased = $ | |
269 | - | let userNextLeased = $ | |
278 | + | let $t01139511481 = getUserLeasingData(nodeAddress, userAddress) | |
279 | + | let userCurrentLeased = $t01139511481._1 | |
280 | + | let userNextLeased = $t01139511481._2 | |
270 | 281 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
271 | - | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
272 | - | let newToClaim = min([toClaim, (toClaim + (toUnlock - userLeasingAmount))]) | |
282 | + | let fromUnlockedAmount = (userLeasingAmount - paymentAmount) | |
283 | + | let newToUnlock = max([0, (toUnlock - fromUnlockedAmount)]) | |
284 | + | let newToClaim = min([toClaim, (toClaim + (toUnlock - fromUnlockedAmount))]) | |
273 | 285 | let userTotalLocked = getUserTotalLocked(userAddress) | |
274 | 286 | let newUserTotalLocked = (userTotalLocked + userLeasingAmount) | |
275 | 287 | [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)] | |
276 | 288 | } | |
277 | 289 | else throw("Strict value is not equal to itself.") | |
278 | 290 | } | |
279 | 291 | ||
280 | 292 | ||
281 | 293 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
282 | 294 | let check = [if ((newPeriodLength > 0)) | |
283 | 295 | then true | |
284 | 296 | else throwErr("period length should be greater than 0")] | |
285 | 297 | if ((check == check)) | |
286 | 298 | then if ((periodOffsetHeight == -1)) | |
287 | 299 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
288 | 300 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
289 | 301 | else throw("Strict value is not equal to itself.") | |
290 | 302 | } | |
291 | 303 | ||
292 | 304 | ||
293 | 305 | @Callable(i) | |
294 | 306 | func setNewPeriodLength (newPeriodLength) = { | |
295 | 307 | let checks = [if (isAdmin(toString(i.caller))) | |
296 | 308 | then true | |
297 | 309 | else throwErr("caller is not in adminList")] | |
298 | 310 | if ((checks == checks)) | |
299 | 311 | then getSetNewPeriodLengthActions(newPeriodLength) | |
300 | 312 | else throw("Strict value is not equal to itself.") | |
301 | 313 | } | |
302 | 314 | ||
303 | 315 | ||
304 | 316 | ||
305 | 317 | @Callable(i) | |
306 | 318 | func setForceStopFlag (stop) = { | |
307 | 319 | let check = [if (isAdmin(toString(i.caller))) | |
308 | 320 | then true | |
309 | 321 | else throwErr("caller is not an admin")] | |
310 | 322 | if ((check == check)) | |
311 | 323 | then [BooleanEntry(keyForceStop, stop)] | |
312 | 324 | else throw("Strict value is not equal to itself.") | |
313 | 325 | } | |
314 | 326 | ||
315 | 327 | ||
316 | 328 | ||
317 | 329 | @Callable(i) | |
318 | 330 | func getNodeDataREADONLY (nodeAddress) = { | |
319 | - | let $ | |
320 | - | let currentLease = $ | |
321 | - | let nextLeased = $ | |
331 | + | let $t01363213696 = getLeasingNodeData(nodeAddress) | |
332 | + | let currentLease = $t01363213696._1 | |
333 | + | let nextLeased = $t01363213696._2 | |
322 | 334 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
323 | 335 | } | |
324 | 336 | ||
325 | 337 | ||
326 | 338 | ||
327 | 339 | @Callable(i) | |
328 | 340 | func getUserDataREADONLY (userAddress) = { | |
329 | - | let $ | |
330 | - | let toClaim = $ | |
331 | - | let toUnlock = $ | |
341 | + | let $t01405914119 = getUserToClaimBalance(userAddress) | |
342 | + | let toClaim = $t01405914119._1 | |
343 | + | let toUnlock = $t01405914119._2 | |
332 | 344 | let userTotalLocked = getUserTotalLocked(userAddress) | |
333 | 345 | $Tuple2(nil, $Tuple6(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, userTotalLocked, height)) | |
334 | 346 | } | |
335 | 347 | ||
336 | 348 | ||
337 | 349 | ||
338 | 350 | @Callable(i) | |
339 | 351 | func leaseByAddress (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i) | |
340 | 352 | ||
341 | 353 | ||
342 | 354 | ||
343 | 355 | @Callable(i) | |
344 | 356 | func lease (nodeAddress) = { | |
345 | 357 | let userAddress = toString(i.caller) | |
346 | 358 | getStakeActions(nodeAddress, userAddress, i) | |
347 | 359 | } | |
348 | 360 | ||
349 | 361 | ||
350 | 362 | ||
351 | 363 | @Callable(i) | |
352 | 364 | func leaseFromLocked (nodeAddress,amount) = { | |
353 | 365 | let userAddress = toString(i.caller) | |
354 | - | getStakeFromUnlockedActions(nodeAddress, userAddress, amount) | |
366 | + | getStakeFromUnlockedActions(nodeAddress, userAddress, amount, i) | |
355 | 367 | } | |
356 | 368 | ||
357 | 369 | ||
358 | 370 | ||
359 | 371 | @Callable(i) | |
360 | 372 | func cancelLease (nodeAddress,amount) = { | |
361 | 373 | let userAddress = toString(i.caller) | |
362 | 374 | getUnstakeActions(nodeAddress, userAddress, amount) | |
363 | 375 | } | |
364 | 376 | ||
365 | 377 | ||
366 | 378 | ||
367 | 379 | @Callable(i) | |
368 | 380 | func claim (amount) = { | |
369 | 381 | let userAddress = toString(i.caller) | |
370 | 382 | getClaimUnlockedActions(userAddress, amount) | |
371 | 383 | } | |
372 | 384 | ||
373 | 385 | ||
374 | 386 | ||
375 | 387 | @Callable(i) | |
376 | 388 | func claimAll () = { | |
377 | 389 | let userAddress = toString(i.caller) | |
378 | - | let $ | |
379 | - | let toClaim = $ | |
380 | - | let toUnlock = $ | |
390 | + | let $t01512315183 = getUserToClaimBalance(userAddress) | |
391 | + | let toClaim = $t01512315183._1 | |
392 | + | let toUnlock = $t01512315183._2 | |
381 | 393 | let checks = [if ((toClaim > 0)) | |
382 | 394 | then true | |
383 | 395 | else throwErr("nothing to claim")] | |
384 | 396 | if ((checks == checks)) | |
385 | 397 | then getClaimUnlockedActions(userAddress, toClaim) | |
386 | 398 | else throw("Strict value is not equal to itself.") | |
387 | 399 | } | |
388 | 400 | ||
389 | 401 |
github/deemru/w8io/026f985 43.08 ms ◑