tx · 7rMbGGt5aktHCTVDbvEGLwVXvDVt1K95jzwkRHdgF59N 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h: -0.01000000 Waves 2024.02.05 12:41 [2962804] smart account 3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h > SELF 0.00000000 Waves
{ "type": 13, "id": "7rMbGGt5aktHCTVDbvEGLwVXvDVt1K95jzwkRHdgF59N", "fee": 1000000, "feeAssetId": null, "timestamp": 1707126115894, "version": 2, "chainId": 84, "sender": "3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h", "senderPublicKey": "3z8Q6Zu3KppVmn6fJJvrLc1Wo3krVHSvfaNcerm82md2", "proofs": [ "5hrmiuzzu553uiDXjLe64FsGnwLVedj9t2eqm7y9S573Q3GhgyZSfVr2pTM79jjNaxZGFJrhpGbAVMq4Nd7gMSUV" ], "script": "base64:BgIiCAISAwoBARIDCgEIEgQKAggIEgMKAQgSBAoCCAESAwoBASEADGNvbnRyYWN0RmlsZQIRbDJtcF9sZWFzaW5nLnJpZGUAA1NFUAICX18ABnNjYWxlOACAwtcvAQh0aHJvd0VycgEDbXNnCQACAQkArAICCQCsAgIFDGNvbnRyYWN0RmlsZQICOiAFA21zZwAKa2V5QXNzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICB2Fzc2V0SWQFA25pbAUDU0VQABFrZXlQZXJpb2RPZmZzZXRJZAkAuQkCCQDMCAICAiVzCQDMCAICCG9mZnNldElkBQNuaWwFA1NFUAAVa2V5UGVyaW9kT2Zmc2V0SGVpZ2h0CQC5CQIJAMwIAgICJXMJAMwIAgIMb2Zmc2V0SGVpZ2h0BQNuaWwFA1NFUAAPa2V5UGVyaW9kTGVuZ3RoCQC5CQIJAMwIAgICJXMJAMwIAgIMcGVyaW9kTGVuZ3RoBQNuaWwFA1NFUAAOcGVyaW9kT2Zmc2V0SWQJAQt2YWx1ZU9yRWxzZQIJAJoIAgUEdGhpcwURa2V5UGVyaW9kT2Zmc2V0SWQA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2VkBQh0b1VubG9jawUHdG9DbGFpbQUIbm9kZUxpc3QBaQEIc3Rha2VGb3ICC25vZGVBZGRyZXNzC3VzZXJBZGRyZXNzCQEPZ2V0U3Rha2VBY3Rpb25zAwULbm9kZUFkZHJlc3MFC3VzZXJBZGRyZXNzBQFpAWkBBXN0YWtlAQtub2RlQWRkcmVzcwQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQEPZ2V0U3Rha2VBY3Rpb25zAwULbm9kZUFkZHJlc3MFC3VzZXJBZGRyZXNzBQFpAWkBB3Vuc3Rha2UCC25vZGVBZGRyZXNzBmFtb3VudAQLdXNlckFkZHJlc3MJAKUIAQgFAWkGY2FsbGVyCQERZ2V0VW5zdGFrZUFjdGlvbnMDBQtub2RlQWRkcmVzcwULdXNlckFkZHJlc3MFBmFtb3VudAFpAQVjbGFpbQEGYW1vdW50BAt1c2VyQWRkcmVzcwkApQgBCAUBaQZjYWxsZXIJARdnZXRDbGFpbVVubG9ja2VkQWN0aW9ucwIFC3VzZXJBZGRyZXNzBQZhbW91bnQA3xS1Ww==", "height": 2962804, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FA8VMsWMtMDVNqo22HmMLWfxkUzQCqWJUBrgqqF2DNhD Next: GDTPtt3d2tK8zGC9QiCdh1wkh9ZpreoWp2ywPnwcma4E Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let contractFile = "l2mp_leasing.ride" | |
5 | + | ||
6 | + | let SEP = "__" | |
7 | + | ||
8 | + | let scale8 = 100000000 | |
9 | + | ||
10 | + | func throwErr (msg) = throw(((contractFile + ": ") + msg)) | |
11 | + | ||
12 | + | ||
13 | + | let keyAssetId = makeString(["%s", "assetId"], SEP) | |
14 | + | ||
15 | + | let keyPeriodOffsetId = makeString(["%s", "offsetId"], SEP) | |
16 | + | ||
17 | + | let keyPeriodOffsetHeight = makeString(["%s", "offsetHeight"], SEP) | |
18 | + | ||
19 | + | let keyPeriodLength = makeString(["%s", "periodLength"], SEP) | |
20 | + | ||
21 | + | let periodOffsetId = valueOrElse(getInteger(this, keyPeriodOffsetId), 0) | |
22 | + | ||
23 | + | let periodLength = valueOrElse(getInteger(this, keyPeriodLength), 10000) | |
24 | + | ||
25 | + | let periodOffsetHeight = valueOrElse(getIntegerValue(this, keyPeriodOffsetHeight), -1) | |
26 | + | ||
27 | + | let currentPeriodId = if ((height > periodOffsetHeight)) | |
28 | + | then (((height - periodOffsetHeight) / periodLength) + periodOffsetId) | |
29 | + | else periodOffsetId | |
30 | + | ||
31 | + | func keyLeasingNodeData (nodeAddress) = makeString(["%s", "leasingNode", nodeAddress], SEP) | |
32 | + | ||
33 | + | ||
34 | + | func keyUserLeasingNodeList (userAddress) = makeString(["%s%s", "userLeasingNodeList", userAddress], SEP) | |
35 | + | ||
36 | + | ||
37 | + | func keyUserLeasingNodeData (userAddress,nodeAddress) = makeString(["%s%s", "userLeasingNodeData", userAddress, nodeAddress], SEP) | |
38 | + | ||
39 | + | ||
40 | + | func keyUserBalances (userAddress) = makeString(["%s%s", "userBalances", userAddress], SEP) | |
41 | + | ||
42 | + | ||
43 | + | let assetIdString = valueOrElse(getString(this, keyAssetId), "WAVES") | |
44 | + | ||
45 | + | let assetIdBytes = if ((assetIdString == "WAVES")) | |
46 | + | then unit | |
47 | + | else fromBase58String(assetIdString) | |
48 | + | ||
49 | + | func isValidAddress (address) = match addressFromString(address) { | |
50 | + | case a: Address => | |
51 | + | true | |
52 | + | case _ => | |
53 | + | false | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | func getLeasingNodeEntry (nodeAddress,totalLeased) = { | |
58 | + | let valueString = makeString(["%d", toString(totalLeased)], SEP) | |
59 | + | StringEntry(keyLeasingNodeData(nodeAddress), valueString) | |
60 | + | } | |
61 | + | ||
62 | + | ||
63 | + | func getLeasingNodeData (nodeAddress) = { | |
64 | + | let leasingDataStringRaw = getString(this, keyLeasingNodeData(nodeAddress)) | |
65 | + | match leasingDataStringRaw { | |
66 | + | case ds: String => | |
67 | + | let dataList = split(ds, SEP) | |
68 | + | let totalLeased = parseIntValue(dataList[1]) | |
69 | + | totalLeased | |
70 | + | case _ => | |
71 | + | 0 | |
72 | + | } | |
73 | + | } | |
74 | + | ||
75 | + | ||
76 | + | func getUserLeasingEntry (nodeAddress,userAddress,totalUserLeased) = { | |
77 | + | let valueString = makeString(["%d", toString(totalUserLeased)], SEP) | |
78 | + | StringEntry(keyUserLeasingNodeData(userAddress, nodeAddress), valueString) | |
79 | + | } | |
80 | + | ||
81 | + | ||
82 | + | func getUserLeasingData (nodeAddress,userAddress) = { | |
83 | + | let leasingDataStringRaw = getString(this, keyUserLeasingNodeData(userAddress, nodeAddress)) | |
84 | + | match leasingDataStringRaw { | |
85 | + | case ds: String => | |
86 | + | let dataList = split(ds, SEP) | |
87 | + | let totalLeased = parseIntValue(dataList[1]) | |
88 | + | totalLeased | |
89 | + | case _ => | |
90 | + | 0 | |
91 | + | } | |
92 | + | } | |
93 | + | ||
94 | + | ||
95 | + | func getUserBalancesEntry (userAddress,periodId,leased,toUnlock,toClaim) = { | |
96 | + | let valueString = makeString(["%d%d%d%d", toString(periodId), toString(leased), toString(toUnlock), toString(toClaim)], SEP) | |
97 | + | StringEntry(keyUserBalances(userAddress), valueString) | |
98 | + | } | |
99 | + | ||
100 | + | ||
101 | + | func getUserBalances (userAddress) = { | |
102 | + | let leasingDataStringRaw = getString(this, keyUserBalances(userAddress)) | |
103 | + | match leasingDataStringRaw { | |
104 | + | case ds: String => | |
105 | + | let dataList = split(ds, SEP) | |
106 | + | let periodId = parseIntValue(dataList[1]) | |
107 | + | let leased = parseIntValue(dataList[2]) | |
108 | + | let toUnlock = parseIntValue(dataList[3]) | |
109 | + | let toClaim = parseIntValue(dataList[4]) | |
110 | + | if (((currentPeriodId - periodId) > 0)) | |
111 | + | then $Tuple4(periodId, leased, 0, (toClaim + toUnlock)) | |
112 | + | else $Tuple4(periodId, leased, toUnlock, toClaim) | |
113 | + | case _ => | |
114 | + | $Tuple4(0, 0, 0, 0) | |
115 | + | } | |
116 | + | } | |
117 | + | ||
118 | + | ||
119 | + | func getUserLeasingNodeList (userAddress) = { | |
120 | + | let leasingDataStringRaw = getString(this, keyUserLeasingNodeList(userAddress)) | |
121 | + | match leasingDataStringRaw { | |
122 | + | case ds: String => | |
123 | + | let dataList = split_51C(ds, SEP) | |
124 | + | dataList | |
125 | + | case _ => | |
126 | + | nil | |
127 | + | } | |
128 | + | } | |
129 | + | ||
130 | + | ||
131 | + | func getUserNodeListEntry (userAddress,nodeList) = if ((size(nodeList) == 0)) | |
132 | + | then DeleteEntry(keyUserLeasingNodeList(userAddress)) | |
133 | + | else StringEntry(keyUserLeasingNodeList(userAddress), makeString_11C(nodeList, SEP)) | |
134 | + | ||
135 | + | ||
136 | + | func addNodeToNodeList (userAddress,nodeAddress) = { | |
137 | + | let nodeList = getUserLeasingNodeList(userAddress) | |
138 | + | if (containsElement(nodeList, nodeAddress)) | |
139 | + | then nodeList | |
140 | + | else (nodeList :+ nodeAddress) | |
141 | + | } | |
142 | + | ||
143 | + | ||
144 | + | func removeNodeFromNodeList (userAddress,nodeAddress) = { | |
145 | + | let nodeList = getUserLeasingNodeList(userAddress) | |
146 | + | match indexOf(nodeList, nodeAddress) { | |
147 | + | case index: Int => | |
148 | + | removeByIndex(nodeList, index) | |
149 | + | case _ => | |
150 | + | nodeList | |
151 | + | } | |
152 | + | } | |
153 | + | ||
154 | + | ||
155 | + | func getStakeActions (nodeAddress,userAddress,i) = { | |
156 | + | let checks = [if ((size(i.payments) == 1)) | |
157 | + | then true | |
158 | + | else throwErr("payment size should be exactly 1"), if ((i.payments[0].assetId == assetIdBytes)) | |
159 | + | then true | |
160 | + | else throwErr(makeString(["payment assetId should be:", assetIdString], " ")), if (isValidAddress(nodeAddress)) | |
161 | + | then true | |
162 | + | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
163 | + | then true | |
164 | + | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
165 | + | if ((checks == checks)) | |
166 | + | then { | |
167 | + | let userLeasingAmount = i.payments[0].amount | |
168 | + | let totalNodeLeased = getLeasingNodeData(nodeAddress) | |
169 | + | let newTotalLease = (totalNodeLeased + userLeasingAmount) | |
170 | + | let userTotalLeased = getUserLeasingData(nodeAddress, userAddress) | |
171 | + | let newUserTotalLease = (userTotalLeased + userLeasingAmount) | |
172 | + | let $t058275899 = getUserBalances(userAddress) | |
173 | + | let periodId = $t058275899._1 | |
174 | + | let leased = $t058275899._2 | |
175 | + | let toUnlock = $t058275899._3 | |
176 | + | let toClaim = $t058275899._4 | |
177 | + | let newLeased = (leased + userLeasingAmount) | |
178 | + | [getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, currentPeriodId, newLeased, toUnlock, toClaim), getUserNodeListEntry(userAddress, addNodeToNodeList(userAddress, nodeAddress))] | |
179 | + | } | |
180 | + | else throw("Strict value is not equal to itself.") | |
181 | + | } | |
182 | + | ||
183 | + | ||
184 | + | func getUnstakeActions (nodeAddress,userAddress,unstakeAmount) = { | |
185 | + | let totalNodeLeased = getLeasingNodeData(nodeAddress) | |
186 | + | let userTotalLeased = getUserLeasingData(nodeAddress, userAddress) | |
187 | + | let checks = [if ((unstakeAmount > 0)) | |
188 | + | then true | |
189 | + | else throwErr("unstake amount should be greater than 0"), if ((userTotalLeased >= unstakeAmount)) | |
190 | + | then true | |
191 | + | else throwErr("unstake amount should be less or equal user staked amount"), if ((totalNodeLeased >= unstakeAmount)) | |
192 | + | then true | |
193 | + | else throwErr("unstake amount should be less or equal node staked amount"), if (isValidAddress(nodeAddress)) | |
194 | + | then true | |
195 | + | else throwErr(makeString(["node address is not valid:", nodeAddress], " ")), if (isValidAddress(userAddress)) | |
196 | + | then true | |
197 | + | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
198 | + | if ((checks == checks)) | |
199 | + | then { | |
200 | + | let newTotalLease = (totalNodeLeased - unstakeAmount) | |
201 | + | let newUserTotalLease = (userTotalLeased - unstakeAmount) | |
202 | + | let $t071827254 = getUserBalances(userAddress) | |
203 | + | let periodId = $t071827254._1 | |
204 | + | let leased = $t071827254._2 | |
205 | + | let toUnlock = $t071827254._3 | |
206 | + | let toClaim = $t071827254._4 | |
207 | + | let newLeased = (leased - unstakeAmount) | |
208 | + | let newToUnlock = (toUnlock + unstakeAmount) | |
209 | + | let removeNodeActions = if ((newUserTotalLease == 0)) | |
210 | + | then [getUserNodeListEntry(userAddress, removeNodeFromNodeList(userAddress, nodeAddress))] | |
211 | + | else nil | |
212 | + | ([getLeasingNodeEntry(nodeAddress, newTotalLease), getUserLeasingEntry(nodeAddress, userAddress, newUserTotalLease), getUserBalancesEntry(userAddress, currentPeriodId, newLeased, newToUnlock, toClaim)] ++ removeNodeActions) | |
213 | + | } | |
214 | + | else throw("Strict value is not equal to itself.") | |
215 | + | } | |
216 | + | ||
217 | + | ||
218 | + | func getClaimUnlockedActions (userAddress,claimAmount) = { | |
219 | + | let $t078557927 = getUserBalances(userAddress) | |
220 | + | let periodId = $t078557927._1 | |
221 | + | let leased = $t078557927._2 | |
222 | + | let toUnlock = $t078557927._3 | |
223 | + | let toClaim = $t078557927._4 | |
224 | + | let checks = [if ((claimAmount > 0)) | |
225 | + | then true | |
226 | + | else throwErr("claim amount should be greater than 0"), if ((toClaim >= claimAmount)) | |
227 | + | then true | |
228 | + | else throwErr("claim amount should be less or equal unlocked amount"), if (isValidAddress(userAddress)) | |
229 | + | then true | |
230 | + | else throwErr(makeString(["user address is not valid:", userAddress], " "))] | |
231 | + | if ((checks == checks)) | |
232 | + | then { | |
233 | + | let newToClaim = (toClaim - claimAmount) | |
234 | + | [getUserBalancesEntry(userAddress, currentPeriodId, leased, toUnlock, newToClaim)] | |
235 | + | } | |
236 | + | else throw("Strict value is not equal to itself.") | |
237 | + | } | |
238 | + | ||
239 | + | ||
240 | + | func getSetNewPeriodLengthActions (newPeriodLength) = { | |
241 | + | let check = [if ((newPeriodLength > 0)) | |
242 | + | then true | |
243 | + | else throwErr("period length should be greater than 0")] | |
244 | + | if ((check == check)) | |
245 | + | then if ((periodOffsetHeight == -1)) | |
246 | + | then [IntegerEntry(keyPeriodLength, newPeriodLength), IntegerEntry(keyPeriodOffsetHeight, height)] | |
247 | + | else { | |
248 | + | let newPeriodOffsetId = (currentPeriodId + 1) | |
249 | + | let newOffsetHeight = ((periodLength * (newPeriodOffsetId - periodOffsetId)) + periodOffsetHeight) | |
250 | + | [IntegerEntry(keyPeriodOffsetId, newPeriodOffsetId), IntegerEntry(keyPeriodOffsetHeight, newOffsetHeight), IntegerEntry(keyPeriodLength, newPeriodLength)] | |
251 | + | } | |
252 | + | else throw("Strict value is not equal to itself.") | |
253 | + | } | |
4 | 254 | ||
5 | 255 | ||
6 | 256 | @Callable(i) | |
7 | - | func foo (n) = { | |
8 | - | let setterContract = addressFromStringValue("3Mu5kasZ85VY5xUCpPYoWr6fBzh6eGZwcnt") | |
9 | - | let num = getIntegerValue(setterContract, "numValue") | |
10 | - | let si = invoke(setterContract, "changeRate", [(num + n)], nil) | |
11 | - | if ((si == si)) | |
12 | - | then nil | |
13 | - | else throw("Strict value is not equal to itself.") | |
257 | + | func setNewPeriodLength (newPeriodLength) = getSetNewPeriodLengthActions(newPeriodLength) | |
258 | + | ||
259 | + | ||
260 | + | ||
261 | + | @Callable(i) | |
262 | + | func getUserData (userAddress) = { | |
263 | + | let $t093099381 = getUserBalances(userAddress) | |
264 | + | let periodId = $t093099381._1 | |
265 | + | let leased = $t093099381._2 | |
266 | + | let toUnlock = $t093099381._3 | |
267 | + | let toClaim = $t093099381._4 | |
268 | + | let nodeList = getUserLeasingNodeList(userAddress) | |
269 | + | $Tuple2(nil, $Tuple5(currentPeriodId, leased, toUnlock, toClaim, nodeList)) | |
270 | + | } | |
271 | + | ||
272 | + | ||
273 | + | ||
274 | + | @Callable(i) | |
275 | + | func stakeFor (nodeAddress,userAddress) = getStakeActions(nodeAddress, userAddress, i) | |
276 | + | ||
277 | + | ||
278 | + | ||
279 | + | @Callable(i) | |
280 | + | func stake (nodeAddress) = { | |
281 | + | let userAddress = toString(i.caller) | |
282 | + | getStakeActions(nodeAddress, userAddress, i) | |
283 | + | } | |
284 | + | ||
285 | + | ||
286 | + | ||
287 | + | @Callable(i) | |
288 | + | func unstake (nodeAddress,amount) = { | |
289 | + | let userAddress = toString(i.caller) | |
290 | + | getUnstakeActions(nodeAddress, userAddress, amount) | |
291 | + | } | |
292 | + | ||
293 | + | ||
294 | + | ||
295 | + | @Callable(i) | |
296 | + | func claim (amount) = { | |
297 | + | let userAddress = toString(i.caller) | |
298 | + | getClaimUnlockedActions(userAddress, amount) | |
14 | 299 | } | |
15 | 300 | ||
16 | 301 |
github/deemru/w8io/169f3d6 32.02 ms ◑