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:BgIvCAISAwoBARIDCgEIEgMKAQgSBAoCCAgSAwoBCBIECgIIARIECgIIARIDCgEBEgAgAAxjb250cmFjdEZpbGUCEWwybXBfbGVhc2luZy5yaWRlAANTRVACAl9fAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQABFrZXlQZXJpb2RPZmZzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICCG9mZnNldElkBQNuaWwFA1NFUAAVa2V5UGVyaW9kT2Zmc2V0SGVpZ2h0CQC5CQIJAMwIAgICJXMJAMwIAgIMb2Zmc2V0SGVpZ2h0BQNuaWwFA1NFUAAPa2V5UGVyaW9kTGVuZ3RoCQC5CQIJAMwIAgICJXMJAMwIAgIMcGVyaW9kTGVuZ3RoBQNuaWwFA1NFUAAOcGVyaW9kT2Zmc2V0SWQJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwURa2V5UGVyaW9kT2Zmc2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2NrZWRBY3Rpb25zAgULdXNlckFkZHJlc3MFBmFtb3VudAFpAQhjbGFpbUFsbAAEC3VzZXJBZGRyZXNzCQClCAEIBQFpBmNhbGxlcgQNJHQwMTIwNzgxMjEzOAkBFWdldFVzZXJUb0NsYWltQmFsYW5jZQEFC3VzZXJBZGRyZXNzBAd0b0NsYWltCAUNJHQwMTIwNzgxMjEzOAJfMQQIdG9VbmxvY2sIBQ0kdDAxMjA3ODEyMTM4Al8yBAZjaGVja3MJAMwIAgMJAGYCBQd0b0NsYWltAAAGCQEIdGhyb3dFcnIBAhBub3RoaW5nIHRvIGNsYWltBQNuaWwDCQAAAgUGY2hlY2tzBQZjaGVja3MJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQd0b0NsYWltCQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAGDhSn0=", "height": 2973341, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BnxhjRvsFxx5GWYAGufgqtCv1BbJxM2tH3hs67eYkZd7 Next: 4FG8tqN6QasBdHEH4Fac2CZDVHPaPL6rL9UUAPGMJCCK Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | ||
40 | 40 | ||
41 | 41 | 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) | |
42 | 48 | ||
43 | 49 | ||
44 | 50 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
140 | 146 | if ((checks == checks)) | |
141 | 147 | then { | |
142 | 148 | let userLeasingAmount = i.payments[0].amount | |
143 | - | let $ | |
144 | - | let nodeCurrentLeased = $ | |
145 | - | let nodeNextLeased = $ | |
149 | + | let $t057775850 = getLeasingNodeData(nodeAddress) | |
150 | + | let nodeCurrentLeased = $t057775850._1 | |
151 | + | let nodeNextLeased = $t057775850._2 | |
146 | 152 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
147 | - | let $ | |
148 | - | let userCurrentLeased = $ | |
149 | - | let userNextLeased = $ | |
153 | + | let $t059186004 = getUserLeasingData(nodeAddress, userAddress) | |
154 | + | let userCurrentLeased = $t059186004._1 | |
155 | + | let userNextLeased = $t059186004._2 | |
150 | 156 | 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)] | |
152 | 158 | } | |
153 | 159 | else throw("Strict value is not equal to itself.") | |
154 | 160 | } | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
158 | - | let $ | |
159 | - | let nodeCurrentLeased = $ | |
160 | - | let nodeNextLeased = $ | |
161 | - | let $ | |
162 | - | let userCurrentLeased = $ | |
163 | - | let userNextLeased = $ | |
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 | |
164 | 170 | let checks = [if ((unstakeAmount > 0)) | |
165 | 171 | then true | |
166 | 172 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
176 | 182 | then { | |
177 | 183 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
178 | 184 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
179 | - | let $ | |
180 | - | let toClaim = $ | |
181 | - | let toUnlock = $ | |
185 | + | let $t073737478 = getUserToClaimBalance(userAddress) | |
186 | + | let toClaim = $t073737478._1 | |
187 | + | let toUnlock = $t073737478._2 | |
182 | 188 | 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)] | |
184 | 190 | } | |
185 | 191 | else throw("Strict value is not equal to itself.") | |
186 | 192 | } | |
187 | 193 | ||
188 | 194 | ||
189 | 195 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
190 | - | let $ | |
191 | - | let toClaim = $ | |
192 | - | let toUnlock = $ | |
196 | + | let $t080218081 = getUserToClaimBalance(userAddress) | |
197 | + | let toClaim = $t080218081._1 | |
198 | + | let toUnlock = $t080218081._2 | |
193 | 199 | let checks = [if ((claimAmount > 0)) | |
194 | 200 | then true | |
195 | 201 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
207 | 213 | ||
208 | 214 | ||
209 | 215 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
210 | - | let $ | |
211 | - | let toClaim = $ | |
212 | - | let toUnlock = $ | |
216 | + | let $t087218781 = getUserToClaimBalance(userAddress) | |
217 | + | let toClaim = $t087218781._1 | |
218 | + | let toUnlock = $t087218781._2 | |
213 | 219 | let available = (toUnlock + toClaim) | |
214 | 220 | let checks = [if ((userLeasingAmount > 0)) | |
215 | 221 | then true | |
222 | 228 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
223 | 229 | if ((checks == checks)) | |
224 | 230 | then { | |
225 | - | let $ | |
226 | - | let nodeCurrentLeased = $ | |
227 | - | let nodeNextLeased = $ | |
231 | + | let $t092589331 = getLeasingNodeData(nodeAddress) | |
232 | + | let nodeCurrentLeased = $t092589331._1 | |
233 | + | let nodeNextLeased = $t092589331._2 | |
228 | 234 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
229 | - | let $ | |
230 | - | let userCurrentLeased = $ | |
231 | - | let userNextLeased = $ | |
235 | + | let $t093999485 = getUserLeasingData(nodeAddress, userAddress) | |
236 | + | let userCurrentLeased = $t093999485._1 | |
237 | + | let userNextLeased = $t093999485._2 | |
232 | 238 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
233 | 239 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
234 | 240 | 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)] | |
236 | 242 | } | |
237 | 243 | else throw("Strict value is not equal to itself.") | |
238 | 244 | } | |
257 | 263 | ||
258 | 264 | @Callable(i) | |
259 | 265 | func getNodeDataREADONLY (nodeAddress) = { | |
260 | - | let $ | |
261 | - | let currentLease = $ | |
262 | - | let nextLeased = $ | |
266 | + | let $t01088010944 = getLeasingNodeData(nodeAddress) | |
267 | + | let currentLease = $t01088010944._1 | |
268 | + | let nextLeased = $t01088010944._2 | |
263 | 269 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
264 | 270 | } | |
265 | 271 | ||
267 | 273 | ||
268 | 274 | @Callable(i) | |
269 | 275 | func getUserDataREADONLY (userAddress) = { | |
270 | - | let $ | |
271 | - | let toClaim = $ | |
272 | - | let toUnlock = $ | |
276 | + | let $t01110011160 = getUserToClaimBalance(userAddress) | |
277 | + | let toClaim = $t01110011160._1 | |
278 | + | let toUnlock = $t01110011160._2 | |
273 | 279 | $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height)) | |
274 | 280 | } | |
275 | 281 | ||
315 | 321 | @Callable(i) | |
316 | 322 | func claimAll () = { | |
317 | 323 | let userAddress = toString(i.caller) | |
318 | - | let $ | |
319 | - | let toClaim = $ | |
320 | - | let toUnlock = $ | |
324 | + | let $t01207812138 = getUserToClaimBalance(userAddress) | |
325 | + | let toClaim = $t01207812138._1 | |
326 | + | let toUnlock = $t01207812138._2 | |
321 | 327 | let checks = [if ((toClaim > 0)) | |
322 | 328 | then true | |
323 | 329 | 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 keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
14 | 14 | ||
15 | 15 | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
16 | 16 | ||
17 | 17 | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
18 | 18 | ||
19 | 19 | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
20 | 20 | ||
21 | 21 | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
22 | 22 | ||
23 | 23 | let periodOffsetHeight = valueOrElse(getInteger(this, keyPeriodOffsetHeight), -1) | |
24 | 24 | ||
25 | 25 | let currentPeriodId = if (if ((height > periodOffsetHeight)) | |
26 | 26 | then (periodOffsetHeight != -1) | |
27 | 27 | else false) | |
28 | 28 | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
29 | 29 | else max([0, (periodOffsetId - 1)]) | |
30 | 30 | ||
31 | 31 | let currentPeriodHeight = (periodOffsetHeight + ((currentPeriodId - periodOffsetId) * periodLength)) | |
32 | 32 | ||
33 | 33 | let nextPeriodHeight = (currentPeriodHeight + periodLength) | |
34 | 34 | ||
35 | 35 | func keyLeasingNodeData (nodeAddress) = makeString(["%s", nodeAddress], SEP) | |
36 | 36 | ||
37 | 37 | ||
38 | 38 | func keyUserToClaim (userAddress) = makeString(["%s%s", "toClaim", userAddress], SEP) | |
39 | 39 | ||
40 | 40 | ||
41 | 41 | 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) | |
42 | 48 | ||
43 | 49 | ||
44 | 50 | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
45 | 51 | ||
46 | 52 | let assetIdBytes = if ((assetIdString == "WAVES")) | |
47 | 53 | then unit | |
48 | 54 | else fromBase58String(assetIdString) | |
49 | 55 | ||
50 | 56 | func isValidAddress (address) = match addressFromString(address) { | |
51 | 57 | case a: Address => | |
52 | 58 | true | |
53 | 59 | case _ => | |
54 | 60 | false | |
55 | 61 | } | |
56 | 62 | ||
57 | 63 | ||
58 | 64 | func getLeasingNodeEntry (nodeAddress,currentLeased,nextLeased) = { | |
59 | 65 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(currentLeased), toString(nextPeriodHeight), toString(nextLeased)], SEP) | |
60 | 66 | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
61 | 67 | } | |
62 | 68 | ||
63 | 69 | ||
64 | 70 | func getLeasingNodeData (nodeAddress) = { | |
65 | 71 | let leasingNodeDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
66 | 72 | match leasingNodeDataStringRaw { | |
67 | 73 | case ds: String => | |
68 | 74 | let dataList = split(ds, SEP) | |
69 | 75 | let nodeCurrentPeriod = parseIntValue(dataList[1]) | |
70 | 76 | let nodeCurrentLeased = parseIntValue(dataList[2]) | |
71 | 77 | let nodeNextPeriod = parseIntValue(dataList[3]) | |
72 | 78 | let nodeNextLeased = parseIntValue(dataList[4]) | |
73 | 79 | if ((nodeNextPeriod > height)) | |
74 | 80 | then $Tuple2(nodeCurrentLeased, nodeNextLeased) | |
75 | 81 | else $Tuple2(nodeNextLeased, nodeNextLeased) | |
76 | 82 | case _ => | |
77 | 83 | $Tuple2(0, 0) | |
78 | 84 | } | |
79 | 85 | } | |
80 | 86 | ||
81 | 87 | ||
82 | 88 | func getUserLeasingEntry (nodeAddress,userAddress,userCurrentLeased,userNextLeased) = { | |
83 | 89 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(userCurrentLeased), toString(nextPeriodHeight), toString(userNextLeased)], SEP) | |
84 | 90 | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
85 | 91 | } | |
86 | 92 | ||
87 | 93 | ||
88 | 94 | func getUserLeasingData (nodeAddress,userAddress) = { | |
89 | 95 | let leasingUserDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
90 | 96 | match leasingUserDataStringRaw { | |
91 | 97 | case ds: String => | |
92 | 98 | let dataList = split(ds, SEP) | |
93 | 99 | let userCurrentPeriod = parseIntValue(dataList[1]) | |
94 | 100 | let userCurrentLeased = parseIntValue(dataList[2]) | |
95 | 101 | let userNextPeriod = parseIntValue(dataList[3]) | |
96 | 102 | let userNextLeased = parseIntValue(dataList[4]) | |
97 | 103 | if ((userNextPeriod > height)) | |
98 | 104 | then $Tuple2(userCurrentLeased, userNextLeased) | |
99 | 105 | else $Tuple2(userNextLeased, userNextLeased) | |
100 | 106 | case _ => | |
101 | 107 | $Tuple2(0, 0) | |
102 | 108 | } | |
103 | 109 | } | |
104 | 110 | ||
105 | 111 | ||
106 | 112 | func getUserToClaimEntry (userAddress,toClaim,toUnlock) = { | |
107 | 113 | let valueString = makeString(["%d%d%d%d", toString(currentPeriodHeight), toString(toClaim), toString(nextPeriodHeight), toString(toUnlock)], SEP) | |
108 | 114 | StringEntry(keyUserToClaim(userAddress), valueString) | |
109 | 115 | } | |
110 | 116 | ||
111 | 117 | ||
112 | 118 | func getUserToClaimBalance (userAddress) = { | |
113 | 119 | let userToClaimDataStringRaw = getString(this, keyUserToClaim(userAddress)) | |
114 | 120 | match userToClaimDataStringRaw { | |
115 | 121 | case ds: String => | |
116 | 122 | let dataList = split(ds, SEP) | |
117 | 123 | let currentPeriod = parseIntValue(dataList[1]) | |
118 | 124 | let toClaim = parseIntValue(dataList[2]) | |
119 | 125 | let nextPeriod = parseIntValue(dataList[3]) | |
120 | 126 | let toUnlock = parseIntValue(dataList[4]) | |
121 | 127 | if ((nextPeriod > height)) | |
122 | 128 | then $Tuple2(toClaim, toUnlock) | |
123 | 129 | else $Tuple2((toClaim + toUnlock), 0) | |
124 | 130 | case _ => | |
125 | 131 | $Tuple2(0, 0) | |
126 | 132 | } | |
127 | 133 | } | |
128 | 134 | ||
129 | 135 | ||
130 | 136 | func getStakeActions (nodeAddress,userAddress,i) = { | |
131 | 137 | let checks = [if ((size(i.payments) == 1)) | |
132 | 138 | then true | |
133 | 139 | else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes)) | |
134 | 140 | then true | |
135 | 141 | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress)) | |
136 | 142 | then true | |
137 | 143 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
138 | 144 | then true | |
139 | 145 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
140 | 146 | if ((checks == checks)) | |
141 | 147 | then { | |
142 | 148 | let userLeasingAmount = i.payments[0].amount | |
143 | - | let $ | |
144 | - | let nodeCurrentLeased = $ | |
145 | - | let nodeNextLeased = $ | |
149 | + | let $t057775850 = getLeasingNodeData(nodeAddress) | |
150 | + | let nodeCurrentLeased = $t057775850._1 | |
151 | + | let nodeNextLeased = $t057775850._2 | |
146 | 152 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
147 | - | let $ | |
148 | - | let userCurrentLeased = $ | |
149 | - | let userNextLeased = $ | |
153 | + | let $t059186004 = getUserLeasingData(nodeAddress, userAddress) | |
154 | + | let userCurrentLeased = $t059186004._1 | |
155 | + | let userNextLeased = $t059186004._2 | |
150 | 156 | 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)] | |
152 | 158 | } | |
153 | 159 | else throw("Strict value is not equal to itself.") | |
154 | 160 | } | |
155 | 161 | ||
156 | 162 | ||
157 | 163 | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
158 | - | let $ | |
159 | - | let nodeCurrentLeased = $ | |
160 | - | let nodeNextLeased = $ | |
161 | - | let $ | |
162 | - | let userCurrentLeased = $ | |
163 | - | let userNextLeased = $ | |
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 | |
164 | 170 | let checks = [if ((unstakeAmount > 0)) | |
165 | 171 | then true | |
166 | 172 | else throwErr("unstake amount should be greater than 0"), if ((userNextLeased >= unstakeAmount)) | |
167 | 173 | then true | |
168 | 174 | else throwErr("unstake amount should be less or equal user staked amount"), if ((nodeNextLeased >= unstakeAmount)) | |
169 | 175 | then true | |
170 | 176 | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
171 | 177 | then true | |
172 | 178 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
173 | 179 | then true | |
174 | 180 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
175 | 181 | if ((checks == checks)) | |
176 | 182 | then { | |
177 | 183 | let newNodeNextLease = (nodeNextLeased - unstakeAmount) | |
178 | 184 | let newUserNextLeased = (userNextLeased - unstakeAmount) | |
179 | - | let $ | |
180 | - | let toClaim = $ | |
181 | - | let toUnlock = $ | |
185 | + | let $t073737478 = getUserToClaimBalance(userAddress) | |
186 | + | let toClaim = $t073737478._1 | |
187 | + | let toUnlock = $t073737478._2 | |
182 | 188 | 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)] | |
184 | 190 | } | |
185 | 191 | else throw("Strict value is not equal to itself.") | |
186 | 192 | } | |
187 | 193 | ||
188 | 194 | ||
189 | 195 | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
190 | - | let $ | |
191 | - | let toClaim = $ | |
192 | - | let toUnlock = $ | |
196 | + | let $t080218081 = getUserToClaimBalance(userAddress) | |
197 | + | let toClaim = $t080218081._1 | |
198 | + | let toUnlock = $t080218081._2 | |
193 | 199 | let checks = [if ((claimAmount > 0)) | |
194 | 200 | then true | |
195 | 201 | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
196 | 202 | then true | |
197 | 203 | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
198 | 204 | then true | |
199 | 205 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
200 | 206 | if ((checks == checks)) | |
201 | 207 | then { | |
202 | 208 | let newToClaim = (toClaim - claimAmount) | |
203 | 209 | [getUserToClaimEntry(userAddress, newToClaim, toUnlock), ScriptTransfer(addressFromStringValue(userAddress), claimAmount, assetIdBytes)] | |
204 | 210 | } | |
205 | 211 | else throw("Strict value is not equal to itself.") | |
206 | 212 | } | |
207 | 213 | ||
208 | 214 | ||
209 | 215 | func getStakeFromUnlockedActions (nodeAddress,userAddress,userLeasingAmount) = { | |
210 | - | let $ | |
211 | - | let toClaim = $ | |
212 | - | let toUnlock = $ | |
216 | + | let $t087218781 = getUserToClaimBalance(userAddress) | |
217 | + | let toClaim = $t087218781._1 | |
218 | + | let toUnlock = $t087218781._2 | |
213 | 219 | let available = (toUnlock + toClaim) | |
214 | 220 | let checks = [if ((userLeasingAmount > 0)) | |
215 | 221 | then true | |
216 | 222 | else throwErr("amount should be greater than 0"), if ((available >= userLeasingAmount)) | |
217 | 223 | then true | |
218 | 224 | else throwErr("amount should be less or equal to available"), if (isValidAddress(nodeAddress)) | |
219 | 225 | then true | |
220 | 226 | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
221 | 227 | then true | |
222 | 228 | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
223 | 229 | if ((checks == checks)) | |
224 | 230 | then { | |
225 | - | let $ | |
226 | - | let nodeCurrentLeased = $ | |
227 | - | let nodeNextLeased = $ | |
231 | + | let $t092589331 = getLeasingNodeData(nodeAddress) | |
232 | + | let nodeCurrentLeased = $t092589331._1 | |
233 | + | let nodeNextLeased = $t092589331._2 | |
228 | 234 | let newNodeNextLease = (nodeNextLeased + userLeasingAmount) | |
229 | - | let $ | |
230 | - | let userCurrentLeased = $ | |
231 | - | let userNextLeased = $ | |
235 | + | let $t093999485 = getUserLeasingData(nodeAddress, userAddress) | |
236 | + | let userCurrentLeased = $t093999485._1 | |
237 | + | let userNextLeased = $t093999485._2 | |
232 | 238 | let newUserNextLeased = (userNextLeased + userLeasingAmount) | |
233 | 239 | let newToUnlock = max([0, (toUnlock - userLeasingAmount)]) | |
234 | 240 | 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)] | |
236 | 242 | } | |
237 | 243 | else throw("Strict value is not equal to itself.") | |
238 | 244 | } | |
239 | 245 | ||
240 | 246 | ||
241 | 247 | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
242 | 248 | let check = [if ((newPeriodLength > 0)) | |
243 | 249 | then true | |
244 | 250 | else throwErr("period length should be greater than 0")] | |
245 | 251 | if ((check == check)) | |
246 | 252 | then if ((periodOffsetHeight == -1)) | |
247 | 253 | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
248 | 254 | else [IntegerEntry(keyPeriodOffsetId, (currentPeriodId + 1)), IntegerEntry(keyPeriodOffsetHeight, nextPeriodHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
249 | 255 | else throw("Strict value is not equal to itself.") | |
250 | 256 | } | |
251 | 257 | ||
252 | 258 | ||
253 | 259 | @Callable(i) | |
254 | 260 | func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength) | |
255 | 261 | ||
256 | 262 | ||
257 | 263 | ||
258 | 264 | @Callable(i) | |
259 | 265 | func getNodeDataREADONLY (nodeAddress) = { | |
260 | - | let $ | |
261 | - | let currentLease = $ | |
262 | - | let nextLeased = $ | |
266 | + | let $t01088010944 = getLeasingNodeData(nodeAddress) | |
267 | + | let currentLease = $t01088010944._1 | |
268 | + | let nextLeased = $t01088010944._2 | |
263 | 269 | $Tuple2(nil, $Tuple5(currentPeriodHeight, currentLease, nextPeriodHeight, nextLeased, height)) | |
264 | 270 | } | |
265 | 271 | ||
266 | 272 | ||
267 | 273 | ||
268 | 274 | @Callable(i) | |
269 | 275 | func getUserDataREADONLY (userAddress) = { | |
270 | - | let $ | |
271 | - | let toClaim = $ | |
272 | - | let toUnlock = $ | |
276 | + | let $t01110011160 = getUserToClaimBalance(userAddress) | |
277 | + | let toClaim = $t01110011160._1 | |
278 | + | let toUnlock = $t01110011160._2 | |
273 | 279 | $Tuple2(nil, $Tuple5(currentPeriodHeight, toClaim, nextPeriodHeight, toUnlock, height)) | |
274 | 280 | } | |
275 | 281 | ||
276 | 282 | ||
277 | 283 | ||
278 | 284 | @Callable(i) | |
279 | 285 | func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i) | |
280 | 286 | ||
281 | 287 | ||
282 | 288 | ||
283 | 289 | @Callable(i) | |
284 | 290 | func stake (nodeAddress) = { | |
285 | 291 | let userAddress = toString(i.caller) | |
286 | 292 | getStakeActions(nodeAddress, userAddress, i) | |
287 | 293 | } | |
288 | 294 | ||
289 | 295 | ||
290 | 296 | ||
291 | 297 | @Callable(i) | |
292 | 298 | func stakeFromUnlocked (nodeAddress,amount) = { | |
293 | 299 | let userAddress = toString(i.caller) | |
294 | 300 | getStakeFromUnlockedActions(nodeAddress, userAddress, amount) | |
295 | 301 | } | |
296 | 302 | ||
297 | 303 | ||
298 | 304 | ||
299 | 305 | @Callable(i) | |
300 | 306 | func unstake (nodeAddress,amount) = { | |
301 | 307 | let userAddress = toString(i.caller) | |
302 | 308 | getUnstakeActions(nodeAddress, userAddress, amount) | |
303 | 309 | } | |
304 | 310 | ||
305 | 311 | ||
306 | 312 | ||
307 | 313 | @Callable(i) | |
308 | 314 | func claim (amount) = { | |
309 | 315 | let userAddress = toString(i.caller) | |
310 | 316 | getClaimUnlockedActions(userAddress, amount) | |
311 | 317 | } | |
312 | 318 | ||
313 | 319 | ||
314 | 320 | ||
315 | 321 | @Callable(i) | |
316 | 322 | func claimAll () = { | |
317 | 323 | let userAddress = toString(i.caller) | |
318 | - | let $ | |
319 | - | let toClaim = $ | |
320 | - | let toUnlock = $ | |
324 | + | let $t01207812138 = getUserToClaimBalance(userAddress) | |
325 | + | let toClaim = $t01207812138._1 | |
326 | + | let toUnlock = $t01207812138._2 | |
321 | 327 | let checks = [if ((toClaim > 0)) | |
322 | 328 | then true | |
323 | 329 | else throwErr("nothing to claim")] | |
324 | 330 | if ((checks == checks)) | |
325 | 331 | then getClaimUnlockedActions(userAddress, toClaim) | |
326 | 332 | else throw("Strict value is not equal to itself.") | |
327 | 333 | } | |
328 | 334 | ||
329 | 335 |
github/deemru/w8io/169f3d6 80.54 ms ◑